diff mbox

[v4,12/15] mmc: core: add new 1.8v flag for mmc

Message ID 1348659527-4200-13-git-send-email-keyuan.liu@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kevin Liu Sept. 26, 2012, 11:38 a.m. UTC
From: Kevin Liu <kliu5@marvell.com>

Mmc does NOT have special sequence requirements for 1.8v
signal voltage setting compared to sd and sdio.
Add a new 1.8v flag for mmc so as to use the same
start_signal_voltage_switch interface.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
---
 drivers/mmc/core/mmc.c   |    3 ++-
 include/linux/mmc/host.h |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

Comments

Ulf Hansson Sept. 27, 2012, 9:41 a.m. UTC | #1
Hi Kevin,

On 26 September 2012 13:38, Kevin Liu <keyuan.liu@gmail.com> wrote:
> From: Kevin Liu <kliu5@marvell.com>
>
> Mmc does NOT have special sequence requirements for 1.8v
> signal voltage setting compared to sd and sdio.
> Add a new 1.8v flag for mmc so as to use the same
> start_signal_voltage_switch interface.

This problem is protocol issue and should not be solved in the host
driver. We have more issues for signal_voltage switch as well.

Please have a look at Johan Rudholms patches:
[PATCH v2 1/2] mmc: core: Proper signal voltage switch
[PATCH v2 2/2] mmc: core: Power cycle card on voltage switch fail


