diff mbox series

[v5,1/5] mmc: mmc: add hs400_prepare_ddr callback

Message ID 20181122063448.12351-1-yinbo.zhu@nxp.com (mailing list archive)
State New, archived
Headers show
Series [v5,1/5] mmc: mmc: add hs400_prepare_ddr callback | expand

Commit Message

Yinbo Zhu Nov. 22, 2018, 6:34 a.m. UTC
Some SD controllers need specific settings for HS400 mode
before the speed mode is been switching from DDR mode to
HS400 mode. and Prepare switch to DDR during the HS400
init sequence This patch is to add hs400_prepare_ddr
callback for this.

Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
---
Change in v5:
		rebase this patch and update the commit information

 drivers/mmc/core/mmc.c   |    3 +++
 include/linux/mmc/host.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

Comments

Ulf Hansson Nov. 22, 2018, 10:41 a.m. UTC | #1
On 22 November 2018 at 07:34, Yinbo Zhu <yinbo.zhu@nxp.com> wrote:
> Some SD controllers need specific settings for HS400 mode
> before the speed mode is been switching from DDR mode to
> HS400 mode. and Prepare switch to DDR during the HS400
> init sequence This patch is to add hs400_prepare_ddr
> callback for this.
>
> Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
> ---
> Change in v5:
>                 rebase this patch and update the commit information

I had a few comments on v4, could you please check.

Kind regards
Uffe

>
>  drivers/mmc/core/mmc.c   |    3 +++
>  include/linux/mmc/host.h |    1 +
>  2 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index bc1bd2c..749c5f2 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1182,6 +1182,9 @@ static int mmc_select_hs400(struct mmc_card *card)
>                 goto out_err;
>
>         /* Switch card to DDR */
> +       if (host->ops->prepare_ddr_to_hs400)
> +               host->ops->prepare_ddr_to_hs400(host);
> +
>         err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
>                          EXT_CSD_BUS_WIDTH,
>                          EXT_CSD_DDR_BUS_WIDTH_8,
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 2a5fe75..a44544e 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -146,6 +146,7 @@ struct mmc_host_ops {
>
>         /* Prepare HS400 target operating frequency depending host driver */
>         int     (*prepare_hs400_tuning)(struct mmc_host *host, struct mmc_ios *ios);
> +       int     (*prepare_ddr_to_hs400)(struct mmc_host *host);
>
>         /* Prepare for switching from HS400 to HS200 */
>         void    (*hs400_downgrade)(struct mmc_host *host);
> --
> 1.7.1
>
diff mbox series

Patch

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index bc1bd2c..749c5f2 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1182,6 +1182,9 @@  static int mmc_select_hs400(struct mmc_card *card)
 		goto out_err;
 
 	/* Switch card to DDR */
+	if (host->ops->prepare_ddr_to_hs400)
+		host->ops->prepare_ddr_to_hs400(host);
+
 	err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
 			 EXT_CSD_BUS_WIDTH,
 			 EXT_CSD_DDR_BUS_WIDTH_8,
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 2a5fe75..a44544e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -146,6 +146,7 @@  struct mmc_host_ops {
 
 	/* Prepare HS400 target operating frequency depending host driver */
 	int	(*prepare_hs400_tuning)(struct mmc_host *host, struct mmc_ios *ios);
+	int     (*prepare_ddr_to_hs400)(struct mmc_host *host);
 
 	/* Prepare for switching from HS400 to HS200 */
 	void	(*hs400_downgrade)(struct mmc_host *host);