PM: domains: replace -ENOTSUPP with -EOPNOTSUPP
[linux-2.6-microblaze.git] / include / linux / pm_domain.h
index 66f3c5d..5fd20d1 100644 (file)
@@ -68,6 +68,13 @@ enum gpd_status {
        GENPD_STATE_OFF,        /* PM domain is off */
 };
 
+enum genpd_notication {
+       GENPD_NOTIFY_PRE_OFF = 0,
+       GENPD_NOTIFY_OFF,
+       GENPD_NOTIFY_PRE_ON,
+       GENPD_NOTIFY_ON,
+};
+
 struct dev_power_governor {
        bool (*power_down_ok)(struct dev_pm_domain *domain);
        bool (*suspend_ok)(struct device *dev);
@@ -82,6 +89,8 @@ struct genpd_power_state {
        s64 power_off_latency_ns;
        s64 power_on_latency_ns;
        s64 residency_ns;
+       u64 usage;
+       u64 rejected;
        struct fwnode_handle *fwnode;
        ktime_t idle_time;
        void *data;
@@ -112,6 +121,7 @@ struct generic_pm_domain {
        cpumask_var_t cpus;             /* A cpumask of the attached CPUs */
        int (*power_off)(struct generic_pm_domain *domain);
        int (*power_on)(struct generic_pm_domain *domain);
+       struct raw_notifier_head power_notifiers; /* Power on/off notifiers */
        struct opp_table *opp_table;    /* OPP table of the genpd */
        unsigned int (*opp_to_performance_state)(struct generic_pm_domain *genpd,
                                                 struct dev_pm_opp *opp);
@@ -178,6 +188,7 @@ struct generic_pm_domain_data {
        struct pm_domain_data base;
        struct gpd_timing_data td;
        struct notifier_block nb;
+       struct notifier_block *power_nb;
        int cpu;
        unsigned int performance_state;
        void *data;
@@ -204,6 +215,8 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
                  struct dev_power_governor *gov, bool is_off);
 int pm_genpd_remove(struct generic_pm_domain *genpd);
 int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state);
+int dev_pm_genpd_add_notifier(struct device *dev, struct notifier_block *nb);
+int dev_pm_genpd_remove_notifier(struct device *dev);
 
 extern struct dev_power_governor simple_qos_governor;
 extern struct dev_power_governor pm_domain_always_on_gov;
@@ -242,13 +255,24 @@ static inline int pm_genpd_init(struct generic_pm_domain *genpd,
 }
 static inline int pm_genpd_remove(struct generic_pm_domain *genpd)
 {
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
 
 static inline int dev_pm_genpd_set_performance_state(struct device *dev,
                                                     unsigned int state)
 {
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
+}
+
+static inline int dev_pm_genpd_add_notifier(struct device *dev,
+                                           struct notifier_block *nb)
+{
+       return -EOPNOTSUPP;
+}
+
+static inline int dev_pm_genpd_remove_notifier(struct device *dev)
+{
+       return -EOPNOTSUPP;
 }
 
 #define simple_qos_governor            (*(struct dev_power_governor *)(NULL))
@@ -301,13 +325,13 @@ struct device *genpd_dev_pm_attach_by_name(struct device *dev,
 static inline int of_genpd_add_provider_simple(struct device_node *np,
                                        struct generic_pm_domain *genpd)
 {
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
 
 static inline int of_genpd_add_provider_onecell(struct device_node *np,
                                        struct genpd_onecell_data *data)
 {
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
 
 static inline void of_genpd_del_provider(struct device_node *np) {}
@@ -363,7 +387,7 @@ static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
 static inline
 struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
 {
-       return ERR_PTR(-ENOTSUPP);
+       return ERR_PTR(-EOPNOTSUPP);
 }
 #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */