drivers/pmdomain/qcom/cpr.c
Source file repositories/reference/linux-study-clean/drivers/pmdomain/qcom/cpr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pmdomain/qcom/cpr.c- Extension
.c- Size
- 44119 bytes
- Lines
- 1727
- Domain
- Driver Families
- Bucket
- drivers/pmdomain
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cleanup.hlinux/module.hlinux/err.hlinux/debugfs.hlinux/string.hlinux/kernel.hlinux/list.hlinux/init.hlinux/io.hlinux/bitops.hlinux/slab.hlinux/of.hlinux/platform_device.hlinux/pm_domain.hlinux/pm_opp.hlinux/interrupt.hlinux/regmap.hlinux/mfd/syscon.hlinux/regulator/consumer.hlinux/clk.hlinux/nvmem-consumer.h
Detected Declarations
struct cpr_fusestruct fuse_corner_datastruct cpr_fusesstruct corner_datastruct cpr_descstruct acc_descstruct cpr_acc_descstruct fuse_cornerstruct cornerstruct cpr_drvenum voltage_change_dirfunction cpr_is_allowedfunction cpr_writefunction cpr_readfunction cpr_masked_writefunction cpr_irq_clrfunction cpr_irq_clr_nackfunction cpr_irq_clr_ackfunction cpr_irq_setfunction cpr_ctl_modifyfunction cpr_ctl_enablefunction cpr_ctl_disablefunction cpr_ctl_is_enabledfunction cpr_ctl_is_busyfunction cpr_corner_savefunction cpr_corner_restorefunction cpr_set_accfunction cpr_pre_voltagefunction cpr_post_voltagefunction cpr_scale_voltagefunction cpr_get_cur_perf_statefunction cpr_scalefunction cpr_irq_handlerfunction cpr_enablefunction cpr_disablefunction cpr_configfunction cpr_set_performance_statefunction cpr_populate_ring_osc_idxfunction cpr_read_fuse_uVfunction cpr_fuse_corner_initfunction cpr_calculate_scalingfunction cpr_interpolatefunction cpr_get_fuse_cornerfunction cpr_get_opp_hz_for_reqfunction for_each_available_child_of_node_scopedfunction cpr_corner_initfunction cpr_set_loop_allowedfunction cpr_init_parameters
Annotated Snippet
struct cpr_fuse {
char *ring_osc;
char *init_voltage;
char *quotient;
char *quotient_offset;
};
struct fuse_corner_data {
int ref_uV;
int max_uV;
int min_uV;
int max_volt_scale;
int max_quot_scale;
/* fuse quot */
int quot_offset;
int quot_scale;
int quot_adjust;
/* fuse quot_offset */
int quot_offset_scale;
int quot_offset_adjust;
};
struct cpr_fuses {
int init_voltage_step;
int init_voltage_width;
struct fuse_corner_data *fuse_corner_data;
};
struct corner_data {
unsigned int fuse_corner;
unsigned long freq;
};
struct cpr_desc {
unsigned int num_fuse_corners;
int min_diff_quot;
int *step_quot;
unsigned int timer_delay_us;
unsigned int timer_cons_up;
unsigned int timer_cons_down;
unsigned int up_threshold;
unsigned int down_threshold;
unsigned int idle_clocks;
unsigned int gcnt_us;
unsigned int vdd_apc_step_up_limit;
unsigned int vdd_apc_step_down_limit;
unsigned int clamp_timer_interval;
struct cpr_fuses cpr_fuses;
bool reduce_to_fuse_uV;
bool reduce_to_corner_uV;
};
struct acc_desc {
unsigned int enable_reg;
u32 enable_mask;
struct reg_sequence *config;
struct reg_sequence *settings;
int num_regs_per_fuse;
};
struct cpr_acc_desc {
const struct cpr_desc *cpr_desc;
const struct acc_desc *acc_desc;
};
struct fuse_corner {
int min_uV;
int max_uV;
int uV;
int quot;
int step_quot;
const struct reg_sequence *accs;
int num_accs;
unsigned long max_freq;
u8 ring_osc_idx;
};
struct corner {
int min_uV;
int max_uV;
int uV;
int last_uV;
int quot_adjust;
u32 save_ctl;
u32 save_irq;
unsigned long freq;
struct fuse_corner *fuse_corner;
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/module.h`, `linux/err.h`, `linux/debugfs.h`, `linux/string.h`, `linux/kernel.h`, `linux/list.h`, `linux/init.h`.
- Detected declarations: `struct cpr_fuse`, `struct fuse_corner_data`, `struct cpr_fuses`, `struct corner_data`, `struct cpr_desc`, `struct acc_desc`, `struct cpr_acc_desc`, `struct fuse_corner`, `struct corner`, `struct cpr_drv`.
- Atlas domain: Driver Families / drivers/pmdomain.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.