sdhci-st.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Support for SDHCI on STMicroelectronics SoCs
  4. *
  5. * Copyright (C) 2014 STMicroelectronics Ltd
  6. * Author: Giuseppe Cavallaro <[email protected]>
  7. * Contributors: Peter Griffin <[email protected]>
  8. *
  9. * Based on sdhci-cns3xxx.c
  10. */
  11. #include <linux/io.h>
  12. #include <linux/of.h>
  13. #include <linux/module.h>
  14. #include <linux/err.h>
  15. #include <linux/mmc/host.h>
  16. #include <linux/reset.h>
  17. #include "sdhci-pltfm.h"
  18. struct st_mmc_platform_data {
  19. struct reset_control *rstc;
  20. struct clk *icnclk;
  21. void __iomem *top_ioaddr;
  22. };
  23. /* MMCSS glue logic to setup the HC on some ST SoCs (e.g. STiH407 family) */
  24. #define ST_MMC_CCONFIG_REG_1 0x400
  25. #define ST_MMC_CCONFIG_TIMEOUT_CLK_UNIT BIT(24)
  26. #define ST_MMC_CCONFIG_TIMEOUT_CLK_FREQ BIT(12)
  27. #define ST_MMC_CCONFIG_TUNING_COUNT_DEFAULT BIT(8)
  28. #define ST_MMC_CCONFIG_ASYNC_WAKEUP BIT(0)
  29. #define ST_MMC_CCONFIG_1_DEFAULT \
  30. ((ST_MMC_CCONFIG_TIMEOUT_CLK_UNIT) | \
  31. (ST_MMC_CCONFIG_TIMEOUT_CLK_FREQ) | \
  32. (ST_MMC_CCONFIG_TUNING_COUNT_DEFAULT))
  33. #define ST_MMC_CCONFIG_REG_2 0x404
  34. #define ST_MMC_CCONFIG_HIGH_SPEED BIT(28)
  35. #define ST_MMC_CCONFIG_ADMA2 BIT(24)
  36. #define ST_MMC_CCONFIG_8BIT BIT(20)
  37. #define ST_MMC_CCONFIG_MAX_BLK_LEN 16
  38. #define MAX_BLK_LEN_1024 1
  39. #define MAX_BLK_LEN_2048 2
  40. #define BASE_CLK_FREQ_200 0xc8
  41. #define BASE_CLK_FREQ_100 0x64
  42. #define BASE_CLK_FREQ_50 0x32
  43. #define ST_MMC_CCONFIG_2_DEFAULT \
  44. (ST_MMC_CCONFIG_HIGH_SPEED | ST_MMC_CCONFIG_ADMA2 | \
  45. ST_MMC_CCONFIG_8BIT | \
  46. (MAX_BLK_LEN_1024 << ST_MMC_CCONFIG_MAX_BLK_LEN))
  47. #define ST_MMC_CCONFIG_REG_3 0x408
  48. #define ST_MMC_CCONFIG_EMMC_SLOT_TYPE BIT(28)
  49. #define ST_MMC_CCONFIG_64BIT BIT(24)
  50. #define ST_MMC_CCONFIG_ASYNCH_INTR_SUPPORT BIT(20)
  51. #define ST_MMC_CCONFIG_1P8_VOLT BIT(16)
  52. #define ST_MMC_CCONFIG_3P0_VOLT BIT(12)
  53. #define ST_MMC_CCONFIG_3P3_VOLT BIT(8)
  54. #define ST_MMC_CCONFIG_SUSP_RES_SUPPORT BIT(4)
  55. #define ST_MMC_CCONFIG_SDMA BIT(0)
  56. #define ST_MMC_CCONFIG_3_DEFAULT \
  57. (ST_MMC_CCONFIG_ASYNCH_INTR_SUPPORT | \
  58. ST_MMC_CCONFIG_3P3_VOLT | \
  59. ST_MMC_CCONFIG_SUSP_RES_SUPPORT | \
  60. ST_MMC_CCONFIG_SDMA)
  61. #define ST_MMC_CCONFIG_REG_4 0x40c
  62. #define ST_MMC_CCONFIG_D_DRIVER BIT(20)
  63. #define ST_MMC_CCONFIG_C_DRIVER BIT(16)
  64. #define ST_MMC_CCONFIG_A_DRIVER BIT(12)
  65. #define ST_MMC_CCONFIG_DDR50 BIT(8)
  66. #define ST_MMC_CCONFIG_SDR104 BIT(4)
  67. #define ST_MMC_CCONFIG_SDR50 BIT(0)
  68. #define ST_MMC_CCONFIG_4_DEFAULT 0
  69. #define ST_MMC_CCONFIG_REG_5 0x410
  70. #define ST_MMC_CCONFIG_TUNING_FOR_SDR50 BIT(8)
  71. #define RETUNING_TIMER_CNT_MAX 0xf
  72. #define ST_MMC_CCONFIG_5_DEFAULT 0
  73. /* I/O configuration for Arasan IP */
  74. #define ST_MMC_GP_OUTPUT 0x450
  75. #define ST_MMC_GP_OUTPUT_CD BIT(12)
  76. #define ST_MMC_STATUS_R 0x460
  77. #define ST_TOP_MMC_DLY_FIX_OFF(x) (x - 0x8)
  78. /* TOP config registers to manage static and dynamic delay */
  79. #define ST_TOP_MMC_TX_CLK_DLY ST_TOP_MMC_DLY_FIX_OFF(0x8)
  80. #define ST_TOP_MMC_RX_CLK_DLY ST_TOP_MMC_DLY_FIX_OFF(0xc)
  81. /* MMC delay control register */
  82. #define ST_TOP_MMC_DLY_CTRL ST_TOP_MMC_DLY_FIX_OFF(0x18)
  83. #define ST_TOP_MMC_DLY_CTRL_DLL_BYPASS_CMD BIT(0)
  84. #define ST_TOP_MMC_DLY_CTRL_DLL_BYPASS_PH_SEL BIT(1)
  85. #define ST_TOP_MMC_DLY_CTRL_TX_DLL_ENABLE BIT(8)
  86. #define ST_TOP_MMC_DLY_CTRL_RX_DLL_ENABLE BIT(9)
  87. #define ST_TOP_MMC_DLY_CTRL_ATUNE_NOT_CFG_DLY BIT(10)
  88. #define ST_TOP_MMC_START_DLL_LOCK BIT(11)
  89. /* register to provide the phase-shift value for DLL */
  90. #define ST_TOP_MMC_TX_DLL_STEP_DLY ST_TOP_MMC_DLY_FIX_OFF(0x1c)
  91. #define ST_TOP_MMC_RX_DLL_STEP_DLY ST_TOP_MMC_DLY_FIX_OFF(0x20)
  92. #define ST_TOP_MMC_RX_CMD_STEP_DLY ST_TOP_MMC_DLY_FIX_OFF(0x24)
  93. /* phase shift delay on the tx clk 2.188ns */
  94. #define ST_TOP_MMC_TX_DLL_STEP_DLY_VALID 0x6
  95. #define ST_TOP_MMC_DLY_MAX 0xf
  96. #define ST_TOP_MMC_DYN_DLY_CONF \
  97. (ST_TOP_MMC_DLY_CTRL_TX_DLL_ENABLE | \
  98. ST_TOP_MMC_DLY_CTRL_ATUNE_NOT_CFG_DLY | \
  99. ST_TOP_MMC_START_DLL_LOCK)
  100. /*
  101. * For clock speeds greater than 90MHz, we need to check that the
  102. * DLL procedure has finished before switching to ultra-speed modes.
  103. */
  104. #define CLK_TO_CHECK_DLL_LOCK 90000000
  105. static inline void st_mmcss_set_static_delay(void __iomem *ioaddr)
  106. {
  107. if (!ioaddr)
  108. return;
  109. writel_relaxed(0x0, ioaddr + ST_TOP_MMC_DLY_CTRL);
  110. writel_relaxed(ST_TOP_MMC_DLY_MAX,
  111. ioaddr + ST_TOP_MMC_TX_CLK_DLY);
  112. }
  113. /**
  114. * st_mmcss_cconfig: configure the Arasan HC inside the flashSS.
  115. * @np: dt device node.
  116. * @host: sdhci host
  117. * Description: this function is to configure the Arasan host controller.
  118. * On some ST SoCs, i.e. STiH407 family, the MMC devices inside a dedicated
  119. * flashSS sub-system which needs to be configured to be compliant to eMMC 4.5
  120. * or eMMC4.3. This has to be done before registering the sdhci host.
  121. */
  122. static void st_mmcss_cconfig(struct device_node *np, struct sdhci_host *host)
  123. {
  124. struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  125. struct mmc_host *mhost = host->mmc;
  126. u32 cconf2, cconf3, cconf4, cconf5;
  127. if (!of_device_is_compatible(np, "st,sdhci-stih407"))
  128. return;
  129. cconf2 = ST_MMC_CCONFIG_2_DEFAULT;
  130. cconf3 = ST_MMC_CCONFIG_3_DEFAULT;
  131. cconf4 = ST_MMC_CCONFIG_4_DEFAULT;
  132. cconf5 = ST_MMC_CCONFIG_5_DEFAULT;
  133. writel_relaxed(ST_MMC_CCONFIG_1_DEFAULT,
  134. host->ioaddr + ST_MMC_CCONFIG_REG_1);
  135. /* Set clock frequency, default to 50MHz if max-frequency is not
  136. * provided */
  137. switch (mhost->f_max) {
  138. case 200000000:
  139. clk_set_rate(pltfm_host->clk, mhost->f_max);
  140. cconf2 |= BASE_CLK_FREQ_200;
  141. break;
  142. case 100000000:
  143. clk_set_rate(pltfm_host->clk, mhost->f_max);
  144. cconf2 |= BASE_CLK_FREQ_100;
  145. break;
  146. default:
  147. clk_set_rate(pltfm_host->clk, 50000000);
  148. cconf2 |= BASE_CLK_FREQ_50;
  149. }
  150. writel_relaxed(cconf2, host->ioaddr + ST_MMC_CCONFIG_REG_2);
  151. if (!mmc_card_is_removable(mhost))
  152. cconf3 |= ST_MMC_CCONFIG_EMMC_SLOT_TYPE;
  153. else
  154. /* CARD _D ET_CTRL */
  155. writel_relaxed(ST_MMC_GP_OUTPUT_CD,
  156. host->ioaddr + ST_MMC_GP_OUTPUT);
  157. if (mhost->caps & MMC_CAP_UHS_SDR50) {
  158. /* use 1.8V */
  159. cconf3 |= ST_MMC_CCONFIG_1P8_VOLT;
  160. cconf4 |= ST_MMC_CCONFIG_SDR50;
  161. /* Use tuning */
  162. cconf5 |= ST_MMC_CCONFIG_TUNING_FOR_SDR50;
  163. /* Max timeout for retuning */
  164. cconf5 |= RETUNING_TIMER_CNT_MAX;
  165. }
  166. if (mhost->caps & MMC_CAP_UHS_SDR104) {
  167. /*
  168. * SDR104 implies the HC can support HS200 mode, so
  169. * it's mandatory to use 1.8V
  170. */
  171. cconf3 |= ST_MMC_CCONFIG_1P8_VOLT;
  172. cconf4 |= ST_MMC_CCONFIG_SDR104;
  173. /* Max timeout for retuning */
  174. cconf5 |= RETUNING_TIMER_CNT_MAX;
  175. }
  176. if (mhost->caps & MMC_CAP_UHS_DDR50)
  177. cconf4 |= ST_MMC_CCONFIG_DDR50;
  178. writel_relaxed(cconf3, host->ioaddr + ST_MMC_CCONFIG_REG_3);
  179. writel_relaxed(cconf4, host->ioaddr + ST_MMC_CCONFIG_REG_4);
  180. writel_relaxed(cconf5, host->ioaddr + ST_MMC_CCONFIG_REG_5);
  181. }
  182. static inline void st_mmcss_set_dll(void __iomem *ioaddr)
  183. {
  184. if (!ioaddr)
  185. return;
  186. writel_relaxed(ST_TOP_MMC_DYN_DLY_CONF, ioaddr + ST_TOP_MMC_DLY_CTRL);
  187. writel_relaxed(ST_TOP_MMC_TX_DLL_STEP_DLY_VALID,
  188. ioaddr + ST_TOP_MMC_TX_DLL_STEP_DLY);
  189. }
  190. static int st_mmcss_lock_dll(void __iomem *ioaddr)
  191. {
  192. unsigned long curr, value;
  193. unsigned long finish = jiffies + HZ;
  194. /* Checks if the DLL procedure is finished */
  195. do {
  196. curr = jiffies;
  197. value = readl(ioaddr + ST_MMC_STATUS_R);
  198. if (value & 0x1)
  199. return 0;
  200. cpu_relax();
  201. } while (!time_after_eq(curr, finish));
  202. return -EBUSY;
  203. }
  204. static int sdhci_st_set_dll_for_clock(struct sdhci_host *host)
  205. {
  206. int ret = 0;
  207. struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  208. struct st_mmc_platform_data *pdata = sdhci_pltfm_priv(pltfm_host);
  209. if (host->clock > CLK_TO_CHECK_DLL_LOCK) {
  210. st_mmcss_set_dll(pdata->top_ioaddr);
  211. ret = st_mmcss_lock_dll(host->ioaddr);
  212. }
  213. return ret;
  214. }
  215. static void sdhci_st_set_uhs_signaling(struct sdhci_host *host,
  216. unsigned int uhs)
  217. {
  218. struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  219. struct st_mmc_platform_data *pdata = sdhci_pltfm_priv(pltfm_host);
  220. u16 ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
  221. int ret = 0;
  222. /* Select Bus Speed Mode for host */
  223. ctrl_2 &= ~SDHCI_CTRL_UHS_MASK;
  224. switch (uhs) {
  225. /*
  226. * Set V18_EN -- UHS modes do not work without this.
  227. * does not change signaling voltage
  228. */
  229. case MMC_TIMING_UHS_SDR12:
  230. st_mmcss_set_static_delay(pdata->top_ioaddr);
  231. ctrl_2 |= SDHCI_CTRL_UHS_SDR12 | SDHCI_CTRL_VDD_180;
  232. break;
  233. case MMC_TIMING_UHS_SDR25:
  234. st_mmcss_set_static_delay(pdata->top_ioaddr);
  235. ctrl_2 |= SDHCI_CTRL_UHS_SDR25 | SDHCI_CTRL_VDD_180;
  236. break;
  237. case MMC_TIMING_UHS_SDR50:
  238. st_mmcss_set_static_delay(pdata->top_ioaddr);
  239. ctrl_2 |= SDHCI_CTRL_UHS_SDR50 | SDHCI_CTRL_VDD_180;
  240. ret = sdhci_st_set_dll_for_clock(host);
  241. break;
  242. case MMC_TIMING_UHS_SDR104:
  243. case MMC_TIMING_MMC_HS200:
  244. st_mmcss_set_static_delay(pdata->top_ioaddr);
  245. ctrl_2 |= SDHCI_CTRL_UHS_SDR104 | SDHCI_CTRL_VDD_180;
  246. ret = sdhci_st_set_dll_for_clock(host);
  247. break;
  248. case MMC_TIMING_UHS_DDR50:
  249. case MMC_TIMING_MMC_DDR52:
  250. st_mmcss_set_static_delay(pdata->top_ioaddr);
  251. ctrl_2 |= SDHCI_CTRL_UHS_DDR50 | SDHCI_CTRL_VDD_180;
  252. break;
  253. }
  254. if (ret)
  255. dev_warn(mmc_dev(host->mmc), "Error setting dll for clock "
  256. "(uhs %d)\n", uhs);
  257. dev_dbg(mmc_dev(host->mmc), "uhs %d, ctrl_2 %04X\n", uhs, ctrl_2);
  258. sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
  259. }
  260. static u32 sdhci_st_readl(struct sdhci_host *host, int reg)
  261. {
  262. u32 ret;
  263. switch (reg) {
  264. case SDHCI_CAPABILITIES:
  265. ret = readl_relaxed(host->ioaddr + reg);
  266. /* Support 3.3V and 1.8V */
  267. ret &= ~SDHCI_CAN_VDD_300;
  268. break;
  269. default:
  270. ret = readl_relaxed(host->ioaddr + reg);
  271. }
  272. return ret;
  273. }
  274. static const struct sdhci_ops sdhci_st_ops = {
  275. .get_max_clock = sdhci_pltfm_clk_get_max_clock,
  276. .set_clock = sdhci_set_clock,
  277. .set_bus_width = sdhci_set_bus_width,
  278. .read_l = sdhci_st_readl,
  279. .reset = sdhci_reset,
  280. .set_uhs_signaling = sdhci_st_set_uhs_signaling,
  281. };
  282. static const struct sdhci_pltfm_data sdhci_st_pdata = {
  283. .ops = &sdhci_st_ops,
  284. .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
  285. SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
  286. SDHCI_QUIRK_NO_HISPD_BIT,
  287. .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
  288. SDHCI_QUIRK2_STOP_WITH_TC,
  289. };
  290. static int sdhci_st_probe(struct platform_device *pdev)
  291. {
  292. struct device_node *np = pdev->dev.of_node;
  293. struct sdhci_host *host;
  294. struct st_mmc_platform_data *pdata;
  295. struct sdhci_pltfm_host *pltfm_host;
  296. struct clk *clk, *icnclk;
  297. int ret = 0;
  298. u16 host_version;
  299. struct resource *res;
  300. struct reset_control *rstc;
  301. clk = devm_clk_get(&pdev->dev, "mmc");
  302. if (IS_ERR(clk)) {
  303. dev_err(&pdev->dev, "Peripheral clk not found\n");
  304. return PTR_ERR(clk);
  305. }
  306. /* ICN clock isn't compulsory, but use it if it's provided. */
  307. icnclk = devm_clk_get(&pdev->dev, "icn");
  308. if (IS_ERR(icnclk))
  309. icnclk = NULL;
  310. rstc = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
  311. if (IS_ERR(rstc))
  312. return PTR_ERR(rstc);
  313. reset_control_deassert(rstc);
  314. host = sdhci_pltfm_init(pdev, &sdhci_st_pdata, sizeof(*pdata));
  315. if (IS_ERR(host)) {
  316. dev_err(&pdev->dev, "Failed sdhci_pltfm_init\n");
  317. ret = PTR_ERR(host);
  318. goto err_pltfm_init;
  319. }
  320. pltfm_host = sdhci_priv(host);
  321. pdata = sdhci_pltfm_priv(pltfm_host);
  322. pdata->rstc = rstc;
  323. ret = mmc_of_parse(host->mmc);
  324. if (ret) {
  325. dev_err(&pdev->dev, "Failed mmc_of_parse\n");
  326. goto err_of;
  327. }
  328. ret = clk_prepare_enable(clk);
  329. if (ret) {
  330. dev_err(&pdev->dev, "Failed to prepare clock\n");
  331. goto err_of;
  332. }
  333. ret = clk_prepare_enable(icnclk);
  334. if (ret) {
  335. dev_err(&pdev->dev, "Failed to prepare icn clock\n");
  336. goto err_icnclk;
  337. }
  338. /* Configure the FlashSS Top registers for setting eMMC TX/RX delay */
  339. res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
  340. "top-mmc-delay");
  341. pdata->top_ioaddr = devm_ioremap_resource(&pdev->dev, res);
  342. if (IS_ERR(pdata->top_ioaddr))
  343. pdata->top_ioaddr = NULL;
  344. pltfm_host->clk = clk;
  345. pdata->icnclk = icnclk;
  346. /* Configure the Arasan HC inside the flashSS */
  347. st_mmcss_cconfig(np, host);
  348. ret = sdhci_add_host(host);
  349. if (ret)
  350. goto err_out;
  351. host_version = readw_relaxed((host->ioaddr + SDHCI_HOST_VERSION));
  352. dev_info(&pdev->dev, "SDHCI ST Initialised: Host Version: 0x%x Vendor Version 0x%x\n",
  353. ((host_version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT),
  354. ((host_version & SDHCI_VENDOR_VER_MASK) >>
  355. SDHCI_VENDOR_VER_SHIFT));
  356. return 0;
  357. err_out:
  358. clk_disable_unprepare(icnclk);
  359. err_icnclk:
  360. clk_disable_unprepare(clk);
  361. err_of:
  362. sdhci_pltfm_free(pdev);
  363. err_pltfm_init:
  364. reset_control_assert(rstc);
  365. return ret;
  366. }
  367. static int sdhci_st_remove(struct platform_device *pdev)
  368. {
  369. struct sdhci_host *host = platform_get_drvdata(pdev);
  370. struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  371. struct st_mmc_platform_data *pdata = sdhci_pltfm_priv(pltfm_host);
  372. struct reset_control *rstc = pdata->rstc;
  373. sdhci_pltfm_unregister(pdev);
  374. clk_disable_unprepare(pdata->icnclk);
  375. reset_control_assert(rstc);
  376. return 0;
  377. }
  378. #ifdef CONFIG_PM_SLEEP
  379. static int sdhci_st_suspend(struct device *dev)
  380. {
  381. struct sdhci_host *host = dev_get_drvdata(dev);
  382. struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  383. struct st_mmc_platform_data *pdata = sdhci_pltfm_priv(pltfm_host);
  384. int ret;
  385. if (host->tuning_mode != SDHCI_TUNING_MODE_3)
  386. mmc_retune_needed(host->mmc);
  387. ret = sdhci_suspend_host(host);
  388. if (ret)
  389. goto out;
  390. reset_control_assert(pdata->rstc);
  391. clk_disable_unprepare(pdata->icnclk);
  392. clk_disable_unprepare(pltfm_host->clk);
  393. out:
  394. return ret;
  395. }
  396. static int sdhci_st_resume(struct device *dev)
  397. {
  398. struct sdhci_host *host = dev_get_drvdata(dev);
  399. struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  400. struct st_mmc_platform_data *pdata = sdhci_pltfm_priv(pltfm_host);
  401. struct device_node *np = dev->of_node;
  402. int ret;
  403. ret = clk_prepare_enable(pltfm_host->clk);
  404. if (ret)
  405. return ret;
  406. ret = clk_prepare_enable(pdata->icnclk);
  407. if (ret) {
  408. clk_disable_unprepare(pltfm_host->clk);
  409. return ret;
  410. }
  411. reset_control_deassert(pdata->rstc);
  412. st_mmcss_cconfig(np, host);
  413. return sdhci_resume_host(host);
  414. }
  415. #endif
  416. static SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume);
  417. static const struct of_device_id st_sdhci_match[] = {
  418. { .compatible = "st,sdhci" },
  419. {},
  420. };
  421. MODULE_DEVICE_TABLE(of, st_sdhci_match);
  422. static struct platform_driver sdhci_st_driver = {
  423. .probe = sdhci_st_probe,
  424. .remove = sdhci_st_remove,
  425. .driver = {
  426. .name = "sdhci-st",
  427. .probe_type = PROBE_PREFER_ASYNCHRONOUS,
  428. .pm = &sdhci_st_pmops,
  429. .of_match_table = st_sdhci_match,
  430. },
  431. };
  432. module_platform_driver(sdhci_st_driver);
  433. MODULE_DESCRIPTION("SDHCI driver for STMicroelectronics SoCs");
  434. MODULE_AUTHOR("Giuseppe Cavallaro <[email protected]>");
  435. MODULE_LICENSE("GPL v2");
  436. MODULE_ALIAS("platform:sdhci-st");