Loading Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml +3 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,9 @@ $defs: bias-pull-down: true bias-pull-up: true bias-disable: true input-enable: true input-enable: false output-disable: true output-enable: true output-high: true output-low: true Loading drivers/pinctrl/qcom/pinctrl-msm.c +31 −5 Original line number Diff line number Diff line Loading @@ -323,6 +323,7 @@ static int msm_config_reg(struct msm_pinctrl *pctrl, break; case PIN_CONFIG_OUTPUT: case PIN_CONFIG_INPUT_ENABLE: case PIN_CONFIG_OUTPUT_ENABLE: *bit = g->oe_bit; *mask = 1; break; Loading Loading @@ -414,11 +415,9 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev, val = msm_readl_io(pctrl, g); arg = !!(val & BIT(g->in_bit)); break; case PIN_CONFIG_INPUT_ENABLE: /* Pin is output */ if (arg) case PIN_CONFIG_OUTPUT_ENABLE: if (!arg) return -EINVAL; arg = 1; break; default: return -ENOTSUPP; Loading Loading @@ -502,9 +501,36 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev, arg = 1; break; case PIN_CONFIG_INPUT_ENABLE: /* disable output */ /* * According to pinctrl documentation this should * actually be a no-op. * * The docs are explicit that "this does not affect * the pin's ability to drive output" but what we do * here is to modify the output enable bit. Thus, to * follow the docs we should remove that. * * The docs say that we should enable any relevant * input buffer, but TLMM there is no input buffer that * can be enabled/disabled. It's always on. * * The points above, explain why this _should_ be a * no-op. However, for historical reasons and to * support old device trees, we'll violate the docs * still affect the output. * * It should further be noted that this old historical * behavior actually overrides arg to 0. That means * that "input-enable" and "input-disable" in a device * tree would _both_ disable the output. We'll * continue to preserve this behavior as well since * we have no other use for this attribute. */ arg = 0; break; case PIN_CONFIG_OUTPUT_ENABLE: arg = !!arg; break; default: dev_err(pctrl->dev, "Unsupported config parameter: %x\n", param); Loading Loading
Documentation/devicetree/bindings/pinctrl/qcom,tlmm-common.yaml +3 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,9 @@ $defs: bias-pull-down: true bias-pull-up: true bias-disable: true input-enable: true input-enable: false output-disable: true output-enable: true output-high: true output-low: true Loading
drivers/pinctrl/qcom/pinctrl-msm.c +31 −5 Original line number Diff line number Diff line Loading @@ -323,6 +323,7 @@ static int msm_config_reg(struct msm_pinctrl *pctrl, break; case PIN_CONFIG_OUTPUT: case PIN_CONFIG_INPUT_ENABLE: case PIN_CONFIG_OUTPUT_ENABLE: *bit = g->oe_bit; *mask = 1; break; Loading Loading @@ -414,11 +415,9 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev, val = msm_readl_io(pctrl, g); arg = !!(val & BIT(g->in_bit)); break; case PIN_CONFIG_INPUT_ENABLE: /* Pin is output */ if (arg) case PIN_CONFIG_OUTPUT_ENABLE: if (!arg) return -EINVAL; arg = 1; break; default: return -ENOTSUPP; Loading Loading @@ -502,9 +501,36 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev, arg = 1; break; case PIN_CONFIG_INPUT_ENABLE: /* disable output */ /* * According to pinctrl documentation this should * actually be a no-op. * * The docs are explicit that "this does not affect * the pin's ability to drive output" but what we do * here is to modify the output enable bit. Thus, to * follow the docs we should remove that. * * The docs say that we should enable any relevant * input buffer, but TLMM there is no input buffer that * can be enabled/disabled. It's always on. * * The points above, explain why this _should_ be a * no-op. However, for historical reasons and to * support old device trees, we'll violate the docs * still affect the output. * * It should further be noted that this old historical * behavior actually overrides arg to 0. That means * that "input-enable" and "input-disable" in a device * tree would _both_ disable the output. We'll * continue to preserve this behavior as well since * we have no other use for this attribute. */ arg = 0; break; case PIN_CONFIG_OUTPUT_ENABLE: arg = !!arg; break; default: dev_err(pctrl->dev, "Unsupported config parameter: %x\n", param); Loading