1
0
Fork 0
remarkable-linux/drivers/pinctrl
Douglas Anderson 07101e1c84 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:38:13 +02:00
..
aspeed pinctrl: aspeed: Rework strap register write logic for the AST2500 2017-08-31 13:39:38 +02:00
bcm pinctrl: nsp: Fix potential NULL dereference 2018-08-24 13:09:17 +02:00
berlin pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
freescale pinctrl: imx: off by one in imx_pinconf_group_dbg_show() 2018-09-19 22:43:42 +02:00
intel Revert "pinctrl: intel: Initialize GPIO properly when used through irqchip" 2018-04-29 11:33:09 +02:00
mediatek License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
meson pinctrl: meson-gxl: add tsin_a pins 2017-06-16 11:08:49 +02:00
mvebu pinctrl: armada-37xx: Fix direction_output() callback behavior 2017-12-14 09:52:49 +01:00
nomadik License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pxa pinctrl: pxa: pxa2xx: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2018-02-07 11:12:20 -08:00
qcom pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant 2018-09-26 08:38:13 +02:00
samsung pinctrl: samsung: Correct EINTG banks order 2018-07-03 11:24:56 +02:00
sh-pfc pinctrl: sh-pfc: r8a7796: Fix MOD_SEL register pin assignment for SSI pins group 2018-05-30 07:52:39 +02:00
sirf pinctrl: sirf: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:39:08 +02:00
spear License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sprd pinctrl: sprd: fix off by one bugs 2017-09-12 11:27:36 +02:00
stm32 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sunxi pinctrl: sunxi: Fix A64 UART mux value 2018-02-25 11:07:56 +01:00
tegra License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ti pinctrl: ti-iodelay: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:48 +02:00
uniphier License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vt8500 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zte pinctrl: zte: fix 'functions' allocation in zx_pinctrl_build_state() 2017-08-14 15:01:01 +02:00
Kconfig pinctrl: adi2: Fix Kconfig build problem 2017-12-20 10:10:34 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
core.c pinctrl: Really force states during suspend/resume 2018-03-24 11:01:26 +01:00
core.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
devicetree.c pinctrl: devicetree: Fix pctldev pointer overwrite 2018-07-03 11:24:56 +02:00
devicetree.h pinctrl: core: Use delayed work for hogs 2017-01-03 09:26:16 +01:00
pinconf-generic.c pinctrl: Add sleep related state to indicate sleep related configs 2017-08-31 09:15:21 +02:00
pinconf.c pinctrl: check ops->pin_config_set in pinconf_set_config() 2017-08-14 15:01:59 +02:00
pinconf.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
pinctrl-adi2-bf54x.c
pinctrl-adi2-bf60x.c added tabs instead of spaces 2015-07-16 09:39:01 +02:00
pinctrl-adi2.c pinctrl: adi2: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:40:45 +02:00
pinctrl-adi2.h
pinctrl-amd.c pinctrl/amd: only handle irq if it is pending and unmasked 2018-09-19 22:43:42 +02:00
pinctrl-amd.h pinctrl/amd: save pin registers over suspend/resume 2017-09-12 15:58:45 +02:00
pinctrl-artpec6.c pinctrl: artpec6: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:36:59 +02:00
pinctrl-as3722.c pinctrl: as3722: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:21 +02:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: add missing of_node_put 2018-08-03 07:50:31 +02:00
pinctrl-at91.c pinctrl: at91: add support for OUTPUT config 2016-10-31 09:16:46 +01:00
pinctrl-at91.h pinctrl: at91: use own header 2014-10-29 09:28:35 +01:00
pinctrl-coh901.c pinctrl: coh901: constify gpio_chip structure 2017-08-14 15:00:59 +02:00
pinctrl-coh901.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pinctrl-da850-pupd.c Merge branch 'ib-pinctrl-genprops' into devel 2017-01-26 15:27:54 +01:00
pinctrl-digicolor.c pinctrl: digicolor: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:39:36 +02:00
pinctrl-falcon.c pinctrl: update my email address 2016-12-30 09:17:02 +01:00
pinctrl-gemini.c pinctrl: add a Gemini SoC pin controller 2017-08-14 15:01:59 +02:00
pinctrl-ingenic.c pinctrl: ingenic: Fix inverted direction for < JZ4770 2018-08-24 13:09:17 +02:00
pinctrl-lantiq.c pinctrl: update my email address 2016-12-30 09:17:02 +01:00
pinctrl-lantiq.h pinctrl: update my email address 2016-12-30 09:17:02 +01:00
pinctrl-lpc18xx.c pinctrl: Widen the generic pinconf argument from 16 to 24 bits 2017-01-26 15:22:32 +01:00
pinctrl-max77620.c pinctrl: Widen the generic pinconf argument from 16 to 24 bits 2017-01-26 15:22:32 +01:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: spi: Fix regmap debugfs entries 2018-05-30 07:52:41 +02:00
pinctrl-oxnas.c pinctrl: oxnas: Add support for OX820 2016-10-24 16:30:14 +02:00
pinctrl-palmas.c pinctrl: Widen the generic pinconf argument from 16 to 24 bits 2017-01-26 15:22:32 +01:00
pinctrl-pic32.c pinctrl: pic32: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:24 +02:00
pinctrl-pic32.h pinctrl: pinctrl-pic32: Add PIC32 pin control driver 2016-02-05 23:54:47 +01:00
pinctrl-pistachio.c pinctrl: pistachio: fix mfio pll_lock pinmux 2016-08-22 15:28:35 +02:00
pinctrl-rk805.c pinctrl: Add pinctrl driver for the RK805 PMIC 2017-08-21 08:54:46 +01:00
pinctrl-rockchip.c pinctrl: rockchip: enable clock when reading pin direction register 2018-03-24 11:01:26 +01:00
pinctrl-rza1.c pinctrl: rza1: Fix selector use for groups and functions 2018-09-26 08:38:10 +02:00
pinctrl-single.c pinctrl: single: use of_device_get_match_data() to get soc data 2017-05-29 10:18:46 +02:00
pinctrl-st.c pinctrl: st: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:38:03 +02:00
pinctrl-sx150x.c pinctrl: sx150x: Add a static gpio/pinctrl pin range mapping 2018-02-16 20:23:08 +01:00
pinctrl-tb10x.c pinctrl: tb10x: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:41:40 +02:00
pinctrl-tz1090-pdc.c pinctrl: tz1090-pdc: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:00 +02:00
pinctrl-tz1090.c pinctrl: tz1090: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:19 +02:00
pinctrl-u300.c pinctrl: u300: make u300_pmx_registers static 2016-06-13 09:27:43 +02:00
pinctrl-utils.c pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map 2016-04-01 15:06:36 +02:00
pinctrl-utils.h pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map 2016-04-01 15:06:36 +02:00
pinctrl-xway.c pinctrl: xway: fix copy/paste error in xrx200_grps 2017-05-29 18:46:42 +02:00
pinctrl-zynq.c pinctrl: zynq: Fix warnings in the driver 2017-08-14 15:01:01 +02:00
pinmux.c pinctrl: add __rcu annotations to fix sparse warnings 2017-08-14 15:01:59 +02:00
pinmux.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00