gpio: mxc: add runtime pm support
authorShenwei Wang <shenwei.wang@nxp.com>
Thu, 6 Jul 2023 14:56:11 +0000 (09:56 -0500)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 10 Jul 2023 07:56:09 +0000 (09:56 +0200)
commit3283d820dce649ad6d5eaa531d76251b4e22ad40
tree3b6199ab0c1e90ea52222ee8a6dfe228a84e22db
parente2051394a50c7dd49e9b56bfaf049a03972362ae
gpio: mxc: add runtime pm support

Add runtime PM support and allow the GPIO controller to enter
into runtime suspend automatically when not in use to save power.
However, it will automatically resume and enable clocks when a
GPIO or IRQ is requested.

While putting the GPIO module itself into power saving mode may not
have an obvious impact on current dissipation, the function is necessary
because the GPIO module disables its clock when idle. This enables the
system an opportunity to power off the parent subsystem, and this conserves
more power. The typical i.MX8 SoC features up to 8 GPIO controllers, but
most of the controllers often remain unused.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-mxc.c