diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-05-08 18:29:27 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-05-08 18:29:27 -0700 |
commit | d585a021c0b10b0477d6b608c53e1feb8cde0507 (patch) | |
tree | 5ca059da1db7f15d4b29427644ad9c08270c885c /arch/arm/plat-orion | |
parent | 84e5b0d00f8f84c4ae226be131d4bebbcee88bd3 (diff) | |
parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) |
Merge commit 'v2.6.30-rc5' into next
Diffstat (limited to 'arch/arm/plat-orion')
-rw-r--r-- | arch/arm/plat-orion/gpio.c | 29 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/gpio.h | 6 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/mvsdio.h | 21 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/orion5x_wdt.h | 18 | ||||
-rw-r--r-- | arch/arm/plat-orion/time.c | 4 |
5 files changed, 66 insertions, 12 deletions
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index 0d12c2164766..32eb9e33bebb 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c @@ -19,7 +19,8 @@ static DEFINE_SPINLOCK(gpio_lock); static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */ -static unsigned long gpio_valid[BITS_TO_LONGS(GPIO_MAX)]; +static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)]; +static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)]; static inline void __set_direction(unsigned pin, int input) { @@ -53,7 +54,7 @@ int gpio_direction_input(unsigned pin) { unsigned long flags; - if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { + if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_input)) { pr_debug("%s: invalid GPIO %d\n", __func__, pin); return -EINVAL; } @@ -83,7 +84,7 @@ int gpio_direction_output(unsigned pin, int value) unsigned long flags; u32 u; - if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { + if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_output)) { pr_debug("%s: invalid GPIO %d\n", __func__, pin); return -EINVAL; } @@ -161,7 +162,9 @@ int gpio_request(unsigned pin, const char *label) unsigned long flags; int ret; - if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { + if (pin >= GPIO_MAX || + !(test_bit(pin, gpio_valid_input) || + test_bit(pin, gpio_valid_output))) { pr_debug("%s: invalid GPIO %d\n", __func__, pin); return -EINVAL; } @@ -183,7 +186,9 @@ EXPORT_SYMBOL(gpio_request); void gpio_free(unsigned pin) { - if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { + if (pin >= GPIO_MAX || + !(test_bit(pin, gpio_valid_input) || + test_bit(pin, gpio_valid_output))) { pr_debug("%s: invalid GPIO %d\n", __func__, pin); return; } @@ -208,12 +213,18 @@ void __init orion_gpio_set_unused(unsigned pin) __set_direction(pin, 0); } -void __init orion_gpio_set_valid(unsigned pin, int valid) +void __init orion_gpio_set_valid(unsigned pin, int mode) { - if (valid) - __set_bit(pin, gpio_valid); + if (mode == 1) + mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK; + if (mode & GPIO_INPUT_OK) + __set_bit(pin, gpio_valid_input); else - __clear_bit(pin, gpio_valid); + __clear_bit(pin, gpio_valid_input); + if (mode & GPIO_OUTPUT_OK) + __set_bit(pin, gpio_valid_output); + else + __clear_bit(pin, gpio_valid_output); } void orion_gpio_set_blink(unsigned pin, int blink) diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h index ec743e82c876..33f6c6aec185 100644 --- a/arch/arm/plat-orion/include/plat/gpio.h +++ b/arch/arm/plat-orion/include/plat/gpio.h @@ -25,9 +25,13 @@ void gpio_set_value(unsigned pin, int value); * Orion-specific GPIO API extensions. */ void orion_gpio_set_unused(unsigned pin); -void orion_gpio_set_valid(unsigned pin, int valid); void orion_gpio_set_blink(unsigned pin, int blink); +#define GPIO_BIDI_OK (1 << 0) +#define GPIO_INPUT_OK (1 << 1) +#define GPIO_OUTPUT_OK (1 << 2) +void orion_gpio_set_valid(unsigned pin, int mode); + /* * GPIO interrupt handling. */ diff --git a/arch/arm/plat-orion/include/plat/mvsdio.h b/arch/arm/plat-orion/include/plat/mvsdio.h new file mode 100644 index 000000000000..14ca88676002 --- /dev/null +++ b/arch/arm/plat-orion/include/plat/mvsdio.h @@ -0,0 +1,21 @@ +/* + * arch/arm/plat-orion/include/plat/mvsdio.h + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef __MACH_MVSDIO_H +#define __MACH_MVSDIO_H + +#include <linux/mbus.h> + +struct mvsdio_platform_data { + struct mbus_dram_target_info *dram; + unsigned int clock; + int gpio_card_detect; + int gpio_write_protect; +}; + +#endif diff --git a/arch/arm/plat-orion/include/plat/orion5x_wdt.h b/arch/arm/plat-orion/include/plat/orion5x_wdt.h new file mode 100644 index 000000000000..3c9cf6a305ef --- /dev/null +++ b/arch/arm/plat-orion/include/plat/orion5x_wdt.h @@ -0,0 +1,18 @@ +/* + * arch/arm/plat-orion/include/plat/orion5x_wdt.h + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef __PLAT_ORION5X_WDT_H +#define __PLAT_ORION5X_WDT_H + +struct orion5x_wdt_platform_data { + u32 tclk; /* no <linux/clk.h> support yet */ +}; + + +#endif + diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c index 6fa2923e6dca..de8a001fc3a9 100644 --- a/arch/arm/plat-orion/time.c +++ b/arch/arm/plat-orion/time.c @@ -16,7 +16,7 @@ #include <linux/interrupt.h> #include <linux/irq.h> #include <asm/mach/time.h> -#include <mach/hardware.h> +#include <mach/bridge-regs.h> /* * Number of timer ticks per jiffy. @@ -41,7 +41,7 @@ static u32 ticks_per_jiffy; /* * Clocksource handling. */ -static cycle_t orion_clksrc_read(void) +static cycle_t orion_clksrc_read(struct clocksource *cs) { return 0xffffffff - readl(TIMER0_VAL); } |