ARM: dts: qcom: msm8974-klte: Add support for SD card
authorIskren Chernev <iskren.chernev@gmail.com>
Sun, 20 Sep 2020 14:48:59 +0000 (17:48 +0300)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 26 Oct 2020 14:52:40 +0000 (09:52 -0500)
The Samsung Galaxy S5 (klte), has 3 SDHCI nodes used for internal
storage, WiFi, external SD card slot. The external SD card slot is
similar to the internal storage.

Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Link: https://lore.kernel.org/r/20200920144859.813032-8-iskren.chernev@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
arch/arm/boot/dts/qcom-msm8974-samsung-klte.dts

index 989447b..b089910 100644 (file)
@@ -12,6 +12,8 @@
 
        aliases {
                serial0 = &blsp1_uart1;
+               sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
+               sdhc2 = &sdhc_2; /* SDC2 SD card slot */
        };
 
        chosen {
                                        pma8084_l21: l21 {
                                                regulator-min-microvolt = <2950000>;
                                                regulator-max-microvolt = <2950000>;
+
+                                               regulator-allow-set-load;
+                                               regulator-system-load = <200000>;
                                        };
 
                                        pma8084_l22: l22 {
                        };
                };
 
+               sdhc2_pin_a: sdhc2-pin-active {
+                       clk-cmd-data {
+                               pins = "gpio35", "gpio36", "gpio37", "gpio38",
+                                       "gpio39", "gpio40";
+                               function = "sdc3";
+                               drive-strength = <8>;
+                               bias-disable;
+                       };
+               };
+
+               sdhc2_cd_pin: sdhc2-cd {
+                       pins = "gpio62";
+                       function = "gpio";
+
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+
                sdhc3_pin_a: sdhc3-pin-active {
                        clk {
                                pins = "sdc2_clk";
                };
        };
 
-       sdhci@f9824900 {
+       sdhc_1: sdhci@f9824900 {
                status = "ok";
 
                vmmc-supply = <&pma8084_l20>;
                pinctrl-0 = <&sdhc1_pin_a>;
        };
 
+       sdhc_2: sdhci@f9864900 {
+               status = "ok";
+
+               max-frequency = <100000000>;
+
+               vmmc-supply = <&pma8084_l21>;
+               vqmmc-supply = <&pma8084_l13>;
+
+               bus-width = <4>;
+
+               /* cd-gpio is intentionally disabled. If enabled, an SD card
+                * present during boot is not initialized correctly. Without
+                * cd-gpios the driver resorts to polling, so hotplug works.
+                */
+               pinctrl-names = "default";
+               pinctrl-0 = <&sdhc2_pin_a /* &sdhc2_cd_pin */>;
+               // cd-gpios = <&msmgpio 62 GPIO_ACTIVE_LOW>;
+       };
+
        sdhci@f98a4900 {
                status = "okay";