MLK-17290-04 gpio: mxc: add runtime pm support
authorFugang Duan <fugang.duan@nxp.com>
Tue, 19 Dec 2017 07:47:08 +0000 (15:47 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:52:11 +0000 (14:52 -0500)
commit3fb6ee79fc99d7405c489b345539fac640351758
tree9a6010bbc27943e26e7a5a107fbfb77636ab26f8
parent977f07ddcde2a8dc9d2791733e84f7f7f500c701
MLK-17290-04 gpio: mxc: add runtime pm support

Add runtime pm support to automatically enable the ipg clock and power
domain if present.

To save power, suggest all sub-devices of the gpiochip/irq domain should
dynamically manage gpio/irq resouces like:
gpio:
gpiod_request()
... //set gpio direction
gpiod_free()
irq:
devm_request_irq() //=> module active
devm_free_irq() //=>module is non-active or runtime idle

Since the driver support irqchip and gpiochip, any irq/gpio resouce requested
by other modules the gpio controller clock and power domain should be enabled.
And the irqchip's parent's clock and power also should be enabled if irq resouce
requested.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Tested-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
drivers/gpio/gpio-mxc.c