From: Lee Jones <lee.jones@linaro.org>
To: Felipe Balbi <balbi@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case
Date: Mon, 18 Nov 2013 17:46:38 +0000 [thread overview]
Message-ID: <20131118174638.GQ13640@lee--X1> (raw)
In-Reply-To: <20131118172510.GI16038@saruman.home>
> > > +static struct of_dev_auxdata twl_auxdata_lookup[] = {
> > > + OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL),
> > > + { /* sentinel */ },
> > > +};
> > > +
> > > /* NOTE: This driver only handles a single twl4030/tps659x0 chip */
> > > static int
> > > twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> > > @@ -1271,10 +1276,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> > > twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
> > > }
> > >
> > > - if (node)
> > > - status = of_platform_populate(node, NULL, NULL, &client->dev);
> > > - else
> > > + if (node) {
> > > + if (pdata)
> > > + twl_auxdata_lookup[0].platform_data = pdata->gpio;
> > > + status = of_platform_populate(node, NULL, twl_auxdata_lookup,
> > > + &client->dev);
> > > + } else {
> > > status = add_children(pdata, irq_base, id->driver_data);
> >
> > Why doesn't the TWL driver use the MFD framework for this stuff?
>
> that's reminiscent from years ago and, surely, needs to be fixed. Should
> we gate $subject for that, though ? This has been in tree for quite a
> few years already and Tony's patch is still a step forward, since most
> omap3 platforms would break on DT-only without it.
I didn't say that I would reject the patch. I was just surprised to
see so much hand-rolling, as the MFD core code does much of it
automatically. This is the first time I've taken a look at this and it
seems to be quite the relic.
> There are quite a few folks who could volunteer to fixing that after
> Tony's patch is in (me included, although there could be better choices
> hehe).
Well it's not doing any harm. I'll make a note to fix it myself if a)
no one has done so already and b) I manage to find some spare
time. The latter issue is less likely to be resolved. :)
Are you Acking this patch by the way?
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case
Date: Mon, 18 Nov 2013 17:46:38 +0000 [thread overview]
Message-ID: <20131118174638.GQ13640@lee--X1> (raw)
In-Reply-To: <20131118172510.GI16038@saruman.home>
> > > +static struct of_dev_auxdata twl_auxdata_lookup[] = {
> > > + OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL),
> > > + { /* sentinel */ },
> > > +};
> > > +
> > > /* NOTE: This driver only handles a single twl4030/tps659x0 chip */
> > > static int
> > > twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> > > @@ -1271,10 +1276,14 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> > > twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
> > > }
> > >
> > > - if (node)
> > > - status = of_platform_populate(node, NULL, NULL, &client->dev);
> > > - else
> > > + if (node) {
> > > + if (pdata)
> > > + twl_auxdata_lookup[0].platform_data = pdata->gpio;
> > > + status = of_platform_populate(node, NULL, twl_auxdata_lookup,
> > > + &client->dev);
> > > + } else {
> > > status = add_children(pdata, irq_base, id->driver_data);
> >
> > Why doesn't the TWL driver use the MFD framework for this stuff?
>
> that's reminiscent from years ago and, surely, needs to be fixed. Should
> we gate $subject for that, though ? This has been in tree for quite a
> few years already and Tony's patch is still a step forward, since most
> omap3 platforms would break on DT-only without it.
I didn't say that I would reject the patch. I was just surprised to
see so much hand-rolling, as the MFD core code does much of it
automatically. This is the first time I've taken a look at this and it
seems to be quite the relic.
> There are quite a few folks who could volunteer to fixing that after
> Tony's patch is in (me included, although there could be better choices
> hehe).
Well it's not doing any harm. I'll make a note to fix it myself if a)
no one has done so already and b) I manage to find some spare
time. The latter issue is less likely to be resolved. :)
Are you Acking this patch by the way?
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2013-11-18 17:46 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-16 0:36 [PATCH 0/5] Prepare making omap3 device tree only and convert LDP Tony Lindgren
2013-11-16 0:36 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 1/5] mfd: twl-core: Fix passing of platform data in the device tree case Tony Lindgren
2013-11-16 0:36 ` Tony Lindgren
2013-11-18 10:29 ` Lee Jones
2013-11-18 10:29 ` Lee Jones
2013-11-18 17:25 ` Felipe Balbi
2013-11-18 17:25 ` Felipe Balbi
2013-11-18 17:46 ` Lee Jones [this message]
2013-11-18 17:46 ` Lee Jones
2013-11-18 18:11 ` Tony Lindgren
2013-11-18 18:11 ` Tony Lindgren
2013-11-18 19:09 ` Lee Jones
2013-11-18 19:09 ` Lee Jones
2013-11-18 19:22 ` Tony Lindgren
2013-11-18 19:22 ` Tony Lindgren
2013-11-18 19:28 ` Lee Jones
2013-11-18 19:28 ` Lee Jones
2013-11-18 19:33 ` Tony Lindgren
2013-11-18 19:33 ` Tony Lindgren
2013-11-21 10:46 ` Lee Jones
2013-11-21 10:46 ` Lee Jones
2013-11-21 11:09 ` Lee Jones
2013-11-21 11:09 ` Lee Jones
2013-11-25 23:22 ` Tony Lindgren
2013-11-25 23:22 ` Tony Lindgren
2013-11-18 18:40 ` Felipe Balbi
2013-11-18 18:40 ` Felipe Balbi
2013-11-16 0:36 ` [PATCH 2/5] ARM: OMAP2+: Add support for legacy auxdata for twl Tony Lindgren
2013-11-16 0:36 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 3/5] ARM: OMAP2+: Add DT init code for DPI displays and make omap3 LDP to use it Tony Lindgren
2013-11-16 0:36 ` Tony Lindgren
2013-11-18 13:06 ` Tomi Valkeinen
2013-11-18 13:06 ` Tomi Valkeinen
2013-11-18 18:19 ` Tony Lindgren
2013-11-18 18:19 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 4/5] ARM: dts: Add basic support for omap3 LDP zoom1 labrador Tony Lindgren
2013-11-16 0:36 ` Tony Lindgren
2013-11-16 8:04 ` Sebastian Reichel
2013-11-16 8:04 ` Sebastian Reichel
2013-11-16 14:40 ` Tony Lindgren
2013-11-16 14:40 ` Tony Lindgren
2013-11-16 0:36 ` [PATCH 5/5] ARM: OMAP2+: Remove legacy booting support for LDP Tony Lindgren
2013-11-16 0:36 ` Tony Lindgren
2013-11-16 12:05 ` N900 board code in 3.14 Sebastian Reichel
2013-11-16 14:12 ` Tony Lindgren
2013-11-16 14:12 ` Tony Lindgren
2013-11-16 15:50 ` Sebastian Reichel
2013-11-16 15:50 ` Sebastian Reichel
2013-11-21 18:58 ` Tony Lindgren
2013-11-21 18:58 ` Tony Lindgren
2013-11-21 23:51 ` Sebastian Reichel
2013-11-21 23:51 ` Sebastian Reichel
2013-11-22 10:41 ` Javier Martinez Canillas
2013-11-22 10:41 ` Javier Martinez Canillas
2013-11-23 21:09 ` Sebastian Reichel
2013-11-23 21:09 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131118174638.GQ13640@lee--X1 \
--to=lee.jones@linaro.org \
--cc=balbi@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.