All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Hutchings <ben.hutchings@codethink.co.uk>,
	Ian Molton <ian@mnementh.co.uk>,
	linux-mmc@vger.kernel.org
Cc: linux-sh@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@lists.codethink.co.uk
Subject: Re: [RFC PATCH 5/7] mmc: sh_mobile_sdhi: Add UHS-I mode support
Date: Thu, 30 Apr 2015 19:04:49 +0300	[thread overview]
Message-ID: <554252A1.6070302@cogentembedded.com> (raw)
In-Reply-To: <1430397136.5802.44.camel@xylophone.i.decadent.org.uk>

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@codethink.co.uk>
> ---
>   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.

[...]

WBR, Sergei


WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ben Hutchings <ben.hutchings@codethink.co.uk>,
	Ian Molton <ian@mnementh.co.uk>,
	linux-mmc@vger.kernel.org
Cc: linux-sh@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@lists.codethink.co.uk
Subject: Re: [RFC PATCH 5/7] mmc: sh_mobile_sdhi: Add UHS-I mode support
Date: Thu, 30 Apr 2015 16:04:49 +0000	[thread overview]
Message-ID: <554252A1.6070302@cogentembedded.com> (raw)
In-Reply-To: <1430397136.5802.44.camel@xylophone.i.decadent.org.uk>

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@codethink.co.uk>
> ---
>   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.

[...]

WBR, Sergei


  reply	other threads:[~2015-04-30 16:04 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 12:29 [RFC PATCH 0/7] UHS-I support for sh_mobile_sdhi Ben Hutchings
2015-04-30 12:29 ` Ben Hutchings
     [not found] ` <1430396995.5802.39.camel-2NU49sBE5Aze9VDwLV8dzJPsBRI6B4nW9dF7HbQ/qKg@public.gmane.org>
2015-04-30 12:30   ` [RFC PATCH 1/7] mmc: tmio: Add UHS-I mode support Ben Hutchings
2015-04-30 12:30     ` Ben Hutchings
2015-05-11  3:38     ` Kuninori Morimoto
     [not found]       ` <87egmn4wfo.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2015-05-11 14:04         ` Ben Hutchings
2015-05-11 14:04           ` Ben Hutchings
2015-05-11 14:10       ` Ben Hutchings
2015-05-11 14:10         ` Ben Hutchings
2015-04-30 12:33   ` [RFC PATCH 7/7] ARM: shmobile: r8a7790-lager.dts: Assert UHS-I SDR-50 capability Ben Hutchings
2015-04-30 12:33     ` Ben Hutchings
2015-04-30 16:08     ` Sergei Shtylyov
2015-04-30 16:08       ` Sergei Shtylyov
2015-04-30 12:31 ` [RFC PATCH 2/7] mmc: sh_mobile_sdhi: Add actual clock rate support Ben Hutchings
2015-04-30 12:31   ` Ben Hutchings
2015-04-30 16:34   ` Sergei Shtylyov
2015-04-30 16:34     ` Sergei Shtylyov
     [not found]     ` <554259A0.9030307-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-05-06  1:05       ` Ben Hutchings
2015-05-06  1:05         ` Ben Hutchings
2015-05-06  1:10         ` Ben Hutchings
2015-05-06  1:10           ` Ben Hutchings
2015-04-30 12:31 ` [RFC PATCH 3/7] pinctrl: sh-pfc: r8a7790: Add regulators for SD voltage switch Ben Hutchings
2015-04-30 12:31   ` Ben Hutchings
2015-05-05  7:52   ` Ulf Hansson
2015-05-05  7:52     ` Ulf Hansson
2015-05-06  1:12     ` Ben Hutchings
2015-05-06  1:12       ` Ben Hutchings
2015-04-30 12:31 ` [RFC PATCH 4/7] ARM: shmobile: r8a7790: Add nodes for pfc SD voltage regulators Ben Hutchings
2015-04-30 12:31   ` Ben Hutchings
2015-05-01  0:57   ` Simon Horman
2015-05-01  0:57     ` Simon Horman
2015-05-06  1:18     ` Ben Hutchings
2015-05-06  1:18       ` Ben Hutchings
     [not found]       ` <1430875082.4222.28.camel-2NU49sBE5Aze9VDwLV8dzJPsBRI6B4nW9dF7HbQ/qKg@public.gmane.org>
2015-05-07  4:33         ` Simon Horman
2015-05-07  4:33           ` Simon Horman
2015-04-30 12:32 ` [RFC PATCH 5/7] mmc: sh_mobile_sdhi: Add UHS-I mode support Ben Hutchings
2015-04-30 12:32   ` Ben Hutchings
2015-04-30 16:04   ` Sergei Shtylyov [this message]
2015-04-30 16:04     ` Sergei Shtylyov
     [not found]     ` <554252A1.6070302-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-05-06  1:41       ` Ben Hutchings
2015-05-06  1:41         ` Ben Hutchings
2015-05-05  7:56   ` Ulf Hansson
2015-05-05  7:56     ` Ulf Hansson
2015-05-05  8:35     ` [Linux-kernel] " Ben Dooks
2015-05-05  8:35       ` Ben Dooks
     [not found]       ` <554880C9.8080201-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
2015-05-05  8:47         ` Ulf Hansson
2015-05-05  8:47           ` Ulf Hansson
2015-05-06  1:38           ` Ben Hutchings
2015-05-06  1:38             ` Ben Hutchings
2015-05-06  8:44             ` Ulf Hansson
2015-05-06  8:44               ` Ulf Hansson
2015-05-06 13:49               ` Ben Hutchings
2015-05-06 13:49                 ` Ben Hutchings
2015-05-11  8:54                 ` Ulf Hansson
2015-05-11  8:54                   ` Ulf Hansson
2015-05-11 14:01                   ` Ben Hutchings
2015-05-11 14:01                     ` Ben Hutchings
2015-05-11 14:58                     ` Ulf Hansson
2015-05-11 14:58                       ` Ulf Hansson
2015-04-30 12:32 ` [RFC PATCH 6/7] ARM: shmobile: r8a7790-lager.dts: Set sdhi and mmcif clock rates Ben Hutchings
2015-04-30 12:32   ` Ben Hutchings
2015-04-30 16:06   ` Sergei Shtylyov
2015-04-30 16:06     ` Sergei Shtylyov
2015-05-06  1:44     ` Ben Hutchings
2015-05-06  1:44       ` Ben Hutchings
     [not found]   ` <1430397166.5802.45.camel-2NU49sBE5Aze9VDwLV8dzJPsBRI6B4nW9dF7HbQ/qKg@public.gmane.org>
2015-05-01  0:59     ` Simon Horman
2015-05-01  0:59       ` Simon Horman
     [not found]       ` <20150501005920.GH13754-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2015-05-06  1:46         ` Ben Hutchings
2015-05-06  1:46           ` Ben Hutchings
2015-05-07  4:29           ` Simon Horman
2015-05-07  4:29             ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554252A1.6070302@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=ben.hutchings@codethink.co.uk \
    --cc=devicetree@vger.kernel.org \
    --cc=ian@mnementh.co.uk \
    --cc=linux-kernel@lists.codethink.co.uk \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.