| 1 |
// SPDX-License-Identifier: GPL-2.0 |
| 2 |
/* |
| 3 |
* Copyright (C) 2023-2025 SpacemiT (Hangzhou) Technology Co. Ltd |
| 4 |
* Copyright (c) 2025 Yixun Lan <[email protected]> |
| 5 |
*/ |
| 6 |
|
| 7 |
#include <linux/bitfield.h> |
| 8 |
#include <linux/clk.h> |
| 9 |
#include <linux/delay.h> |
| 10 |
#include <linux/iopoll.h> |
| 11 |
#include <linux/init.h> |
| 12 |
#include <linux/mmc/card.h> |
| 13 |
#include <linux/mmc/host.h> |
| 14 |
#include <linux/mmc/mmc.h> |
| 15 |
#include <linux/module.h> |
| 16 |
#include <linux/of.h> |
| 17 |
#include <linux/of_device.h> |
| 18 |
#include <linux/reset.h> |
| 19 |
#include <linux/pinctrl/consumer.h> |
| 20 |
#include <linux/platform_device.h> |
| 21 |
|
| 22 |
#include "sdhci.h" |
| 23 |
#include "sdhci-pltfm.h" |
| 24 |
|
| 25 |
#define SPACEMIT_SDHC_OP_EXT_REG 0x108 |
| 26 |
#define SDHC_OVRRD_CLK_OEN BIT(11) |
| 27 |
#define SDHC_FORCE_CLK_ON BIT(12) |
| 28 |
|
| 29 |
#define SPACEMIT_SDHC_LEGACY_CTRL_REG 0x10C |
| 30 |
#define SDHC_GEN_PAD_CLK_ON BIT(6) |
| 31 |
|
| 32 |
#define SPACEMIT_SDHC_MMC_CTRL_REG 0x114 |
| 33 |
#define SDHC_MISC_INT_EN BIT(1) |
| 34 |
#define SDHC_MISC_INT BIT(2) |
| 35 |
#define SDHC_ENHANCE_STROBE_EN BIT(8) |
| 36 |
#define SDHC_MMC_HS400 BIT(9) |
| 37 |
#define SDHC_MMC_HS200 BIT(10) |
| 38 |
#define SDHC_MMC_CARD_MODE BIT(12) |
| 39 |
|
| 40 |
#define SPACEMIT_SDHC_TX_CFG_REG 0x11C |
| 41 |
#define SDHC_TX_INT_CLK_SEL BIT(30) |
| 42 |
#define SDHC_TX_MUX_SEL BIT(31) |
| 43 |
|
| 44 |
#define SPACEMIT_SDHC_PHY_CTRL_REG 0x160 |
| 45 |
#define SDHC_PHY_FUNC_EN BIT(0) |
| 46 |
#define SDHC_PHY_PLL_LOCK BIT(1) |
| 47 |
#define SDHC_HOST_LEGACY_MODE BIT(31) |
| 48 |
|
| 49 |
#define SPACEMIT_SDHC_PHY_FUNC_REG 0x164 |
| 50 |
#define SDHC_PHY_TEST_EN BIT(7) |
| 51 |
#define SDHC_HS200_USE_RFIFO BIT(15) |
| 52 |
|
| 53 |
#define SPACEMIT_SDHC_PHY_DLLCFG 0x168 |
| 54 |
#define SDHC_DLL_PREDLY_NUM GENMASK(3, 2) |
| 55 |
#define SDHC_DLL_FULLDLY_RANGE GENMASK(5, 4) |
| 56 |
#define SDHC_DLL_VREG_CTRL GENMASK(7, 6) |
| 57 |
#define SDHC_DLL_ENABLE BIT(31) |
| 58 |
|
| 59 |
#define SPACEMIT_SDHC_PHY_DLLCFG1 0x16C |
| 60 |
#define SDHC_DLL_REG1_CTRL GENMASK(7, 0) |
| 61 |
#define SDHC_DLL_REG2_CTRL GENMASK(15, 8) |
| 62 |
#define SDHC_DLL_REG3_CTRL GENMASK(23, 16) |
| 63 |
#define SDHC_DLL_REG4_CTRL GENMASK(31, 24) |
| 64 |
|
| 65 |
#define SPACEMIT_SDHC_PHY_DLLSTS 0x170 |
| 66 |
#define SDHC_DLL_LOCK_STATE BIT(0) |
| 67 |
|
| 68 |
#define SPACEMIT_SDHC_PHY_PADCFG_REG 0x178 |
| 69 |
#define SDHC_PHY_DRIVE_SEL GENMASK(2, 0) |
| 70 |
#define SDHC_RX_BIAS_CTRL BIT(5) |
| 71 |
|
| 72 |
struct spacemit_sdhci_host { |
| 73 |
struct clk *clk_core; |
| 74 |
struct clk *clk_io; |
| 75 |
struct pinctrl *pinctrl; |
| 76 |
struct pinctrl_state *pinctrl_default; |
| 77 |
struct pinctrl_state *pinctrl_uhs; |
| 78 |
}; |
| 79 |
|
| 80 |
/* All helper functions will update clr/set while preserve rest bits */ |
| 81 |
static inline void spacemit_sdhci_setbits(struct sdhci_host *host, u32 val, int reg) |
| 82 |
{ |
| 83 |
sdhci_writel(host, sdhci_readl(host, reg) | val, reg); |
| 84 |
} |
| 85 |
|
| 86 |
static inline void spacemit_sdhci_clrbits(struct sdhci_host *host, u32 val, int reg) |
| 87 |
{ |
| 88 |
sdhci_writel(host, sdhci_readl(host, reg) & ~val, reg); |
| 89 |
} |
| 90 |
|
| 91 |
static inline void spacemit_sdhci_clrsetbits(struct sdhci_host *host, u32 clr, u32 set, int reg) |
| 92 |
{ |
| 93 |
u32 val = sdhci_readl(host, reg); |
| 94 |
|
| 95 |
val = (val & ~clr) | set; |
| 96 |
sdhci_writel(host, val, reg); |
| 97 |
} |
| 98 |
|
| 99 |
static void spacemit_sdhci_reset(struct sdhci_host *host, u8 mask) |
| 100 |
{ |
| 101 |
sdhci_reset(host, mask); |
| 102 |
|
| 103 |
if (mask != SDHCI_RESET_ALL) |
| 104 |
return; |
| 105 |
|
| 106 |
spacemit_sdhci_setbits(host, SDHC_PHY_FUNC_EN | SDHC_PHY_PLL_LOCK, |
| 107 |
SPACEMIT_SDHC_PHY_CTRL_REG); |
| 108 |
|
| 109 |
spacemit_sdhci_clrsetbits(host, SDHC_PHY_DRIVE_SEL, |
| 110 |
SDHC_RX_BIAS_CTRL | FIELD_PREP(SDHC_PHY_DRIVE_SEL, 4), |
| 111 |
SPACEMIT_SDHC_PHY_PADCFG_REG); |
| 112 |
|
| 113 |
if (!(host->mmc->caps2 & MMC_CAP2_NO_MMC)) |
| 114 |
spacemit_sdhci_setbits(host, SDHC_MMC_CARD_MODE, SPACEMIT_SDHC_MMC_CTRL_REG); |
| 115 |
|
| 116 |
spacemit_sdhci_setbits(host, SDHC_GEN_PAD_CLK_ON, SPACEMIT_SDHC_LEGACY_CTRL_REG); |
| 117 |
|
| 118 |
if (host->mmc->caps2 & MMC_CAP2_NO_MMC) |
| 119 |
spacemit_sdhci_setbits(host, SDHC_OVRRD_CLK_OEN | SDHC_FORCE_CLK_ON, |
| 120 |
SPACEMIT_SDHC_OP_EXT_REG); |
| 121 |
} |
| 122 |
|
| 123 |
static void spacemit_sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned int timing) |
| 124 |
{ |
| 125 |
if (timing == MMC_TIMING_MMC_HS200) |
| 126 |
spacemit_sdhci_setbits(host, SDHC_MMC_HS200, SPACEMIT_SDHC_MMC_CTRL_REG); |
| 127 |
|
| 128 |
if (timing == MMC_TIMING_MMC_HS400) |
| 129 |
spacemit_sdhci_setbits(host, SDHC_MMC_HS400, SPACEMIT_SDHC_MMC_CTRL_REG); |
| 130 |
|
| 131 |
sdhci_set_uhs_signaling(host, timing); |
| 132 |
|
| 133 |
if (!(host->mmc->caps2 & MMC_CAP2_NO_SDIO)) |
| 134 |
spacemit_sdhci_setbits(host, SDHCI_CTRL_VDD_180, SDHCI_HOST_CONTROL2); |
| 135 |
} |
| 136 |
|
| 137 |
static void spacemit_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) |
| 138 |
{ |
| 139 |
struct mmc_host *mmc = host->mmc; |
| 140 |
|
| 141 |
if (mmc->ios.timing <= MMC_TIMING_UHS_SDR50) |
| 142 |
spacemit_sdhci_setbits(host, SDHC_TX_INT_CLK_SEL, SPACEMIT_SDHC_TX_CFG_REG); |
| 143 |
else |
| 144 |
spacemit_sdhci_clrbits(host, SDHC_TX_INT_CLK_SEL, SPACEMIT_SDHC_TX_CFG_REG); |
| 145 |
|
| 146 |
sdhci_set_clock(host, clock); |
| 147 |
}; |
| 148 |
|
| 149 |
static void spacemit_sdhci_phy_dll_init(struct sdhci_host *host) |
| 150 |
{ |
| 151 |
u32 state; |
| 152 |
int ret; |
| 153 |
|
| 154 |
spacemit_sdhci_clrsetbits(host, SDHC_DLL_PREDLY_NUM | |
| 155 |
SDHC_DLL_FULLDLY_RANGE | |
| 156 |
SDHC_DLL_VREG_CTRL, |
| 157 |
FIELD_PREP(SDHC_DLL_PREDLY_NUM, 1) | |
| 158 |
FIELD_PREP(SDHC_DLL_FULLDLY_RANGE, 1) | |
| 159 |
FIELD_PREP(SDHC_DLL_VREG_CTRL, 1), |
| 160 |
SPACEMIT_SDHC_PHY_DLLCFG); |
| 161 |
|
| 162 |
spacemit_sdhci_clrsetbits(host, SDHC_DLL_REG1_CTRL, |
| 163 |
FIELD_PREP(SDHC_DLL_REG1_CTRL, 0x92), |
| 164 |
SPACEMIT_SDHC_PHY_DLLCFG1); |
| 165 |
|
| 166 |
spacemit_sdhci_setbits(host, SDHC_DLL_ENABLE, SPACEMIT_SDHC_PHY_DLLCFG); |
| 167 |
|
| 168 |
ret = readl_poll_timeout(host->ioaddr + SPACEMIT_SDHC_PHY_DLLSTS, state, |
| 169 |
state & SDHC_DLL_LOCK_STATE, 2, 100); |
| 170 |
if (ret == -ETIMEDOUT) |
| 171 |
dev_warn(mmc_dev(host->mmc), "fail to lock phy dll in 100us!\n"); |
| 172 |
} |
| 173 |
|
| 174 |
static void spacemit_sdhci_hs400_enhanced_strobe(struct mmc_host *mmc, struct mmc_ios *ios) |
| 175 |
{ |
| 176 |
struct sdhci_host *host = mmc_priv(mmc); |
| 177 |
|
| 178 |
if (!ios->enhanced_strobe) { |
| 179 |
spacemit_sdhci_clrbits(host, SDHC_ENHANCE_STROBE_EN, SPACEMIT_SDHC_MMC_CTRL_REG); |
| 180 |
return; |
| 181 |
} |
| 182 |
|
| 183 |
spacemit_sdhci_setbits(host, SDHC_ENHANCE_STROBE_EN, SPACEMIT_SDHC_MMC_CTRL_REG); |
| 184 |
spacemit_sdhci_phy_dll_init(host); |
| 185 |
} |
| 186 |
|
| 187 |
static unsigned int spacemit_sdhci_clk_get_max_clock(struct sdhci_host *host) |
| 188 |
{ |
| 189 |
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
| 190 |
|
| 191 |
return clk_get_rate(pltfm_host->clk); |
| 192 |
} |
| 193 |
|
| 194 |
static int spacemit_sdhci_pre_select_hs400(struct mmc_host *mmc) |
| 195 |
{ |
| 196 |
struct sdhci_host *host = mmc_priv(mmc); |
| 197 |
|
| 198 |
spacemit_sdhci_setbits(host, SDHC_MMC_HS400, SPACEMIT_SDHC_MMC_CTRL_REG); |
| 199 |
|
| 200 |
return 0; |
| 201 |
} |
| 202 |
|
| 203 |
static void spacemit_sdhci_post_select_hs400(struct mmc_host *mmc) |
| 204 |
{ |
| 205 |
struct sdhci_host *host = mmc_priv(mmc); |
| 206 |
|
| 207 |
spacemit_sdhci_phy_dll_init(host); |
| 208 |
} |
| 209 |
|
| 210 |
static void spacemit_sdhci_pre_hs400_to_hs200(struct mmc_host *mmc) |
| 211 |
{ |
| 212 |
struct sdhci_host *host = mmc_priv(mmc); |
| 213 |
|
| 214 |
spacemit_sdhci_clrbits(host, SDHC_PHY_FUNC_EN | SDHC_PHY_PLL_LOCK, |
| 215 |
SPACEMIT_SDHC_PHY_CTRL_REG); |
| 216 |
spacemit_sdhci_clrbits(host, SDHC_MMC_HS400 | SDHC_MMC_HS200 | SDHC_ENHANCE_STROBE_EN, |
| 217 |
SPACEMIT_SDHC_MMC_CTRL_REG); |
| 218 |
spacemit_sdhci_clrbits(host, SDHC_HS200_USE_RFIFO, SPACEMIT_SDHC_PHY_FUNC_REG); |
| 219 |
|
| 220 |
udelay(5); |
| 221 |
|
| 222 |
spacemit_sdhci_setbits(host, SDHC_PHY_FUNC_EN | SDHC_PHY_PLL_LOCK, |
| 223 |
SPACEMIT_SDHC_PHY_CTRL_REG); |
| 224 |
} |
| 225 |
|
| 226 |
static int spacemit_sdhci_start_signal_voltage_switch(struct mmc_host *mmc, |
| 227 |
struct mmc_ios *ios) |
| 228 |
{ |
| 229 |
struct sdhci_host *host = mmc_priv(mmc); |
| 230 |
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
| 231 |
struct spacemit_sdhci_host *sdhst = sdhci_pltfm_priv(pltfm_host); |
| 232 |
struct pinctrl_state *state; |
| 233 |
int ret; |
| 234 |
|
| 235 |
ret = sdhci_start_signal_voltage_switch(mmc, ios); |
| 236 |
if (ret) |
| 237 |
return ret; |
| 238 |
|
| 239 |
if (!sdhst->pinctrl) |
| 240 |
return 0; |
| 241 |
|
| 242 |
/* Select appropriate pinctrl state based on signal voltage */ |
| 243 |
switch (ios->signal_voltage) { |
| 244 |
case MMC_SIGNAL_VOLTAGE_330: |
| 245 |
state = sdhst->pinctrl_default; |
| 246 |
break; |
| 247 |
case MMC_SIGNAL_VOLTAGE_180: |
| 248 |
state = sdhst->pinctrl_uhs; |
| 249 |
break; |
| 250 |
default: |
| 251 |
dev_warn(mmc_dev(mmc), "unsupported voltage %d\n", ios->signal_voltage); |
| 252 |
return 0; |
| 253 |
} |
| 254 |
|
| 255 |
ret = pinctrl_select_state(sdhst->pinctrl, state); |
| 256 |
if (ret) { |
| 257 |
dev_warn(mmc_dev(mmc), "failed to select pinctrl state: %d\n", ret); |
| 258 |
return 0; |
| 259 |
} |
| 260 |
dev_dbg(mmc_dev(mmc), "switched to %s pinctrl state\n", |
| 261 |
ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180 ? "UHS" : "default"); |
| 262 |
|
| 263 |
return 0; |
| 264 |
} |
| 265 |
|
| 266 |
static inline int spacemit_sdhci_get_clocks(struct device *dev, |
| 267 |
struct sdhci_pltfm_host *pltfm_host) |
| 268 |
{ |
| 269 |
struct spacemit_sdhci_host *sdhst = sdhci_pltfm_priv(pltfm_host); |
| 270 |
|
| 271 |
sdhst->clk_core = devm_clk_get_enabled(dev, "core"); |
| 272 |
if (IS_ERR(sdhst->clk_core)) |
| 273 |
return -EINVAL; |
| 274 |
|
| 275 |
sdhst->clk_io = devm_clk_get_enabled(dev, "io"); |
| 276 |
if (IS_ERR(sdhst->clk_io)) |
| 277 |
return -EINVAL; |
| 278 |
|
| 279 |
pltfm_host->clk = sdhst->clk_io; |
| 280 |
|
| 281 |
return 0; |
| 282 |
} |
| 283 |
|
| 284 |
static inline int spacemit_sdhci_get_resets(struct device *dev) |
| 285 |
{ |
| 286 |
struct reset_control *rst; |
| 287 |
|
| 288 |
rst = devm_reset_control_get_optional_shared_deasserted(dev, "axi"); |
| 289 |
if (IS_ERR(rst)) |
| 290 |
return PTR_ERR(rst); |
| 291 |
|
| 292 |
rst = devm_reset_control_get_optional_exclusive_deasserted(dev, "sdh"); |
| 293 |
if (IS_ERR(rst)) |
| 294 |
return PTR_ERR(rst); |
| 295 |
|
| 296 |
return 0; |
| 297 |
} |
| 298 |
|
| 299 |
static inline void spacemit_sdhci_get_pins(struct device *dev, |
| 300 |
struct sdhci_pltfm_host *pltfm_host) |
| 301 |
{ |
| 302 |
struct spacemit_sdhci_host *sdhst = sdhci_pltfm_priv(pltfm_host); |
| 303 |
|
| 304 |
sdhst->pinctrl = devm_pinctrl_get(dev); |
| 305 |
if (IS_ERR(sdhst->pinctrl)) { |
| 306 |
sdhst->pinctrl = NULL; |
| 307 |
dev_dbg(dev, "pinctrl not available, voltage switching will work without it\n"); |
| 308 |
return; |
| 309 |
} |
| 310 |
|
| 311 |
sdhst->pinctrl_default = pinctrl_lookup_state(sdhst->pinctrl, "default"); |
| 312 |
if (IS_ERR(sdhst->pinctrl_default)) |
| 313 |
sdhst->pinctrl_default = NULL; |
| 314 |
|
| 315 |
sdhst->pinctrl_uhs = pinctrl_lookup_state(sdhst->pinctrl, "uhs"); |
| 316 |
if (IS_ERR(sdhst->pinctrl_uhs)) |
| 317 |
sdhst->pinctrl_uhs = NULL; |
| 318 |
|
| 319 |
dev_dbg(dev, "pinctrl setup: default=%p, uhs=%p\n", |
| 320 |
sdhst->pinctrl_default, sdhst->pinctrl_uhs); |
| 321 |
} |
| 322 |
|
| 323 |
static const struct sdhci_ops spacemit_sdhci_ops = { |
| 324 |
.get_max_clock = spacemit_sdhci_clk_get_max_clock, |
| 325 |
.reset = spacemit_sdhci_reset, |
| 326 |
.set_bus_width = sdhci_set_bus_width, |
| 327 |
.set_clock = spacemit_sdhci_set_clock, |
| 328 |
.set_uhs_signaling = spacemit_sdhci_set_uhs_signaling, |
| 329 |
}; |
| 330 |
|
| 331 |
static const struct sdhci_pltfm_data spacemit_sdhci_k1_pdata = { |
| 332 |
.ops = &spacemit_sdhci_ops, |
| 333 |
.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | |
| 334 |
SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC | |
| 335 |
SDHCI_QUIRK_32BIT_ADMA_SIZE | |
| 336 |
SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | |
| 337 |
SDHCI_QUIRK_BROKEN_CARD_DETECTION | |
| 338 |
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, |
| 339 |
.quirks2 = SDHCI_QUIRK2_BROKEN_64_BIT_DMA | |
| 340 |
SDHCI_QUIRK2_PRESET_VALUE_BROKEN, |
| 341 |
}; |
| 342 |
|
| 343 |
static const struct sdhci_pltfm_data spacemit_sdhci_k3_pdata = { |
| 344 |
.ops = &spacemit_sdhci_ops, |
| 345 |
.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | |
| 346 |
SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC | |
| 347 |
SDHCI_QUIRK_32BIT_ADMA_SIZE | |
| 348 |
SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | |
| 349 |
SDHCI_QUIRK_BROKEN_CARD_DETECTION | |
| 350 |
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, |
| 351 |
.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, |
| 352 |
}; |
| 353 |
|
| 354 |
static const struct of_device_id spacemit_sdhci_of_match[] = { |
| 355 |
{ .compatible = "spacemit,k1-sdhci", .data = &spacemit_sdhci_k1_pdata }, |
| 356 |
{ .compatible = "spacemit,k3-sdhci", .data = &spacemit_sdhci_k3_pdata }, |
| 357 |
{ /* sentinel */ } |
| 358 |
}; |
| 359 |
MODULE_DEVICE_TABLE(of, spacemit_sdhci_of_match); |
| 360 |
|
| 361 |
static int spacemit_sdhci_probe(struct platform_device *pdev) |
| 362 |
{ |
| 363 |
struct device *dev = &pdev->dev; |
| 364 |
struct spacemit_sdhci_host *sdhst; |
| 365 |
struct sdhci_pltfm_host *pltfm_host; |
| 366 |
struct sdhci_host *host; |
| 367 |
const struct sdhci_pltfm_data *data; |
| 368 |
struct mmc_host_ops *mops; |
| 369 |
int ret; |
| 370 |
|
| 371 |
data = of_device_get_match_data(&pdev->dev); |
| 372 |
|
| 373 |
host = sdhci_pltfm_init(pdev, data, sizeof(*sdhst)); |
| 374 |
if (IS_ERR(host)) |
| 375 |
return PTR_ERR(host); |
| 376 |
|
| 377 |
pltfm_host = sdhci_priv(host); |
| 378 |
|
| 379 |
ret = mmc_of_parse(host->mmc); |
| 380 |
if (ret) |
| 381 |
goto err_pltfm; |
| 382 |
|
| 383 |
sdhci_get_of_property(pdev); |
| 384 |
|
| 385 |
if (!(host->mmc->caps2 & MMC_CAP2_NO_MMC)) { |
| 386 |
mops = &host->mmc_host_ops; |
| 387 |
mops->hs400_prepare_ddr = spacemit_sdhci_pre_select_hs400; |
| 388 |
mops->hs400_complete = spacemit_sdhci_post_select_hs400; |
| 389 |
mops->hs400_downgrade = spacemit_sdhci_pre_hs400_to_hs200; |
| 390 |
mops->hs400_enhanced_strobe = spacemit_sdhci_hs400_enhanced_strobe; |
| 391 |
} |
| 392 |
|
| 393 |
host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY; |
| 394 |
|
| 395 |
spacemit_sdhci_get_pins(dev, pltfm_host); |
| 396 |
|
| 397 |
host->mmc_host_ops.start_signal_voltage_switch = spacemit_sdhci_start_signal_voltage_switch; |
| 398 |
|
| 399 |
ret = spacemit_sdhci_get_clocks(dev, pltfm_host); |
| 400 |
if (ret) |
| 401 |
goto err_pltfm; |
| 402 |
|
| 403 |
ret = spacemit_sdhci_get_resets(dev); |
| 404 |
if (ret) |
| 405 |
goto err_pltfm; |
| 406 |
|
| 407 |
ret = sdhci_add_host(host); |
| 408 |
if (ret) |
| 409 |
goto err_pltfm; |
| 410 |
|
| 411 |
return 0; |
| 412 |
|
| 413 |
err_pltfm: |
| 414 |
return ret; |
| 415 |
} |
| 416 |
|
| 417 |
static struct platform_driver spacemit_sdhci_driver = { |
| 418 |
.driver = { |
| 419 |
.name = "sdhci-spacemit", |
| 420 |
.of_match_table = spacemit_sdhci_of_match, |
| 421 |
}, |
| 422 |
.probe = spacemit_sdhci_probe, |
| 423 |
.remove = sdhci_pltfm_remove, |
| 424 |
}; |
| 425 |
module_platform_driver(spacemit_sdhci_driver); |
| 426 |
|
| 427 |
MODULE_DESCRIPTION("SpacemiT SDHCI platform driver"); |
| 428 |
MODULE_LICENSE("GPL"); |