Commit c7c9e610 authored by Ulf Hansson's avatar Ulf Hansson Committed by Guodong Xu
Browse files

i2c: designware: Rework system PM support



The current code that is deployed to support system PM is complex and
relies on the so called "direct_complete" feature provided by the PM core.

Unfurtunate it also has a few drawbacks, explained below.

1)
In case of the ->prepare() callback find the device runtime resumed it
returns 0. The PM core will thus invoke the additonal system PM callbacks,
to allow the device to be suspended. Under these circumstances the device
also becomes unconditionally resumed at system PM resume. It would be
better to postpone that to be managed by runtime PM when actually needed,
but that isn't possible in this aproach.

2)
For various reasons, it's prefered to have the device's HW state to always
properly reflect its runtime PM status. In the same scenario as in 1), the
period in-between when the ->suspend() and ->resume() callback is invoked,
the runtime PM status becomes out of sync.

To simplify the code and to better adress 1) and 2), convert the system PM
support into deploying the so called runtime PM centric aproach, by using
the pm_runtime_force_suspend|resume() as the system PM callbacks.

Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent d581dde4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment