summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-tps6586x.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-11-13 14:48:07 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-13 20:02:15 +0100
commitfe39f2f4dc8481d3aa4561ba649b0c0a4429a49e (patch)
treedf8b9915e712ae5aaead904f8a27feda9dcbdbb1 /drivers/gpio/gpio-tps6586x.c
parentmfd: Add irq io-resource for tps6586x rtc sub driver (diff)
downloadlinux-fe39f2f4dc8481d3aa4561ba649b0c0a4429a49e.tar.xz
linux-fe39f2f4dc8481d3aa4561ba649b0c0a4429a49e.zip
mfd: Implement tps6586x gpio_to_irq
The TPS6586x adds the interrupt of this device using linear mapping on irq domain. Hence, implement gpio_to_irq to get the irq number corresponding to TPS6586x GPIOs which is created dynamically. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/gpio/gpio-tps6586x.c')
-rw-r--r--drivers/gpio/gpio-tps6586x.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index 2526b3bb0fae..62e9e1cb3bc1 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -80,6 +80,14 @@ static int tps6586x_gpio_output(struct gpio_chip *gc, unsigned offset,
val, mask);
}
+static int tps6586x_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
+{
+ struct tps6586x_gpio *tps6586x_gpio = to_tps6586x_gpio(gc);
+
+ return tps6586x_irq_get_virq(tps6586x_gpio->parent,
+ TPS6586X_INT_PLDO_0 + offset);
+}
+
static int __devinit tps6586x_gpio_probe(struct platform_device *pdev)
{
struct tps6586x_platform_data *pdata;
@@ -106,6 +114,7 @@ static int __devinit tps6586x_gpio_probe(struct platform_device *pdev)
tps6586x_gpio->gpio_chip.direction_output = tps6586x_gpio_output;
tps6586x_gpio->gpio_chip.set = tps6586x_gpio_set;
tps6586x_gpio->gpio_chip.get = tps6586x_gpio_get;
+ tps6586x_gpio->gpio_chip.to_irq = tps6586x_gpio_to_irq;
#ifdef CONFIG_OF_GPIO
tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node;