[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3328261.Ltcx4CEcHA@barack>
Date: Tue, 5 Jul 2011 15:09:06 +0300
From: Péter Ujfalusi <peter.ujfalusi@...com>
To: "Balbi, Felipe" <balbi@...com>
CC: "Girdwood, Liam" <lrg@...com>, Tony Lindgren <tony@...mide.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"Lopez Cruz, Misael" <misael.lopez@...com>
Subject: Re: Re: [PATCH 1/5] MFD: twl6040: Add irq variable for slave devices
On Tuesday 05 July 2011 13:22:46 Balbi, Felipe wrote:
> Hi,
>
> On Tue, Jul 05, 2011 at 12:14:22PM +0300, Peter Ujfalusi wrote:
> > Add new variable to pass the irq number for the slaves
> > devices of twl6040.
> > The irq number configuration is done in the twl6040-core
> > at probe time, so machine drivers do not need to be
> > modified.
> >
> > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
> > ---
> >
> > drivers/mfd/twl6040-core.c | 2 ++
> > include/linux/i2c/twl.h | 2 ++
> > 2 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
> > index cfaedb5..8607793 100644
> > --- a/drivers/mfd/twl6040-core.c
> > +++ b/drivers/mfd/twl6040-core.c
> > @@ -501,6 +501,7 @@ static int __devinit twl6040_probe(struct
> > platform_device *pdev)
> >
> > if (pdata->codec) {
> >
> > cell = &twl6040->cells[children];
> > cell->name = "twl6040-codec";
> >
> > + pdata->codec->plug_irq = twl6040->irq_base + TWL6040_IRQ_PLUG;
>
> are the slave devices platform_devices ?? If so, you could use struct
> resource to pass IRQs as that's the "approved" way to do so. Then, on
> child driver, you could either rely on a particular order of the
> resources or assign them names and use platform_get_irq_byname() to
> fetch the correct one (if you have more than one, that is).
You mean something like this:
static struct resource twl6040_codec_rsrc[] = {
{
.flags = IORESOURCE_IRQ,
},
};
...
@@ -501,6 +501,7 @@ static int __devinit twl6040_probe(struct platform_device
*pdev)
if (pdata->codec) {
cell = &twl6040->cells[children];
cell->name = "twl6040-codec";
+ twl6040_codec_rsrc[0].start = twl6040->irq_base + TWL6040_IRQ_PLUG;
+ twl6040_codec_rsrc[0].end = twl6040->irq_base + TWL6040_IRQ_PLUG;
+ cell->resource = twl6040_codec_rsrc;
+ cell->num_resources = ARRAY_SIZE(twl6040_codec_rsrc);
cell->platform_data = pdata->codec;
cell->pdata_size = sizeof(*pdata->codec);
children++;
--
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists