From 01c0151a36565c653043d08a826d62d5744e511a Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 9 Apr 2018 20:47:31 +0200 Subject: [PATCH] mmc: matsushita-common: Special case only select registers in 16bit There are only a few registerse used in the 16bit mode which are 32bit internally. Special-case only those in the IO accessors and always write both halves. Any other register access is protected from accidentally overwriting neighboring register. Signed-off-by: Marek Vasut Cc: Jaehoon Chung Cc: Masahiro Yamada --- drivers/mmc/matsushita-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/matsushita-common.c b/drivers/mmc/matsushita-common.c index 3f538c354e..739586557a 100644 --- a/drivers/mmc/matsushita-common.c +++ b/drivers/mmc/matsushita-common.c @@ -68,7 +68,9 @@ void matsu_sd_writel(struct matsu_sd_priv *priv, writel(val, priv->regbase + (reg << 1)); if (priv->caps & MATSU_SD_CAP_16BIT) { writew(val & 0xffff, priv->regbase + (reg >> 1)); - if (val >> 16) + if (reg == MATSU_SD_INFO1 || reg == MATSU_SD_INFO1_MASK || + reg == MATSU_SD_INFO2 || reg == MATSU_SD_INFO2_MASK || + reg == MATSU_SD_ARG) writew(val >> 16, priv->regbase + (reg >> 1) + 2); } else writel(val, priv->regbase + reg); -- 2.39.5