drivers/clk/sunxi/clk-a10-codec.c
Source file repositories/reference/linux-study-clean/drivers/clk/sunxi/clk-a10-codec.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/sunxi/clk-a10-codec.c- Extension
.c- Size
- 895 bytes
- Lines
- 36
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk-provider.hlinux/of.hlinux/of_address.h
Detected Declarations
function sun4i_codec_clk_setup
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2013 Emilio López
*
* Emilio López <emilio@elopez.com.ar>
*/
#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/of_address.h>
#define SUN4I_CODEC_GATE 31
static void __init sun4i_codec_clk_setup(struct device_node *node)
{
struct clk *clk;
const char *clk_name = node->name, *parent_name;
void __iomem *reg;
reg = of_io_request_and_map(node, 0, of_node_full_name(node));
if (IS_ERR(reg))
return;
of_property_read_string(node, "clock-output-names", &clk_name);
parent_name = of_clk_get_parent_name(node, 0);
clk = clk_register_gate(NULL, clk_name, parent_name,
CLK_SET_RATE_PARENT, reg,
SUN4I_CODEC_GATE, 0, NULL);
if (!IS_ERR(clk))
of_clk_add_provider(node, of_clk_src_simple_get, clk);
}
CLK_OF_DECLARE(sun4i_codec, "allwinner,sun4i-a10-codec-clk",
sun4i_codec_clk_setup);
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `function sun4i_codec_clk_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.