diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-14 17:14:24 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-05-20 11:27:07 -0400 |
commit | cd99758ba3bde64347a8ece381cbae2fb5c745b2 (patch) | |
tree | ce74c5150978f1cd29861e33e8847bc5dd667ed7 /drivers/input | |
parent | 4492c4c3ff7bbb5fd400f021532643a3493f0723 (diff) |
mfd: Convert wm831x to irq_domain
The modern idiom is to use irq_domain to allocate interrupts. This is
useful partly to allow further infrastructure to be based on the domains
and partly because it makes it much easier to allocate virtual interrupts
to devices as we don't need to allocate a contiguous range of interrupt
numbers.
Convert the wm831x driver over to this infrastructure, using a legacy
IRQ mapping if an irq_base is specified in platform data and otherwise
using a linear mapping, always registering the interrupts even if they
won't ever be used. Only boards which need to use the GPIOs as
interrupts should need to use an irq_base.
This means that we can't use the MFD irq_base management since the
unless we're using an explicit irq_base from platform data we can't rely
on a linear mapping of interrupts. Instead we need to map things via
the irq_domain - provide a conveniencem function wm831x_irq() to save a
small amount of typing when doing so. Looking at this I couldn't clearly
see anything the MFD core could do to make this nicer.
Since we're not supporting device tree yet there's no meaningful
advantage if we don't do this conversion in one, the fact that the
interrupt resources are used for repeated IP blocks makes accessor
functions for the irq_domain more trouble to do than they're worth.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/wm831x-on.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/wm831x-ts.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c index 47f18d6bce46..6790a812a1db 100644 --- a/drivers/input/misc/wm831x-on.c +++ b/drivers/input/misc/wm831x-on.c | |||
@@ -73,7 +73,7 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev) | |||
73 | { | 73 | { |
74 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 74 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
75 | struct wm831x_on *wm831x_on; | 75 | struct wm831x_on *wm831x_on; |
76 | int irq = platform_get_irq(pdev, 0); | 76 | int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0)); |
77 | int ret; | 77 | int ret; |
78 | 78 | ||
79 | wm831x_on = kzalloc(sizeof(struct wm831x_on), GFP_KERNEL); | 79 | wm831x_on = kzalloc(sizeof(struct wm831x_on), GFP_KERNEL); |
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c index 4bc851a9dc3d..e83410721e38 100644 --- a/drivers/input/touchscreen/wm831x-ts.c +++ b/drivers/input/touchscreen/wm831x-ts.c | |||
@@ -260,15 +260,16 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) | |||
260 | * If we have a direct IRQ use it, otherwise use the interrupt | 260 | * If we have a direct IRQ use it, otherwise use the interrupt |
261 | * from the WM831x IRQ controller. | 261 | * from the WM831x IRQ controller. |
262 | */ | 262 | */ |
263 | wm831x_ts->data_irq = wm831x_irq(wm831x, | ||
264 | platform_get_irq_byname(pdev, | ||
265 | "TCHDATA")); | ||
263 | if (pdata && pdata->data_irq) | 266 | if (pdata && pdata->data_irq) |
264 | wm831x_ts->data_irq = pdata->data_irq; | 267 | wm831x_ts->data_irq = pdata->data_irq; |
265 | else | ||
266 | wm831x_ts->data_irq = platform_get_irq_byname(pdev, "TCHDATA"); | ||
267 | 268 | ||
269 | wm831x_ts->pd_irq = wm831x_irq(wm831x, | ||
270 | platform_get_irq_byname(pdev, "TCHPD")); | ||
268 | if (pdata && pdata->pd_irq) | 271 | if (pdata && pdata->pd_irq) |
269 | wm831x_ts->pd_irq = pdata->pd_irq; | 272 | wm831x_ts->pd_irq = pdata->pd_irq; |
270 | else | ||
271 | wm831x_ts->pd_irq = platform_get_irq_byname(pdev, "TCHPD"); | ||
272 | 273 | ||
273 | if (pdata) | 274 | if (pdata) |
274 | wm831x_ts->pressure = pdata->pressure; | 275 | wm831x_ts->pressure = pdata->pressure; |