drivers/clk/tegra/clk-dfll.c
Source file repositories/reference/linux-study-clean/drivers/clk/tegra/clk-dfll.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/tegra/clk-dfll.c- Extension
.c- Size
- 56056 bytes
- Lines
- 2109
- Domain
- Driver Families
- Bucket
- drivers/clk
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/clk.hlinux/clk-provider.hlinux/debugfs.hlinux/device.hlinux/err.hlinux/i2c.hlinux/io.hlinux/kernel.hlinux/module.hlinux/of.hlinux/pinctrl/consumer.hlinux/pm_opp.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hlinux/reset.hlinux/seq_file.hclk-dfll.hcvb.h
Detected Declarations
struct dfll_rate_reqstruct tegra_dfllenum dfll_ctrl_modeenum dfll_tune_rangeenum tegra_dfll_pmu_iffunction dfll_readlfunction dfll_writelfunction dfll_wmbfunction dfll_i2c_readlfunction dfll_i2c_writelfunction dfll_i2c_wmbfunction dfll_is_runningfunction tegra_dfll_runtime_resumefunction clk_unpreparefunction operationsfunction dfll_scale_dvco_ratefunction dfll_set_modefunction get_dvco_rate_belowfunction dfll_i2c_set_output_enabledfunction dfll_pwm_set_output_enabledfunction dfll_set_force_output_valuefunction dfll_set_force_output_enabledfunction dfll_force_outputfunction dfll_load_i2c_lutfunction dfll_init_i2c_iffunction dfll_init_out_iffunction find_lut_index_for_ratefunction dfll_calculate_rate_requestfunction dfll_set_frequency_requestfunction dfll_request_ratefunction dfll_disablefunction dfll_enablefunction dfll_set_open_loop_configfunction dfll_lockfunction dfll_unlockfunction clk_enablefunction dfll_clk_enablefunction dfll_clk_disablefunction dfll_clk_recalc_ratefunction dfll_clk_determine_ratefunction dfll_clk_set_ratefunction dfll_register_clkfunction dfll_unregister_clkfunction dfll_calc_monitored_ratefunction dfll_read_monitor_ratefunction attr_enable_getfunction attr_enable_setfunction attr_lock_get
Annotated Snippet
struct dfll_rate_req {
unsigned long rate;
unsigned long dvco_target_rate;
int lut_index;
u8 mult_bits;
u8 scale_bits;
};
struct tegra_dfll {
struct device *dev;
struct tegra_dfll_soc_data *soc;
void __iomem *base;
void __iomem *i2c_base;
void __iomem *i2c_controller_base;
void __iomem *lut_base;
struct regulator *vdd_reg;
struct clk *soc_clk;
struct clk *ref_clk;
struct clk *i2c_clk;
struct clk *dfll_clk;
struct reset_control *dfll_rst;
struct reset_control *dvco_rst;
unsigned long ref_rate;
unsigned long i2c_clk_rate;
unsigned long dvco_rate_min;
enum dfll_ctrl_mode mode;
enum dfll_tune_range tune_range;
struct dentry *debugfs_dir;
struct clk_hw dfll_clk_hw;
const char *output_clock_name;
struct dfll_rate_req last_req;
unsigned long last_unrounded_rate;
/* Parameters from DT */
u32 droop_ctrl;
u32 sample_rate;
u32 force_mode;
u32 cf;
u32 ci;
u32 cg;
bool cg_scale;
/* I2C interface parameters */
u32 i2c_fs_rate;
u32 i2c_reg;
u32 i2c_slave_addr;
/* lut array entries are regulator framework selectors or PWM values*/
unsigned lut[MAX_DFLL_VOLTAGES];
unsigned long lut_uv[MAX_DFLL_VOLTAGES];
int lut_size;
u8 lut_bottom, lut_min, lut_max, lut_safe;
/* PWM interface */
enum tegra_dfll_pmu_if pmu_if;
unsigned long pwm_rate;
struct pinctrl *pwm_pin;
struct pinctrl_state *pwm_enable_state;
struct pinctrl_state *pwm_disable_state;
u32 reg_init_uV;
};
#define clk_hw_to_dfll(_hw) container_of(_hw, struct tegra_dfll, dfll_clk_hw)
/* mode_name: map numeric DFLL modes to names for friendly console messages */
static const char * const mode_name[] = {
[DFLL_UNINITIALIZED] = "uninitialized",
[DFLL_DISABLED] = "disabled",
[DFLL_OPEN_LOOP] = "open_loop",
[DFLL_CLOSED_LOOP] = "closed_loop",
};
/*
* Register accessors
*/
static inline u32 dfll_readl(struct tegra_dfll *td, u32 offs)
{
return __raw_readl(td->base + offs);
}
static inline void dfll_writel(struct tegra_dfll *td, u32 val, u32 offs)
{
WARN_ON(offs >= DFLL_I2C_CFG);
__raw_writel(val, td->base + offs);
}
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/debugfs.h`, `linux/device.h`, `linux/err.h`, `linux/i2c.h`, `linux/io.h`, `linux/kernel.h`.
- Detected declarations: `struct dfll_rate_req`, `struct tegra_dfll`, `enum dfll_ctrl_mode`, `enum dfll_tune_range`, `enum tegra_dfll_pmu_if`, `function dfll_readl`, `function dfll_writel`, `function dfll_wmb`, `function dfll_i2c_readl`, `function dfll_i2c_writel`.
- Atlas domain: Driver Families / drivers/clk.
- Implementation status: integration 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.