mutex_lock(&genpd->lock);
- if (genpd->prepared_count++ == 0)
+ if (genpd->prepared_count++ == 0) {
genpd->suspended_count = 0;
+ genpd->suspend_power_off = genpd->status == GPD_STATE_POWER_OFF;
+ }
mutex_unlock(&genpd->lock);
if (IS_ERR(genpd))
return -EINVAL;
- if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))
+ if (genpd->suspend_power_off ||
+ (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
return 0;
/*
if (IS_ERR(genpd))
return -EINVAL;
- if (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))
+ if (genpd->suspend_power_off ||
+ (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
return 0;
/*
unsigned int device_count; /* Number of devices */
unsigned int suspended_count; /* System suspend device counter */
unsigned int prepared_count; /* Suspend counter of prepared devices */
+ bool suspend_power_off; /* Power status before system suspend */
int (*power_off)(struct generic_pm_domain *domain);
s64 power_off_latency_ns;
int (*power_on)(struct generic_pm_domain *domain);