diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-16 12:21:56 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-12-13 13:21:44 -0500 |
commit | dc0fb25c14e37f2ab843c2901743222f2be7f447 (patch) | |
tree | d97620709ed64144a825186197246269e44d8656 /drivers/gpio | |
parent | ecba96e6966174ccee47255c98b2091a739e1e45 (diff) |
gpiolib: Implement gpio_to_irq() for wm831x
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/wm831x-gpio.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpio/wm831x-gpio.c b/drivers/gpio/wm831x-gpio.c index f5e4934f1da1..b4468b616890 100644 --- a/drivers/gpio/wm831x-gpio.c +++ b/drivers/gpio/wm831x-gpio.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/mfd/wm831x/core.h> | 22 | #include <linux/mfd/wm831x/core.h> |
23 | #include <linux/mfd/wm831x/pdata.h> | 23 | #include <linux/mfd/wm831x/pdata.h> |
24 | #include <linux/mfd/wm831x/gpio.h> | 24 | #include <linux/mfd/wm831x/gpio.h> |
25 | #include <linux/mfd/wm831x/irq.h> | ||
25 | 26 | ||
26 | struct wm831x_gpio { | 27 | struct wm831x_gpio { |
27 | struct wm831x *wm831x; | 28 | struct wm831x *wm831x; |
@@ -78,6 +79,17 @@ static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | |||
78 | value << offset); | 79 | value << offset); |
79 | } | 80 | } |
80 | 81 | ||
82 | static int wm831x_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
83 | { | ||
84 | struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); | ||
85 | struct wm831x *wm831x = wm831x_gpio->wm831x; | ||
86 | |||
87 | if (!wm831x->irq_base) | ||
88 | return -EINVAL; | ||
89 | |||
90 | return wm831x->irq_base + WM831X_IRQ_GPIO_1 + offset; | ||
91 | } | ||
92 | |||
81 | #ifdef CONFIG_DEBUG_FS | 93 | #ifdef CONFIG_DEBUG_FS |
82 | static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) | 94 | static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) |
83 | { | 95 | { |
@@ -173,6 +185,7 @@ static struct gpio_chip template_chip = { | |||
173 | .get = wm831x_gpio_get, | 185 | .get = wm831x_gpio_get, |
174 | .direction_output = wm831x_gpio_direction_out, | 186 | .direction_output = wm831x_gpio_direction_out, |
175 | .set = wm831x_gpio_set, | 187 | .set = wm831x_gpio_set, |
188 | .to_irq = wm831x_gpio_to_irq, | ||
176 | .dbg_show = wm831x_gpio_dbg_show, | 189 | .dbg_show = wm831x_gpio_dbg_show, |
177 | .can_sleep = 1, | 190 | .can_sleep = 1, |
178 | }; | 191 | }; |