sdhci-st.c 14 KB

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