public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support
@ 2010-02-15  8:08 Yusuke Goda
  2010-02-15 12:15 ` Magnus Damm
  2010-02-15 18:00 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Yusuke Goda @ 2010-02-15  8:08 UTC (permalink / raw)
  To: linux-mmc; +Cc: akpm, Magnus Damm

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

Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
---
 drivers/mmc/host/tmio_mmc.c |    2 ++
 include/linux/mfd/tmio.h    |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index e22c3fa..a8ca83f 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -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;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 9cb1834..695199a 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -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);
 };
-- 
1.6.4.3



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

* Re: tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support
  2010-02-15  8:08 tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support Yusuke Goda
@ 2010-02-15 12:15 ` Magnus Damm
  2010-02-16 22:32   ` Andrew Morton
  2010-02-15 18:00 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Magnus Damm @ 2010-02-15 12:15 UTC (permalink / raw)
  To: Yusuke Goda; +Cc: linux-mmc, akpm

Hi Goda-san,

2010/2/15 Yusuke Goda <goda.yusuke@renesas.com>:
> Enable MMC_CAP_MMC_HIGHSPEED support in the tmio_mmc driver if
> pdata->cap_highspeed is set.
>
> Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>

Thanks for your patch, it looks fine to me.
Acked-by: Magnus Damm <damm@opensource.se>

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

Cheers,

/ magnus

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

* Re: tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support
  2010-02-15  8:08 tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support Yusuke Goda
  2010-02-15 12:15 ` Magnus Damm
@ 2010-02-15 18:00 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2010-02-15 18:00 UTC (permalink / raw)
  To: Yusuke Goda; +Cc: linux-mmc, akpm, Magnus Damm

2010/2/15 Yusuke Goda <goda.yusuke@renesas.com>:

> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index 9cb1834..695199a 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -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:

> diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
> (...)
>        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

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

* Re: tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support
  2010-02-15 12:15 ` Magnus Damm
@ 2010-02-16 22:32   ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2010-02-16 22:32 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Yusuke Goda, linux-mmc

On Mon, 15 Feb 2010 21:15:49 +0900
Magnus Damm <magnus.damm@gmail.com> wrote:

> Hi Goda-san,
> 
> 2010/2/15 Yusuke Goda <goda.yusuke@renesas.com>:
> > Enable MMC_CAP_MMC_HIGHSPEED support in the tmio_mmc driver if
> > pdata->cap_highspeed is set.
> >
> > Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
> 
> Thanks for your patch, it looks fine to me.
> Acked-by: Magnus Damm <damm@opensource.se>
> 
> 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.


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

end of thread, other threads:[~2010-02-16 22:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15  8:08 tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support Yusuke Goda
2010-02-15 12:15 ` Magnus Damm
2010-02-16 22:32   ` Andrew Morton
2010-02-15 18:00 ` Linus Walleij

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