diff mbox series

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

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

Commit Message

Yinbo Zhu Nov. 23, 2018, 3:15 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 v6:
		rename the callback to "hs400_prepare_ddr" in code

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

Comments

Ulf Hansson Dec. 5, 2018, 2:23 p.m. UTC | #1
On Fri, 23 Nov 2018 at 04:20, 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>

Applied the series for next, thanks! I have also added a comment in
the header file, to explain a bit about the introduced callback.

Future wise, please also include a coverletter when sending a series
like this (git format-patch --cover-letter), as it helps during
review.

Kind regards
Uffe

> ---
> Change in v6:
>                 rename the callback to "hs400_prepare_ddr" in code
>
>  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..f3f0f64 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->hs400_prepare_ddr)
> +               host->ops->hs400_prepare_ddr(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..1077147 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     (*hs400_prepare_ddr)(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..f3f0f64 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->hs400_prepare_ddr)
+		host->ops->hs400_prepare_ddr(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..1077147 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     (*hs400_prepare_ddr)(struct mmc_host *host);
 
 	/* Prepare for switching from HS400 to HS200 */
 	void	(*hs400_downgrade)(struct mmc_host *host);