@@ -881,6 +881,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
return !!dev->power.async_suspend;
}
+static inline bool device_platform_resources_pm_managed(struct device *dev)
+{
+ return dev->power.platform_resources_managed;
+}
+
+static inline void device_platform_resources_set_pm_managed(struct device *dev,
+ bool val)
+{
+ dev->power.platform_resources_managed = val;
+}
+
static inline bool device_pm_not_required(struct device *dev)
{
return dev->power.no_pm;
@@ -670,6 +670,7 @@ struct dev_pm_info {
bool no_pm:1;
bool early_init:1; /* Owned by the PM core */
bool direct_complete:1; /* Owned by the PM core */
+ bool platform_resources_managed:1;
u32 driver_flags;
spinlock_t lock;
#ifdef CONFIG_PM_SLEEP
Introduce a new dev_pm_info flag - platform_resources_managed, to indicate whether platform PM resources such as clocks or resets are managed externally (e.g. by a generic power domain driver) instead of directly by the consumer device driver. This flag enables device drivers to cooperate with SoC-specific PM domains by conditionally skipping management of clocks and resets when the platform owns them. This idea was discussed on the mailing list [1]. [1] - https://lore.kernel.org/all/CAPDyKFq=BF5f2i_Sr1cmVqtVAMgr=0FqsksL7RHZLKn++y0uwg@mail.gmail.com/ Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> --- include/linux/device.h | 11 +++++++++++ include/linux/pm.h | 1 + 2 files changed, 12 insertions(+)