diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2009-09-22 19:46:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:48 -0400 |
commit | 4cf8e53b3b55fa2f9b2a6b9c3e557b649adf7c6a (patch) | |
tree | 3a3ca1ba8ced694568f7c0ee31c19f7fcc6e38a9 /include/linux | |
parent | 1e5db00687c1ebd93a902caf1d3694209013cb3e (diff) |
mfd/gpio: add a GPIO interface to the UCB1400 MFD chip driver via gpiolib
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Brownell <david-b@pacbell.net>
Cc: Samuel Ortiz <sameo@openedhand.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ucb1400.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index ae779bb8cc0f..adb44066680c 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <sound/ac97_codec.h> | 26 | #include <sound/ac97_codec.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/gpio.h> | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * UCB1400 AC-link registers | 32 | * UCB1400 AC-link registers |
@@ -82,6 +83,17 @@ | |||
82 | #define UCB_ID 0x7e | 83 | #define UCB_ID 0x7e |
83 | #define UCB_ID_1400 0x4304 | 84 | #define UCB_ID_1400 0x4304 |
84 | 85 | ||
86 | struct ucb1400_gpio_data { | ||
87 | int gpio_offset; | ||
88 | int (*gpio_setup)(struct device *dev, int ngpio); | ||
89 | int (*gpio_teardown)(struct device *dev, int ngpio); | ||
90 | }; | ||
91 | |||
92 | struct ucb1400_gpio { | ||
93 | struct gpio_chip gc; | ||
94 | struct snd_ac97 *ac97; | ||
95 | }; | ||
96 | |||
85 | struct ucb1400_ts { | 97 | struct ucb1400_ts { |
86 | struct input_dev *ts_idev; | 98 | struct input_dev *ts_idev; |
87 | struct task_struct *ts_task; | 99 | struct task_struct *ts_task; |
@@ -95,6 +107,7 @@ struct ucb1400_ts { | |||
95 | 107 | ||
96 | struct ucb1400 { | 108 | struct ucb1400 { |
97 | struct platform_device *ucb1400_ts; | 109 | struct platform_device *ucb1400_ts; |
110 | struct platform_device *ucb1400_gpio; | ||
98 | }; | 111 | }; |
99 | 112 | ||
100 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) | 113 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) |
@@ -147,4 +160,10 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) | |||
147 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | 160 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, |
148 | int adcsync); | 161 | int adcsync); |
149 | 162 | ||
163 | #ifdef CONFIG_GPIO_UCB1400 | ||
164 | void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data); | ||
165 | #else | ||
166 | static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {} | ||
167 | #endif | ||
168 | |||
150 | #endif | 169 | #endif |