diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2009-09-22 16:46:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 07:39:48 -0700 |
commit | 4cf8e53b3b55fa2f9b2a6b9c3e557b649adf7c6a (patch) | |
tree | 3a3ca1ba8ced694568f7c0ee31c19f7fcc6e38a9 /include/linux/ucb1400.h | |
parent | 1e5db00687c1ebd93a902caf1d3694209013cb3e (diff) | |
download | linux-4cf8e53b3b55fa2f9b2a6b9c3e557b649adf7c6a.tar.gz linux-4cf8e53b3b55fa2f9b2a6b9c3e557b649adf7c6a.tar.bz2 linux-4cf8e53b3b55fa2f9b2a6b9c3e557b649adf7c6a.zip |
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/ucb1400.h')
-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 @@ #include <sound/ac97_codec.h> #include <linux/mutex.h> #include <linux/platform_device.h> +#include <linux/gpio.h> /* * UCB1400 AC-link registers @@ -82,6 +83,17 @@ #define UCB_ID 0x7e #define UCB_ID_1400 0x4304 +struct ucb1400_gpio_data { + int gpio_offset; + int (*gpio_setup)(struct device *dev, int ngpio); + int (*gpio_teardown)(struct device *dev, int ngpio); +}; + +struct ucb1400_gpio { + struct gpio_chip gc; + struct snd_ac97 *ac97; +}; + struct ucb1400_ts { struct input_dev *ts_idev; struct task_struct *ts_task; @@ -95,6 +107,7 @@ struct ucb1400_ts { struct ucb1400 { struct platform_device *ucb1400_ts; + struct platform_device *ucb1400_gpio; }; 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) unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, int adcsync); +#ifdef CONFIG_GPIO_UCB1400 +void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data); +#else +static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {} +#endif + #endif |