* [PATCH] mmc: sdhci-pltfm: add calling mmc_of_parse in sdhci_pltfm_register
@ 2013-03-08 4:52 Kevin Liu
2013-03-08 20:18 ` Stephen Warren
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Liu @ 2013-03-08 4:52 UTC (permalink / raw)
To: linux-mmc, Chris Ball, Guennadi Liakhovetski, Sujit Reddy Thumma,
Jaehoon Chung, Aaron Lu, Ulf Hansson, Wei WANG, Fabio Estevam
Cc: Stephen Warren, Adrian Hunter, Philip Rakity, Shawn Guo,
Johan Rudholm, Girish K S, Haijun Zhang, Zhangfei Gao,
Haojian Zhuang, Chao Xie, Kevin Liu, Kevin Liu
commit 6c56e7a0 provide a function mmc_of_parse for standard MMC
device-tree binding parser centrally. So just call it with
sdhci_get_of_property together in sdhci_pltfm_register.
Signed-off-by: Kevin Liu <kliu5@marvell.com>
---
drivers/mmc/host/sdhci-pltfm.c | 56 +++++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index e605509..0c5eb6a 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -71,42 +71,43 @@ void sdhci_get_of_property(struct platform_device *pdev)
u32 bus_width;
int size;
- if (of_device_is_available(np)) {
- if (of_get_property(np, "sdhci,auto-cmd12", NULL))
- host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
+ if (!of_device_is_available(np))
+ return;
- if (of_get_property(np, "sdhci,1-bit-only", NULL) ||
- (of_property_read_u32(np, "bus-width", &bus_width) == 0 &&
- bus_width == 1))
- host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
+ if (of_get_property(np, "sdhci,auto-cmd12", NULL))
+ host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
- if (sdhci_of_wp_inverted(np))
- host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
+ if (of_get_property(np, "sdhci,1-bit-only", NULL) ||
+ (of_property_read_u32(np, "bus-width", &bus_width) == 0 &&
+ bus_width == 1))
+ host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
- if (of_get_property(np, "broken-cd", NULL))
- host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ if (sdhci_of_wp_inverted(np))
+ host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
- if (of_get_property(np, "no-1-8-v", NULL))
- host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
+ if (of_get_property(np, "broken-cd", NULL))
+ host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
- if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc"))
- host->quirks |= SDHCI_QUIRK_BROKEN_DMA;
+ if (of_get_property(np, "no-1-8-v", NULL))
+ host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
- if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
- of_device_is_compatible(np, "fsl,p1010-esdhc") ||
- of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
- host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+ if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc"))
+ host->quirks |= SDHCI_QUIRK_BROKEN_DMA;
- clk = of_get_property(np, "clock-frequency", &size);
- if (clk && size == sizeof(*clk) && *clk)
- pltfm_host->clock = be32_to_cpup(clk);
+ if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
+ of_device_is_compatible(np, "fsl,p1010-esdhc") ||
+ of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
+ host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
- if (of_find_property(np, "keep-power-in-suspend", NULL))
- host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
+ clk = of_get_property(np, "clock-frequency", &size);
+ if (clk && size == sizeof(*clk) && *clk)
+ pltfm_host->clock = be32_to_cpup(clk);
- if (of_find_property(np, "enable-sdio-wakeup", NULL))
- host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
- }
+ if (of_find_property(np, "keep-power-in-suspend", NULL))
+ host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
+
+ if (of_find_property(np, "enable-sdio-wakeup", NULL))
+ host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
}
#else
void sdhci_get_of_property(struct platform_device *pdev) {}
@@ -212,6 +213,7 @@ int sdhci_pltfm_register(struct platform_device *pdev,
if (IS_ERR(host))
return PTR_ERR(host);
+ mmc_of_parse(host->mmc);
sdhci_get_of_property(pdev);
ret = sdhci_add_host(host);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] mmc: sdhci-pltfm: add calling mmc_of_parse in sdhci_pltfm_register
2013-03-08 4:52 [PATCH] mmc: sdhci-pltfm: add calling mmc_of_parse in sdhci_pltfm_register Kevin Liu
@ 2013-03-08 20:18 ` Stephen Warren
2013-03-09 4:27 ` Kevin Liu
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2013-03-08 20:18 UTC (permalink / raw)
To: Kevin Liu
Cc: linux-mmc, Chris Ball, Guennadi Liakhovetski, Sujit Reddy Thumma,
Jaehoon Chung, Aaron Lu, Ulf Hansson, Wei WANG, Fabio Estevam,
Adrian Hunter, Philip Rakity, Shawn Guo, Johan Rudholm,
Girish K S, Haijun Zhang, Zhangfei Gao, Haojian Zhuang, Chao Xie,
Kevin Liu
On 03/07/2013 09:52 PM, Kevin Liu wrote:
> commit 6c56e7a0 provide a function mmc_of_parse for standard MMC
> device-tree binding parser centrally. So just call it with
> sdhci_get_of_property together in sdhci_pltfm_register.
BTW, this patch seems to do two unrelated things; firstly it changes the
indentation level throughout sdhci_get_of_property(), and secondly makes
the change described in the commit description.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: sdhci-pltfm: add calling mmc_of_parse in sdhci_pltfm_register
2013-03-08 20:18 ` Stephen Warren
@ 2013-03-09 4:27 ` Kevin Liu
2013-03-11 15:53 ` Stephen Warren
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Liu @ 2013-03-09 4:27 UTC (permalink / raw)
To: Stephen Warren
Cc: Kevin Liu, linux-mmc, Chris Ball, Guennadi Liakhovetski,
Sujit Reddy Thumma, Jaehoon Chung, Aaron Lu, Ulf Hansson,
Wei WANG, Fabio Estevam, Adrian Hunter, Philip Rakity, Shawn Guo,
Johan Rudholm, Girish K S, Haijun Zhang, Zhangfei Gao,
Haojian Zhuang, Chao Xie
2013/3/9 Stephen Warren <swarren@wwwdotorg.org>:
> On 03/07/2013 09:52 PM, Kevin Liu wrote:
>> commit 6c56e7a0 provide a function mmc_of_parse for standard MMC
>> device-tree binding parser centrally. So just call it with
>> sdhci_get_of_property together in sdhci_pltfm_register.
>
> BTW, this patch seems to do two unrelated things; firstly it changes the
> indentation level throughout sdhci_get_of_property(), and secondly makes
> the change described in the commit description.
That's true. I originally want to do the first thing incidentally :-)
So do you want to split this patch into two?
Thanks
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: sdhci-pltfm: add calling mmc_of_parse in sdhci_pltfm_register
2013-03-09 4:27 ` Kevin Liu
@ 2013-03-11 15:53 ` Stephen Warren
2013-03-12 2:03 ` Kevin Liu
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2013-03-11 15:53 UTC (permalink / raw)
To: Kevin Liu
Cc: Kevin Liu, linux-mmc, Chris Ball, Guennadi Liakhovetski,
Sujit Reddy Thumma, Jaehoon Chung, Aaron Lu, Ulf Hansson,
Wei WANG, Fabio Estevam, Adrian Hunter, Philip Rakity, Shawn Guo,
Johan Rudholm, Girish K S, Haijun Zhang, Zhangfei Gao,
Haojian Zhuang, Chao Xie
On 03/08/2013 09:27 PM, Kevin Liu wrote:
> 2013/3/9 Stephen Warren <swarren@wwwdotorg.org>:
>> On 03/07/2013 09:52 PM, Kevin Liu wrote:
>>> commit 6c56e7a0 provide a function mmc_of_parse for standard MMC
>>> device-tree binding parser centrally. So just call it with
>>> sdhci_get_of_property together in sdhci_pltfm_register.
>>
>> BTW, this patch seems to do two unrelated things; firstly it changes the
>> indentation level throughout sdhci_get_of_property(), and secondly makes
>> the change described in the commit description.
>
> That's true. I originally want to do the first thing incidentally :-)
> So do you want to split this patch into two?
It's Chris's call, but I think it'd be more usual to make this two
separate patches.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: sdhci-pltfm: add calling mmc_of_parse in sdhci_pltfm_register
2013-03-11 15:53 ` Stephen Warren
@ 2013-03-12 2:03 ` Kevin Liu
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Liu @ 2013-03-12 2:03 UTC (permalink / raw)
To: Stephen Warren
Cc: Kevin Liu, linux-mmc, Chris Ball, Guennadi Liakhovetski,
Sujit Reddy Thumma, Jaehoon Chung, Aaron Lu, Ulf Hansson,
Wei WANG, Fabio Estevam, Adrian Hunter, Philip Rakity, Shawn Guo,
Johan Rudholm, Girish K S, Haijun Zhang, Zhangfei Gao,
Haojian Zhuang, Chao Xie
2013/3/11 Stephen Warren <swarren@wwwdotorg.org>:
> On 03/08/2013 09:27 PM, Kevin Liu wrote:
>> 2013/3/9 Stephen Warren <swarren@wwwdotorg.org>:
>>> On 03/07/2013 09:52 PM, Kevin Liu wrote:
>>>> commit 6c56e7a0 provide a function mmc_of_parse for standard MMC
>>>> device-tree binding parser centrally. So just call it with
>>>> sdhci_get_of_property together in sdhci_pltfm_register.
>>>
>>> BTW, this patch seems to do two unrelated things; firstly it changes the
>>> indentation level throughout sdhci_get_of_property(), and secondly makes
>>> the change described in the commit description.
>>
>> That's true. I originally want to do the first thing incidentally :-)
>> So do you want to split this patch into two?
>
> It's Chris's call, but I think it'd be more usual to make this two
> separate patches.
Thanks for review!
I have splited it into different patches as below:
[PATCH v3 1/4] mmc: sdhci-pltfm: add calling mmc_of_parse in
[PATCH 2/4] mmc: sdhci-pltfm: avoid indentation in
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-12 2:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-08 4:52 [PATCH] mmc: sdhci-pltfm: add calling mmc_of_parse in sdhci_pltfm_register Kevin Liu
2013-03-08 20:18 ` Stephen Warren
2013-03-09 4:27 ` Kevin Liu
2013-03-11 15:53 ` Stephen Warren
2013-03-12 2:03 ` Kevin Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox