mailbox: imx: Support runtime PM
authorAnson Huang <Anson.Huang@nxp.com>
Mon, 13 Apr 2020 12:25:30 +0000 (20:25 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Sat, 30 May 2020 21:07:19 +0000 (16:07 -0500)
commit676f23eab75adbf72c029bdfb7b5a7b2f1129177
tree5fc1640847d2ce587584f6c43c34bcc2d23e739e
parent00d9990acb23c4319a1dc961d4e29a9213923b67
mailbox: imx: Support runtime PM

Some power hungry sub-systems like VPU has its own MUs which also
use mailbox driver, current mailbox driver uses platform driver
model and MU's power will be ON after driver probed and left ON
there, it may cause the whole sub-system can NOT enter lower power
mode, take VPU driver for example, it has runtime PM support, but
due to its MU always ON, the VPU sub-system will be always ON and
consume many power during kernel idle.

To save power in kernel idle, mailbox driver needs to support
runtime PM in order to power off MU when it is unused. However,
the runtime suspend/resume can ONLY be implemented in mailbox's
.shutdown/.startup callback, so its consumer needs to call
mbox_request_channel()/mbox_free_channel() in consumer driver's
runtime PM callback, then the MU's power will be ON/OFF along with
consumer's runtime PM status.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/imx-mailbox.c