drivers/clk/clk-en7523.c
Source file repositories/reference/linux-study-clean/drivers/clk/clk-en7523.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/clk-en7523.c- Extension
.c- Size
- 27373 bytes
- Lines
- 1036
- 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/bitfield.hlinux/delay.hlinux/clk-provider.hlinux/io.hlinux/mfd/syscon.hlinux/platform_device.hlinux/property.hlinux/regmap.hlinux/reset-controller.hdt-bindings/clock/en7523-clk.hdt-bindings/reset/airoha,en7523-reset.hdt-bindings/reset/airoha,en7581-reset.hdt-bindings/clock/econet,en751221-scu.hdt-bindings/reset/econet,en751221-scu.h
Detected Declarations
struct en_clk_descstruct en_clk_gatestruct en_rst_datastruct en_clk_soc_dataenum en_hirfunction en7523_get_base_ratefunction en7523_get_divfunction en7523_pci_is_enabledfunction en7523_pci_preparefunction en7523_pci_unpreparefunction en7581_pci_is_enabledfunction en7581_pci_enablefunction en7581_pci_disablefunction en7523_register_clocksfunction en7523_clk_hw_initfunction en7581_register_clocksfunction en7523_reset_updatefunction en7523_reset_assertfunction en7523_reset_deassertfunction en7523_reset_statusfunction en7523_reset_xlatefunction en7581_reset_registerfunction en7581_clk_hw_initfunction get_hw_idfunction en751221_try_register_clkfunction en751221_register_clocksfunction en751221_clk_hw_initfunction en7523_clk_probefunction clk_en7523_init
Annotated Snippet
struct en_clk_desc {
int id;
const char *name;
u32 base_reg;
u8 base_bits;
u8 base_shift;
union {
const unsigned int *base_values;
unsigned int base_value;
};
size_t n_base_values;
u16 div_reg;
u8 div_bits;
u8 div_shift;
u16 div_val0;
u8 div_step;
u8 div_offset;
};
struct en_clk_gate {
void __iomem *base;
struct clk_hw hw;
};
struct en_rst_data {
const u16 *bank_ofs;
const u16 *idx_map;
void __iomem *base;
struct reset_controller_dev rcdev;
};
struct en_clk_soc_data {
u32 num_clocks;
const struct clk_ops pcie_ops;
int (*hw_init)(struct platform_device *pdev,
struct clk_hw_onecell_data *clk_data);
};
static const u32 gsw_base[] = { 400000000, 500000000 };
static const u32 emi_base[] = { 333000000, 400000000 };
static const u32 bus_base[] = { 500000000, 540000000 };
static const u32 slic_base[] = { 100000000, 3125000 };
static const u32 npu_base[] = { 333000000, 400000000, 500000000 };
/* EN7581 */
static const u32 emi7581_base[] = { 540000000, 480000000, 400000000, 300000000 };
static const u32 bus7581_base[] = { 600000000, 540000000 };
static const u32 npu7581_base[] = { 800000000, 750000000, 720000000, 600000000 };
static const u32 crypto_base[] = { 540000000, 480000000 };
static const u32 emmc7581_base[] = { 200000000, 150000000 };
/* EN751221 */
static const u32 gsw751221_base[] = { 500000000, 250000000, 400000000, 200000000 };
static const struct en_clk_desc en7523_base_clks[] = {
{
.id = EN7523_CLK_GSW,
.name = "gsw",
.base_reg = REG_GSW_CLK_DIV_SEL,
.base_bits = 1,
.base_shift = 8,
.base_values = gsw_base,
.n_base_values = ARRAY_SIZE(gsw_base),
.div_bits = 3,
.div_shift = 0,
.div_step = 1,
.div_offset = 1,
}, {
.id = EN7523_CLK_EMI,
.name = "emi",
.base_reg = REG_EMI_CLK_DIV_SEL,
.base_bits = 1,
.base_shift = 8,
.base_values = emi_base,
.n_base_values = ARRAY_SIZE(emi_base),
.div_bits = 3,
.div_shift = 0,
.div_step = 1,
.div_offset = 1,
}, {
.id = EN7523_CLK_BUS,
.name = "bus",
.base_reg = REG_BUS_CLK_DIV_SEL,
.base_bits = 1,
.base_shift = 8,
.base_values = bus_base,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/delay.h`, `linux/clk-provider.h`, `linux/io.h`, `linux/mfd/syscon.h`, `linux/platform_device.h`, `linux/property.h`, `linux/regmap.h`.
- Detected declarations: `struct en_clk_desc`, `struct en_clk_gate`, `struct en_rst_data`, `struct en_clk_soc_data`, `enum en_hir`, `function en7523_get_base_rate`, `function en7523_get_div`, `function en7523_pci_is_enabled`, `function en7523_pci_prepare`, `function en7523_pci_unprepare`.
- 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.