drivers/opp/opp.h
Source file repositories/reference/linux-study-clean/drivers/opp/opp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/opp/opp.h- Extension
.h- Size
- 10176 bytes
- Lines
- 303
- Domain
- Driver Families
- Bucket
- drivers/opp
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/interconnect.hlinux/kernel.hlinux/kref.hlinux/list.hlinux/limits.hlinux/pm_opp.hlinux/notifier.h
Detected Declarations
struct clkstruct regulatorstruct opp_config_datastruct dev_pm_opp_icc_bwstruct dev_pm_oppstruct opp_devicestruct opp_tableenum opp_table_accessfunction lazy_linking_pendingfunction _of_init_opp_tablefunction _of_clear_oppfunction opp_debug_remove_one
Annotated Snippet
struct opp_config_data {
struct opp_table *opp_table;
unsigned int flags;
unsigned int required_dev_index;
};
/**
* 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;
};
/*
* Internal data structure organization with the OPP layer library is as
* follows:
* opp_tables (root)
* |- device 1 (represents voltage domain 1)
* | |- opp 1 (availability, freq, voltage)
* | |- opp 2 ..
* ... ...
* | `- opp n ..
* |- device 2 (represents the next voltage domain)
* ...
* `- device m (represents mth voltage domain)
* device 1, 2.. are represented by opp_table structure while each opp
* is represented by the opp structure.
*/
/**
* struct dev_pm_opp - Generic OPP description structure
* @node: opp table node. The nodes are maintained throughout the lifetime
* of boot. It is expected only an optimal set of OPPs are
* added to the library by the SoC framework.
* IMPORTANT: the opp nodes should be maintained in increasing
* order.
* @kref: for reference count of the OPP.
* @available: true/false - marks if this OPP as available or not
* @dynamic: not-created from static DT entries.
* @turbo: true if turbo (boost) OPP
* @suspend: true if suspend OPP
* @removed: flag indicating that OPP's reference is dropped by OPP core.
* @rates: Frequencies in hertz
* @level: Performance level
* @supplies: Power supplies voltage/current values
* @bandwidth: Interconnect bandwidth values
* @clock_latency_ns: Latency (in nanoseconds) of switching to this OPP's
* frequency from any other OPP's frequency.
* @required_opps: List of OPPs that are required by this OPP.
* @opp_table: points back to the opp_table struct this opp belongs to
* @np: OPP's device node.
* @dentry: debugfs dentry pointer (per opp)
*
* This structure stores the OPP information for a given device.
*/
struct dev_pm_opp {
struct list_head node;
struct kref kref;
bool available;
bool dynamic;
bool turbo;
bool suspend;
bool removed;
unsigned long *rates;
unsigned int level;
struct dev_pm_opp_supply *supplies;
struct dev_pm_opp_icc_bw *bandwidth;
unsigned long clock_latency_ns;
struct dev_pm_opp **required_opps;
struct opp_table *opp_table;
struct device_node *np;
#ifdef CONFIG_DEBUG_FS
struct dentry *dentry;
const char *of_name;
#endif
};
/**
* struct opp_device - devices managed by 'struct opp_table'
Annotation
- Immediate include surface: `linux/device.h`, `linux/interconnect.h`, `linux/kernel.h`, `linux/kref.h`, `linux/list.h`, `linux/limits.h`, `linux/pm_opp.h`, `linux/notifier.h`.
- Detected declarations: `struct clk`, `struct regulator`, `struct opp_config_data`, `struct dev_pm_opp_icc_bw`, `struct dev_pm_opp`, `struct opp_device`, `struct opp_table`, `enum opp_table_access`, `function lazy_linking_pending`, `function _of_init_opp_table`.
- Atlas domain: Driver Families / drivers/opp.
- 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.