include/linux/pm_opp.h
Source file repositories/reference/linux-study-clean/include/linux/pm_opp.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/pm_opp.h- Extension
.h- Size
- 21031 bytes
- Lines
- 762
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cleanup.hlinux/energy_model.hlinux/err.hlinux/notifier.h
Detected Declarations
struct clkstruct cpufreq_frequency_tablestruct regulatorstruct dev_pm_oppstruct devicestruct opp_tablestruct dev_pm_opp_supplystruct dev_pm_opp_configstruct dev_pm_opp_datastruct dev_pm_opp_keyenum dev_pm_opp_eventfunction dev_pm_opp_put_opp_tablefunction dev_pm_opp_get_voltagefunction dev_pm_opp_get_suppliesfunction dev_pm_opp_get_powerfunction dev_pm_opp_get_freq_indexedfunction dev_pm_opp_get_levelfunction dev_pm_opp_get_required_pstatefunction dev_pm_opp_is_turbofunction dev_pm_opp_get_opp_countfunction dev_pm_opp_get_max_clock_latencyfunction dev_pm_opp_get_max_volt_latencyfunction dev_pm_opp_get_max_transition_latencyfunction dev_pm_opp_get_suspend_opp_freqfunction dev_pm_opp_find_freq_exact_indexedfunction dev_pm_opp_find_freq_floor_indexedfunction dev_pm_opp_find_freq_ceil_indexedfunction dev_pm_opp_putfunction dev_pm_opp_removefunction dev_pm_opp_enablefunction dev_pm_opp_disablefunction dev_pm_opp_register_notifierfunction dev_pm_opp_unregister_notifierfunction dev_pm_opp_set_configfunction devm_pm_opp_set_configfunction dev_pm_opp_clear_configfunction dev_pm_opp_xlate_performance_statefunction dev_pm_opp_set_ratefunction dev_pm_opp_set_oppfunction dev_pm_opp_set_sharing_cpusfunction dev_pm_opp_get_sharing_cpusfunction dev_pm_opp_remove_tablefunction dev_pm_opp_init_cpufreq_tablefunction dev_pm_opp_free_cpufreq_tablefunction dev_pm_opp_of_unregister_emfunction dev_pm_opp_of_add_tablefunction dev_pm_opp_of_add_table_indexedfunction devm_pm_opp_of_add_table_indexed
Annotated Snippet
struct dev_pm_opp_supply {
unsigned long u_volt;
unsigned long u_volt_min;
unsigned long u_volt_max;
unsigned long u_amp;
unsigned long u_watt;
};
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);
typedef int (*config_clks_t)(struct device *dev, struct opp_table *opp_table,
struct dev_pm_opp *opp, void *data, bool scaling_down);
/**
* struct dev_pm_opp_config - Device OPP configuration values
* @clk_names: Clk names, NULL terminated array.
* @config_clks: Custom set clk helper.
* @prop_name: Name to postfix to properties.
* @config_regulators: Custom set regulator helper.
* @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.
* @required_dev: The required OPP device.
* @required_dev_index: The index of the required OPP for the @required_dev.
*
* This structure contains platform specific OPP configurations for the device.
*/
struct dev_pm_opp_config {
/* NULL terminated */
const char * const *clk_names;
config_clks_t config_clks;
const char *prop_name;
config_regulators_t config_regulators;
const unsigned int *supported_hw;
unsigned int supported_hw_count;
const char * const *regulator_names;
struct device *required_dev;
unsigned int required_dev_index;
};
#define OPP_LEVEL_UNSET U32_MAX
/**
* struct dev_pm_opp_data - The data to use to initialize an OPP.
* @turbo: Flag to indicate whether the OPP is to be marked turbo or not.
* @level: The performance level for the OPP. Set level to OPP_LEVEL_UNSET if
* level field isn't used.
* @freq: The clock rate in Hz for the OPP.
* @u_volt: The voltage in uV for the OPP.
*/
struct dev_pm_opp_data {
bool turbo;
unsigned int level;
unsigned long freq;
unsigned long u_volt;
};
/**
* struct dev_pm_opp_key - Key used to identify OPP entries
* @freq: Frequency in Hz. Use 0 if frequency is not to be matched.
* @level: Performance level associated with the OPP entry.
* Use OPP_LEVEL_UNSET if level is not to be matched.
* @bw: Bandwidth associated with the OPP entry.
* Use 0 if bandwidth is not to be matched.
*
* This structure is used to uniquely identify an OPP entry based on
* frequency, performance level, and bandwidth. Each field can be
* selectively ignored during matching by setting it to its respective
* NOP value.
*/
struct dev_pm_opp_key {
unsigned long freq;
unsigned int level;
u32 bw;
};
#if defined(CONFIG_PM_OPP)
struct opp_table *dev_pm_opp_get_opp_table(struct device *dev);
struct opp_table *dev_pm_opp_get_opp_table_ref(struct opp_table *opp_table);
void dev_pm_opp_put_opp_table(struct opp_table *opp_table);
unsigned long dev_pm_opp_get_bw(struct dev_pm_opp *opp, bool peak, int index);
unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);
int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supply *supplies);
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/energy_model.h`, `linux/err.h`, `linux/notifier.h`.
- Detected declarations: `struct clk`, `struct cpufreq_frequency_table`, `struct regulator`, `struct dev_pm_opp`, `struct device`, `struct opp_table`, `struct dev_pm_opp_supply`, `struct dev_pm_opp_config`, `struct dev_pm_opp_data`, `struct dev_pm_opp_key`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.