rmk-wifi.patch 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. diff -Nur linux-3.16.orig/arch/arm/boot/dts/imx6qdl-microsom.dtsi linux-3.16/arch/arm/boot/dts/imx6qdl-microsom.dtsi
  2. --- linux-3.16.orig/arch/arm/boot/dts/imx6qdl-microsom.dtsi 2014-08-04 00:25:02.000000000 +0200
  3. +++ linux-3.16/arch/arm/boot/dts/imx6qdl-microsom.dtsi 2014-08-11 12:34:43.603892919 +0200
  4. @@ -2,14 +2,92 @@
  5. * Copyright (C) 2013,2014 Russell King
  6. */
  7. +#include <dt-bindings/gpio/gpio.h>
  8. +/ {
  9. + regulators {
  10. + compatible = "simple-bus";
  11. +
  12. + reg_brcm_osc: brcm-osc-reg {
  13. + compatible = "regulator-fixed";
  14. + enable-active-high;
  15. + gpio = <&gpio5 5 0>;
  16. + pinctrl-names = "default";
  17. + pinctrl-0 = <&pinctrl_microsom_brcm_osc_reg>;
  18. + regulator-name = "brcm_osc_reg";
  19. + regulator-min-microvolt = <3300000>;
  20. + regulator-max-microvolt = <3300000>;
  21. + regulator-always-on;
  22. + regulator-boot-on;
  23. + };
  24. +
  25. + reg_brcm: brcm-reg {
  26. + compatible = "regulator-fixed";
  27. + enable-active-high;
  28. + gpio = <&gpio3 19 0>;
  29. + pinctrl-names = "default";
  30. + pinctrl-0 = <&pinctrl_microsom_brcm_reg>;
  31. + regulator-name = "brcm_reg";
  32. + regulator-min-microvolt = <3300000>;
  33. + regulator-max-microvolt = <3300000>;
  34. + startup-delay-us = <200000>;
  35. + };
  36. + };
  37. +};
  38. +
  39. &iomuxc {
  40. microsom {
  41. + pinctrl_microsom_brcm_bt: microsom-brcm-bt {
  42. + fsl,pins = <
  43. + MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00 0x40013070
  44. + MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01 0x40013070
  45. + MX6QDL_PAD_CSI0_DAT18__GPIO6_IO04 0x40013070
  46. + >;
  47. + };
  48. +
  49. + pinctrl_microsom_brcm_osc_reg: microsom-brcm-osc-reg {
  50. + fsl,pins = <
  51. + MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05 0x40013070
  52. + >;
  53. + };
  54. +
  55. + pinctrl_microsom_brcm_reg: microsom-brcm-reg {
  56. + fsl,pins = <
  57. + MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x40013070
  58. + >;
  59. + };
  60. +
  61. + pinctrl_microsom_brcm_wifi: microsom-brcm-wifi {
  62. + fsl,pins = <
  63. + MX6QDL_PAD_GPIO_8__XTALOSC_REF_CLK_32K 0x1b0b0
  64. + MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x40013070
  65. + MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26 0x40013070
  66. + MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27 0x40013070
  67. + >;
  68. + };
  69. pinctrl_microsom_uart1: microsom-uart1 {
  70. fsl,pins = <
  71. MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
  72. MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
  73. >;
  74. };
  75. + pinctrl_microsom_uart4_1: microsom-uart4 {
  76. + fsl,pins = <
  77. + MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b1
  78. + MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA 0x1b0b1
  79. + MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B 0x1b0b1
  80. + MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B 0x1b0b1
  81. + >;
  82. + };
  83. + pinctrl_microsom_usdhc1: microsom-usdhc1 {
  84. + fsl,pins = <
  85. + MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17059
  86. + MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10059
  87. + MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059
  88. + MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059
  89. + MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059
  90. + MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059
  91. + >;
  92. + };
  93. };
  94. };
  95. @@ -18,3 +96,23 @@
  96. pinctrl-0 = <&pinctrl_microsom_uart1>;
  97. status = "okay";
  98. };
  99. +
  100. +/* UART4 - Connected to optional BRCM Wifi/BT/FM */
  101. +&uart4 {
  102. + pinctrl-names = "default";
  103. + pinctrl-0 = <&pinctrl_microsom_brcm_bt &pinctrl_microsom_uart4_1>;
  104. + fsl,uart-has-rtscts;
  105. + status = "okay";
  106. +};
  107. +
  108. +/* USDHC1 - Connected to optional BRCM Wifi/BT/FM */
  109. +&usdhc1 {
  110. + card-external-vcc-supply = <&reg_brcm>;
  111. + card-reset-gpios = <&gpio5 26 GPIO_ACTIVE_LOW>, <&gpio6 0 GPIO_ACTIVE_LOW>;
  112. + keep-power-in-suspend;
  113. + non-removable;
  114. + pinctrl-names = "default";
  115. + pinctrl-0 = <&pinctrl_microsom_brcm_wifi &pinctrl_microsom_usdhc1>;
  116. + vmmc-supply = <&reg_brcm>;
  117. + status = "okay";
  118. +};
  119. diff -Nur linux-3.16.orig/Documentation/devicetree/bindings/mmc/mmc.txt linux-3.16/Documentation/devicetree/bindings/mmc/mmc.txt
  120. --- linux-3.16.orig/Documentation/devicetree/bindings/mmc/mmc.txt 2014-08-04 00:25:02.000000000 +0200
  121. +++ linux-3.16/Documentation/devicetree/bindings/mmc/mmc.txt 2014-08-11 12:34:15.535644516 +0200
  122. @@ -5,6 +5,8 @@
  123. Interpreted by the OF core:
  124. - reg: Registers location and length.
  125. - interrupts: Interrupts used by the MMC controller.
  126. +- clocks: Clocks needed for the host controller, if any.
  127. +- clock-names: Goes with clocks above.
  128. Card detection:
  129. If no property below is supplied, host native card detect is used.
  130. @@ -41,6 +43,15 @@
  131. - mmc-hs400-1_8v: eMMC HS400 mode(1.8V I/O) is supported
  132. - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
  133. +Card power and reset control:
  134. +The following properties can be specified for cases where the MMC
  135. +peripheral needs additional reset, regulator and clock lines. It is for
  136. +example common for WiFi/BT adapters to have these separate from the main
  137. +MMC bus:
  138. + - card-reset-gpios: Specify GPIOs for card reset (reset active low)
  139. + - card-external-vcc-supply: Regulator to drive (independent) card VCC
  140. + - clock with name "card_ext_clock": External clock provided to the card
  141. +
  142. *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
  143. polarity properties, we have to fix the meaning of the "normal" and "inverted"
  144. line levels. We choose to follow the SDHCI standard, which specifies both those
  145. diff -Nur linux-3.16.orig/drivers/mmc/core/core.c linux-3.16/drivers/mmc/core/core.c
  146. --- linux-3.16.orig/drivers/mmc/core/core.c 2014-08-04 00:25:02.000000000 +0200
  147. +++ linux-3.16/drivers/mmc/core/core.c 2014-08-11 12:34:15.555644693 +0200
  148. @@ -13,11 +13,13 @@
  149. #include <linux/module.h>
  150. #include <linux/init.h>
  151. #include <linux/interrupt.h>
  152. +#include <linux/clk.h>
  153. #include <linux/completion.h>
  154. #include <linux/device.h>
  155. #include <linux/delay.h>
  156. #include <linux/pagemap.h>
  157. #include <linux/err.h>
  158. +#include <linux/gpio/consumer.h>
  159. #include <linux/leds.h>
  160. #include <linux/scatterlist.h>
  161. #include <linux/log2.h>
  162. @@ -1515,6 +1517,43 @@
  163. mmc_host_clk_release(host);
  164. }
  165. +static void mmc_card_power_up(struct mmc_host *host)
  166. +{
  167. + int i;
  168. + struct gpio_desc **gds = host->card_reset_gpios;
  169. +
  170. + for (i = 0; i < ARRAY_SIZE(host->card_reset_gpios); i++) {
  171. + if (gds[i]) {
  172. + dev_dbg(host->parent, "Asserting reset line %d", i);
  173. + gpiod_set_value(gds[i], 1);
  174. + }
  175. + }
  176. +
  177. + if (host->card_regulator) {
  178. + dev_dbg(host->parent, "Enabling external regulator");
  179. + if (regulator_enable(host->card_regulator))
  180. + dev_err(host->parent, "Failed to enable external regulator");
  181. + }
  182. +
  183. + if (host->card_clk) {
  184. + dev_dbg(host->parent, "Enabling external clock");
  185. + clk_prepare_enable(host->card_clk);
  186. + }
  187. +
  188. + /* 2ms delay to let clocks and power settle */
  189. + mmc_delay(20);
  190. +
  191. + for (i = 0; i < ARRAY_SIZE(host->card_reset_gpios); i++) {
  192. + if (gds[i]) {
  193. + dev_dbg(host->parent, "Deasserting reset line %d", i);
  194. + gpiod_set_value(gds[i], 0);
  195. + }
  196. + }
  197. +
  198. + /* 2ms delay to after reset release */
  199. + mmc_delay(20);
  200. +}
  201. +
  202. /*
  203. * Apply power to the MMC stack. This is a two-stage process.
  204. * First, we enable power to the card without the clock running.
  205. @@ -1531,6 +1570,9 @@
  206. if (host->ios.power_mode == MMC_POWER_ON)
  207. return;
  208. + /* Power up the card/module first, if needed */
  209. + mmc_card_power_up(host);
  210. +
  211. mmc_host_clk_hold(host);
  212. host->ios.vdd = fls(ocr) - 1;
  213. diff -Nur linux-3.16.orig/drivers/mmc/core/host.c linux-3.16/drivers/mmc/core/host.c
  214. --- linux-3.16.orig/drivers/mmc/core/host.c 2014-08-04 00:25:02.000000000 +0200
  215. +++ linux-3.16/drivers/mmc/core/host.c 2014-08-11 12:34:27.995754826 +0200
  216. @@ -12,14 +12,18 @@
  217. * MMC host class device management
  218. */
  219. +#include <linux/kernel.h>
  220. +#include <linux/clk.h>
  221. #include <linux/device.h>
  222. #include <linux/err.h>
  223. +#include <linux/gpio/consumer.h>
  224. #include <linux/idr.h>
  225. #include <linux/of.h>
  226. #include <linux/of_gpio.h>
  227. #include <linux/pagemap.h>
  228. #include <linux/export.h>
  229. #include <linux/leds.h>
  230. +#include <linux/regulator/consumer.h>
  231. #include <linux/slab.h>
  232. #include <linux/suspend.h>
  233. @@ -461,6 +465,66 @@
  234. EXPORT_SYMBOL(mmc_of_parse);
  235. +static int mmc_of_parse_child(struct mmc_host *host)
  236. +{
  237. + struct device_node *np;
  238. + struct clk *clk;
  239. + int i;
  240. +
  241. + if (!host->parent || !host->parent->of_node)
  242. + return 0;
  243. +
  244. + np = host->parent->of_node;
  245. +
  246. + host->card_regulator = regulator_get(host->parent, "card-external-vcc");
  247. + if (IS_ERR(host->card_regulator)) {
  248. + if (PTR_ERR(host->card_regulator) == -EPROBE_DEFER)
  249. + return PTR_ERR(host->card_regulator);
  250. + host->card_regulator = NULL;
  251. + }
  252. +
  253. + /* Parse card power/reset/clock control */
  254. + if (of_find_property(np, "card-reset-gpios", NULL)) {
  255. + struct gpio_desc *gpd;
  256. + int level = 0;
  257. +
  258. + /*
  259. + * If the regulator is enabled, then we can hold the
  260. + * card in reset with an active high resets. Otherwise,
  261. + * hold the resets low.
  262. + */
  263. + if (host->card_regulator && regulator_is_enabled(host->card_regulator))
  264. + level = 1;
  265. +
  266. + for (i = 0; i < ARRAY_SIZE(host->card_reset_gpios); i++) {
  267. + gpd = devm_gpiod_get_index(host->parent, "card-reset", i);
  268. + if (IS_ERR(gpd)) {
  269. + if (PTR_ERR(gpd) == -EPROBE_DEFER)
  270. + return PTR_ERR(gpd);
  271. + break;
  272. + }
  273. + gpiod_direction_output(gpd, gpiod_is_active_low(gpd) | level);
  274. + host->card_reset_gpios[i] = gpd;
  275. + }
  276. +
  277. + gpd = devm_gpiod_get_index(host->parent, "card-reset", ARRAY_SIZE(host->card_reset_gpios));
  278. + if (!IS_ERR(gpd)) {
  279. + dev_warn(host->parent, "More reset gpios than we can handle");
  280. + gpiod_put(gpd);
  281. + }
  282. + }
  283. +
  284. + clk = of_clk_get_by_name(np, "card_ext_clock");
  285. + if (IS_ERR(clk)) {
  286. + if (PTR_ERR(clk) == -EPROBE_DEFER)
  287. + return PTR_ERR(clk);
  288. + clk = NULL;
  289. + }
  290. + host->card_clk = clk;
  291. +
  292. + return 0;
  293. +}
  294. +
  295. /**
  296. * mmc_alloc_host - initialise the per-host structure.
  297. * @extra: sizeof private data structure
  298. @@ -540,6 +604,10 @@
  299. {
  300. int err;
  301. + err = mmc_of_parse_child(host);
  302. + if (err)
  303. + return err;
  304. +
  305. WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
  306. !host->ops->enable_sdio_irq);
  307. diff -Nur linux-3.16.orig/drivers/mmc/host/dw_mmc.c linux-3.16/drivers/mmc/host/dw_mmc.c
  308. --- linux-3.16.orig/drivers/mmc/host/dw_mmc.c 2014-08-04 00:25:02.000000000 +0200
  309. +++ linux-3.16/drivers/mmc/host/dw_mmc.c 2014-08-11 12:34:22.043702140 +0200
  310. @@ -2049,6 +2049,8 @@
  311. if (!mmc)
  312. return -ENOMEM;
  313. + mmc_of_parse(mmc);
  314. +
  315. slot = mmc_priv(mmc);
  316. slot->id = id;
  317. slot->mmc = mmc;
  318. diff -Nur linux-3.16.orig/drivers/mmc/host/Kconfig linux-3.16/drivers/mmc/host/Kconfig
  319. --- linux-3.16.orig/drivers/mmc/host/Kconfig 2014-08-04 00:25:02.000000000 +0200
  320. +++ linux-3.16/drivers/mmc/host/Kconfig 2014-08-11 12:34:03.391536946 +0200
  321. @@ -25,8 +25,7 @@
  322. If unsure, say N.
  323. config MMC_SDHCI
  324. - tristate "Secure Digital Host Controller Interface support"
  325. - depends on HAS_DMA
  326. + tristate
  327. help
  328. This selects the generic Secure Digital Host Controller Interface.
  329. It is used by manufacturers such as Texas Instruments(R), Ricoh(R)
  330. @@ -59,7 +58,8 @@
  331. config MMC_SDHCI_PCI
  332. tristate "SDHCI support on PCI bus"
  333. - depends on MMC_SDHCI && PCI
  334. + depends on PCI && HAS_DMA
  335. + select MMC_SDHCI
  336. help
  337. This selects the PCI Secure Digital Host Controller Interface.
  338. Most controllers found today are PCI devices.
  339. @@ -83,7 +83,8 @@
  340. config MMC_SDHCI_ACPI
  341. tristate "SDHCI support for ACPI enumerated SDHCI controllers"
  342. - depends on MMC_SDHCI && ACPI
  343. + depends on ACPI && HAS_DMA
  344. + select MMC_SDHCI
  345. help
  346. This selects support for ACPI enumerated SDHCI controllers,
  347. identified by ACPI Compatibility ID PNP0D40 or specific
  348. @@ -94,8 +95,8 @@
  349. If unsure, say N.
  350. config MMC_SDHCI_PLTFM
  351. - tristate "SDHCI platform and OF driver helper"
  352. - depends on MMC_SDHCI
  353. + tristate
  354. + select MMC_SDHCI
  355. help
  356. This selects the common helper functions support for Secure Digital
  357. Host Controller Interface based platform and OF drivers.
  358. @@ -106,8 +107,8 @@
  359. config MMC_SDHCI_OF_ARASAN
  360. tristate "SDHCI OF support for the Arasan SDHCI controllers"
  361. - depends on MMC_SDHCI_PLTFM
  362. - depends on OF
  363. + depends on OF && HAS_DMA
  364. + select MMC_SDHCI_PLTFM
  365. help
  366. This selects the Arasan Secure Digital Host Controller Interface
  367. (SDHCI). This hardware is found e.g. in Xilinx' Zynq SoC.
  368. @@ -118,9 +119,9 @@
  369. config MMC_SDHCI_OF_ESDHC
  370. tristate "SDHCI OF support for the Freescale eSDHC controller"
  371. - depends on MMC_SDHCI_PLTFM
  372. - depends on PPC_OF
  373. + depends on PPC_OF && HAS_DMA
  374. select MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER
  375. + select MMC_SDHCI_PLTFM
  376. help
  377. This selects the Freescale eSDHC controller support.
  378. @@ -130,9 +131,9 @@
  379. config MMC_SDHCI_OF_HLWD
  380. tristate "SDHCI OF support for the Nintendo Wii SDHCI controllers"
  381. - depends on MMC_SDHCI_PLTFM
  382. - depends on PPC_OF
  383. + depends on PPC_OF && HAS_DMA
  384. select MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER
  385. + select MMC_SDHCI_PLTFM
  386. help
  387. This selects the Secure Digital Host Controller Interface (SDHCI)
  388. found in the "Hollywood" chipset of the Nintendo Wii video game
  389. @@ -144,8 +145,8 @@
  390. config MMC_SDHCI_CNS3XXX
  391. tristate "SDHCI support on the Cavium Networks CNS3xxx SoC"
  392. - depends on ARCH_CNS3XXX
  393. - depends on MMC_SDHCI_PLTFM
  394. + depends on ARCH_CNS3XXX && HAS_DMA
  395. + select MMC_SDHCI_PLTFM
  396. help
  397. This selects the SDHCI support for CNS3xxx System-on-Chip devices.
  398. @@ -155,9 +156,9 @@
  399. config MMC_SDHCI_ESDHC_IMX
  400. tristate "SDHCI support for the Freescale eSDHC/uSDHC i.MX controller"
  401. - depends on ARCH_MXC
  402. - depends on MMC_SDHCI_PLTFM
  403. + depends on ARCH_MXC && HAS_DMA
  404. select MMC_SDHCI_IO_ACCESSORS
  405. + select MMC_SDHCI_PLTFM
  406. help
  407. This selects the Freescale eSDHC/uSDHC controller support
  408. found on i.MX25, i.MX35 i.MX5x and i.MX6x.
  409. @@ -168,9 +169,9 @@
  410. config MMC_SDHCI_DOVE
  411. tristate "SDHCI support on Marvell's Dove SoC"
  412. - depends on ARCH_DOVE || MACH_DOVE
  413. - depends on MMC_SDHCI_PLTFM
  414. + depends on (ARCH_DOVE || MACH_DOVE) && HAS_DMA
  415. select MMC_SDHCI_IO_ACCESSORS
  416. + select MMC_SDHCI_PLTFM
  417. help
  418. This selects the Secure Digital Host Controller Interface in
  419. Marvell's Dove SoC.
  420. @@ -181,9 +182,9 @@
  421. config MMC_SDHCI_TEGRA
  422. tristate "SDHCI platform support for the Tegra SD/MMC Controller"
  423. - depends on ARCH_TEGRA
  424. - depends on MMC_SDHCI_PLTFM
  425. + depends on ARCH_TEGRA && HAS_DMA
  426. select MMC_SDHCI_IO_ACCESSORS
  427. + select MMC_SDHCI_PLTFM
  428. help
  429. This selects the Tegra SD/MMC controller. If you have a Tegra
  430. platform with SD or MMC devices, say Y or M here.
  431. @@ -192,7 +193,8 @@
  432. config MMC_SDHCI_S3C
  433. tristate "SDHCI support on Samsung S3C SoC"
  434. - depends on MMC_SDHCI && PLAT_SAMSUNG
  435. + depends on PLAT_SAMSUNG && HAS_DMA
  436. + select MMC_SDHCI
  437. help
  438. This selects the Secure Digital Host Controller Interface (SDHCI)
  439. often referrered to as the HSMMC block in some of the Samsung S3C
  440. @@ -204,8 +206,8 @@
  441. config MMC_SDHCI_SIRF
  442. tristate "SDHCI support on CSR SiRFprimaII and SiRFmarco SoCs"
  443. - depends on ARCH_SIRF
  444. - depends on MMC_SDHCI_PLTFM
  445. + depends on ARCH_SIRF && HAS_DMA
  446. + select MMC_SDHCI_PLTFM
  447. help
  448. This selects the SDHCI support for SiRF System-on-Chip devices.
  449. @@ -215,8 +217,8 @@
  450. config MMC_SDHCI_PXAV3
  451. tristate "Marvell MMP2 SD Host Controller support (PXAV3)"
  452. - depends on CLKDEV_LOOKUP
  453. - depends on MMC_SDHCI_PLTFM
  454. + depends on CLKDEV_LOOKUP && HAS_DMA
  455. + select MMC_SDHCI_PLTFM
  456. default CPU_MMP2
  457. help
  458. This selects the Marvell(R) PXAV3 SD Host Controller.
  459. @@ -227,8 +229,8 @@
  460. config MMC_SDHCI_PXAV2
  461. tristate "Marvell PXA9XX SD Host Controller support (PXAV2)"
  462. - depends on CLKDEV_LOOKUP
  463. - depends on MMC_SDHCI_PLTFM
  464. + depends on CLKDEV_LOOKUP && HAS_DMA
  465. + select MMC_SDHCI_PLTFM
  466. default CPU_PXA910
  467. help
  468. This selects the Marvell(R) PXAV2 SD Host Controller.
  469. @@ -239,7 +241,8 @@
  470. config MMC_SDHCI_SPEAR
  471. tristate "SDHCI support on ST SPEAr platform"
  472. - depends on MMC_SDHCI && PLAT_SPEAR
  473. + depends on PLAT_SPEAR && HAS_DMA
  474. + select MMC_SDHCI
  475. help
  476. This selects the Secure Digital Host Controller Interface (SDHCI)
  477. often referrered to as the HSMMC block in some of the ST SPEAR range
  478. @@ -261,8 +264,8 @@
  479. config MMC_SDHCI_BCM_KONA
  480. tristate "SDHCI support on Broadcom KONA platform"
  481. - depends on ARCH_BCM_MOBILE
  482. - depends on MMC_SDHCI_PLTFM
  483. + depends on ARCH_BCM_MOBILE && HAS_DMA
  484. + select MMC_SDHCI_PLTFM
  485. help
  486. This selects the Broadcom Kona Secure Digital Host Controller
  487. Interface(SDHCI) support.
  488. @@ -272,9 +275,9 @@
  489. config MMC_SDHCI_BCM2835
  490. tristate "SDHCI platform support for the BCM2835 SD/MMC Controller"
  491. - depends on ARCH_BCM2835
  492. - depends on MMC_SDHCI_PLTFM
  493. + depends on ARCH_BCM2835 && HAS_DMA
  494. select MMC_SDHCI_IO_ACCESSORS
  495. + select MMC_SDHCI_PLTFM
  496. help
  497. This selects the BCM2835 SD/MMC controller. If you have a BCM2835
  498. platform with SD or MMC devices, say Y or M here.
  499. diff -Nur linux-3.16.orig/drivers/mmc/host/sdhci.c linux-3.16/drivers/mmc/host/sdhci.c
  500. --- linux-3.16.orig/drivers/mmc/host/sdhci.c 2014-08-04 00:25:02.000000000 +0200
  501. +++ linux-3.16/drivers/mmc/host/sdhci.c 2014-08-11 12:34:08.763584537 +0200
  502. @@ -1530,7 +1530,6 @@
  503. host->ops->set_clock(host, host->clock);
  504. }
  505. -
  506. /* Reset SD Clock Enable */
  507. clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
  508. clk &= ~SDHCI_CLOCK_CARD_EN;
  509. @@ -1763,9 +1762,6 @@
  510. ctrl |= SDHCI_CTRL_VDD_180;
  511. sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
  512. - /* Wait for 5ms */
  513. - usleep_range(5000, 5500);
  514. -
  515. /* 1.8V regulator output should be stable within 5 ms */
  516. ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
  517. if (ctrl & SDHCI_CTRL_VDD_180)
  518. diff -Nur linux-3.16.orig/include/linux/mmc/host.h linux-3.16/include/linux/mmc/host.h
  519. --- linux-3.16.orig/include/linux/mmc/host.h 2014-08-04 00:25:02.000000000 +0200
  520. +++ linux-3.16/include/linux/mmc/host.h 2014-08-11 12:34:15.559644729 +0200
  521. @@ -298,6 +298,11 @@
  522. unsigned long clkgate_delay;
  523. #endif
  524. + /* card specific properties to deal with power and reset */
  525. + struct regulator *card_regulator; /* External VCC needed by the card */
  526. + struct gpio_desc *card_reset_gpios[2]; /* External resets, active low */
  527. + struct clk *card_clk; /* External clock needed by the card */
  528. +
  529. /* host specific block data */
  530. unsigned int max_seg_size; /* see blk_queue_max_segment_size */
  531. unsigned short max_segs; /* see blk_queue_max_segments */