2019-06-04 08:11:33 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00: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__
|
|
|
|
|
2020-05-27 09:58:54 +00:00
|
|
|
#include <linux/energy_model.h>
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
#include <linux/err.h>
|
2011-09-30 20:35:12 +00:00
|
|
|
#include <linux/notifier.h>
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2016-12-01 10:58:20 +00:00
|
|
|
struct clk;
|
|
|
|
struct regulator;
|
2013-09-19 21:03:51 +00:00
|
|
|
struct dev_pm_opp;
|
2012-01-30 16:46:54 +00:00
|
|
|
struct device;
|
2016-11-30 10:51:25 +00:00
|
|
|
struct opp_table;
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2013-09-19 21:03:51 +00:00
|
|
|
enum dev_pm_opp_event {
|
2014-11-27 03:24:06 +00:00
|
|
|
OPP_EVENT_ADD, OPP_EVENT_REMOVE, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
|
2019-10-16 14:57:53 +00:00
|
|
|
OPP_EVENT_ADJUST_VOLTAGE,
|
2011-09-30 20:35:12 +00:00
|
|
|
};
|
|
|
|
|
2016-12-01 10:58:17 +00:00
|
|
|
/**
|
|
|
|
* 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
|
2022-03-02 11:29:14 +00:00
|
|
|
* @u_watt: Power used by the device in microwatts
|
2016-12-01 10:58:17 +00:00
|
|
|
*
|
2022-03-02 11:29:14 +00:00
|
|
|
* This structure stores the voltage/current/power values for a single power
|
|
|
|
* supply.
|
2016-12-01 10:58:17 +00:00
|
|
|
*/
|
|
|
|
struct dev_pm_opp_supply {
|
|
|
|
unsigned long u_volt;
|
|
|
|
unsigned long u_volt_min;
|
|
|
|
unsigned long u_volt_max;
|
|
|
|
unsigned long u_amp;
|
2022-03-02 11:29:14 +00:00
|
|
|
unsigned long u_watt;
|
2016-12-01 10:58:17 +00:00
|
|
|
};
|
|
|
|
|
2020-05-12 12:53:21 +00:00
|
|
|
/**
|
|
|
|
* struct dev_pm_opp_icc_bw - Interconnect bandwidth values
|
|
|
|
* @avg: Average bandwidth corresponding to this OPP (in icc units)
|
|
|
|
* @peak: Peak bandwidth corresponding to this OPP (in icc units)
|
|
|
|
*
|
|
|
|
* This structure stores the bandwidth values for a single interconnect path.
|
|
|
|
*/
|
|
|
|
struct dev_pm_opp_icc_bw {
|
|
|
|
u32 avg;
|
|
|
|
u32 peak;
|
|
|
|
};
|
|
|
|
|
2022-07-04 08:15:08 +00:00
|
|
|
typedef int (*config_regulators_t)(struct device *dev,
|
|
|
|
struct dev_pm_opp *old_opp, struct dev_pm_opp *new_opp,
|
|
|
|
struct regulator **regulators, unsigned int count);
|
|
|
|
|
2022-06-10 06:32:04 +00:00
|
|
|
typedef int (*config_clks_t)(struct device *dev, struct opp_table *opp_table,
|
|
|
|
struct dev_pm_opp *opp, void *data, bool scaling_down);
|
|
|
|
|
2022-05-25 09:53:16 +00:00
|
|
|
/**
|
|
|
|
* struct dev_pm_opp_config - Device OPP configuration values
|
2022-06-10 06:32:04 +00:00
|
|
|
* @clk_names: Clk names, NULL terminated array.
|
|
|
|
* @config_clks: Custom set clk helper.
|
2022-05-25 09:53:16 +00:00
|
|
|
* @prop_name: Name to postfix to properties.
|
2022-07-04 08:15:08 +00:00
|
|
|
* @config_regulators: Custom set regulator helper.
|
2022-05-25 09:53:16 +00:00
|
|
|
* @supported_hw: Array of hierarchy of versions to match.
|
|
|
|
* @supported_hw_count: Number of elements in the array.
|
|
|
|
* @regulator_names: Array of pointers to the names of the regulator, NULL terminated.
|
|
|
|
* @genpd_names: Null terminated array of pointers containing names of genpd to
|
|
|
|
* attach.
|
|
|
|
* @virt_devs: Pointer to return the array of virtual devices.
|
|
|
|
*
|
|
|
|
* This structure contains platform specific OPP configurations for the device.
|
|
|
|
*/
|
|
|
|
struct dev_pm_opp_config {
|
|
|
|
/* NULL terminated */
|
|
|
|
const char * const *clk_names;
|
2022-06-10 06:32:04 +00:00
|
|
|
config_clks_t config_clks;
|
2022-05-25 09:53:16 +00:00
|
|
|
const char *prop_name;
|
2022-07-04 08:15:08 +00:00
|
|
|
config_regulators_t config_regulators;
|
2022-05-25 09:53:16 +00:00
|
|
|
const unsigned int *supported_hw;
|
|
|
|
unsigned int supported_hw_count;
|
|
|
|
const char * const *regulator_names;
|
|
|
|
const char * const *genpd_names;
|
|
|
|
struct device ***virt_devs;
|
|
|
|
};
|
|
|
|
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
#if defined(CONFIG_PM_OPP)
|
|
|
|
|
2017-01-23 04:41:42 +00:00
|
|
|
struct opp_table *dev_pm_opp_get_opp_table(struct device *dev);
|
|
|
|
void dev_pm_opp_put_opp_table(struct opp_table *opp_table);
|
|
|
|
|
2013-09-19 21:03:51 +00:00
|
|
|
unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2022-05-31 07:54:21 +00:00
|
|
|
int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supply *supplies);
|
|
|
|
|
2022-03-02 11:29:14 +00:00
|
|
|
unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp);
|
|
|
|
|
2023-07-20 05:40:53 +00:00
|
|
|
unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index);
|
|
|
|
|
2019-01-10 04:02:02 +00:00
|
|
|
unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp);
|
|
|
|
|
2021-01-18 00:55:19 +00:00
|
|
|
unsigned int dev_pm_opp_get_required_pstate(struct dev_pm_opp *opp,
|
|
|
|
unsigned int index);
|
|
|
|
|
2015-07-09 15:43:35 +00:00
|
|
|
bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp);
|
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
int dev_pm_opp_get_opp_count(struct device *dev);
|
2015-07-29 10:53:03 +00:00
|
|
|
unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev);
|
2016-02-09 05:00:35 +00:00
|
|
|
unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev);
|
2016-02-09 05:00:36 +00:00
|
|
|
unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev);
|
2017-01-02 09:11:02 +00:00
|
|
|
unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2013-09-19 21:03:51 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
|
|
|
|
unsigned long freq,
|
|
|
|
bool available);
|
2023-07-21 08:04:54 +00:00
|
|
|
|
2023-07-21 08:11:20 +00:00
|
|
|
struct dev_pm_opp *
|
|
|
|
dev_pm_opp_find_freq_exact_indexed(struct device *dev, unsigned long freq,
|
|
|
|
u32 index, bool available);
|
|
|
|
|
2013-09-19 21:03:51 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
|
|
|
|
unsigned long *freq);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2023-07-20 05:40:52 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_floor_indexed(struct device *dev,
|
|
|
|
unsigned long *freq, u32 index);
|
|
|
|
|
2023-07-21 08:04:54 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
|
|
|
|
unsigned long *freq);
|
|
|
|
|
2023-07-20 05:40:52 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_freq_ceil_indexed(struct device *dev,
|
|
|
|
unsigned long *freq, u32 index);
|
|
|
|
|
2022-05-04 10:10:22 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
|
|
|
|
unsigned int level);
|
2023-07-21 08:04:54 +00:00
|
|
|
|
2022-05-04 10:10:22 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
|
|
|
|
unsigned int *level);
|
|
|
|
|
2022-05-04 08:17:32 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev,
|
|
|
|
unsigned int *bw, int index);
|
|
|
|
|
|
|
|
struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
|
|
|
|
unsigned int *bw, int index);
|
|
|
|
|
2017-01-23 04:41:46 +00:00
|
|
|
void dev_pm_opp_put(struct dev_pm_opp *opp);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
int dev_pm_opp_add(struct device *dev, unsigned long freq,
|
|
|
|
unsigned long u_volt);
|
2014-11-27 03:24:06 +00:00
|
|
|
void dev_pm_opp_remove(struct device *dev, unsigned long freq);
|
2019-01-04 09:44:33 +00:00
|
|
|
void dev_pm_opp_remove_all_dynamic(struct device *dev);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2019-10-16 14:57:53 +00:00
|
|
|
int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
|
|
|
|
unsigned long u_volt, unsigned long u_volt_min,
|
|
|
|
unsigned long u_volt_max);
|
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
int dev_pm_opp_enable(struct device *dev, unsigned long freq);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
int dev_pm_opp_disable(struct device *dev, unsigned long freq);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2017-01-02 09:11:03 +00:00
|
|
|
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);
|
|
|
|
|
2022-05-25 09:53:16 +00:00
|
|
|
int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config);
|
|
|
|
int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config);
|
|
|
|
void dev_pm_opp_clear_config(int token);
|
2022-06-10 07:07:25 +00:00
|
|
|
int dev_pm_opp_config_clks_simple(struct device *dev,
|
|
|
|
struct opp_table *opp_table, struct dev_pm_opp *opp, void *data,
|
|
|
|
bool scaling_down);
|
2022-05-25 09:53:16 +00:00
|
|
|
|
2021-02-04 08:14:22 +00:00
|
|
|
struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table, struct opp_table *dst_table, struct dev_pm_opp *src_opp);
|
2018-11-02 09:06:42 +00:00
|
|
|
int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
|
2016-02-09 05:00:39 +00:00
|
|
|
int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
|
2021-01-21 06:45:36 +00:00
|
|
|
int dev_pm_opp_set_opp(struct device *dev, struct dev_pm_opp *opp);
|
2016-04-30 11:33:29 +00: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 14:05:04 +00:00
|
|
|
void dev_pm_opp_remove_table(struct device *dev);
|
|
|
|
void dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask);
|
2021-01-20 22:26:47 +00:00
|
|
|
int dev_pm_opp_sync_regulators(struct device *dev);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
#else
|
2017-01-23 04:41:42 +00:00
|
|
|
static inline struct opp_table *dev_pm_opp_get_opp_table(struct device *dev)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
2017-01-23 04:41:42 +00:00
|
|
|
}
|
|
|
|
|
2018-09-05 10:47:14 +00:00
|
|
|
static inline struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
2018-09-05 10:47:14 +00:00
|
|
|
}
|
|
|
|
|
2017-01-23 04:41:42 +00:00
|
|
|
static inline void dev_pm_opp_put_opp_table(struct opp_table *opp_table) {}
|
|
|
|
|
2013-09-19 21:03:51 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2022-05-31 07:54:21 +00:00
|
|
|
static inline int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supply *supplies)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2022-03-02 11:29:14 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-07-20 05:40:53 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_freq_indexed(struct dev_pm_opp *opp, u32 index)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-01-10 04:02:02 +00:00
|
|
|
static inline unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-01-18 00:55:19 +00:00
|
|
|
static inline
|
|
|
|
unsigned int dev_pm_opp_get_required_pstate(struct dev_pm_opp *opp,
|
|
|
|
unsigned int index)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-07-09 15:43:35 +00:00
|
|
|
static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
static inline int dev_pm_opp_get_opp_count(struct device *dev)
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-07-29 10:53:03 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-02-09 05:00:35 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-02-09 05:00:36 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-01-02 09:11:02 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev)
|
2015-09-08 16:41:01 +00:00
|
|
|
{
|
2017-01-02 09:11:02 +00:00
|
|
|
return 0;
|
2015-09-08 16:41:01 +00:00
|
|
|
}
|
|
|
|
|
2023-07-21 08:04:54 +00:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
|
|
|
|
unsigned long freq, bool available)
|
2019-07-25 10:41:29 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
2019-07-25 10:41:29 +00:00
|
|
|
}
|
|
|
|
|
2023-07-21 08:11:20 +00:00
|
|
|
static inline struct dev_pm_opp *
|
|
|
|
dev_pm_opp_find_freq_exact_indexed(struct device *dev, unsigned long freq,
|
|
|
|
u32 index, bool available)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
}
|
|
|
|
|
2023-07-21 08:04:54 +00:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
|
|
|
|
unsigned long *freq)
|
2021-01-18 00:55:18 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
2021-01-18 00:55:18 +00:00
|
|
|
}
|
|
|
|
|
2023-07-20 05:40:52 +00:00
|
|
|
static inline struct dev_pm_opp *
|
|
|
|
dev_pm_opp_find_freq_floor_indexed(struct device *dev, unsigned long *freq, u32 index)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
}
|
|
|
|
|
2023-07-21 08:04:54 +00:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
|
|
|
|
unsigned long *freq)
|
2022-05-04 10:10:22 +00:00
|
|
|
{
|
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
}
|
|
|
|
|
2023-07-20 05:40:52 +00:00
|
|
|
static inline struct dev_pm_opp *
|
|
|
|
dev_pm_opp_find_freq_ceil_indexed(struct device *dev, unsigned long *freq, u32 index)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
}
|
|
|
|
|
2023-07-21 08:04:54 +00:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
|
|
|
|
unsigned int level)
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
}
|
|
|
|
|
2023-07-21 08:04:54 +00:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
|
|
|
|
unsigned int *level)
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
}
|
|
|
|
|
2022-05-04 08:17:32 +00:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev,
|
|
|
|
unsigned int *bw, int index)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
|
|
|
|
unsigned int *bw, int index)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
}
|
|
|
|
|
2017-01-23 04:41:46 +00:00
|
|
|
static inline void dev_pm_opp_put(struct dev_pm_opp *opp) {}
|
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
static inline int dev_pm_opp_add(struct device *dev, unsigned long freq,
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
unsigned long u_volt)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
}
|
|
|
|
|
2014-11-27 03:24:06 +00:00
|
|
|
static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-01-04 09:44:33 +00:00
|
|
|
static inline void dev_pm_opp_remove_all_dynamic(struct device *dev)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-10-16 14:57:53 +00:00
|
|
|
static inline int
|
|
|
|
dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
|
|
|
|
unsigned long u_volt, unsigned long u_volt_min,
|
|
|
|
unsigned long u_volt_max)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-09-19 21:03:50 +00:00
|
|
|
static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq)
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2011-09-30 20:35:12 +00:00
|
|
|
|
2017-01-02 09:11:03 +00:00
|
|
|
static inline int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb)
|
2011-09-30 20:35:12 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2017-01-02 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2011-09-30 20:35:12 +00:00
|
|
|
}
|
2015-12-09 02:31:46 +00:00
|
|
|
|
2022-05-25 09:53:16 +00:00
|
|
|
static inline int dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_clear_config(int token) {}
|
|
|
|
|
2022-06-10 07:07:25 +00:00
|
|
|
static inline int dev_pm_opp_config_clks_simple(struct device *dev,
|
|
|
|
struct opp_table *opp_table, struct dev_pm_opp *opp, void *data,
|
|
|
|
bool scaling_down)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2021-02-04 08:14:22 +00:00
|
|
|
static inline struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table,
|
|
|
|
struct opp_table *dst_table, struct dev_pm_opp *src_opp)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
|
|
}
|
|
|
|
|
2018-11-02 09:06:42 +00:00
|
|
|
static inline int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2018-11-02 09:06:42 +00:00
|
|
|
}
|
|
|
|
|
2016-02-09 05:00:39 +00:00
|
|
|
static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2016-02-09 05:00:39 +00:00
|
|
|
}
|
|
|
|
|
2021-01-21 06:45:36 +00:00
|
|
|
static inline int dev_pm_opp_set_opp(struct device *dev, struct dev_pm_opp *opp)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2021-01-21 06:45:36 +00:00
|
|
|
}
|
|
|
|
|
2016-04-30 11:33:29 +00:00
|
|
|
static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask)
|
2016-04-21 08:58:55 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2016-04-21 08:58:55 +00:00
|
|
|
}
|
|
|
|
|
2016-04-30 11:33:29 +00:00
|
|
|
static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
|
2016-04-27 03:22:23 +00:00
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2016-05-03 14:05:04 +00: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)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-01-20 22:26:47 +00:00
|
|
|
static inline int dev_pm_opp_sync_regulators(struct device *dev)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2021-01-20 22:26:47 +00:00
|
|
|
}
|
|
|
|
|
2011-11-03 09:12:27 +00:00
|
|
|
#endif /* CONFIG_PM_OPP */
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
|
2013-02-21 11:04:45 +00:00
|
|
|
#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
|
2015-09-04 08:17:24 +00:00
|
|
|
int dev_pm_opp_of_add_table(struct device *dev);
|
2017-04-26 05:15:46 +00:00
|
|
|
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);
|
2021-09-20 17:22:46 +00:00
|
|
|
int devm_pm_opp_of_add_table_indexed(struct device *dev, int index);
|
2015-09-04 08:17:24 +00:00
|
|
|
void dev_pm_opp_of_remove_table(struct device *dev);
|
2021-03-14 16:33:57 +00:00
|
|
|
int devm_pm_opp_of_add_table(struct device *dev);
|
2016-04-30 11:33:29 +00: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 17:29:26 +00:00
|
|
|
struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev);
|
2018-01-12 04:33:45 +00:00
|
|
|
struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp);
|
2018-12-14 09:50:56 +00:00
|
|
|
int of_get_required_opp_performance_state(struct device_node *np, int index);
|
2020-05-12 12:53:21 +00:00
|
|
|
int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table);
|
2020-05-27 09:58:54 +00:00
|
|
|
int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus);
|
|
|
|
static inline void dev_pm_opp_of_unregister_em(struct device *dev)
|
|
|
|
{
|
|
|
|
em_dev_unregister_perf_domain(dev);
|
|
|
|
}
|
2013-02-21 11:04:45 +00:00
|
|
|
#else
|
2015-09-04 08:17:24 +00:00
|
|
|
static inline int dev_pm_opp_of_add_table(struct device *dev)
|
2013-02-21 11:04:45 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2013-02-21 11:04:45 +00:00
|
|
|
}
|
2014-11-27 03:24:06 +00:00
|
|
|
|
2017-04-26 05:15:46 +00:00
|
|
|
static inline int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2017-04-26 05:15:46 +00:00
|
|
|
}
|
|
|
|
|
2021-09-20 17:22:46 +00:00
|
|
|
static inline int devm_pm_opp_of_add_table_indexed(struct device *dev, int index)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-09-04 08:17:24 +00:00
|
|
|
static inline void dev_pm_opp_of_remove_table(struct device *dev)
|
2014-11-27 03:24:06 +00:00
|
|
|
{
|
|
|
|
}
|
2015-06-12 11:40:38 +00:00
|
|
|
|
2021-03-14 16:33:57 +00:00
|
|
|
static inline int devm_pm_opp_of_add_table(struct device *dev)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2016-04-30 11:33:29 +00:00
|
|
|
static inline int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask)
|
2015-06-12 11:40:38 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2015-06-12 11:40:38 +00:00
|
|
|
}
|
|
|
|
|
2016-04-30 11:33:29 +00:00
|
|
|
static inline void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask)
|
2015-06-12 11:40:38 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-04-30 11:33:29 +00:00
|
|
|
static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
|
2015-06-12 11:40:38 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2015-06-12 11:40:38 +00:00
|
|
|
}
|
2017-02-03 17:29:26 +00:00
|
|
|
|
|
|
|
static inline struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2017-11-29 09:48:36 +00:00
|
|
|
|
2018-01-12 04:33:45 +00:00
|
|
|
static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
PM / OPP: Introduce a power estimation helper
The Energy Model (EM) framework provides an API to let drivers register
the active power of CPUs. The drivers are expected to provide a callback
method which estimates the power consumed by a CPU at each available
performance levels. How exactly this should be implemented, however,
depends on the platform.
On some systems, PM_OPP knows the voltage and frequency at which CPUs
can run. When coupled with the CPU 'capacitance' (as provided by the
'dynamic-power-coefficient' devicetree binding), it is possible to
estimate the dynamic power consumption of a CPU as P = C * V^2 * f, with
C its capacitance and V and f respectively the voltage and frequency of
the OPP. The Intelligent Power Allocator (IPA) thermal governor already
implements that estimation method, in the thermal framework.
However, this power estimation method can be applied to any platform
where all the parameters are known (C, V and f), and not only those
suffering thermal issues. As such, the code implementing this feature
can be re-used to also populate the EM framework now used by EAS.
As a first step, introduce in PM_OPP a helper function which CPUFreq
drivers can use to register into the EM framework. This duplicates the
power estimation done in IPA until it can be migrated to using the EM
framework. This will be done later, once the EM framework has support
for at least all platforms currently supported by IPA.
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-02-04 11:09:48 +00:00
|
|
|
|
2020-05-27 09:58:54 +00:00
|
|
|
static inline int dev_pm_opp_of_register_em(struct device *dev,
|
|
|
|
struct cpumask *cpus)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2020-05-27 09:58:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_of_unregister_em(struct device *dev)
|
PM / OPP: Introduce a power estimation helper
The Energy Model (EM) framework provides an API to let drivers register
the active power of CPUs. The drivers are expected to provide a callback
method which estimates the power consumed by a CPU at each available
performance levels. How exactly this should be implemented, however,
depends on the platform.
On some systems, PM_OPP knows the voltage and frequency at which CPUs
can run. When coupled with the CPU 'capacitance' (as provided by the
'dynamic-power-coefficient' devicetree binding), it is possible to
estimate the dynamic power consumption of a CPU as P = C * V^2 * f, with
C its capacitance and V and f respectively the voltage and frequency of
the OPP. The Intelligent Power Allocator (IPA) thermal governor already
implements that estimation method, in the thermal framework.
However, this power estimation method can be applied to any platform
where all the parameters are known (C, V and f), and not only those
suffering thermal issues. As such, the code implementing this feature
can be re-used to also populate the EM framework now used by EAS.
As a first step, introduce in PM_OPP a helper function which CPUFreq
drivers can use to register into the EM framework. This duplicates the
power estimation done in IPA until it can be migrated to using the EM
framework. This will be done later, once the EM framework has support
for at least all platforms currently supported by IPA.
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-02-04 11:09:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-12-14 09:50:56 +00:00
|
|
|
static inline int of_get_required_opp_performance_state(struct device_node *np, int index)
|
2018-06-27 10:59:50 +00:00
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2018-06-27 10:59:50 +00:00
|
|
|
}
|
2020-05-12 12:53:21 +00:00
|
|
|
|
|
|
|
static inline int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table)
|
|
|
|
{
|
2021-02-01 05:18:54 +00:00
|
|
|
return -EOPNOTSUPP;
|
2020-05-12 12:53:21 +00:00
|
|
|
}
|
2013-02-21 11:04:45 +00:00
|
|
|
#endif
|
|
|
|
|
2022-07-04 11:06:26 +00:00
|
|
|
/* OPP Configuration helpers */
|
|
|
|
|
|
|
|
/* Regulators helpers */
|
|
|
|
static inline int dev_pm_opp_set_regulators(struct device *dev,
|
|
|
|
const char * const names[])
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.regulator_names = names,
|
|
|
|
};
|
|
|
|
|
|
|
|
return dev_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_put_regulators(int token)
|
|
|
|
{
|
|
|
|
dev_pm_opp_clear_config(token);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int devm_pm_opp_set_regulators(struct device *dev,
|
|
|
|
const char * const names[])
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.regulator_names = names,
|
|
|
|
};
|
|
|
|
|
|
|
|
return devm_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
2022-05-26 04:06:27 +00:00
|
|
|
/* Supported-hw helpers */
|
|
|
|
static inline int dev_pm_opp_set_supported_hw(struct device *dev,
|
|
|
|
const u32 *versions,
|
|
|
|
unsigned int count)
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.supported_hw = versions,
|
|
|
|
.supported_hw_count = count,
|
|
|
|
};
|
|
|
|
|
|
|
|
return dev_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_put_supported_hw(int token)
|
|
|
|
{
|
|
|
|
dev_pm_opp_clear_config(token);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int devm_pm_opp_set_supported_hw(struct device *dev,
|
|
|
|
const u32 *versions,
|
|
|
|
unsigned int count)
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.supported_hw = versions,
|
|
|
|
.supported_hw_count = count,
|
|
|
|
};
|
|
|
|
|
|
|
|
return devm_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
2022-05-26 04:06:27 +00:00
|
|
|
/* clkname helpers */
|
|
|
|
static inline int dev_pm_opp_set_clkname(struct device *dev, const char *name)
|
|
|
|
{
|
|
|
|
const char *names[] = { name, NULL };
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.clk_names = names,
|
|
|
|
};
|
|
|
|
|
|
|
|
return dev_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_put_clkname(int token)
|
|
|
|
{
|
|
|
|
dev_pm_opp_clear_config(token);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int devm_pm_opp_set_clkname(struct device *dev, const char *name)
|
|
|
|
{
|
|
|
|
const char *names[] = { name, NULL };
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.clk_names = names,
|
|
|
|
};
|
|
|
|
|
|
|
|
return devm_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
2022-07-04 08:15:08 +00:00
|
|
|
/* config-regulators helpers */
|
|
|
|
static inline int dev_pm_opp_set_config_regulators(struct device *dev,
|
|
|
|
config_regulators_t helper)
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.config_regulators = helper,
|
|
|
|
};
|
|
|
|
|
|
|
|
return dev_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_put_config_regulators(int token)
|
|
|
|
{
|
|
|
|
dev_pm_opp_clear_config(token);
|
2022-05-26 04:06:27 +00:00
|
|
|
}
|
|
|
|
|
2022-05-26 04:06:27 +00:00
|
|
|
/* genpd helpers */
|
|
|
|
static inline int dev_pm_opp_attach_genpd(struct device *dev,
|
|
|
|
const char * const *names,
|
|
|
|
struct device ***virt_devs)
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.genpd_names = names,
|
|
|
|
.virt_devs = virt_devs,
|
|
|
|
};
|
|
|
|
|
|
|
|
return dev_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_detach_genpd(int token)
|
|
|
|
{
|
|
|
|
dev_pm_opp_clear_config(token);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int devm_pm_opp_attach_genpd(struct device *dev,
|
|
|
|
const char * const *names,
|
|
|
|
struct device ***virt_devs)
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.genpd_names = names,
|
|
|
|
.virt_devs = virt_devs,
|
|
|
|
};
|
|
|
|
|
|
|
|
return devm_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
2022-05-26 04:06:27 +00:00
|
|
|
/* prop-name helpers */
|
|
|
|
static inline int dev_pm_opp_set_prop_name(struct device *dev, const char *name)
|
|
|
|
{
|
|
|
|
struct dev_pm_opp_config config = {
|
|
|
|
.prop_name = name,
|
|
|
|
};
|
|
|
|
|
|
|
|
return dev_pm_opp_set_config(dev, &config);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dev_pm_opp_put_prop_name(int token)
|
|
|
|
{
|
|
|
|
dev_pm_opp_clear_config(token);
|
|
|
|
}
|
2022-05-26 04:06:27 +00:00
|
|
|
|
2023-07-21 09:25:07 +00:00
|
|
|
static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
|
|
|
|
{
|
|
|
|
return dev_pm_opp_get_freq_indexed(opp, 0);
|
|
|
|
}
|
|
|
|
|
PM: Introduce library for device-specific OPPs (v7)
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs. The actual
definitions of OPP varies over silicon versions. For a specific domain,
we can have a set of {frequency, voltage} pairs. As the kernel boots
and more information is available, a default set of these are activated
based on the precise nature of device. Further on operation, based on
conditions prevailing in the system (such as temperature), some OPP
availability may be temporarily controlled by the SoC frameworks.
To implement an OPP, some sort of power management support is necessary
hence this library depends on CONFIG_PM.
Contributions include:
Sanjeev Premi for the initial concept:
http://patchwork.kernel.org/patch/50998/
Kevin Hilman for converting original design to device-based.
Kevin Hilman and Paul Walmsey for cleaning up many of the function
abstractions, improvements and data structure handling.
Romit Dasgupta for using enums instead of opp pointers.
Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and
cleanups.
Linus Walleij for recommending this layer be made generic for usage
in other architectures beyond OMAP and ARM.
Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for
valuable improvements.
Discussions and comments from:
http://marc.info/?l=linux-omap&m=126033945313269&w=2
http://marc.info/?l=linux-omap&m=125482970102327&w=2
http://marc.info/?t=125809247500002&r=1&w=2
http://marc.info/?l=linux-omap&m=126025973426007&w=2
http://marc.info/?t=128152609200064&r=1&w=2
http://marc.info/?t=128468723000002&r=1&w=2
incorporated.
v1: http://marc.info/?t=128468723000002&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-10-12 22:13:10 +00:00
|
|
|
#endif /* __LINUX_OPP_H__ */
|