summaryrefslogtreecommitdiff
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2026-01-23 20:24:08 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2026-02-23 12:06:55 +0100
commit9b541ceaf5b462f852f35245add4f2d3afd579f4 (patch)
tree730cce838d10cc6e5df66de4cf7fdf0ec7e4fc57 /drivers/mmc/host
parent6aaa6c561fe6e4a9011534ed050ca50fa6491f2f (diff)
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>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/dw_mmc-k3.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c
index 8cf0487b952c..8b1b4cf016ab 100644
--- a/drivers/mmc/host/dw_mmc-k3.c
+++ b/drivers/mmc/host/dw_mmc-k3.c
@@ -53,7 +53,6 @@
#define USE_DLY_MAX_SMPL (14)
struct k3_priv {
- int ctrl_id;
u32 cur_speed;
struct regmap *reg;
};
@@ -127,13 +126,6 @@ static int dw_mci_hi6220_parse_dt(struct dw_mci *host)
if (IS_ERR(priv->reg))
priv->reg = NULL;
- priv->ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
- if (priv->ctrl_id < 0)
- priv->ctrl_id = 0;
-
- if (priv->ctrl_id >= TIMING_MODE)
- return -EINVAL;
-
host->priv = priv;
return 0;
}
@@ -211,7 +203,7 @@ static const struct dw_mci_drv_data hi6220_data = {
.execute_tuning = dw_mci_hi6220_execute_tuning,
};
-static void dw_mci_hs_set_timing(struct dw_mci *host, int timing,
+static int dw_mci_hs_set_timing(struct dw_mci *host, int timing,
int smpl_phase)
{
u32 drv_phase;
@@ -220,10 +212,10 @@ static void dw_mci_hs_set_timing(struct dw_mci *host, int timing,
u32 enable_shift = 0;
u32 reg_value;
int ctrl_id;
- struct k3_priv *priv;
- priv = host->priv;
- ctrl_id = priv->ctrl_id;
+ ctrl_id = host->mmc->index;
+ if (ctrl_id >= TIMING_MODE)
+ return -EINVAL;
drv_phase = hs_timing_cfg[ctrl_id][timing].drv_phase;
smpl_dly = hs_timing_cfg[ctrl_id][timing].smpl_dly;
@@ -260,6 +252,8 @@ static void dw_mci_hs_set_timing(struct dw_mci *host, int timing,
/* We should delay 1ms wait for timing setting finished. */
usleep_range(1000, 2000);
+
+ return 0;
}
static int dw_mci_hi3660_init(struct dw_mci *host)
@@ -267,10 +261,9 @@ static int dw_mci_hi3660_init(struct dw_mci *host)
mci_writel(host, CDTHRCTL, SDMMC_SET_THLD(SDCARD_RD_THRESHOLD,
SDMMC_CARD_RD_THR_EN));
- dw_mci_hs_set_timing(host, MMC_TIMING_LEGACY, -1);
host->bus_hz /= (GENCLK_DIV + 1);
- return 0;
+ return dw_mci_hs_set_timing(host, MMC_TIMING_LEGACY, -1);
}
static int dw_mci_set_sel18(struct dw_mci *host, bool set)
@@ -407,7 +400,7 @@ static int dw_mci_hi3660_switch_voltage(struct dw_mci *host,
if (!priv || !priv->reg)
return 0;
- if (priv->ctrl_id == DWMMC_SDIO_ID)
+ if (mmc->index == DWMMC_SDIO_ID)
return 0;
if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330)