mirror_ubuntu-kernels/drivers/pinctrl/qcom
Douglas Anderson e49eabe3e1 pinctrl: qcom: Support OUTPUT_ENABLE; deprecate INPUT_ENABLE
The Qualcomm pinctrl driver has been violating the documented meaning
of PIN_CONFIG_INPUT_ENABLE. That documentation says:

  Note that this does not affect the pin's ability to drive output.

...yet the Qualcomm driver's sole action when asked to "enable input"
on a pin is to disable its output.

The Qualcomm driver's implementation stems from the fact that
"output-disable" is a "new" property from 2017. It was introduced in
commit 425562429d ("pinctrl: generic: Add output-enable
property"). The "input-enable" handling in Qualcomm drivers is from
2015 introduced in commit 407f5e392f ("pinctrl: qcom: handle
input-enable pinconf property").

Let's change the Qualcomm driver to move us in the right direction. As
part of this:
1. We'll now support PIN_CONFIG_OUTPUT_ENABLE
2. We'll still support using PIN_CONFIG_INPUT_ENABLE to disable a
   pin's output (in violation of the docs) with a big comment in the
   code. This is needed because old device trees have "input-enable"
   in them and, in some cases, people might need the old
   behavior. While we could programmatically change all old device
   trees, it doesn't really hurt to keep supporting the old behavior
   and we're _supposed_ to try to be compatible with old device trees
   anyway.

It can also be noted that the PIN_CONFIG_INPUT_ENABLE handling code
seems to have purposefully ignored its argument. That means that old
boards that had _either_ "input-disable" or "input-enable" in them
would have had the effect of disabling a pin's output. While we could
change this behavior, since we're only leaving the
PIN_CONFIG_INPUT_ENABLE there for backward compatibility we might as
well be fully backward compatible.

NOTE: despite the fact that we'll still support
PIN_CONFIG_INPUT_ENABLE for _setting_ config, we take it away from
msm_config_group_get(). This appears to be only used for populating
debugfs and fixing debugfs to "output enabled" where relevant instead
of "input enabled" makes more sense and has more truthiness.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230323102605.8.Id740ae6a993f9313b58add6b10f6a92795d510d4@changeid
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-03-29 10:46:59 +02:00
..
Kconfig pinctrl: qcom: Introduce IPQ5332 TLMM driver 2023-02-07 15:44:39 +01:00
Makefile pinctrl: qcom: Introduce IPQ5332 TLMM driver 2023-02-07 15:44:39 +01:00
pinctrl-apq8064.c
pinctrl-apq8084.c
pinctrl-ipq4019.c pinctrl: qcom: ipq4019: add open drain support 2020-07-16 10:46:24 +02:00
pinctrl-ipq5332.c pinctrl: qcom: Introduce IPQ5332 TLMM driver 2023-02-07 15:44:39 +01:00
pinctrl-ipq6018.c pinctrl: qcom: ipq6018 Add missing pins in qpic pin group 2020-06-20 22:05:24 +02:00
pinctrl-ipq8064.c ipq8064: pinctrl: Fixed missing RGMII pincontrol definitions 2020-02-21 16:23:26 +01:00
pinctrl-ipq8074.c pinctrl: qcom: ipq8074: route gpio interrupts to APPS 2020-07-11 23:11:00 +02:00
pinctrl-lpass-lpi.c pinctrl: qcom: lpass-lpi: Remove duplicate assignment of of_gpio_n_cells 2023-01-16 15:02:16 +01:00
pinctrl-lpass-lpi.h pinctrl: qcom: Add missing header(s) 2022-10-24 17:06:46 +03:00
pinctrl-mdm9607.c pinctrl: qcom: Add MDM9607 pinctrl driver 2021-07-23 17:44:13 +02:00
pinctrl-mdm9615.c
pinctrl-msm8x74.c
pinctrl-msm8226.c pinctrl: qcom: msm8226: Add General Purpose clocks 2023-01-10 08:56:41 +01:00
pinctrl-msm8660.c
pinctrl-msm8909.c pinctrl: qcom: Add pinctrl driver for MSM8909 2022-07-11 10:26:52 +02:00
pinctrl-msm8916.c pinctrl: qcom: msm8916: Allow CAMSS GP clocks to be muxed 2022-06-26 00:54:10 +02:00
pinctrl-msm8953.c pinctrl: qcom: add pinctrl driver for msm8953 2020-11-10 14:58:14 +01:00
pinctrl-msm8960.c
pinctrl-msm8976.c pinctrl: qcom: pinctrl-msm8976: Correct function names for wcss pins 2023-01-09 14:40:22 +01:00
pinctrl-msm8994.c
pinctrl-msm8996.c
pinctrl-msm8998.c
pinctrl-msm.c pinctrl: qcom: Support OUTPUT_ENABLE; deprecate INPUT_ENABLE 2023-03-29 10:46:59 +02:00
pinctrl-msm.h pinctrl: qcom: Add support for i2c specific pull feature 2023-02-10 23:47:07 +01:00
pinctrl-qcm2290.c pinctrl: qcom: qcm2290: Add GPIO wakeirq map 2022-02-19 01:59:19 +01:00
pinctrl-qcs404.c
pinctrl-qdf2xxx.c
pinctrl-qdu1000.c pinctrl: qcom: Add QDU1000/QRU1000 pinctrl driver 2022-12-29 02:34:53 +01:00
pinctrl-sa8775p.c pinctrl: qcom: add the tlmm driver sa8775p platforms 2023-02-01 23:44:49 +01:00
pinctrl-sc7180.c pinctrl: qcom: Handle broken/missing PDC dual edge IRQs on sc7180 2020-07-16 15:41:41 +02:00
pinctrl-sc7280-lpass-lpi.c pinctrl: qcom: sc7280: Add clock optional check for ADSP bypass targets 2022-06-26 00:50:41 +02:00
pinctrl-sc7280.c pinctrl: qcom: sc7280: Add egpio support 2021-11-22 00:27:54 +01:00
pinctrl-sc8180x.c pinctrl: qcom: sc8180x: Fix wrong pin numbers 2022-08-22 10:57:07 +02:00
pinctrl-sc8280xp-lpass-lpi.c pinctrl: qcom: Add sc8280xp lpass lpi pinctrl driver 2022-08-25 14:32:04 +02:00
pinctrl-sc8280xp.c pinctrl: qcom: sc8280xp: Rectify UFS reset pins 2022-11-08 15:03:24 +01:00
pinctrl-sdm660.c
pinctrl-sdm670.c pinctrl: qcom: sdm670: change sdm670_reserved_gpios to static 2022-10-24 10:17:28 +02:00
pinctrl-sdm845.c pinctrl: qcom: sdm845: Enable dual edge errata 2021-11-16 02:19:15 +01:00
pinctrl-sdx55.c pinctrl: qcom: Fix duplication in gpio_groups 2021-06-07 00:18:55 +02:00
pinctrl-sdx65.c pinctrl: qcom: Add SDX65 pincontrol driver 2021-11-21 23:48:27 +01:00
pinctrl-sm6115.c drivers: qcom: pinctrl: Add pinctrl driver for sm6115 2021-07-31 23:23:06 +02:00
pinctrl-sm6125.c pinctrl: qcom: cleanup comments 2022-03-15 01:30:37 +01:00
pinctrl-sm6350.c pinctrl: qcom: sm6350: fix order of UFS & SDC pins 2022-04-18 01:38:24 +02:00
pinctrl-sm6375.c pinctrl: qcom: Add SM6375 TLMM driver 2022-07-26 09:28:53 +02:00
pinctrl-sm8150.c pinctrl: qcom: sm8150: Specify PDC map 2022-04-18 01:09:42 +02:00
pinctrl-sm8250-lpass-lpi.c pinctrl: qcom: Extract chip specific LPASS LPI code 2022-04-23 00:04:43 +02:00
pinctrl-sm8250.c pinctrl: qcom: sm8250: Fix PDC map 2022-08-03 20:20:56 +02:00
pinctrl-sm8350.c pinctrl: qcom: sm8350: Correct UFS and SDC offsets 2021-11-16 02:19:15 +01:00
pinctrl-sm8450-lpass-lpi.c pinctrl: qcom: sm8450-lpass-lpi: correct swr_rx_data group 2023-02-06 12:14:23 +01:00
pinctrl-sm8450.c pinctrl: qcom: sm8450: Add egpio support 2022-02-19 01:53:55 +01:00
pinctrl-sm8550-lpass-lpi.c pinctrl: qcom: pinctrl-sm8550-lpass-lpi: add SM8550 LPASS 2023-02-06 12:15:51 +01:00
pinctrl-sm8550.c pinctrl: qcom: Add support for i2c specific pull feature 2023-02-10 23:47:07 +01:00
pinctrl-spmi-gpio.c pinctrl: qcom: Unify accessing to device fwnode 2023-01-26 13:40:55 +01:00
pinctrl-spmi-mpp.c pinctrl: qcom: Unify accessing to device fwnode 2023-01-26 13:40:55 +01:00
pinctrl-ssbi-gpio.c pinctrl: qcom: Unify accessing to device fwnode 2023-01-26 13:40:55 +01:00
pinctrl-ssbi-mpp.c pinctrl: qcom: Unify accessing to device fwnode 2023-01-26 13:40:55 +01:00