PM: i2c-designware-platdrv: Use DPM_FLAG_SMART_PREPARE
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Jan 2018 00:35:54 +0000 (01:35 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 9 Jan 2018 23:48:25 +0000 (00:48 +0100)
commit422cb781e0d0f81789a1cc0f2171611028450f09
treea4fd7349a4e9c554a49a968b83ab53522bc0cf12
parent8425ec7faff005500aad89b9fc00e5ba91ac57b9
PM: i2c-designware-platdrv: Use DPM_FLAG_SMART_PREPARE

Modify i2c-designware-platdrv to set DPM_FLAG_SMART_PREPARE for its
devices and return 0 from the system suspend ->prepare callback
if the device has an ACPI companion object in order to tell the PM
core and middle layers to avoid skipping system suspend/resume
callbacks for the device in that case (which may be problematic,
because the device may be accessed during suspend and resume of
other devices via I2C operation regions then).

Also the pm_runtime_suspended() check in dw_i2c_plat_prepare()
is not necessary any more, because the core does it when setting
power.direct_complete for the device, so drop it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
drivers/i2c/busses/i2c-designware-platdrv.c