linux/drivers/pinctrl
Douglas Anderson 86312d58a9 pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant
[ Upstream commit 1cf86bc212 ]

If you do this on an sdm845 board:
  grep "" /sys/kernel/debug/pinctrl/*spmi:pmic*/pinconf-groups

...it looks like nonsense.  For every pin you see listed:
  input bias disabled, input bias high impedance, input bias pull down, input bias pull up, ...

That's because pmic_gpio_config_get() isn't complying with the rules
that pinconf_generic_dump_one() expects.  Specifically for boolean
parameters (anything with a "struct pin_config_item" where has_arg is
false) the function expects that the function should return its value
not through the "config" parameter but should return "0" if the value
is set and "-EINVAL" if the value isn't set.

Let's fix this.

>From a quick sample of other pinctrl drivers, it appears to be
tradition to also return 1 through the config parameter for these
boolean parameters when they exist.  I'm not one to knock tradition,
so I'll follow tradition and return 1 in these cases.  While I'm at
it, I'll also continue searching for four leaf clovers, kocking on
wood three times, and trying not to break mirrors.

NOTE: This also fixes an apparent typo for reading
PIN_CONFIG_BIAS_DISABLE where the old driver was accidentally
using "=" instead of "==" and thus was setting some internal
state when you tried to query PIN_CONFIG_BIAS_DISABLE.  Oops.

Fixes: eadff30244 ("pinctrl: Qualcomm SPMI PMIC GPIO pin controller driver")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:35:10 +02:00
..
bcm
berlin pinctrl: berlin-bg4ct: fix the value for "sd1a" of pin SCRD0_CRD_PRES 2017-06-17 06:39:37 +02:00
freescale pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show() 2018-09-05 09:18:39 +02:00
intel pinctrl: cherryview: Do not mask all interrupts in probe 2017-03-26 12:13:17 +02:00
mediatek
meson pinctrl: meson: meson8b: fix the NAND DQS pins 2017-07-15 11:57:46 +02:00
mvebu
nomadik
qcom pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant 2018-09-26 08:35:10 +02:00
samsung pinctrl: samsung: Remove bogus irq_[un]mask from resource management 2017-08-16 13:40:30 -07:00
sh-pfc pinctrl: sh-pfc: Update info pointer after SoC-specific init 2017-07-15 11:57:46 +02:00
sirf
spear
sunxi pinctrl: sunxi: Fix A80 interrupt pin bank 2018-02-25 11:03:39 +01:00
uniphier
vt8500
core.c pinctrl: Really force states during suspend/resume 2018-03-24 10:58:48 +01:00
core.h
devicetree.c
devicetree.h
Kconfig pinctrl: adi2: Fix Kconfig build problem 2017-12-20 10:05:00 +01:00
Makefile
pinconf-generic.c
pinconf.c
pinconf.h
pinctrl-adi2-bf54x.c
pinctrl-adi2-bf60x.c
pinctrl-adi2.c
pinctrl-adi2.h
pinctrl-amd.c
pinctrl-amd.h
pinctrl-as3722.c
pinctrl-at91-pio4.c pinctrl: at91-pio4: add missing of_node_put 2018-08-06 16:24:34 +02:00
pinctrl-at91.c
pinctrl-at91.h
pinctrl-coh901.c
pinctrl-coh901.h
pinctrl-digicolor.c
pinctrl-falcon.c
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-palmas.c
pinctrl-pistachio.c
pinctrl-rockchip.c
pinctrl-single.c
pinctrl-st.c pinctrl: st: add irq_request/release_resources callbacks 2017-12-25 14:22:11 +01:00
pinctrl-tb10x.c
pinctrl-tegra-xusb.c
pinctrl-tegra.c
pinctrl-tegra.h
pinctrl-tegra20.c
pinctrl-tegra30.c
pinctrl-tegra114.c
pinctrl-tegra124.c
pinctrl-tegra210.c
pinctrl-tz1090-pdc.c
pinctrl-tz1090.c
pinctrl-u300.c
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c
pinctrl-zynq.c
pinmux.c
pinmux.h