mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
arm64: dts: qcom: msm8916/39: Fix SD card detect pinctrl
The current SD card detect pinctrl setup configures bias-pull-up for the "default" (active) case and bias-disable for the "sleep" case. Before commitb5c833b703("mmc: sdhci-msm: Set IO pins in low power state during suspend") the pull up was permanently active. Since then it is only active when a valid SD card is inserted. This does not really make sense: For an active-low CD, the pull up is needed to pull the GPIO high when the card is not inserted. When the card gets inserted CD is shorted to ground (low). This means right now the pull-up is removed exactly when it is needed to detect the next card insertion. Generally, applying different bias for CD does not really make sense. It should always stay the same so card removals and insertions can be detected properly. The reason why card detection still works fine in practice is that most boards seem to have external pull up on the CD pin. However, this means that there is no need to configure an internal pull-up at all and we can keep bias-disable permanently. There are also some boards with different CD polarity (acer-a1-724) and with different GPIO number (huawei-g7). All in all this makes it obvious that the CD pin is board-specific and the pinctrl for it should be defined in the board DT. Move it to the boards that need it and use bias-disable permanently for the boards that seem to have external pull-up. The vendor device tree for msm8939-sony-xperia-kanuti-tulip suggests that it needs the internal pull-up permanently [1] so it gets bias-pull-up to be sure. [1]:57b5050e34/arch/arm/boot/dts/qcom/msm8939-kanuti_tulip.dtsi (L634-L636)Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-1-11f540b51c93@gerhold.net
This commit is contained in:
committed by
Bjorn Andersson
parent
f43b6dc7d5
commit
dfbda20dab
@@ -380,8 +380,8 @@
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
@@ -642,6 +642,13 @@
|
||||
"USR_LED_2_CTRL", /* GPIO 120 */
|
||||
"SB_HS_ID";
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
tlmm_leds: tlmm-leds-state {
|
||||
pins = "gpio21", "gpio120";
|
||||
function = "gpio";
|
||||
|
||||
@@ -142,8 +142,8 @@
|
||||
|
||||
&sdhc_2 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
@@ -184,6 +184,13 @@
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
touchscreen_default: touchscreen-default-state {
|
||||
reset-pins {
|
||||
pins = "gpio12";
|
||||
|
||||
@@ -181,8 +181,8 @@
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
@@ -276,6 +276,13 @@
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
ts_int_reset_default: ts-int-reset-default-state {
|
||||
pins = "gpio13", "gpio100";
|
||||
function = "gpio";
|
||||
|
||||
@@ -150,8 +150,8 @@
|
||||
vmmc-supply = <®_sd_vmmc>;
|
||||
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
@@ -205,6 +205,13 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
touchscreen_default: touchscreen-default-state {
|
||||
touch-pins {
|
||||
pins = "gpio13";
|
||||
|
||||
@@ -136,8 +136,8 @@
|
||||
};
|
||||
|
||||
&sdhc_2 {
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
@@ -184,6 +184,13 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
touchscreen_default: touchscreen-default-state {
|
||||
reset-pins {
|
||||
pins = "gpio12";
|
||||
|
||||
@@ -270,8 +270,8 @@
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdhc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdhc2_cd_default>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
|
||||
/*
|
||||
* The Huawei device tree sets cd-gpios = <&tlmm 38 GPIO_ACTIVE_HIGH>.
|
||||
@@ -397,7 +397,7 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sdhc2_cd_default: sdhc2-cd-default-state {
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio56";
|
||||
function = "gpio";
|
||||
|
||||
|
||||
@@ -135,8 +135,8 @@
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
@@ -190,6 +190,13 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
usb_id_default: usb-id-default-state {
|
||||
pins = "gpio110";
|
||||
function = "gpio";
|
||||
|
||||
@@ -380,23 +380,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
pmx-sdc2-cd-pin-state {
|
||||
sdc2_cd_on: cd-on-pins {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
sdc2_cd_off: cd-off-pins {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
cdc-pdm-lines-state {
|
||||
cdc_pdm_lines_act: pdm-lines-on-pins {
|
||||
pins = "gpio63", "gpio64", "gpio65", "gpio66",
|
||||
|
||||
@@ -273,8 +273,8 @@
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
@@ -391,6 +391,13 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
tkey_default: tkey-default-state {
|
||||
pins = "gpio98";
|
||||
function = "gpio";
|
||||
|
||||
@@ -143,8 +143,8 @@
|
||||
};
|
||||
|
||||
&sdhc_2 {
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
@@ -199,4 +199,11 @@
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
|
||||
pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_default>;
|
||||
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
@@ -162,4 +162,11 @@
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -43,6 +43,13 @@
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
sdc2_cd_default: sdc2-cd-default-state {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
usb_id_default: usb-id-default-state {
|
||||
pins = "gpio110";
|
||||
function = "gpio";
|
||||
@@ -158,8 +165,8 @@
|
||||
};
|
||||
|
||||
&sdhc_2 {
|
||||
pinctrl-0 = <&sdc2_default_state>;
|
||||
pinctrl-1 = <&sdc2_sleep_state>;
|
||||
pinctrl-0 = <&sdc2_default_state &sdc2_cd_default>;
|
||||
pinctrl-1 = <&sdc2_sleep_state &sdc2_cd_default>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
cd-gpios = <&tlmm 38 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
|
||||
@@ -1138,13 +1138,6 @@
|
||||
bias-pull-up;
|
||||
drive-strength = <10>;
|
||||
};
|
||||
|
||||
cd-pins {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
sdc2_sleep_state: sdc2-sleep-state {
|
||||
@@ -1165,13 +1158,6 @@
|
||||
bias-pull-up;
|
||||
drive-strength = <2>;
|
||||
};
|
||||
|
||||
cd-pins {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
wcnss_pin_a: wcnss-active-state {
|
||||
|
||||
Reference in New Issue
Block a user