From: Mark Brown Date: Fri, 2 Apr 2010 13:51:59 +0000 (+0100) Subject: gpiolib: Implement gpio_to_irq for WM8994 GPIO controller X-Git-Tag: v3.0~4226^2~7^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddf438cf2a6de9aa47783a45907e1188b9437ff7;p=platform%2Fkernel%2Flinux-amlogic.git gpiolib: Implement gpio_to_irq for WM8994 GPIO controller Signed-off-by: Mark Brown --- diff --git a/drivers/gpio/wm8994-gpio.c b/drivers/gpio/wm8994-gpio.c index de28b4a4..3ee35ba 100644 --- a/drivers/gpio/wm8994-gpio.c +++ b/drivers/gpio/wm8994-gpio.c @@ -80,6 +80,18 @@ static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, WM8994_GPN_LVL, value); } +static int wm8994_gpio_to_irq(struct gpio_chip *chip, unsigned offset) +{ + struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); + struct wm8994 *wm8994 = wm8994_gpio->wm8994; + + if (!wm8994->irq_base) + return -EINVAL; + + return wm8994->irq_base + offset; +} + + #ifdef CONFIG_DEBUG_FS static void wm8994_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) {