Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mmc: dw_mmc-k3: Remove mshc alias support

Remove the long-deprecated mshc alias support, as the mmc core already
provides alias functionality through the standard mmc alias. This eliminates
the redundant dual-alias system. The driver now obtains the controller ID
from struct mmc_host::index(supplied by mmc alias) instead of the legacy mshc
alias.

dw_mci_hi6220_parse_dt() which parse mshc alias is used for hi6220, hi3660 and
hi3670. Given hi6220 never assigned mshc alias on the DTS files, and hi3360
and hi3670 share the same code, so with it removed, add a return value to
dw_mci_hs_set_timing() and let dw_mci_hi3660_init() check if index exceeds
TIMING_MODE in the firs place to bail out early, the same as before.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Shawn Lin and committed by
Ulf Hansson
9b541cea 6aaa6c56

+8 -15
+8 -15
drivers/mmc/host/dw_mmc-k3.c
··· 53 53 #define USE_DLY_MAX_SMPL (14) 54 54 55 55 struct k3_priv { 56 - int ctrl_id; 57 56 u32 cur_speed; 58 57 struct regmap *reg; 59 58 }; ··· 125 126 "hisilicon,peripheral-syscon"); 126 127 if (IS_ERR(priv->reg)) 127 128 priv->reg = NULL; 128 - 129 - priv->ctrl_id = of_alias_get_id(host->dev->of_node, "mshc"); 130 - if (priv->ctrl_id < 0) 131 - priv->ctrl_id = 0; 132 - 133 - if (priv->ctrl_id >= TIMING_MODE) 134 - return -EINVAL; 135 129 136 130 host->priv = priv; 137 131 return 0; ··· 203 211 .execute_tuning = dw_mci_hi6220_execute_tuning, 204 212 }; 205 213 206 - static void dw_mci_hs_set_timing(struct dw_mci *host, int timing, 214 + static int dw_mci_hs_set_timing(struct dw_mci *host, int timing, 207 215 int smpl_phase) 208 216 { 209 217 u32 drv_phase; ··· 212 220 u32 enable_shift = 0; 213 221 u32 reg_value; 214 222 int ctrl_id; 215 - struct k3_priv *priv; 216 223 217 - priv = host->priv; 218 - ctrl_id = priv->ctrl_id; 224 + ctrl_id = host->mmc->index; 225 + if (ctrl_id >= TIMING_MODE) 226 + return -EINVAL; 219 227 220 228 drv_phase = hs_timing_cfg[ctrl_id][timing].drv_phase; 221 229 smpl_dly = hs_timing_cfg[ctrl_id][timing].smpl_dly; ··· 252 260 253 261 /* We should delay 1ms wait for timing setting finished. */ 254 262 usleep_range(1000, 2000); 263 + 264 + return 0; 255 265 } 256 266 257 267 static int dw_mci_hi3660_init(struct dw_mci *host) ··· 261 267 mci_writel(host, CDTHRCTL, SDMMC_SET_THLD(SDCARD_RD_THRESHOLD, 262 268 SDMMC_CARD_RD_THR_EN)); 263 269 264 - dw_mci_hs_set_timing(host, MMC_TIMING_LEGACY, -1); 265 270 host->bus_hz /= (GENCLK_DIV + 1); 266 271 267 - return 0; 272 + return dw_mci_hs_set_timing(host, MMC_TIMING_LEGACY, -1); 268 273 } 269 274 270 275 static int dw_mci_set_sel18(struct dw_mci *host, bool set) ··· 400 407 if (!priv || !priv->reg) 401 408 return 0; 402 409 403 - if (priv->ctrl_id == DWMMC_SDIO_ID) 410 + if (mmc->index == DWMMC_SDIO_ID) 404 411 return 0; 405 412 406 413 if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330)