Thread (10 messages) 10 messages, 2 authors, 2015-05-20

[PATCH] i2c: designware: separate ops for system_sleep_pm and runtime_pm

flat view

From: mika.westerberg@linux.intel.com (Mika Westerberg)
Date: 2015-05-20 12:15:12
Also in: linux-i2c, lkml

On Wed, May 20, 2015 at 07:34:22PM +0800, Jisheng Zhang wrote:
Sorry for confusion. Considering one platform which doesn't support power off
the i2c host but it can disable the host's clock. So in such platform, when
the host is runtime suspended, its clock is disabled, then i2c_dw_disable() will
hang when s2ram.
Right. This happens also when the platform powers off the device.
Except using the runtime pm API to ensure the host is in
a correct state, is there any other solution? AFAIK, 'dev->power.direct_complete'
doesn't help such case.
What I had in mind is something like below:

static int i2c_dw_prepare(struct device *dev)
{
	return pm_runtime_suspended(dev);
}

static void i2c_dw_complete(struct device *dev)
{
	if (dev->power.direct_complete)
		pm_request_resume(dev);
}

In other words it checks if the device is already runtime suspended and
prevents ->suspend() etc. from being called.

If that does not work (I didn't try as this problem does not exist on
ACPI platforms because we have PM domain handling things) then we do not
have much of a choice than do what you suggest and runtime resume the
device on ->suspend()
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help