android_kernel_oneplus_msm8998/drivers/pinctrl
Florian Fainelli 3f0ad8ee1d pinctrl: Really force states during suspend/resume
[ Upstream commit 981ed1bfbc6c4660b2ddaa8392893e20a6255048 ]

In case a platform only defaults a "default" set of pins, but not a
"sleep" set of pins, and this particular platform suspends and resumes
in a way that the pin states are not preserved by the hardware, when we
resume, we would call pinctrl_single_resume() -> pinctrl_force_default()
-> pinctrl_select_state() and the first thing we do is check that the
pins state is the same as before, and do nothing.

In order to fix this, decouple the actual state change from
pinctrl_select_state() and move it pinctrl_commit_state(), while keeping
the p->state == state check in pinctrl_select_state() not to change the
caller assumptions. pinctrl_force_sleep() and pinctrl_force_default()
are updated to bypass the state check by calling pinctrl_commit_state().

[Linus Walleij]
The forced pin control states are currently only used in some pin
controller drivers that grab their own reference to their own pins.
This is equal to the pin control hogs: pins taken by pin control
devices since there are no corresponding device in the Linux device
hierarchy, such as memory controller lines or unused GPIO lines,
or GPIO lines that are used orthogonally from the GPIO subsystem
but pincontrol-wise managed as hogs (non-strict mode, allowing
simultaneous use by GPIO and pin control). For this case forcing
the state from the drivers' suspend()/resume() callbacks makes
sense and should semantically match the name of the function.

Fixes: 6e5e959dde ("pinctrl: API changes to support multiple states per device")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
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-03-24 10:58:48 +01:00
..
bcm pinctrl-bcm2835: Fix cut-and-paste error in "pull" parsing 2016-04-12 09:08:37 -07:00
berlin pinctrl: berlin-bg4ct: fix the value for "sd1a" of pin SCRD0_CRD_PRES 2017-06-17 06:39:37 +02:00
freescale pinctrl: mxs: atomically switch mux and drive strength config 2017-07-15 11:57:46 +02:00
intel pinctrl: cherryview: Do not mask all interrupts in probe 2017-03-26 12:13:17 +02:00
mediatek pinctrl: mediatek: fix dual-edge code defect 2016-06-24 10:18:20 -07:00
meson pinctrl: meson: meson8b: fix the NAND DQS pins 2017-07-15 11:57:46 +02:00
mvebu
nomadik pinctrl: nomadik: fix pull debug print inversion 2016-04-20 15:42:08 +09:00
qcom pinctrl: qcom: Don't clear status bit on irq_unmask 2017-03-31 09:49:53 +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 pinctrl: atlas7: support atlas7 step B changes 2015-10-16 21:56:07 +02:00
spear
sunxi pinctrl: sunxi: Fix A80 interrupt pin bank 2018-02-25 11:03:39 +01:00
uniphier pinctrl: uniphier: fix .pin_dbg_show() callback 2016-10-07 15:23:41 +02:00
vt8500 pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
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 pinctrl: uniphier: guard uniphier directory with CONFIG_PINCTRL_UNIPHIER 2015-10-31 22:13:07 +01:00
pinconf-generic.c pinctrl: pinconf-generic: add "input-schmitt" DT property 2015-10-02 15:09:11 -07:00
pinconf.c pinctrl: pinconf: remove needless loop 2015-10-31 22:13:07 +01:00
pinconf.h
pinctrl-adi2-bf54x.c
pinctrl-adi2-bf60x.c
pinctrl-adi2.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-adi2.h
pinctrl-amd.c pinctrl/amd: Remove the default de-bounce time 2016-09-07 08:32:41 +02:00
pinctrl-amd.h
pinctrl-as3722.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: use %pr format string for resource 2016-09-24 10:07:42 +02:00
pinctrl-at91.c This is the bulk of GPIO changes for v4.4: 2015-11-02 12:59:12 -08:00
pinctrl-at91.h
pinctrl-coh901.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-coh901.h
pinctrl-digicolor.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-falcon.c
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-palmas.c
pinctrl-pistachio.c pinctrl: pistachio: fix mfio pll_lock pinmux 2016-09-24 10:07:41 +02:00
pinctrl-rockchip.c This is the bulk of GPIO changes for v4.4: 2015-11-02 12:59:12 -08:00
pinctrl-single.c pinctrl: single: Fix missing flush of posted write for a wakeirq 2016-08-10 11:49:27 +02:00
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-xusb: Correct lane mux options 2015-10-27 17:06:23 +01:00
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-pdc: Remove unneded semicolons 2015-10-02 04:06:46 -07:00
pinctrl-tz1090.c pinctrl: tz1090: Remove unneded semicolons 2015-10-02 04:06:46 -07:00
pinctrl-u300.c
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c pinctrl: replace trivial implementations of gpio_chip request/free 2015-10-16 22:20:21 +02:00
pinctrl-zynq.c pinctrl: zynq: fix UTF-8 errors 2015-10-31 22:12:59 +01:00
pinmux.c
pinmux.h