aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_domain.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-03-13 17:39:48 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-03-16 16:44:59 -0400
commit1e78a0c7fc92aee076965d516cf54475c39e9894 (patch)
treea1a47b1adee44700480ff35d3f85a5ae8fdae390 /include/linux/pm_domain.h
parent65533bbf63b4f37723fdfedc73d0653958973323 (diff)
PM / Domains: Introduce "always on" device flag
The TMU device on the Mackerel board belongs to the A4R power domain and loses power when the domain is turned off. Unfortunately, the TMU driver is not prepared to cope with such situations and crashes the system when that happens. To work around this problem introduce a new helper function, pm_genpd_dev_always_on(), allowing a device driver to mark its device as "always on" in case it belongs to a PM domain, which will make the generic PM domains core code avoid powering off the domain containing the device, both at run time and during system suspend. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Tested-by: Simon Horman <horms@verge.net.au> Acked-by: Paul Mundt <lethal@linux-sh.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'include/linux/pm_domain.h')
-rw-r--r--include/linux/pm_domain.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 5c2bbc248c11..1236d262b3e8 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -99,6 +99,7 @@ struct generic_pm_domain_data {
99 struct gpd_dev_ops ops; 99 struct gpd_dev_ops ops;
100 struct gpd_timing_data td; 100 struct gpd_timing_data td;
101 bool need_restore; 101 bool need_restore;
102 bool always_on;
102}; 103};
103 104
104#ifdef CONFIG_PM_GENERIC_DOMAINS 105#ifdef CONFIG_PM_GENERIC_DOMAINS
@@ -137,6 +138,7 @@ static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
137 138
138extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, 139extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
139 struct device *dev); 140 struct device *dev);
141extern void pm_genpd_dev_always_on(struct device *dev, bool val);
140extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 142extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
141 struct generic_pm_domain *new_subdomain); 143 struct generic_pm_domain *new_subdomain);
142extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 144extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
@@ -179,6 +181,7 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
179{ 181{
180 return -ENOSYS; 182 return -ENOSYS;
181} 183}
184static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {}
182static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 185static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
183 struct generic_pm_domain *new_sd) 186 struct generic_pm_domain *new_sd)
184{ 187{