arch/mips/lantiq/clk.c
Source file repositories/reference/linux-study-clean/arch/mips/lantiq/clk.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/lantiq/clk.c- Extension
.c- Size
- 3527 bytes
- Lines
- 202
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io.hlinux/export.hlinux/init.hlinux/kernel.hlinux/types.hlinux/clk.hlinux/clkdev.hlinux/err.hlinux/list.hasm/time.hasm/irq.hasm/div64.hlantiq_soc.hclk.hprom.h
Detected Declarations
function clkdev_add_staticfunction clk_goodfunction clk_get_ratefunction clk_set_ratefunction clk_round_ratefunction clk_enablefunction clk_disablefunction clk_activatefunction clk_deactivatefunction clk_set_parentfunction get_counter_resolutionfunction plat_time_initexport clk_get_fpiexport clk_get_ioexport clk_get_ppeexport clk_get_rateexport clk_set_rateexport clk_round_rateexport clk_enableexport clk_disableexport clk_activateexport clk_deactivateexport clk_get_parentexport clk_set_parent
Annotated Snippet
if (!*r) {
pr_err("clk %s.%s: trying to set invalid rate %ld\n",
clk->cl.dev_id, clk->cl.con_id, rate);
return -1;
}
}
clk->rate = rate;
return 0;
}
EXPORT_SYMBOL(clk_set_rate);
long clk_round_rate(struct clk *clk, unsigned long rate)
{
if (unlikely(!clk_good(clk)))
return 0;
if (clk->rates && *clk->rates) {
unsigned long *r = clk->rates;
while (*r && (*r != rate))
r++;
if (!*r) {
return clk->rate;
}
}
return rate;
}
EXPORT_SYMBOL(clk_round_rate);
int clk_enable(struct clk *clk)
{
if (unlikely(!clk_good(clk)))
return -1;
if (clk->enable)
return clk->enable(clk);
return -1;
}
EXPORT_SYMBOL(clk_enable);
void clk_disable(struct clk *clk)
{
if (unlikely(!clk_good(clk)))
return;
if (clk->disable)
clk->disable(clk);
}
EXPORT_SYMBOL(clk_disable);
int clk_activate(struct clk *clk)
{
if (unlikely(!clk_good(clk)))
return -1;
if (clk->activate)
return clk->activate(clk);
return -1;
}
EXPORT_SYMBOL(clk_activate);
void clk_deactivate(struct clk *clk)
{
if (unlikely(!clk_good(clk)))
return;
if (clk->deactivate)
clk->deactivate(clk);
}
EXPORT_SYMBOL(clk_deactivate);
struct clk *clk_get_parent(struct clk *clk)
{
return NULL;
}
EXPORT_SYMBOL(clk_get_parent);
int clk_set_parent(struct clk *clk, struct clk *parent)
{
return 0;
}
EXPORT_SYMBOL(clk_set_parent);
static inline u32 get_counter_resolution(void)
{
u32 res;
__asm__ __volatile__(
".set push\n"
Annotation
- Immediate include surface: `linux/io.h`, `linux/export.h`, `linux/init.h`, `linux/kernel.h`, `linux/types.h`, `linux/clk.h`, `linux/clkdev.h`, `linux/err.h`.
- Detected declarations: `function clkdev_add_static`, `function clk_good`, `function clk_get_rate`, `function clk_set_rate`, `function clk_round_rate`, `function clk_enable`, `function clk_disable`, `function clk_activate`, `function clk_deactivate`, `function clk_set_parent`.
- Atlas domain: Architecture Layer / arch/mips.
- 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.