* [PATCH] mmc: omap_hsmmc: support deferred probing for GPIOs
@ 2013-01-30 9:07 Jan Luebbe
2013-02-14 10:43 ` Jan Lübbe
0 siblings, 1 reply; 5+ messages in thread
From: Jan Luebbe @ 2013-01-30 9:07 UTC (permalink / raw)
To: Venkatraman S; +Cc: Chris Ball, linux-mmc, linux-omap, Jan Luebbe
If the CD/WP-GPIOs are not provided by the SoC's GPIO controller,
we need to handle the case where omap_hsmmc is probed earlier than
the GPIO controller chosen in the device tree.
Fix this by checking the return value of of_get_named_gpio against
-EPROBE_DEFER and passing it through to the probe function.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
I've tested this on an AM335x based board which uses an external
GPIO expander.
drivers/mmc/host/omap_hsmmc.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e30c1ee..fd1b342 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1717,6 +1717,12 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
struct omap_mmc_platform_data *pdata;
struct device_node *np = dev->of_node;
u32 bus_width, max_freq;
+ int cd_gpio, wp_gpio;
+
+ cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
+ wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
+ if (cd_gpio == -EPROBE_DEFER || wp_gpio == -EPROBE_DEFER)
+ return ERR_PTR(-EPROBE_DEFER);
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
@@ -1727,8 +1733,8 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
/* This driver only supports 1 slot */
pdata->nr_slots = 1;
- pdata->slots[0].switch_pin = of_get_named_gpio(np, "cd-gpios", 0);
- pdata->slots[0].gpio_wp = of_get_named_gpio(np, "wp-gpios", 0);
+ pdata->slots[0].switch_pin = cd_gpio;
+ pdata->slots[0].gpio_wp = wp_gpio;
if (of_find_property(np, "ti,non-removable", NULL)) {
pdata->slots[0].nonremovable = true;
@@ -1775,6 +1781,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
if (match) {
pdata = of_get_hsmmc_pdata(&pdev->dev);
+
+ if (IS_ERR(pdata))
+ return PTR_ERR(pdata);
+
if (match->data) {
const u16 *offsetp = match->data;
pdata->reg_offset = *offsetp;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] mmc: omap_hsmmc: support deferred probing for GPIOs
2013-01-30 9:07 [PATCH] mmc: omap_hsmmc: support deferred probing for GPIOs Jan Luebbe
@ 2013-02-14 10:43 ` Jan Lübbe
2013-02-14 13:53 ` Balaji T K
0 siblings, 1 reply; 5+ messages in thread
From: Jan Lübbe @ 2013-02-14 10:43 UTC (permalink / raw)
To: Balaji T K; +Cc: Chris Ball, linux-mmc, linux-omap
On Wed, 2013-01-30 at 10:07 +0100, Jan Luebbe wrote:
> If the CD/WP-GPIOs are not provided by the SoC's GPIO controller,
> we need to handle the case where omap_hsmmc is probed earlier than
> the GPIO controller chosen in the device tree.
>
> Fix this by checking the return value of of_get_named_gpio against
> -EPROBE_DEFER and passing it through to the probe function.
>
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Balaji, since you seem to be the new OMAP HSMMC maintainer, do you have
any comments on this patch?
Thanks,
Jan
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: support deferred probing for GPIOs
2013-02-14 10:43 ` Jan Lübbe
@ 2013-02-14 13:53 ` Balaji T K
2013-03-21 11:39 ` Jan Lübbe
2013-03-22 15:52 ` Chris Ball
0 siblings, 2 replies; 5+ messages in thread
From: Balaji T K @ 2013-02-14 13:53 UTC (permalink / raw)
To: Jan Lübbe, Chris Ball, linux-mmc; +Cc: linux-omap
On Thursday 14 February 2013 04:13 PM, Jan Lübbe wrote:
> On Wed, 2013-01-30 at 10:07 +0100, Jan Luebbe wrote:
>> If the CD/WP-GPIOs are not provided by the SoC's GPIO controller,
>> we need to handle the case where omap_hsmmc is probed earlier than
>> the GPIO controller chosen in the device tree.
>>
>> Fix this by checking the return value of of_get_named_gpio against
>> -EPROBE_DEFER and passing it through to the probe function.
>>
>> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
>
> Balaji, since you seem to be the new OMAP HSMMC maintainer, do you have
> any comments on this patch?
Looks good to me,
Acked-by: Balaji T K <balajitk@ti.com>
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: support deferred probing for GPIOs
2013-02-14 13:53 ` Balaji T K
@ 2013-03-21 11:39 ` Jan Lübbe
2013-03-22 15:52 ` Chris Ball
1 sibling, 0 replies; 5+ messages in thread
From: Jan Lübbe @ 2013-03-21 11:39 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc, linux-omap, Balaji T K
On Thu, 2013-02-14 at 19:23 +0530, Balaji T K wrote:
> On Thursday 14 February 2013 04:13 PM, Jan Lübbe wrote:
> > On Wed, 2013-01-30 at 10:07 +0100, Jan Luebbe wrote:
> >> If the CD/WP-GPIOs are not provided by the SoC's GPIO controller,
> >> we need to handle the case where omap_hsmmc is probed earlier than
> >> the GPIO controller chosen in the device tree.
> >>
> >> Fix this by checking the return value of of_get_named_gpio against
> >> -EPROBE_DEFER and passing it through to the probe function.
> >>
> >> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> >
> > Balaji, since you seem to be the new OMAP HSMMC maintainer, do you have
> > any comments on this patch?
>
> Looks good to me,
> Acked-by: Balaji T K <balajitk@ti.com>
Chris, would you take this?
Thanks,
Jan
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: omap_hsmmc: support deferred probing for GPIOs
2013-02-14 13:53 ` Balaji T K
2013-03-21 11:39 ` Jan Lübbe
@ 2013-03-22 15:52 ` Chris Ball
1 sibling, 0 replies; 5+ messages in thread
From: Chris Ball @ 2013-03-22 15:52 UTC (permalink / raw)
To: Balaji T K; +Cc: Jan Lübbe, linux-mmc, linux-omap
Hi,
On Thu, Feb 14 2013, Balaji T K wrote:
> On Thursday 14 February 2013 04:13 PM, Jan Lübbe wrote:
>> On Wed, 2013-01-30 at 10:07 +0100, Jan Luebbe wrote:
>>> If the CD/WP-GPIOs are not provided by the SoC's GPIO controller,
>>> we need to handle the case where omap_hsmmc is probed earlier than
>>> the GPIO controller chosen in the device tree.
>>>
>>> Fix this by checking the return value of of_get_named_gpio against
>>> -EPROBE_DEFER and passing it through to the probe function.
>>>
>>> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
>>
>> Balaji, since you seem to be the new OMAP HSMMC maintainer, do you have
>> any comments on this patch?
>
> Looks good to me,
> Acked-by: Balaji T K <balajitk@ti.com>
Thanks, pushed to mmc-next for 3.10.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-22 15:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 9:07 [PATCH] mmc: omap_hsmmc: support deferred probing for GPIOs Jan Luebbe
2013-02-14 10:43 ` Jan Lübbe
2013-02-14 13:53 ` Balaji T K
2013-03-21 11:39 ` Jan Lübbe
2013-03-22 15:52 ` Chris Ball
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).