public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements
@ 2013-03-25  9:42 Kevin Liu
  2013-03-25  9:42 ` [PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments to sdhci_pltfm_init Kevin Liu
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Kevin Liu @ 2013-03-25  9:42 UTC (permalink / raw)
  To: linux-mmc, Chris Ball, Jerry Huang, Chunhe Lan,
	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


This patchset aim to enhance sdhci-pxav3 with below patches (please get
detailed info in patch commmit message):
[PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments
[PATCH RESEND 2/4] mmc: sdhci-pxav3: remove cd-broken quirk for permanently
[PATCH RESEND 3/4] mmc: sdhci-pxav3: enhance device tree parser code
[PATCH RESEND v5 4/4] mmc: sdhci-pxav3: controller should use SDCLK for

Kevin Liu (4):
 mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments
 mmc: sdhci-pxav3: remove cd-broken quirk for permanently
 mmc: sdhci-pxav3: enhance device tree parser code
 mmc: sdhci-pxav3: controller should use SDCLK for

 drivers/mmc/host/sdhci-pxav3.c |   47 ++++++++++++++--------------------------
 1 file changed, 16 insertions(+), 31 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments to sdhci_pltfm_init
  2013-03-25  9:42 [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Kevin Liu
@ 2013-03-25  9:42 ` Kevin Liu
  2013-03-25  9:42 ` [PATCH RESEND 2/4] mmc: sdhci-pxav3: remove cd-broken quirk for permanently present card Kevin Liu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Kevin Liu @ 2013-03-25  9:42 UTC (permalink / raw)
  To: linux-mmc, Chris Ball, Jerry Huang, Chunhe Lan,
	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

sdhci_pltfm_init can set host->ops and host->quirks if sdhci_pltfm_data
is transfered as arguments. Then no need to set them manually in
sdhci_pxav3_probe.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
---
 drivers/mmc/host/sdhci-pxav3.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 5663a6e..14437fc 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -174,6 +174,14 @@ static const struct sdhci_ops pxav3_sdhci_ops = {
 	.get_max_clock = sdhci_pltfm_clk_get_max_clock,
 };
 
+static struct sdhci_pltfm_data sdhci_pxav3_pdata = {
+	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
+		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
+		| SDHCI_QUIRK_32BIT_ADMA_SIZE
+		| SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
+	.ops = &pxav3_sdhci_ops,
+};
+
 #ifdef CONFIG_OF
 static const struct of_device_id sdhci_pxav3_of_match[] = {
 	{
@@ -235,7 +243,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 	if (!pxa)
 		return -ENOMEM;
 
-	host = sdhci_pltfm_init(pdev, NULL);
+	host = sdhci_pltfm_init(pdev, &sdhci_pxav3_pdata);
 	if (IS_ERR(host)) {
 		kfree(pxa);
 		return PTR_ERR(host);
@@ -252,11 +260,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 	pltfm_host->clk = clk;
 	clk_prepare_enable(clk);
 
-	host->quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
-		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
-		| SDHCI_QUIRK_32BIT_ADMA_SIZE
-		| SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
-
 	/* enable 1/8V DDR capable */
 	host->mmc->caps |= MMC_CAP_1_8V_DDR;
 
@@ -296,8 +299,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 		}
 	}
 
-	host->ops = &pxav3_sdhci_ops;
-
 	sdhci_get_of_property(pdev);
 
 	pm_runtime_set_active(&pdev->dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH RESEND 2/4] mmc: sdhci-pxav3: remove cd-broken quirk for permanently present card
  2013-03-25  9:42 [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Kevin Liu
  2013-03-25  9:42 ` [PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments to sdhci_pltfm_init Kevin Liu
@ 2013-03-25  9:42 ` Kevin Liu
  2013-03-25  9:42 ` [PATCH RESEND 3/4] mmc: sdhci-pxav3: enhance device tree parser code Kevin Liu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Kevin Liu @ 2013-03-25  9:42 UTC (permalink / raw)
  To: linux-mmc, Chris Ball, Jerry Huang, Chunhe Lan,
	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

Flag PXA_FLAG_CARD_PERMANENT is set in sdhci_pxa_platdata flags to indicate
that the card is always wired to host, like on-chip emmc, which is
permanently present and don't need detection.
So only MMC_CAP_NONREMOVABLE should be set for this case. But current code
also set SDHCI_QUIRK_BROKEN_CARD_DETECTION, which doesn't make sense.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
---
 drivers/mmc/host/sdhci-pxav3.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 14437fc..56d6a2e 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -268,11 +268,9 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 		pdata = pxav3_get_mmc_pdata(dev);
 
 	if (pdata) {
-		if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
-			/* on-chip device */
-			host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+		/* on-chip device */
+		if (pdata->flags & PXA_FLAG_CARD_PERMANENT)
 			host->mmc->caps |= MMC_CAP_NONREMOVABLE;
-		}
 
 		/* If slot design supports 8 bit data, indicate this to MMC. */
 		if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH RESEND 3/4] mmc: sdhci-pxav3: enhance device tree parser code
  2013-03-25  9:42 [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Kevin Liu
  2013-03-25  9:42 ` [PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments to sdhci_pltfm_init Kevin Liu
  2013-03-25  9:42 ` [PATCH RESEND 2/4] mmc: sdhci-pxav3: remove cd-broken quirk for permanently present card Kevin Liu
@ 2013-03-25  9:42 ` Kevin Liu
  2013-03-25  9:42 ` [PATCH RESEND v5 4/4] mmc: sdhci-pxav3: controller should use SDCLK for timeout caculation Kevin Liu
  2013-04-02  7:49 ` [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Haojian Zhuang
  4 siblings, 0 replies; 7+ messages in thread
From: Kevin Liu @ 2013-03-25  9:42 UTC (permalink / raw)
  To: linux-mmc, Chris Ball, Jerry Huang, Chunhe Lan,
	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

1. seperate device tree parsing from platform data handling which
can make further work easy when platform data can be removed.
2. add calling mmc_of_parse which can parse more of property and
pxav3_get_mmc_pdata can be shrinked a lot.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
---
 drivers/mmc/host/sdhci-pxav3.c |   24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 56d6a2e..fb0d23c 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -195,29 +195,16 @@ static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev)
 {
 	struct sdhci_pxa_platdata *pdata;
 	struct device_node *np = dev->of_node;
-	u32 bus_width;
 	u32 clk_delay_cycles;
-	enum of_gpio_flags gpio_flags;
 
 	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata)
 		return NULL;
 
-	if (of_find_property(np, "non-removable", NULL))
-		pdata->flags |= PXA_FLAG_CARD_PERMANENT;
-
-	of_property_read_u32(np, "bus-width", &bus_width);
-	if (bus_width == 8)
-		pdata->flags |= PXA_FLAG_SD_8_BIT_CAPABLE_SLOT;
-
 	of_property_read_u32(np, "mrvl,clk-delay-cycles", &clk_delay_cycles);
 	if (clk_delay_cycles > 0)
 		pdata->clk_delay_cycles = clk_delay_cycles;
 
-	pdata->ext_cd_gpio = of_get_named_gpio_flags(np, "cd-gpios", 0, &gpio_flags);
-	if (gpio_flags != OF_GPIO_ACTIVE_LOW)
-		pdata->host_caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
-
 	return pdata;
 }
 #else
@@ -264,10 +251,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 	host->mmc->caps |= MMC_CAP_1_8V_DDR;
 
 	match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), &pdev->dev);
-	if (match)
+	if (match) {
+		mmc_of_parse(host->mmc);
+		sdhci_get_of_property(pdev);
 		pdata = pxav3_get_mmc_pdata(dev);
-
-	if (pdata) {
+	} else if (pdata) {
 		/* on-chip device */
 		if (pdata->flags & PXA_FLAG_CARD_PERMANENT)
 			host->mmc->caps |= MMC_CAP_NONREMOVABLE;
@@ -297,8 +285,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 		}
 	}
 
-	sdhci_get_of_property(pdev);
-
 	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, PXAV3_RPM_DELAY_MS);
@@ -316,7 +302,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, host);
 
-	if (pdata->pm_caps & MMC_PM_KEEP_POWER) {
+	if (host->mmc->pm_caps & MMC_PM_KEEP_POWER) {
 		device_init_wakeup(&pdev->dev, 1);
 		host->mmc->pm_flags |= MMC_PM_WAKE_SDIO_IRQ;
 	} else {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH RESEND v5 4/4] mmc: sdhci-pxav3: controller should use SDCLK for timeout caculation
  2013-03-25  9:42 [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Kevin Liu
                   ` (2 preceding siblings ...)
  2013-03-25  9:42 ` [PATCH RESEND 3/4] mmc: sdhci-pxav3: enhance device tree parser code Kevin Liu
@ 2013-03-25  9:42 ` Kevin Liu
  2013-04-02  7:49 ` [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Haojian Zhuang
  4 siblings, 0 replies; 7+ messages in thread
From: Kevin Liu @ 2013-03-25  9:42 UTC (permalink / raw)
  To: linux-mmc, Chris Ball, Jerry Huang, Chunhe Lan,
	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

sdhci-pxav3 host controller used SDCLK for data timeout.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
---
 drivers/mmc/host/sdhci-pxav3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index fb0d23c..1ae358e 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -175,7 +175,7 @@ static const struct sdhci_ops pxav3_sdhci_ops = {
 };
 
 static struct sdhci_pltfm_data sdhci_pxav3_pdata = {
-	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
+	.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
 		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
 		| SDHCI_QUIRK_32BIT_ADMA_SIZE
 		| SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements
  2013-03-25  9:42 [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Kevin Liu
                   ` (3 preceding siblings ...)
  2013-03-25  9:42 ` [PATCH RESEND v5 4/4] mmc: sdhci-pxav3: controller should use SDCLK for timeout caculation Kevin Liu
@ 2013-04-02  7:49 ` Haojian Zhuang
  2013-04-04 14:04   ` Chris Ball
  4 siblings, 1 reply; 7+ messages in thread
From: Haojian Zhuang @ 2013-04-02  7:49 UTC (permalink / raw)
  To: Kevin Liu
  Cc: linux-mmc, Chris Ball, Jerry Huang, Chunhe Lan,
	Guennadi Liakhovetski, Sujit Reddy Thumma, Jaehoon Chung,
	Aaron Lu, Ulf Hansson, Wei WANG, Fabio Estevam, Stephen Warren,
	Adrian Hunter, Philip Rakity, Shawn Guo, Johan Rudholm,
	Girish K S, Haijun Zhang, Zhangfei Gao, Chao Xie, Kevin Liu

On Mon, Mar 25, 2013 at 5:42 PM, Kevin Liu <kliu5@marvell.com> wrote:
>
> This patchset aim to enhance sdhci-pxav3 with below patches (please get
> detailed info in patch commmit message):
> [PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments
> [PATCH RESEND 2/4] mmc: sdhci-pxav3: remove cd-broken quirk for permanently
> [PATCH RESEND 3/4] mmc: sdhci-pxav3: enhance device tree parser code
> [PATCH RESEND v5 4/4] mmc: sdhci-pxav3: controller should use SDCLK for
>
> Kevin Liu (4):
>  mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments
>  mmc: sdhci-pxav3: remove cd-broken quirk for permanently
>  mmc: sdhci-pxav3: enhance device tree parser code
>  mmc: sdhci-pxav3: controller should use SDCLK for
>
>  drivers/mmc/host/sdhci-pxav3.c |   47 ++++++++++++++--------------------------
>  1 file changed, 16 insertions(+), 31 deletions(-)

Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements
  2013-04-02  7:49 ` [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Haojian Zhuang
@ 2013-04-04 14:04   ` Chris Ball
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Ball @ 2013-04-04 14:04 UTC (permalink / raw)
  To: Haojian Zhuang; +Cc: Kevin Liu, linux-mmc, Zhangfei Gao

Hi,

Trimmed CC -- Kevin, please stop CC'ing so many people personally on
these patches.  That's what the mailing list's for.

On Tue, Apr 02 2013, Haojian Zhuang wrote:
> On Mon, Mar 25, 2013 at 5:42 PM, Kevin Liu <kliu5@marvell.com> wrote:
>>
>> This patchset aim to enhance sdhci-pxav3 with below patches (please get
>> detailed info in patch commmit message):
>> [PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments
>> [PATCH RESEND 2/4] mmc: sdhci-pxav3: remove cd-broken quirk for permanently
>> [PATCH RESEND 3/4] mmc: sdhci-pxav3: enhance device tree parser code
>> [PATCH RESEND v5 4/4] mmc: sdhci-pxav3: controller should use SDCLK for
>>
>> Kevin Liu (4):
>>  mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments
>>  mmc: sdhci-pxav3: remove cd-broken quirk for permanently
>>  mmc: sdhci-pxav3: enhance device tree parser code
>>  mmc: sdhci-pxav3: controller should use SDCLK for
>>
>>  drivers/mmc/host/sdhci-pxav3.c | 47
>> ++++++++++++++--------------------------
>>  1 file changed, 16 insertions(+), 31 deletions(-)
>
> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>

Thanks, all 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] 7+ messages in thread

end of thread, other threads:[~2013-04-04 14:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25  9:42 [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Kevin Liu
2013-03-25  9:42 ` [PATCH RESEND 1/4] mmc: sdhci-pxav3: transfer sdhci_pltfm_data as arguments to sdhci_pltfm_init Kevin Liu
2013-03-25  9:42 ` [PATCH RESEND 2/4] mmc: sdhci-pxav3: remove cd-broken quirk for permanently present card Kevin Liu
2013-03-25  9:42 ` [PATCH RESEND 3/4] mmc: sdhci-pxav3: enhance device tree parser code Kevin Liu
2013-03-25  9:42 ` [PATCH RESEND v5 4/4] mmc: sdhci-pxav3: controller should use SDCLK for timeout caculation Kevin Liu
2013-04-02  7:49 ` [PATCH 0/4] mmc: sdhci-pxav3: misc enhancements Haojian Zhuang
2013-04-04 14:04   ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox