I am trying to add buttons to GPIOs J and L with internal pull-up. I think I have managed to do this by adding the changes below, but I see that my bias settings are applied first, followed by many pull-down and bias disable, overriding my settings and making the buttons not work. The only places I see these set are for TPIU, which I do not see in msm8916-perf_defconfig and camera, which I have disabled. How can I find and disable other settings of these GPIOs bias?
--- a/arch/arm/boot/dts/qcom/apq8016-sbc.dtsi
+++ b/arch/arm/boot/dts/qcom/apq8016-sbc.dtsi
@@ -289,6 +289,24 @@
gpio-key,wakeup;
debounce-interval = <15>;
};
+
+ exp_vol_up {
+ label = "exp_vol_up";
+ gpios = <&msm_gpio 34 0x1>;
+ linux,input-type = <1>;
+ linux,code = <116>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
+
+ exp_vol_down {
+ label = "exp_vol_down";
+ gpios = <&msm_gpio 33 0x1>;
+ linux,input-type = <1>;
+ linux,code = <117>;
+ gpio-key,wakeup;
+ debounce-interval = <15>;
+ };
};
qcom,wcnss-wlan@0a000000 {
— a/arch/arm/boot/dts/qcom/msm8916-pinctrl.dtsi
+++ b/arch/arm/boot/dts/qcom/msm8916-pinctrl.dtsi
@@ -1138,9 +1138,9 @@
};
tlmm_gpio_key {
-
qcom,pins = <&gp 107>, <&gp 108>, <&gp 109>;
-
qcom,pins = <&gp 33>, <&gp 34>, <&gp 107>, <&gp 108>, <&gp 109>;
qcom,pin-func = <0>;
-
qcom,num-grp-pins = <3>;
-
qcom,num-grp-pins = <5>;
label = "tlmm_gpio_key";
gpio_key_active: gpio_key_active {
drive-strength = <2>;
— a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -638,6 +640,8 @@ gpio_keys_get_devtree_pdata(struct device *dev)
pdata->rep = !!of_get_property(node, “autorepeat”, NULL);
pdata->name = of_get_property(node, “input-name”, NULL);
-
dev_info(dev, "%s(): %s: %sautorepeat, %d buttons\n", __func__, pdata->name, pdata->rep ? "" : "no
-
i = 0;
for_each_child_of_node(node, pp) {
int gpio;
— a/drivers/pinctrl/pinctrl-msm-tlmm.c
+++ b/drivers/pinctrl/pinctrl-msm-tlmm.c
@@ -272,6 +272,7 @@ static int msm_tlmm_sdc_cfg(uint pin_no, unsigned long config,
/ Get mask and shft values for this config type */
switch (id) {
case PIN_CONFIG_BIAS_DISABLE:
-
pr_info("%s(): %s: gpio %d bias disabled\n", __func__, pinfo->name, pin_no);
mask = sdc_regs[pin_no].pull_mask;
shft = sdc_regs[pin_no].pull_shft;
data = TLMM_NO_PULL;
@@ -282,6 +283,7 @@ static int msm_tlmm_sdc_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
-
pr_info("%s(): %s: gpio %d pull down\n", __func__, pinfo->name, pin_no);
mask = sdc_regs[pin_no].pull_mask;
shft = sdc_regs[pin_no].pull_shft;
data = TLMM_PULL_DOWN;
@@ -292,6 +294,7 @@ static int msm_tlmm_sdc_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_UP:
-
pr_info("%s(): %s: gpio %d pull up\n", __func__, pinfo->name, pin_no);
mask = sdc_regs[pin_no].pull_mask;
shft = sdc_regs[pin_no].pull_shft;
data = TLMM_PULL_UP;
@@ -339,6 +342,7 @@ static int msm_tlmm_qdsd_cfg(uint pin_no, unsigned long config,
/ Get mask and shft values for this config type */
switch (id) {
case PIN_CONFIG_BIAS_DISABLE:
-
pr_info("%s(): %s: gpio %d bias disabled\n", __func__, pinfo->name, pin_no);
mask = TLMMV_QDSD_PULL_MASK;
shft = pin_no * TLMMV4_QDSD_CONFIG_WIDTH
+ TLMMV4_QDSD_PULL_OFFSET;
@@ -349,6 +353,7 @@ static int msm_tlmm_qdsd_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
-
pr_info("%s(): %s: gpio %d pull down\n", __func__, pinfo->name, pin_no);
mask = TLMMV_QDSD_PULL_MASK;
shft = pin_no * TLMMV4_QDSD_CONFIG_WIDTH
+ TLMMV4_QDSD_PULL_OFFSET;
@@ -359,6 +364,7 @@ static int msm_tlmm_qdsd_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_UP:
-
pr_info("%s(): %s: gpio %d pull up\n", __func__, pinfo->name, pin_no);
mask = TLMMV_QDSD_PULL_MASK;
shft = pin_no * TLMMV4_QDSD_CONFIG_WIDTH
+ TLMMV4_QDSD_PULL_OFFSET;
@@ -406,6 +412,7 @@ static int msm_tlmm_gp_cfg(uint pin_no, unsigned long config,
/ Get mask and shft values for this config type */
switch (id) {
case PIN_CONFIG_BIAS_DISABLE:
-
pr_info("%s(): %s: gpio %d bias disabled\n", __func__, pinfo->name, pin_no);
mask = TLMM_GP_PULL_MASK;
shft = TLMM_GP_PULL_SHFT;
data = TLMM_NO_PULL;
@@ -416,6 +423,7 @@ static int msm_tlmm_gp_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
-
pr_info("%s(): %s: gpio %d pull down\n", __func__, pinfo->name, pin_no);
mask = TLMM_GP_PULL_MASK;
shft = TLMM_GP_PULL_SHFT;
data = TLMM_PULL_DOWN;
@@ -426,6 +434,7 @@ static int msm_tlmm_gp_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_UP:
-
pr_info("%s(): %s: gpio %d pull up\n", __func__, pinfo->name, pin_no);
mask = TLMM_GP_PULL_MASK;
shft = TLMM_GP_PULL_SHFT;
data = TLMM_PULL_UP;
@@ -558,6 +567,7 @@ static int msm_tlmm_ebi_cfg(uint pin_no, unsigned long config,
/ Get mask and shft values for this config type */
switch (id) {
case PIN_CONFIG_BIAS_DISABLE:
-
pr_info("%s(): %s: gpio %d bias disabled\n", __func__, pinfo->name, pin_no);
mask = ebi_regs[pin_no].pull_mask;
shft = ebi_regs[pin_no].pull_shft;
data = TLMM_NO_PULL;
@@ -568,6 +578,7 @@ static int msm_tlmm_ebi_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
-
pr_info("%s(): %s: gpio %d pull down\n", __func__, pinfo->name, pin_no);
mask = ebi_regs[pin_no].pull_mask;
shft = ebi_regs[pin_no].pull_shft;
data = TLMM_PULL_DOWN;
@@ -578,6 +589,7 @@ static int msm_tlmm_ebi_cfg(uint pin_no, unsigned long *config,
}
break;
case PIN_CONFIG_BIAS_PULL_UP:
-
pr_info("%s(): %s: gpio %d pull up\n", __func__, pinfo->name, pin_no);
mask = ebi_regs[pin_no].pull_mask;
shft = ebi_regs[pin_no].pull_shft;
data = TLMM_PULL_UP;