Skip to contentSkip to conversation

tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support

PATCH Yusuke Goda 4 participants 4 messages Feb 15, 2010 – Feb 16, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Enable MMC_CAP_MMC_HIGHSPEED support in the tmio_mmc driver if pdata->cap_highspeed is set.

---
 drivers/mmc/host/tmio_mmc.c |    2 ++
 include/linux/mfd/tmio.h    |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
drivers/mmc/host/tmio_mmc.c +2 -0
index e22c3fa..a8ca83f 100644
@@ -550,6 +550,8 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 
 	mmc->ops = &tmio_mmc_ops;
 	mmc->caps = MMC_CAP_4_BIT_DATA;
+	if (pdata->cap_highspeed)
+		mmc->caps |= MMC_CAP_MMC_HIGHSPEED;
 	mmc->f_max = pdata->hclk;
 	mmc->f_min = mmc->f_max / 512;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
include/linux/mfd/tmio.h +1 -0
index 9cb1834..695199a 100644
@@ -60,6 +60,7 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
  */
 struct tmio_mmc_data {
 	const unsigned int		hclk;
+	int 				cap_highspeed;
 	void (*set_pwr)(struct platform_device *host, int state);
 	void (*set_clk_div)(struct platform_device *host, int state);
 };
Signature · 1 line
1.6.4.3
#3 lore raw
In reply to Yusuke Goda

2010/2/15 Yusuke Goda <[email protected]>:

include/linux/mfd/tmio.h void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); · line 63

Quoted 9 lines
include/linux/mfd/tmio.h +1 -0
index 9cb1834..695199a 100644
@@ -60,6 +60,7 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
  */
  struct tmio_mmc_data {
        const unsigned int              hclk;
+       int                             cap_highspeed;

If this is really a bool, then declare it as a bool.

But isn't it better to be able to specify arbitary caps for the platform? So make this an

unsigned long capabilities;

instead? Else you will get in trouble the day you want to tag on something else (like MMC_CAP_SD_HIGHSPEED), and it doesn't make sense to extend the struct with bools for just about everything.

Such a change would result in:

drivers/mmc/host/tmio_mmc.c static int __devinit tmio_mmc_probe(struct platform_device *dev) · line 554

Quoted 5 lines
drivers/mmc/host/tmio_mmc.c +2 -0
(...)
       mmc->caps = MMC_CAP_4_BIT_DATA;
+       if (pdata->cap_highspeed)
+               mmc->caps |= MMC_CAP_MMC_HIGHSPEED;

mmc->caps |= pdata->capabilities;

..and then set .capabilities to MMC_CAP_MMC_HIGHSPEED in the platform data.

Linus

#2 lore raw
In reply to Magnus Damm
Quoted 6 lines · On Mon, 15 Feb 2010 21:15:49 +0900 Magnus Damm <[email protected]> wrote:

Hi Goda-san,

2010/2/15 Yusuke Goda <[email protected]>:

Quoted 3 lines

Enable MMC_CAP_MMC_HIGHSPEED support in the tmio_mmc driver if pdata->cap_highspeed is set.

Quoted 8 lines
Quoted 1 line

Thanks for your patch, it looks fine to me.

If no one objects then I'll hack up a patch for the sh_mobile_sdhi driver that sets pdata->cah_highspeed to 1.

Would prefer to see the interrelated patches in a single series please.

Linus Walleij's suggestion sounded good, too.