aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-11-13 08:48:07 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-13 14:02:15 -0500
commitfe39f2f4dc8481d3aa4561ba649b0c0a4429a49e (patch)
treedf8b9915e712ae5aaead904f8a27feda9dcbdbb1 /drivers/gpio
parent5b8b1fe2da98dbc4a10b9ad6d0f9f84e2815d4e4 (diff)
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')
-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,
80 val, mask); 80 val, mask);
81} 81}
82 82
83static int tps6586x_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
84{
85 struct tps6586x_gpio *tps6586x_gpio = to_tps6586x_gpio(gc);
86
87 return tps6586x_irq_get_virq(tps6586x_gpio->parent,
88 TPS6586X_INT_PLDO_0 + offset);
89}
90
83static int __devinit tps6586x_gpio_probe(struct platform_device *pdev) 91static int __devinit tps6586x_gpio_probe(struct platform_device *pdev)
84{ 92{
85 struct tps6586x_platform_data *pdata; 93 struct tps6586x_platform_data *pdata;
@@ -106,6 +114,7 @@ static int __devinit tps6586x_gpio_probe(struct platform_device *pdev)
106 tps6586x_gpio->gpio_chip.direction_output = tps6586x_gpio_output; 114 tps6586x_gpio->gpio_chip.direction_output = tps6586x_gpio_output;
107 tps6586x_gpio->gpio_chip.set = tps6586x_gpio_set; 115 tps6586x_gpio->gpio_chip.set = tps6586x_gpio_set;
108 tps6586x_gpio->gpio_chip.get = tps6586x_gpio_get; 116 tps6586x_gpio->gpio_chip.get = tps6586x_gpio_get;
117 tps6586x_gpio->gpio_chip.to_irq = tps6586x_gpio_to_irq;
109 118
110#ifdef CONFIG_OF_GPIO 119#ifdef CONFIG_OF_GPIO
111 tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node; 120 tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node;