>
> Signed-off-by: Kevin Liu <kliu5@marvell.com>
> ---
>  drivers/mmc/core/mmc.c   |    3 ++-
>  include/linux/mmc/host.h |    1 +
>  2 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 7509de1..3aa7f14 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -758,7 +758,8 @@ static int mmc_select_hs200(struct mmc_card *card)
>
>         if (err && card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_8V &&
>                         host->caps2 & MMC_CAP2_HS200_1_8V_SDR)
> -               err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 0);
> +               err = mmc_set_signal_voltage(host,
> +                       MMC_SIGNAL_VOLTAGE_MMC_180, 0);
>
>         /* If fails try again during next card power cycle */
>         if (err)
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 0ee92d2..d9ab286 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -71,6 +71,7 @@ struct mmc_ios {
>  #define MMC_SIGNAL_VOLTAGE_330 0
>  #define MMC_SIGNAL_VOLTAGE_180 1
>  #define MMC_SIGNAL_VOLTAGE_120 2
> +#define MMC_SIGNAL_VOLTAGE_MMC_180     3
>
>         unsigned char   drv_type;               /* driver type (A, B, C, D) */
>
> --
> 1.7.0.4
>

Kind regards
Ulf Hansson
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Liu Sept. 27, 2012, 10:39 a.m. UTC | #2
Hi, Ulf

2012/9/27 Ulf Hansson <ulf.hansson@linaro.org>:
> Hi Kevin,
>
> On 26 September 2012 13:38, Kevin Liu <keyuan.liu@gmail.com> wrote:
>> From: Kevin Liu <kliu5@marvell.com>
>>
>> Mmc does NOT have special sequence requirements for 1.8v
>> signal voltage setting compared to sd and sdio.
>> Add a new 1.8v flag for mmc so as to use the same
>> start_signal_voltage_switch interface.
>
> This problem is protocol issue and should not be solved in the host
> driver. We have more issues for signal_voltage switch as well.
>
> Please have a look at Johan Rudholms patches:
> [PATCH v2 1/2] mmc: core: Proper signal voltage switch
> [PATCH v2 2/2] mmc: core: Power cycle card on voltage switch fail
>
I agree that we should do more things in protocal driver.
But the real voltage switch work is still done in host driver. If we
keep only one voltage switch interface, then we need to add a flag to
distinguish sd/sdio or emmc. Or we should define two interfaces to
call different host functions to handle this.
Johan's patches can't solve my issue.

Thanks
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson Sept. 27, 2012, 2:28 p.m. UTC | #3
On 27 September 2012 12:39, Kevin Liu <keyuan.liu@gmail.com> wrote:
> Hi, Ulf
>
> 2012/9/27 Ulf Hansson <ulf.hansson@linaro.org>:
>> Hi Kevin,
>>
>> On 26 September 2012 13:38, Kevin Liu <keyuan.liu@gmail.com> wrote:
>>> From: Kevin Liu <kliu5@marvell.com>
>>>
>>> Mmc does NOT have special sequence requirements for 1.8v
>>> signal voltage setting compared to sd and sdio.
>>> Add a new 1.8v flag for mmc so as to use the same
>>> start_signal_voltage_switch interface.
>>
>> This problem is protocol issue and should not be solved in the host
>> driver. We have more issues for signal_voltage switch as well.
>>
>> Please have a look at Johan Rudholms patches:
>> [PATCH v2 1/2] mmc: core: Proper signal voltage switch
>> [PATCH v2 2/2] mmc: core: Power cycle card on voltage switch fail
>>
> I agree that we should do more things in protocal driver.
> But the real voltage switch work is still done in host driver. If we
> keep only one voltage switch interface, then we need to add a flag to
> distinguish sd/sdio or emmc. Or we should define two interfaces to
> call different host functions to handle this.
> Johan's patches can't solve my issue.

I understand that your driver today take care of specific things for
sd/sdio. The reason for that is because of the protocol layer is not
doing the voltage switch properly.
The idea with Johans patches is resolve all these issues. Thus the
host driver will just be responsible for the actual voltage switch to
happen. So in the end your voltage switch function in the host is
supposed to be rather simple.

If you still think you need to handle sd/sdio/eMMC in a specific
manner in your driver, there are always mmc_card_sdio|sd|mmc functions
you can use.

>
> Thanks
> Kevin

Kind regards
Ulf Hansson
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Liu Sept. 28, 2012, 7:13 a.m. UTC | #4
2012/9/27 Ulf Hansson <ulf.hansson@linaro.org>:
> On 27 September 2012 12:39, Kevin Liu <keyuan.liu@gmail.com> wrote:
>> Hi, Ulf
>>
>> 2012/9/27 Ulf Hansson <ulf.hansson@linaro.org>:
>>> Hi Kevin,
>>>
>>> On 26 September 2012 13:38, Kevin Liu <keyuan.liu@gmail.com> wrote:
>>>> From: Kevin Liu <kliu5@marvell.com>
>>>>
>>>> Mmc does NOT have special sequence requirements for 1.8v
>>>> signal voltage setting compared to sd and sdio.
>>>> Add a new 1.8v flag for mmc so as to use the same
>>>> start_signal_voltage_switch interface.
>>>
>>> This problem is protocol issue and should not be solved in the host
>>> driver. We have more issues for signal_voltage switch as well.
>>>
>>> Please have a look at Johan Rudholms patches:
>>> [PATCH v2 1/2] mmc: core: Proper signal voltage switch
>>> [PATCH v2 2/2] mmc: core: Power cycle card on voltage switch fail
>>>
>> I agree that we should do more things in protocal driver.
>> But the real voltage switch work is still done in host driver. If we
>> keep only one voltage switch interface, then we need to add a flag to
>> distinguish sd/sdio or emmc. Or we should define two interfaces to
>> call different host functions to handle this.
>> Johan's patches can't solve my issue.
>
> I understand that your driver today take care of specific things for
> sd/sdio. The reason for that is because of the protocol layer is not
> doing the voltage switch properly.
> The idea with Johans patches is resolve all these issues. Thus the
> host driver will just be responsible for the actual voltage switch to
> happen. So in the end your voltage switch function in the host is
> supposed to be rather simple.
>
Ok, Johans new patch is reasonable so I will hold this patch.

> If you still think you need to handle sd/sdio/eMMC in a specific
> manner in your driver, there are always mmc_card_sdio|sd|mmc functions
> you can use.
>
voltage_switch sometimes is called very early even before card type init.

Thanks
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 7509de1..3aa7f14 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -758,7 +758,8 @@  static int mmc_select_hs200(struct mmc_card *card)
 
 	if (err && card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_8V &&
 			host->caps2 & MMC_CAP2_HS200_1_8V_SDR)
-		err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 0);
+		err = mmc_set_signal_voltage(host,
+			MMC_SIGNAL_VOLTAGE_MMC_180, 0);
 
 	/* If fails try again during next card power cycle */
 	if (err)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0ee92d2..d9ab286 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -71,6 +71,7 @@  struct mmc_ios {
 #define MMC_SIGNAL_VOLTAGE_330	0
 #define MMC_SIGNAL_VOLTAGE_180	1
 #define MMC_SIGNAL_VOLTAGE_120	2
+#define MMC_SIGNAL_VOLTAGE_MMC_180	3
 
 	unsigned char	drv_type;		/* driver type (A, B, C, D) */