2019-06-04 10:11:33 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2010-10-13 00:13:10 +02:00
|
|
|
/*
|
|
|
|
|
* Generic OPP Interface
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2009-2010 Texas Instruments Incorporated.
|
|
|
|
|
* Nishanth Menon
|
|
|
|
|
* Romit Dasgupta
|
|
|
|
|
* Kevin Hilman
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __LINUX_OPP_H__
|
|
|
|
|
#define __LINUX_OPP_H__
|
|
|
|
|
|
|
|
|
|
#include <linux/err.h>
|
2011-09-30 22:35:12 +02:00
|
|
|
#include <linux/notifier.h>
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2016-12-01 16:28:20 +05:30
|
|
|
struct clk;
|
|
|
|
|
struct regulator;
|
2013-09-19 16:03:51 -05:00
|
|
|
struct dev_pm_opp;
|
2012-01-30 11:46:54 -05:00
|
|
|
struct device;
|
2016-11-30 16:21:25 +05:30
|
|
|
struct opp_table;
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
enum dev_pm_opp_event {
|
2014-11-27 08:54:06 +05:30
|
|
|
OPP_EVENT_ADD, OPP_EVENT_REMOVE, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
|
2011-09-30 22:35:12 +02:00
|
|
|
};
|
|
|
|
|
|
2016-12-01 16:28:17 +05:30
|
|
|
/**
|
|
|
|
|
* struct dev_pm_opp_supply - Power supply voltage/current values
|
|
|
|
|
* @u_volt: Target voltage in microvolts corresponding to this OPP
|
|
|
|
|
* @u_volt_min: Minimum voltage in microvolts corresponding to this OPP
|
|
|
|
|
* @u_volt_max: Maximum voltage in microvolts corresponding to this OPP
|
|
|
|
|
* @u_amp: Maximum current drawn by the device in microamperes
|
|
|
|
|
*
|
|
|
|
|
* This structure stores the voltage/current values for a single power supply.
|
|
|
|
|
*/
|
|
|
|
|
struct dev_pm_opp_supply {
|
|
|
|
|
unsigned long u_volt;
|
|
|
|
|
unsigned long u_volt_min;
|
|
|
|
|
unsigned long u_volt_max;
|
|
|
|
|
unsigned long u_amp;
|
|
|
|
|
};
|
|
|
|
|
|
2016-12-01 16:28:20 +05:30
|
|
|
/**
|
|
|
|
|
* struct dev_pm_opp_info - OPP freq/voltage/current values
|
|
|
|
|
* @rate: Target clk rate in hz
|
|
|
|
|
* @supplies: Array of voltage/current values for all power supplies
|
|
|
|
|
*
|
|
|
|
|
* This structure stores the freq/voltage/current values for a single OPP.
|
|
|
|
|
*/
|
|
|
|
|
struct dev_pm_opp_info {
|
|
|
|
|
unsigned long rate;
|
|
|
|
|
struct dev_pm_opp_supply *supplies;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* struct dev_pm_set_opp_data - Set OPP data
|
|
|
|
|
* @old_opp: Old OPP info
|
|
|
|
|
* @new_opp: New OPP info
|
|
|
|
|
* @regulators: Array of regulator pointers
|
|
|
|
|
* @regulator_count: Number of regulators
|
|
|
|
|
* @clk: Pointer to clk
|
|
|
|
|
* @dev: Pointer to the struct device
|
|
|
|
|
*
|
|
|
|
|
* This structure contains all information required for setting an OPP.
|
|
|
|
|
*/
|
|
|
|
|
struct dev_pm_set_opp_data {
|
|
|
|
|
struct dev_pm_opp_info old_opp;
|
|
|
|
|
struct dev_pm_opp_info new_opp;
|
|
|
|
|
|
|
|
|
|
struct regulator **regulators;
|
|
|
|
|
unsigned int regulator_count;
|
|
|
|
|
struct clk *clk;
|
|
|
|
|
struct device *dev;
|
|
|
|
|
};
|
|
|
|
|
|
2010-10-13 00:13:10 +02:00
|
|
|
#if defined(CONFIG_PM_OPP)
|
|
|
|
|
|
2017-01-23 10:11:42 +05:30
|
|
|
struct opp_table *dev_pm_opp_get_opp_table(struct device *dev);
|
2018-09-05 16:17:14 +05:30
|
|
|
struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index);
|
2017-01-23 10:11:42 +05:30
|
|
|
void dev_pm_opp_put_opp_table(struct opp_table *opp_table);
|
|
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2019-01-10 09:32:02 +05:30
|
|
|
unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp);
|
|
|
|
|
|
2015-07-09 17:43:35 +02:00
|
|
|
bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp);
|
|
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
int dev_pm_opp_get_opp_count(struct device *dev);
|
2015-07-29 16:23:03 +05:30
|
|
|
unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev);
|
2016-02-09 10:30:35 +05:30
|
|
|
unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev);
|
2016-02-09 10:30:36 +05:30
|
|
|
unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev);
|
2017-01-02 14:41:02 +05:30
|
|
|
unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
|
|
|
|
|
unsigned long freq,
|
|
|
|
|
bool available);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
|
|
|
|
|
unsigned long *freq);
|
2019-03-29 14:46:10 +08:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev,
|
|
|
|
|
unsigned long u_volt);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
|
|
|
|
|
unsigned long *freq);
|
2017-01-23 10:11:46 +05:30
|
|
|
void dev_pm_opp_put(struct dev_pm_opp *opp);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
int dev_pm_opp_add(struct device *dev, unsigned long freq,
|
|
|
|
|
unsigned long u_volt);
|
2014-11-27 08:54:06 +05:30
|
|
|
void dev_pm_opp_remove(struct device *dev, unsigned long freq);
|
2019-01-04 15:14:33 +05:30
|
|
|
void dev_pm_opp_remove_all_dynamic(struct device *dev);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
int dev_pm_opp_enable(struct device *dev, unsigned long freq);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
int dev_pm_opp_disable(struct device *dev, unsigned long freq);
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2017-01-02 14:41:03 +05:30
|
|
|
int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb);
|
|
|
|
|
int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb);
|
|
|
|
|
|
2017-01-23 10:11:43 +05:30
|
|
|
struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, unsigned int count);
|
|
|
|
|
void dev_pm_opp_put_supported_hw(struct opp_table *opp_table);
|
|
|
|
|
struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name);
|
|
|
|
|
void dev_pm_opp_put_prop_name(struct opp_table *opp_table);
|
2016-12-01 16:28:19 +05:30
|
|
|
struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count);
|
|
|
|
|
void dev_pm_opp_put_regulators(struct opp_table *opp_table);
|
2017-06-21 10:29:13 +05:30
|
|
|
struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name);
|
|
|
|
|
void dev_pm_opp_put_clkname(struct opp_table *opp_table);
|
2017-01-23 10:11:43 +05:30
|
|
|
struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
|
2017-10-05 17:26:21 +05:30
|
|
|
void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);
|
2019-05-08 15:19:13 +05:30
|
|
|
struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names);
|
|
|
|
|
void dev_pm_opp_detach_genpd(struct opp_table *opp_table);
|
2018-11-02 14:36:42 +05:30
|
|
|
int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
|
2016-02-09 10:30:39 +05:30
|
|
|
int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
|
2016-04-30 13:33:29 +02:00
|
|
|
int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask);
|
|
|
|
|
int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask);
|
2016-05-03 15:05:04 +01:00
|
|
|
void dev_pm_opp_remove_table(struct device *dev);
|
|
|
|
|
void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask);
|
2010-10-13 00:13:10 +02:00
|
|
|
#else
|
2017-01-23 10:11:42 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_get_opp_table(struct device *dev)
|
|
|
|
|
{
|
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-05 16:17:14 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index)
|
|
|
|
|
{
|
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-23 10:11:42 +05:30
|
|
|
static inline void dev_pm_opp_put_opp_table(struct opp_table *opp_table) {}
|
|
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
|
2010-10-13 00:13:10 +02:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
|
2010-10-13 00:13:10 +02:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-10 09:32:02 +05:30
|
|
|
static inline unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-09 17:43:35 +02:00
|
|
|
static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
static inline int dev_pm_opp_get_opp_count(struct device *dev)
|
2010-10-13 00:13:10 +02:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-29 16:23:03 +05:30
|
|
|
static inline unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-09 10:30:35 +05:30
|
|
|
static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-09 10:30:36 +05:30
|
|
|
static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-02 14:41:02 +05:30
|
|
|
static inline unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev)
|
2015-09-08 18:41:01 +02:00
|
|
|
{
|
2017-01-02 14:41:02 +05:30
|
|
|
return 0;
|
2015-09-08 18:41:01 +02:00
|
|
|
}
|
|
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
|
2010-10-13 00:13:10 +02:00
|
|
|
unsigned long freq, bool available)
|
|
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2010-10-13 00:13:10 +02:00
|
|
|
}
|
|
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
|
2010-10-13 00:13:10 +02:00
|
|
|
unsigned long *freq)
|
|
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2010-10-13 00:13:10 +02:00
|
|
|
}
|
|
|
|
|
|
2019-03-29 14:46:10 +08:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev,
|
|
|
|
|
unsigned long u_volt)
|
|
|
|
|
{
|
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-19 16:03:51 -05:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
|
2010-10-13 00:13:10 +02:00
|
|
|
unsigned long *freq)
|
|
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2010-10-13 00:13:10 +02:00
|
|
|
}
|
|
|
|
|
|
2017-01-23 10:11:46 +05:30
|
|
|
static inline void dev_pm_opp_put(struct dev_pm_opp *opp) {}
|
|
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
static inline int dev_pm_opp_add(struct device *dev, unsigned long freq,
|
2010-10-13 00:13:10 +02:00
|
|
|
unsigned long u_volt)
|
|
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return -ENOTSUPP;
|
2010-10-13 00:13:10 +02:00
|
|
|
}
|
|
|
|
|
|
2014-11-27 08:54:06 +05:30
|
|
|
static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-04 15:14:33 +05:30
|
|
|
static inline void dev_pm_opp_remove_all_dynamic(struct device *dev)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
|
2010-10-13 00:13:10 +02:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-19 16:03:50 -05:00
|
|
|
static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq)
|
2010-10-13 00:13:10 +02:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2011-09-30 22:35:12 +02:00
|
|
|
|
2017-01-02 14:41:03 +05:30
|
|
|
static inline int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb)
|
2011-09-30 22:35:12 +02:00
|
|
|
{
|
2017-01-02 14:41:03 +05:30
|
|
|
return -ENOTSUPP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb)
|
|
|
|
|
{
|
|
|
|
|
return -ENOTSUPP;
|
2011-09-30 22:35:12 +02:00
|
|
|
}
|
2015-12-09 08:01:46 +05:30
|
|
|
|
2017-01-23 10:11:43 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev,
|
|
|
|
|
const u32 *versions,
|
|
|
|
|
unsigned int count)
|
2015-12-09 08:01:46 +05:30
|
|
|
{
|
2017-01-23 10:11:43 +05:30
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2015-12-09 08:01:46 +05:30
|
|
|
}
|
|
|
|
|
|
2017-01-23 10:11:43 +05:30
|
|
|
static inline void dev_pm_opp_put_supported_hw(struct opp_table *opp_table) {}
|
2015-12-09 08:01:46 +05:30
|
|
|
|
2017-01-23 10:11:43 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev,
|
2016-12-01 16:28:21 +05:30
|
|
|
int (*set_opp)(struct dev_pm_set_opp_data *data))
|
|
|
|
|
{
|
2017-01-23 10:11:43 +05:30
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2016-12-01 16:28:21 +05:30
|
|
|
}
|
|
|
|
|
|
2017-10-05 17:26:21 +05:30
|
|
|
static inline void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table) {}
|
2016-12-01 16:28:21 +05:30
|
|
|
|
2017-01-23 10:11:43 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name)
|
2015-12-09 08:01:47 +05:30
|
|
|
{
|
2017-01-23 10:11:43 +05:30
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2015-12-09 08:01:47 +05:30
|
|
|
}
|
|
|
|
|
|
2017-01-23 10:11:43 +05:30
|
|
|
static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {}
|
2015-12-09 08:01:47 +05:30
|
|
|
|
2016-12-01 16:28:19 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count)
|
2016-02-09 10:30:33 +05:30
|
|
|
{
|
2016-11-30 16:21:25 +05:30
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2016-02-09 10:30:33 +05:30
|
|
|
}
|
|
|
|
|
|
2016-12-01 16:28:19 +05:30
|
|
|
static inline void dev_pm_opp_put_regulators(struct opp_table *opp_table) {}
|
2016-02-09 10:30:33 +05:30
|
|
|
|
2017-06-21 10:29:13 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name)
|
|
|
|
|
{
|
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {}
|
|
|
|
|
|
2019-05-08 15:19:13 +05:30
|
|
|
static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names)
|
2018-06-26 16:29:34 +05:30
|
|
|
{
|
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-08 15:19:13 +05:30
|
|
|
static inline void dev_pm_opp_detach_genpd(struct opp_table *opp_table) {}
|
2018-11-02 14:36:42 +05:30
|
|
|
|
|
|
|
|
static inline int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate)
|
|
|
|
|
{
|
|
|
|
|
return -ENOTSUPP;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-09 10:30:39 +05:30
|
|
|
static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
|
|
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return -ENOTSUPP;
|
2016-02-09 10:30:39 +05:30
|
|
|
}
|
|
|
|
|
|
2016-04-30 13:33:29 +02:00
|
|
|
static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask)
|
2016-04-21 14:28:55 +05:30
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return -ENOTSUPP;
|
2016-04-21 14:28:55 +05:30
|
|
|
}
|
|
|
|
|
|
2016-04-30 13:33:29 +02:00
|
|
|
static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
|
2016-04-27 08:52:23 +05:30
|
|
|
{
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-03 15:05:04 +01:00
|
|
|
static inline void dev_pm_opp_remove_table(struct device *dev)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-03 10:12:27 +01:00
|
|
|
#endif /* CONFIG_PM_OPP */
|
2010-10-13 00:13:10 +02:00
|
|
|
|
2013-02-21 11:04:45 +00:00
|
|
|
#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
|
2015-09-04 13:47:24 +05:30
|
|
|
int dev_pm_opp_of_add_table(struct device *dev);
|
2017-04-26 10:45:46 +05:30
|
|
|
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);
|
2015-09-04 13:47:24 +05:30
|
|
|
void dev_pm_opp_of_remove_table(struct device *dev);
|
2016-04-30 13:33:29 +02:00
|
|
|
int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask);
|
|
|
|
|
void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask);
|
|
|
|
|
int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask);
|
2017-02-03 11:29:26 -06:00
|
|
|
struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev);
|
2018-01-12 10:03:45 +05:30
|
|
|
struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp);
|
2018-12-14 15:20:56 +05:30
|
|
|
int of_get_required_opp_performance_state(struct device_node *np, int index);
|
2019-02-04 11:09:48 +00:00
|
|
|
void dev_pm_opp_of_register_em(struct cpumask *cpus);
|
2013-02-21 11:04:45 +00:00
|
|
|
#else
|
2015-09-04 13:47:24 +05:30
|
|
|
static inline int dev_pm_opp_of_add_table(struct device *dev)
|
2013-02-21 11:04:45 +00:00
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return -ENOTSUPP;
|
2013-02-21 11:04:45 +00:00
|
|
|
}
|
2014-11-27 08:54:06 +05:30
|
|
|
|
2017-04-26 10:45:46 +05:30
|
|
|
static inline int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
|
|
|
|
|
{
|
|
|
|
|
return -ENOTSUPP;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-04 13:47:24 +05:30
|
|
|
static inline void dev_pm_opp_of_remove_table(struct device *dev)
|
2014-11-27 08:54:06 +05:30
|
|
|
{
|
|
|
|
|
}
|
2015-06-12 17:10:38 +05:30
|
|
|
|
2016-04-30 13:33:29 +02:00
|
|
|
static inline int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask)
|
2015-06-12 17:10:38 +05:30
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return -ENOTSUPP;
|
2015-06-12 17:10:38 +05:30
|
|
|
}
|
|
|
|
|
|
2016-04-30 13:33:29 +02:00
|
|
|
static inline void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask)
|
2015-06-12 17:10:38 +05:30
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-30 13:33:29 +02:00
|
|
|
static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
|
2015-06-12 17:10:38 +05:30
|
|
|
{
|
2016-04-27 08:52:21 +05:30
|
|
|
return -ENOTSUPP;
|
2015-06-12 17:10:38 +05:30
|
|
|
}
|
2017-02-03 11:29:26 -06:00
|
|
|
|
|
|
|
|
static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2017-11-29 15:18:36 +05:30
|
|
|
|
2018-01-12 10:03:45 +05:30
|
|
|
static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2019-02-04 11:09:48 +00:00
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_of_register_em(struct cpumask *cpus)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-14 15:20:56 +05:30
|
|
|
static inline int of_get_required_opp_performance_state(struct device_node *np, int index)
|
2018-06-27 16:29:50 +05:30
|
|
|
{
|
2018-12-14 15:20:56 +05:30
|
|
|
return -ENOTSUPP;
|
2018-06-27 16:29:50 +05:30
|
|
|
}
|
2013-02-21 11:04:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
2010-10-13 00:13:10 +02:00
|
|
|
#endif /* __LINUX_OPP_H__ */
|