android_kernel_samsung_msm8976/drivers/pinctrl
Florian Fainelli eab07c50cf pinctrl: Really force states during suspend/resume
commit 981ed1bfbc6c4660b2ddaa8392893e20a6255048 upstream.

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: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:49:40 +02:00
..
mvebu
sh-pfc
spear
vt8500
Kconfig
Makefile
core.c
core.h
devicetree.c
devicetree.h
pinconf-generic.c
pinconf.c
pinconf.h
pinctrl-ab8500.c
pinctrl-ab8505.c
pinctrl-ab8540.c
pinctrl-ab9540.c
pinctrl-abx500.c
pinctrl-abx500.h
pinctrl-at91.c
pinctrl-bcm2835.c
pinctrl-coh901.c
pinctrl-coh901.h
pinctrl-exynos.c
pinctrl-exynos.h
pinctrl-exynos5440.c
pinctrl-falcon.c
pinctrl-imx.c
pinctrl-imx.h
pinctrl-imx6dl.c
pinctrl-imx6q.c
pinctrl-imx6sl.c
pinctrl-imx23.c
pinctrl-imx28.c
pinctrl-imx35.c
pinctrl-imx51.c
pinctrl-imx53.c
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-msm-tlmm.c
pinctrl-msm.c
pinctrl-msm.h
pinctrl-mxs.c
pinctrl-mxs.h
pinctrl-nomadik-db8500.c
pinctrl-nomadik-db8540.c
pinctrl-nomadik-stn8815.c
pinctrl-nomadik.c
pinctrl-nomadik.h
pinctrl-s3c64xx.c
pinctrl-samsung.c
pinctrl-samsung.h
pinctrl-single.c
pinctrl-sirf.c
pinctrl-sunxi.c
pinctrl-sunxi.h
pinctrl-tegra.c
pinctrl-tegra.h
pinctrl-tegra20.c
pinctrl-tegra30.c
pinctrl-tegra114.c
pinctrl-u300.c
pinctrl-xway.c
pinmux.c
pinmux.h
sec-pinmux.c