drivers/clk/at91/dt-compat.c
Source file repositories/reference/linux-study-clean/drivers/clk/at91/dt-compat.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/at91/dt-compat.c- Extension
.c- Size
- 27909 bytes
- Lines
- 1068
- Domain
- Driver Families
- Bucket
- drivers/clk
- 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.
- 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-provider.hlinux/clk/at91_pmc.hlinux/of.hlinux/mfd/syscon.hlinux/regmap.hlinux/slab.hpmc.h
Detected Declarations
function of_sama5d2_clk_audio_pll_frac_setupfunction of_sama5d2_clk_audio_pll_pad_setupfunction of_sama5d2_clk_audio_pll_pmc_setupfunction of_sama5d2_clk_generated_setupfunction for_each_child_of_nodefunction of_sama5d4_clk_h32mx_setupfunction of_sama5d2_clk_i2s_mux_setupfunction for_each_child_of_nodefunction of_at91rm9200_clk_main_osc_setupfunction of_at91sam9x5_clk_main_rc_osc_setupfunction of_at91rm9200_clk_main_setupfunction of_at91sam9x5_clk_main_setupfunction of_at91_clk_master_get_characteristicsfunction of_at91_clk_master_setupfunction of_at91rm9200_clk_master_setupfunction of_at91sam9x5_clk_master_setupfunction of_at91_clk_periph_setupfunction for_each_child_of_nodefunction of_at91rm9200_clk_periph_setupfunction of_at91sam9x5_clk_periph_setupfunction of_at91_clk_pll_get_characteristicsfunction of_at91_clk_pll_setupfunction of_at91rm9200_clk_pll_setupfunction of_at91sam9g45_clk_pll_setupfunction of_at91sam9g20_clk_pllb_setupfunction of_sama5d3_clk_pll_setupfunction of_at91sam9x5_clk_plldiv_setupfunction of_at91_clk_prog_setupfunction for_each_child_of_nodefunction of_at91rm9200_clk_prog_setupfunction of_at91sam9g45_clk_prog_setupfunction of_at91sam9x5_clk_prog_setupfunction of_at91sam9260_clk_slow_setupfunction of_at91sam9x5_clk_smd_setupfunction of_at91rm9200_clk_sys_setupfunction for_each_child_of_nodefunction of_at91sam9x5_clk_usb_setupfunction of_at91sam9n12_clk_usb_setupfunction of_at91rm9200_clk_usb_setupfunction of_at91sam9x5_clk_utmi_setup
Annotated Snippet
if (type == PERIPHERAL_AT91RM9200) {
hw = at91_clk_register_peripheral(regmap, name,
parent_name, NULL, id);
} else {
struct clk_range range = CLK_RANGE(0, 0);
unsigned long flags = 0;
of_at91_get_clk_range(periphclknp,
"atmel,clk-output-range",
&range);
/*
* mpddr_clk feed DDR controller and is enabled by
* bootloader thus we need to keep it enabled in case
* there is no Linux consumer for it.
*/
if (!strcmp(periphclknp->name, "mpddr_clk"))
flags = CLK_IS_CRITICAL;
hw = at91_clk_register_sam9x5_peripheral(regmap,
&pmc_pcr_lock,
&dt_pcr_layout,
name,
parent_name,
NULL,
id, &range,
INT_MIN,
flags);
}
if (IS_ERR(hw))
continue;
of_clk_add_hw_provider(periphclknp, of_clk_hw_simple_get, hw);
}
}
static void __init of_at91rm9200_clk_periph_setup(struct device_node *np)
{
of_at91_clk_periph_setup(np, PERIPHERAL_AT91RM9200);
}
CLK_OF_DECLARE(at91rm9200_clk_periph, "atmel,at91rm9200-clk-peripheral",
of_at91rm9200_clk_periph_setup);
static void __init of_at91sam9x5_clk_periph_setup(struct device_node *np)
{
of_at91_clk_periph_setup(np, PERIPHERAL_AT91SAM9X5);
}
CLK_OF_DECLARE(at91sam9x5_clk_periph, "atmel,at91sam9x5-clk-peripheral",
of_at91sam9x5_clk_periph_setup);
static struct clk_pll_characteristics * __init
of_at91_clk_pll_get_characteristics(struct device_node *np)
{
int i;
int offset;
u32 tmp;
int num_output;
u32 num_cells;
struct clk_range input;
struct clk_range *output;
u8 *out = NULL;
u16 *icpll = NULL;
struct clk_pll_characteristics *characteristics;
if (of_at91_get_clk_range(np, "atmel,clk-input-range", &input))
return NULL;
if (of_property_read_u32(np, "#atmel,pll-clk-output-range-cells",
&num_cells))
return NULL;
if (num_cells < 2 || num_cells > 4)
return NULL;
num_output = of_property_count_u32_elems(np, "atmel,pll-clk-output-ranges");
if (num_output <= 0)
return NULL;
num_output /= num_cells;
characteristics = kzalloc_obj(*characteristics);
if (!characteristics)
return NULL;
output = kzalloc_objs(*output, num_output);
if (!output)
goto out_free_characteristics;
if (num_cells > 2) {
out = kcalloc(num_output, sizeof(*out), GFP_KERNEL);
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/clk/at91_pmc.h`, `linux/of.h`, `linux/mfd/syscon.h`, `linux/regmap.h`, `linux/slab.h`, `pmc.h`.
- Detected declarations: `function of_sama5d2_clk_audio_pll_frac_setup`, `function of_sama5d2_clk_audio_pll_pad_setup`, `function of_sama5d2_clk_audio_pll_pmc_setup`, `function of_sama5d2_clk_generated_setup`, `function for_each_child_of_node`, `function of_sama5d4_clk_h32mx_setup`, `function of_sama5d2_clk_i2s_mux_setup`, `function for_each_child_of_node`, `function of_at91rm9200_clk_main_osc_setup`, `function of_at91sam9x5_clk_main_rc_osc_setup`.
- Atlas domain: Driver Families / drivers/clk.
- 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.