* [PATCH] mfd: asic3: Add to_irq() member to gpio_chip structure
@ 2012-01-31 1:18 Paul Parsons
2012-02-20 17:40 ` Samuel Ortiz
0 siblings, 1 reply; 2+ messages in thread
From: Paul Parsons @ 2012-01-31 1:18 UTC (permalink / raw)
To: linux-kernel; +Cc: philipp.zabel, sameo, mad_soft, koen
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>
---
diff -ru clean-3.3-rc1/drivers/mfd/asic3.c linux-3.3-rc1/drivers/mfd/asic3.c
--- clean-3.3-rc1/drivers/mfd/asic3.c 2012-01-19 23:04:48.000000000 +0000
+++ linux-3.3-rc1/drivers/mfd/asic3.c 2012-01-31 00:58:34.777451050 +0000
@@ -525,6 +525,11 @@
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 @@
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,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: asic3: Add to_irq() member to gpio_chip structure
2012-01-31 1:18 [PATCH] mfd: asic3: Add to_irq() member to gpio_chip structure Paul Parsons
@ 2012-02-20 17:40 ` Samuel Ortiz
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-02-20 17:40 UTC (permalink / raw)
To: Paul Parsons; +Cc: linux-kernel, philipp.zabel, mad_soft, koen
Hi Paul,
On Tue, Jan 31, 2012 at 01:18:35AM +0000, Paul Parsons wrote:
> 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.
Good old asic3...Thanks, I applied this one.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-20 17:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-31 1:18 [PATCH] mfd: asic3: Add to_irq() member to gpio_chip structure Paul Parsons
2012-02-20 17:40 ` Samuel Ortiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).