diff options
author | Cyril Chemparathy <cyril@ti.com> | 2010-05-01 18:37:52 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-05-06 18:02:08 -0400 |
commit | 99e9e52de635728d7c89a0fdf79b307f3082cf3a (patch) | |
tree | 554517b1dc2552819954174c8ddafd3927f34970 /arch/arm/mach-davinci/include | |
parent | ba4a984e838dfb1c46135ff8cadeea5f8ca5fd0a (diff) |
Davinci: gpio - structs and functions renamed
Renamed gpio types to something more sensible:
struct gpio_controller --> struct davinci_gpio_regs
struct davinci_gpio --> struct davinci_gpio_controller
gpio2controller() --> gpio2regs()
irq2controller() --> irq2regs()
This change also moves davinci_gpio_controller definition to gpio.h.
Eventually, the gpio registers structure will be moved to gpio.c and no longer
a common cross-soc definition.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Tested-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/include')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/gpio.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h index 0099e6e5aff8..bdab001950ba 100644 --- a/arch/arm/mach-davinci/include/mach/gpio.h +++ b/arch/arm/mach-davinci/include/mach/gpio.h | |||
@@ -45,7 +45,7 @@ | |||
45 | /* Convert GPIO signal to GPIO pin number */ | 45 | /* Convert GPIO signal to GPIO pin number */ |
46 | #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) | 46 | #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) |
47 | 47 | ||
48 | struct gpio_controller { | 48 | struct davinci_gpio_regs { |
49 | u32 dir; | 49 | u32 dir; |
50 | u32 out_data; | 50 | u32 out_data; |
51 | u32 set_data; | 51 | u32 set_data; |
@@ -58,6 +58,12 @@ struct gpio_controller { | |||
58 | u32 intstat; | 58 | u32 intstat; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | struct davinci_gpio_controller { | ||
62 | struct davinci_gpio_regs __iomem *regs; | ||
63 | struct gpio_chip chip; | ||
64 | int irq_base; | ||
65 | }; | ||
66 | |||
61 | /* The __gpio_to_controller() and __gpio_mask() functions inline to constants | 67 | /* The __gpio_to_controller() and __gpio_mask() functions inline to constants |
62 | * with constant parameters; or in outlined code they execute at runtime. | 68 | * with constant parameters; or in outlined code they execute at runtime. |
63 | * | 69 | * |
@@ -67,7 +73,7 @@ struct gpio_controller { | |||
67 | * | 73 | * |
68 | * These are NOT part of the cross-platform GPIO interface | 74 | * These are NOT part of the cross-platform GPIO interface |
69 | */ | 75 | */ |
70 | static inline struct gpio_controller __iomem * | 76 | static inline struct davinci_gpio_regs __iomem * |
71 | __gpio_to_controller(unsigned gpio) | 77 | __gpio_to_controller(unsigned gpio) |
72 | { | 78 | { |
73 | void __iomem *ptr; | 79 | void __iomem *ptr; |
@@ -102,7 +108,7 @@ static inline u32 __gpio_mask(unsigned gpio) | |||
102 | static inline void gpio_set_value(unsigned gpio, int value) | 108 | static inline void gpio_set_value(unsigned gpio, int value) |
103 | { | 109 | { |
104 | if (__builtin_constant_p(value) && gpio < DAVINCI_N_GPIO) { | 110 | if (__builtin_constant_p(value) && gpio < DAVINCI_N_GPIO) { |
105 | struct gpio_controller __iomem *g; | 111 | struct davinci_gpio_regs __iomem *g; |
106 | u32 mask; | 112 | u32 mask; |
107 | 113 | ||
108 | g = __gpio_to_controller(gpio); | 114 | g = __gpio_to_controller(gpio); |
@@ -128,7 +134,7 @@ static inline void gpio_set_value(unsigned gpio, int value) | |||
128 | */ | 134 | */ |
129 | static inline int gpio_get_value(unsigned gpio) | 135 | static inline int gpio_get_value(unsigned gpio) |
130 | { | 136 | { |
131 | struct gpio_controller __iomem *g; | 137 | struct davinci_gpio_regs __iomem *g; |
132 | 138 | ||
133 | if (!__builtin_constant_p(gpio) || gpio >= DAVINCI_N_GPIO) | 139 | if (!__builtin_constant_p(gpio) || gpio >= DAVINCI_N_GPIO) |
134 | return __gpio_get_value(gpio); | 140 | return __gpio_get_value(gpio); |