Re: [RFC PATCH 5/7] mmc: sh_mobile_sdhi: Add UHS-I mode support

Ben Hutchings
2015-05-06T01:41:23Z

On Thu, 2015-04-30 at 19:04 +0300, Sergei Shtylyov wrote:
> Hello.
>
> On 04/30/2015 03:32 PM, Ben Hutchings wrote:
>
> > Implement voltage switch, supporting modes up to SDR-50.
>
> > Based on work by Shinobu Uehara, Rob Taylor, William Towle and Ian Molton.
>
> > This uses two voltage regulators, one external and one on the pfc.
>
> > Signed-off-by: Ben Hutchings <ben.hutchings-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
> > ---
> > drivers/mmc/host/sh_mobile_sdhi.c | 48 +++++++++++++++++++++++++++++++++++++
> > 1 file changed, 48 insertions(+)
>
> > diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> > index 92a58c6007fe..c8538a256e22 100644
> > --- a/drivers/mmc/host/sh_mobile_sdhi.c
> > +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> [...]
> > @@ -148,6 +150,41 @@ static void sh_mobile_sdhi_set_clk_div(struct platform_device *pdev, int clk)
> > }
> > }
> >
> > +static int sh_mobile_sdhi_start_signal_voltage_switch(
> > + struct tmio_mmc_host *host, unsigned char signal_voltage)
> > +{
> > + struct sh_mobile_sdhi *priv = host_to_priv(host);
> > + int min_uV, max_uV;
> > + int ret;
> > +
> > + if (signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
> > + min_uV = 2700000;
> > + max_uV = 3600000;
> > + } else if (signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
> > + min_uV = 1700000;
> > + max_uV = 1950000;
> > + } else {
> > + return -EINVAL;
> > + }
>
> The above is asking to be a *switch* statement.

I suppose so, yes.

Ben.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html