diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-26 12:05:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-26 12:05:35 -0400 |
commit | a38b461ed5329d4c09c36dbc0084fc16f0adeb20 (patch) | |
tree | 92f700f3e8f98cfc15ddb5c739510cbc0864d7ff | |
parent | e95806dffc2f2d632c7891e71fc9ef7e1ba0ce97 (diff) | |
parent | ea452678734eb782126f999bf5c4fb3e71d3b196 (diff) |
Merge tag 'mmc-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson:
"This contains fixes to make the WiFi work again for the ARM64 Hikey
board.
Together with a couple of DTS updates for the Hikey board we have also
extended the mmc pwrseq_simple, to support a new power-off-delay-us DT
property, as that was required to enable a graceful power off sequence
for the WiFi chip"
* tag 'mmc-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
arm64: dts: hikey: Fix WiFi support
arm64: dts: hi6220: Move board data from the dwmmc nodes to hikey dts
arm64: dts: hikey: Add the SYS_5V and the VDD_3V3 regulators
arm64: dts: hi6220: Move the fixed_5v_hub regulator to the hikey dts
arm64: dts: hikey: Add clock for the pmic mfd
mfd: dts: hi655x: Add clock binding for the pmic
mmc: pwrseq_simple: Parse DTS for the power-off-delay-us property
mmc: dt: pwrseq-simple: Invent power-off-delay-us
-rw-r--r-- | Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt | 6 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt | 2 | ||||
-rw-r--r-- | arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 78 | ||||
-rw-r--r-- | arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 31 | ||||
-rw-r--r-- | drivers/mmc/core/pwrseq_simple.c | 7 |
5 files changed, 79 insertions, 45 deletions
diff --git a/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt b/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt index 05485699d70e..9630ac0e4b56 100644 --- a/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt +++ b/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt | |||
@@ -16,6 +16,11 @@ Required properties: | |||
16 | - reg: Base address of PMIC on Hi6220 SoC. | 16 | - reg: Base address of PMIC on Hi6220 SoC. |
17 | - interrupt-controller: Hi655x has internal IRQs (has own IRQ domain). | 17 | - interrupt-controller: Hi655x has internal IRQs (has own IRQ domain). |
18 | - pmic-gpios: The GPIO used by PMIC IRQ. | 18 | - pmic-gpios: The GPIO used by PMIC IRQ. |
19 | - #clock-cells: From common clock binding; shall be set to 0 | ||
20 | |||
21 | Optional properties: | ||
22 | - clock-output-names: From common clock binding to override the | ||
23 | default output clock name | ||
19 | 24 | ||
20 | Example: | 25 | Example: |
21 | pmic: pmic@f8000000 { | 26 | pmic: pmic@f8000000 { |
@@ -24,4 +29,5 @@ Example: | |||
24 | interrupt-controller; | 29 | interrupt-controller; |
25 | #interrupt-cells = <2>; | 30 | #interrupt-cells = <2>; |
26 | pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; | 31 | pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; |
32 | #clock-cells = <0>; | ||
27 | } | 33 | } |
diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt index e25436861867..9029b45b8a22 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt +++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt | |||
@@ -18,6 +18,8 @@ Optional properties: | |||
18 | "ext_clock" (External clock provided to the card). | 18 | "ext_clock" (External clock provided to the card). |
19 | - post-power-on-delay-ms : Delay in ms after powering the card and | 19 | - post-power-on-delay-ms : Delay in ms after powering the card and |
20 | de-asserting the reset-gpios (if any) | 20 | de-asserting the reset-gpios (if any) |
21 | - power-off-delay-us : Delay in us after asserting the reset-gpios (if any) | ||
22 | during power off of the card. | ||
21 | 23 | ||
22 | Example: | 24 | Example: |
23 | 25 | ||
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts index 75bce2d0b1a8..49f6a6242cf9 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | |||
@@ -81,6 +81,45 @@ | |||
81 | }; | 81 | }; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | reg_sys_5v: regulator@0 { | ||
85 | compatible = "regulator-fixed"; | ||
86 | regulator-name = "SYS_5V"; | ||
87 | regulator-min-microvolt = <5000000>; | ||
88 | regulator-max-microvolt = <5000000>; | ||
89 | regulator-boot-on; | ||
90 | regulator-always-on; | ||
91 | }; | ||
92 | |||
93 | reg_vdd_3v3: regulator@1 { | ||
94 | compatible = "regulator-fixed"; | ||
95 | regulator-name = "VDD_3V3"; | ||
96 | regulator-min-microvolt = <3300000>; | ||
97 | regulator-max-microvolt = <3300000>; | ||
98 | regulator-boot-on; | ||
99 | regulator-always-on; | ||
100 | vin-supply = <®_sys_5v>; | ||
101 | }; | ||
102 | |||
103 | reg_5v_hub: regulator@2 { | ||
104 | compatible = "regulator-fixed"; | ||
105 | regulator-name = "5V_HUB"; | ||
106 | regulator-min-microvolt = <5000000>; | ||
107 | regulator-max-microvolt = <5000000>; | ||
108 | regulator-boot-on; | ||
109 | gpio = <&gpio0 7 0>; | ||
110 | regulator-always-on; | ||
111 | vin-supply = <®_sys_5v>; | ||
112 | }; | ||
113 | |||
114 | wl1835_pwrseq: wl1835-pwrseq { | ||
115 | compatible = "mmc-pwrseq-simple"; | ||
116 | /* WLAN_EN GPIO */ | ||
117 | reset-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; | ||
118 | clocks = <&pmic>; | ||
119 | clock-names = "ext_clock"; | ||
120 | power-off-delay-us = <10>; | ||
121 | }; | ||
122 | |||
84 | soc { | 123 | soc { |
85 | spi0: spi@f7106000 { | 124 | spi0: spi@f7106000 { |
86 | status = "ok"; | 125 | status = "ok"; |
@@ -256,11 +295,31 @@ | |||
256 | 295 | ||
257 | /* GPIO blocks 16 thru 19 do not appear to be routed to pins */ | 296 | /* GPIO blocks 16 thru 19 do not appear to be routed to pins */ |
258 | 297 | ||
298 | dwmmc_0: dwmmc0@f723d000 { | ||
299 | cap-mmc-highspeed; | ||
300 | non-removable; | ||
301 | bus-width = <0x8>; | ||
302 | vmmc-supply = <&ldo19>; | ||
303 | }; | ||
304 | |||
305 | dwmmc_1: dwmmc1@f723e000 { | ||
306 | card-detect-delay = <200>; | ||
307 | cap-sd-highspeed; | ||
308 | sd-uhs-sdr12; | ||
309 | sd-uhs-sdr25; | ||
310 | sd-uhs-sdr50; | ||
311 | vqmmc-supply = <&ldo7>; | ||
312 | vmmc-supply = <&ldo10>; | ||
313 | bus-width = <0x4>; | ||
314 | disable-wp; | ||
315 | cd-gpios = <&gpio1 0 1>; | ||
316 | }; | ||
317 | |||
259 | dwmmc_2: dwmmc2@f723f000 { | 318 | dwmmc_2: dwmmc2@f723f000 { |
260 | ti,non-removable; | 319 | bus-width = <0x4>; |
261 | non-removable; | 320 | non-removable; |
262 | /* WL_EN */ | 321 | vmmc-supply = <®_vdd_3v3>; |
263 | vmmc-supply = <&wlan_en_reg>; | 322 | mmc-pwrseq = <&wl1835_pwrseq>; |
264 | 323 | ||
265 | #address-cells = <0x1>; | 324 | #address-cells = <0x1>; |
266 | #size-cells = <0x0>; | 325 | #size-cells = <0x0>; |
@@ -272,18 +331,6 @@ | |||
272 | interrupts = <3 IRQ_TYPE_EDGE_RISING>; | 331 | interrupts = <3 IRQ_TYPE_EDGE_RISING>; |
273 | }; | 332 | }; |
274 | }; | 333 | }; |
275 | |||
276 | wlan_en_reg: regulator@1 { | ||
277 | compatible = "regulator-fixed"; | ||
278 | regulator-name = "wlan-en-regulator"; | ||
279 | regulator-min-microvolt = <1800000>; | ||
280 | regulator-max-microvolt = <1800000>; | ||
281 | /* WLAN_EN GPIO */ | ||
282 | gpio = <&gpio0 5 0>; | ||
283 | /* WLAN card specific delay */ | ||
284 | startup-delay-us = <70000>; | ||
285 | enable-active-high; | ||
286 | }; | ||
287 | }; | 334 | }; |
288 | 335 | ||
289 | leds { | 336 | leds { |
@@ -330,6 +377,7 @@ | |||
330 | pmic: pmic@f8000000 { | 377 | pmic: pmic@f8000000 { |
331 | compatible = "hisilicon,hi655x-pmic"; | 378 | compatible = "hisilicon,hi655x-pmic"; |
332 | reg = <0x0 0xf8000000 0x0 0x1000>; | 379 | reg = <0x0 0xf8000000 0x0 0x1000>; |
380 | #clock-cells = <0>; | ||
333 | interrupt-controller; | 381 | interrupt-controller; |
334 | #interrupt-cells = <2>; | 382 | #interrupt-cells = <2>; |
335 | pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; | 383 | pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; |
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi index 1e5129b19280..5013e4b2ea71 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi | |||
@@ -725,20 +725,10 @@ | |||
725 | status = "disabled"; | 725 | status = "disabled"; |
726 | }; | 726 | }; |
727 | 727 | ||
728 | fixed_5v_hub: regulator@0 { | ||
729 | compatible = "regulator-fixed"; | ||
730 | regulator-name = "fixed_5v_hub"; | ||
731 | regulator-min-microvolt = <5000000>; | ||
732 | regulator-max-microvolt = <5000000>; | ||
733 | regulator-boot-on; | ||
734 | gpio = <&gpio0 7 0>; | ||
735 | regulator-always-on; | ||
736 | }; | ||
737 | |||
738 | usb_phy: usbphy { | 728 | usb_phy: usbphy { |
739 | compatible = "hisilicon,hi6220-usb-phy"; | 729 | compatible = "hisilicon,hi6220-usb-phy"; |
740 | #phy-cells = <0>; | 730 | #phy-cells = <0>; |
741 | phy-supply = <&fixed_5v_hub>; | 731 | phy-supply = <®_5v_hub>; |
742 | hisilicon,peripheral-syscon = <&sys_ctrl>; | 732 | hisilicon,peripheral-syscon = <&sys_ctrl>; |
743 | }; | 733 | }; |
744 | 734 | ||
@@ -766,17 +756,12 @@ | |||
766 | 756 | ||
767 | dwmmc_0: dwmmc0@f723d000 { | 757 | dwmmc_0: dwmmc0@f723d000 { |
768 | compatible = "hisilicon,hi6220-dw-mshc"; | 758 | compatible = "hisilicon,hi6220-dw-mshc"; |
769 | num-slots = <0x1>; | ||
770 | cap-mmc-highspeed; | ||
771 | non-removable; | ||
772 | reg = <0x0 0xf723d000 0x0 0x1000>; | 759 | reg = <0x0 0xf723d000 0x0 0x1000>; |
773 | interrupts = <0x0 0x48 0x4>; | 760 | interrupts = <0x0 0x48 0x4>; |
774 | clocks = <&sys_ctrl 2>, <&sys_ctrl 1>; | 761 | clocks = <&sys_ctrl 2>, <&sys_ctrl 1>; |
775 | clock-names = "ciu", "biu"; | 762 | clock-names = "ciu", "biu"; |
776 | resets = <&sys_ctrl PERIPH_RSTDIS0_MMC0>; | 763 | resets = <&sys_ctrl PERIPH_RSTDIS0_MMC0>; |
777 | reset-names = "reset"; | 764 | reset-names = "reset"; |
778 | bus-width = <0x8>; | ||
779 | vmmc-supply = <&ldo19>; | ||
780 | pinctrl-names = "default"; | 765 | pinctrl-names = "default"; |
781 | pinctrl-0 = <&emmc_pmx_func &emmc_clk_cfg_func | 766 | pinctrl-0 = <&emmc_pmx_func &emmc_clk_cfg_func |
782 | &emmc_cfg_func &emmc_rst_cfg_func>; | 767 | &emmc_cfg_func &emmc_rst_cfg_func>; |
@@ -784,13 +769,7 @@ | |||
784 | 769 | ||
785 | dwmmc_1: dwmmc1@f723e000 { | 770 | dwmmc_1: dwmmc1@f723e000 { |
786 | compatible = "hisilicon,hi6220-dw-mshc"; | 771 | compatible = "hisilicon,hi6220-dw-mshc"; |
787 | num-slots = <0x1>; | ||
788 | card-detect-delay = <200>; | ||
789 | hisilicon,peripheral-syscon = <&ao_ctrl>; | 772 | hisilicon,peripheral-syscon = <&ao_ctrl>; |
790 | cap-sd-highspeed; | ||
791 | sd-uhs-sdr12; | ||
792 | sd-uhs-sdr25; | ||
793 | sd-uhs-sdr50; | ||
794 | reg = <0x0 0xf723e000 0x0 0x1000>; | 773 | reg = <0x0 0xf723e000 0x0 0x1000>; |
795 | interrupts = <0x0 0x49 0x4>; | 774 | interrupts = <0x0 0x49 0x4>; |
796 | #address-cells = <0x1>; | 775 | #address-cells = <0x1>; |
@@ -799,11 +778,6 @@ | |||
799 | clock-names = "ciu", "biu"; | 778 | clock-names = "ciu", "biu"; |
800 | resets = <&sys_ctrl PERIPH_RSTDIS0_MMC1>; | 779 | resets = <&sys_ctrl PERIPH_RSTDIS0_MMC1>; |
801 | reset-names = "reset"; | 780 | reset-names = "reset"; |
802 | vqmmc-supply = <&ldo7>; | ||
803 | vmmc-supply = <&ldo10>; | ||
804 | bus-width = <0x4>; | ||
805 | disable-wp; | ||
806 | cd-gpios = <&gpio1 0 1>; | ||
807 | pinctrl-names = "default", "idle"; | 781 | pinctrl-names = "default", "idle"; |
808 | pinctrl-0 = <&sd_pmx_func &sd_clk_cfg_func &sd_cfg_func>; | 782 | pinctrl-0 = <&sd_pmx_func &sd_clk_cfg_func &sd_cfg_func>; |
809 | pinctrl-1 = <&sd_pmx_idle &sd_clk_cfg_idle &sd_cfg_idle>; | 783 | pinctrl-1 = <&sd_pmx_idle &sd_clk_cfg_idle &sd_cfg_idle>; |
@@ -811,15 +785,12 @@ | |||
811 | 785 | ||
812 | dwmmc_2: dwmmc2@f723f000 { | 786 | dwmmc_2: dwmmc2@f723f000 { |
813 | compatible = "hisilicon,hi6220-dw-mshc"; | 787 | compatible = "hisilicon,hi6220-dw-mshc"; |
814 | num-slots = <0x1>; | ||
815 | reg = <0x0 0xf723f000 0x0 0x1000>; | 788 | reg = <0x0 0xf723f000 0x0 0x1000>; |
816 | interrupts = <0x0 0x4a 0x4>; | 789 | interrupts = <0x0 0x4a 0x4>; |
817 | clocks = <&sys_ctrl HI6220_MMC2_CIUCLK>, <&sys_ctrl HI6220_MMC2_CLK>; | 790 | clocks = <&sys_ctrl HI6220_MMC2_CIUCLK>, <&sys_ctrl HI6220_MMC2_CLK>; |
818 | clock-names = "ciu", "biu"; | 791 | clock-names = "ciu", "biu"; |
819 | resets = <&sys_ctrl PERIPH_RSTDIS0_MMC2>; | 792 | resets = <&sys_ctrl PERIPH_RSTDIS0_MMC2>; |
820 | reset-names = "reset"; | 793 | reset-names = "reset"; |
821 | bus-width = <0x4>; | ||
822 | broken-cd; | ||
823 | pinctrl-names = "default", "idle"; | 794 | pinctrl-names = "default", "idle"; |
824 | pinctrl-0 = <&sdio_pmx_func &sdio_clk_cfg_func &sdio_cfg_func>; | 795 | pinctrl-0 = <&sdio_pmx_func &sdio_clk_cfg_func &sdio_cfg_func>; |
825 | pinctrl-1 = <&sdio_pmx_idle &sdio_clk_cfg_idle &sdio_cfg_idle>; | 796 | pinctrl-1 = <&sdio_pmx_idle &sdio_clk_cfg_idle &sdio_cfg_idle>; |
diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c index 1304160de168..13ef162cf066 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/mmc/core/pwrseq_simple.c | |||
@@ -27,6 +27,7 @@ struct mmc_pwrseq_simple { | |||
27 | struct mmc_pwrseq pwrseq; | 27 | struct mmc_pwrseq pwrseq; |
28 | bool clk_enabled; | 28 | bool clk_enabled; |
29 | u32 post_power_on_delay_ms; | 29 | u32 post_power_on_delay_ms; |
30 | u32 power_off_delay_us; | ||
30 | struct clk *ext_clk; | 31 | struct clk *ext_clk; |
31 | struct gpio_descs *reset_gpios; | 32 | struct gpio_descs *reset_gpios; |
32 | }; | 33 | }; |
@@ -78,6 +79,10 @@ static void mmc_pwrseq_simple_power_off(struct mmc_host *host) | |||
78 | 79 | ||
79 | mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); | 80 | mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); |
80 | 81 | ||
82 | if (pwrseq->power_off_delay_us) | ||
83 | usleep_range(pwrseq->power_off_delay_us, | ||
84 | 2 * pwrseq->power_off_delay_us); | ||
85 | |||
81 | if (!IS_ERR(pwrseq->ext_clk) && pwrseq->clk_enabled) { | 86 | if (!IS_ERR(pwrseq->ext_clk) && pwrseq->clk_enabled) { |
82 | clk_disable_unprepare(pwrseq->ext_clk); | 87 | clk_disable_unprepare(pwrseq->ext_clk); |
83 | pwrseq->clk_enabled = false; | 88 | pwrseq->clk_enabled = false; |
@@ -119,6 +124,8 @@ static int mmc_pwrseq_simple_probe(struct platform_device *pdev) | |||
119 | 124 | ||
120 | device_property_read_u32(dev, "post-power-on-delay-ms", | 125 | device_property_read_u32(dev, "post-power-on-delay-ms", |
121 | &pwrseq->post_power_on_delay_ms); | 126 | &pwrseq->post_power_on_delay_ms); |
127 | device_property_read_u32(dev, "power-off-delay-us", | ||
128 | &pwrseq->power_off_delay_us); | ||
122 | 129 | ||
123 | pwrseq->pwrseq.dev = dev; | 130 | pwrseq->pwrseq.dev = dev; |
124 | pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops; | 131 | pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops; |