All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [PATCH 2/3] mmc: renesas_sdhi: don't hardcode SDIF values
Date: Thu, 12 Nov 2020 14:24:03 +0100	[thread overview]
Message-ID: <20201112132403.GC1491229@oden.dyn.berto.se> (raw)
In-Reply-To: <20201111100244.15823-3-wsa+renesas@sang-engineering.com>

Hi Wolfram,

Thanks for your work.

On 2020-11-11 11:02:43 +0100, Wolfram Sang wrote:
> Use a macro to name the hardcoded values. Also, move the SDIF register
> definition into the SDHI driver because this is an SDHI extension.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/mmc/host/renesas_sdhi_core.c | 7 +++++--
>  drivers/mmc/host/tmio_mmc.h          | 1 -
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index b3eb0182c4af..55633826d38c 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -49,6 +49,9 @@
>  #define HOST_MODE_GEN3_32BIT	(HOST_MODE_GEN3_WMODE | HOST_MODE_GEN3_BUSWIDTH)
>  #define HOST_MODE_GEN3_64BIT	0
>  
> +#define CTL_SDIF_MODE	0xe6
> +#define SDIF_MODE_HS400		BIT(0)
> +
>  #define SDHI_VER_GEN2_SDR50	0x490c
>  #define SDHI_VER_RZ_A1		0x820b
>  /* very old datasheets said 0x490c for SDR104, too. They are wrong! */
> @@ -381,7 +384,7 @@ static void renesas_sdhi_hs400_complete(struct mmc_host *mmc)
>  		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
>  
>  	/* Set HS400 mode */
> -	sd_ctrl_write16(host, CTL_SDIF_MODE, 0x0001 |
> +	sd_ctrl_write16(host, CTL_SDIF_MODE, SDIF_MODE_HS400 |
>  			sd_ctrl_read16(host, CTL_SDIF_MODE));
>  
>  	sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DT2FF,
> @@ -529,7 +532,7 @@ static void renesas_sdhi_reset_hs400_mode(struct tmio_mmc_host *host,
>  			sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
>  
>  	/* Reset HS400 mode */
> -	sd_ctrl_write16(host, CTL_SDIF_MODE, ~0x0001 &
> +	sd_ctrl_write16(host, CTL_SDIF_MODE, ~SDIF_MODE_HS400 &
>  			sd_ctrl_read16(host, CTL_SDIF_MODE));
>  
>  	sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DT2FF, priv->scc_tappos);
> diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
> index 9546e542619c..7ff41185896a 100644
> --- a/drivers/mmc/host/tmio_mmc.h
> +++ b/drivers/mmc/host/tmio_mmc.h
> @@ -42,7 +42,6 @@
>  #define CTL_DMA_ENABLE 0xd8
>  #define CTL_RESET_SD 0xe0
>  #define CTL_VERSION 0xe2
> -#define CTL_SDIF_MODE 0xe6
>  
>  /* Definitions for values the CTL_STOP_INTERNAL_ACTION register can take */
>  #define TMIO_STOP_STP		BIT(0)
> -- 
> 2.28.0
> 

-- 
Regards,
Niklas Söderlund

  reply	other threads:[~2020-11-12 13:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 10:02 [PATCH 0/3] mmc: renesas_sdhi: generic cleanups Wolfram Sang
2020-11-11 10:02 ` [PATCH 1/3] mmc: renesas_sdhi: improve HOST_MODE usage Wolfram Sang
2020-11-12 13:20   ` Niklas Söderlund
2020-11-13  5:53   ` Yoshihiro Shimoda
2020-11-11 10:02 ` [PATCH 2/3] mmc: renesas_sdhi: don't hardcode SDIF values Wolfram Sang
2020-11-12 13:24   ` Niklas Söderlund [this message]
2020-11-11 10:02 ` [PATCH 3/3] mmc: renesas_sdhi: sort includes Wolfram Sang
2020-11-12 13:24   ` Niklas Söderlund
2020-11-13  6:00 ` [PATCH 0/3] mmc: renesas_sdhi: generic cleanups Yoshihiro Shimoda
2020-11-17 11:50 ` Ulf Hansson

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=20201112132403.GC1491229@oden.dyn.berto.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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.