summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/asic3.c
diff options
context:
space:
mode:
authorPaul Parsons <lost.distance@yahoo.com>2012-01-31 01:18:35 +0000
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 18:46:39 +0100
commit450b1151065ae967583fe69c82c50140560a5681 (patch)
treeff4c82a4bbafee35a04df13f83ac691c4aa3d318 /drivers/mfd/asic3.c
parentedcf3196e9e646acc88d53e3bf355a6975daf109 (diff)
mfd: Add to_irq() member to asic3 gpio_chip structure
The gpio_to_irq() macro is now defined as __gpio_to_irq() instead of IRQ_GPIO(). The __gpio_to_irq() function returns -ENXIO if the referenced gpio_chip structure does not define a to_irq() member. This is true of the asic3 gpio_chip structure, and thus calls to gpio_to_irq() now fail (for example from the gpio-vbus module). This patch defines the to_irq() member in the asic3 gpio_chip structure. Signed-off-by: Paul Parsons <lost.distance@yahoo.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/asic3.c')
-rw-r--r--drivers/mfd/asic3.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index b85bbd7f0d1..1895cf9fab8 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -525,6 +525,11 @@ static void asic3_gpio_set(struct gpio_chip *chip,
return;
}
+static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+ return (offset < ASIC3_NUM_GPIOS) ? IRQ_BOARD_START + offset : -ENXIO;
+}
+
static __init int asic3_gpio_probe(struct platform_device *pdev,
u16 *gpio_config, int num)
{
@@ -976,6 +981,7 @@ static int __init asic3_probe(struct platform_device *pdev)
asic->gpio.set = asic3_gpio_set;
asic->gpio.direction_input = asic3_gpio_direction_input;
asic->gpio.direction_output = asic3_gpio_direction_output;
+ asic->gpio.to_irq = asic3_gpio_to_irq;
ret = asic3_gpio_probe(pdev,
pdata->gpio_config,