mmc: tmio: sdhi: Move tap_pos to private data
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Wed, 13 Jun 2018 06:02:55 +0000 (08:02 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 3 Dec 2018 11:51:17 +0000 (12:51 +0100)
Move the tap_pos variable, which is the HS200/HS400/SDR104 calibration
offset, into private data, so it can be passed around. This is done in
preparation for the HS400 mode, which needs to adjust this value.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/renesas-sdhi.c
drivers/mmc/tmio-common.h

index 0cc6f27279ff0304feb16450774714c2e2726fea..1ed50d6292e165d25f1259cbd13c2d1c141264e4 100644 (file)
@@ -125,7 +125,6 @@ static int renesas_sdhi_select_tuning(struct tmio_sd_priv *priv,
                                     unsigned int smpcmp)
 {
        unsigned long tap_cnt;  /* counter of tuning success */
-       unsigned long tap_set;  /* tap position */
        unsigned long tap_start;/* start position of tuning success */
        unsigned long tap_end;  /* end position of tuning success */
        unsigned long ntap;     /* temporary counter of tuning success */
@@ -209,12 +208,12 @@ static int renesas_sdhi_select_tuning(struct tmio_sd_priv *priv,
                select = true;
 
        if (select)
-               tap_set = ((tap_start + tap_end) / 2) % tap_num;
+               priv->tap_set = ((tap_start + tap_end) / 2) % tap_num;
        else
                return -EIO;
 
        /* Set SCC */
-       tmio_sd_writel(priv, tap_set, RENESAS_SDHI_SCC_TAPSET);
+       tmio_sd_writel(priv, priv->tap_set, RENESAS_SDHI_SCC_TAPSET);
 
        /* Enable auto re-tuning */
        reg = tmio_sd_readl(priv, RENESAS_SDHI_SCC_RVSCNTL);
index 6591c61c3c44e72371180d688462b7174df90938..9a427b5311eb0bf11e68bf41ceaf025a47625d0b 100644 (file)
@@ -134,6 +134,9 @@ struct tmio_sd_priv {
 #endif
 #if CONFIG_IS_ENABLED(CLK)
        struct clk                      clk;
+#endif
+#if CONFIG_IS_ENABLED(RENESAS_SDHI)
+       u8                              tap_set;
 #endif
        ulong (*clk_get_rate)(struct tmio_sd_priv *);
 };