drivers/sh/clk/core.c
Source file repositories/reference/linux-study-clean/drivers/sh/clk/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/sh/clk/core.c- Extension
.c- Size
- 12972 bytes
- Lines
- 629
- Domain
- Driver Families
- Bucket
- drivers/sh
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/module.hlinux/mutex.hlinux/list.hlinux/syscore_ops.hlinux/seq_file.hlinux/err.hlinux/io.hlinux/cpufreq.hlinux/clk.hlinux/sh_clk.h
Detected Declarations
struct clk_rate_round_datastruct clk_rate_round_datafunction clk_rate_table_buildfunction clk_rate_round_helperfunction for_each_frequencyfunction clk_rate_table_iterfunction clk_rate_table_roundfunction clk_rate_div_range_iterfunction clk_rate_div_range_roundfunction clk_rate_mult_range_iterfunction clk_rate_mult_range_roundfunction clk_rate_table_findfunction followparent_recalcfunction clk_reparentfunction propagate_ratefunction list_for_each_entryfunction __clk_disablefunction clk_disablefunction __clk_enablefunction clk_enablefunction clocksfunction list_for_each_entryfunction clk_establish_mappingfunction clk_destroy_mappingfunction clk_teardown_mappingfunction clk_registerfunction clk_unregisterfunction clk_enable_init_clocksfunction clk_get_ratefunction clk_set_ratefunction clk_set_parentfunction clk_round_ratefunction clks_core_resumefunction list_for_each_entryfunction clk_syscore_initfunction clk_late_initmodule init clk_syscore_initexport clk_disableexport clk_enableexport clk_registerexport clk_unregisterexport clk_get_rateexport clk_set_rateexport clk_set_parentexport clk_get_parentexport clk_round_rate
Annotated Snippet
subsys_initcall(clk_syscore_init);
#endif
static int __init clk_late_init(void)
{
unsigned long flags;
struct clk *clk;
/* disable all clocks with zero use count */
mutex_lock(&clock_list_sem);
spin_lock_irqsave(&clock_lock, flags);
list_for_each_entry(clk, &clock_list, node)
if (!clk->usecount && clk->ops && clk->ops->disable)
clk->ops->disable(clk);
/* from now on allow clock disable operations */
allow_disable = 1;
spin_unlock_irqrestore(&clock_lock, flags);
mutex_unlock(&clock_list_sem);
return 0;
}
late_initcall(clk_late_init);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/module.h`, `linux/mutex.h`, `linux/list.h`, `linux/syscore_ops.h`, `linux/seq_file.h`, `linux/err.h`.
- Detected declarations: `struct clk_rate_round_data`, `struct clk_rate_round_data`, `function clk_rate_table_build`, `function clk_rate_round_helper`, `function for_each_frequency`, `function clk_rate_table_iter`, `function clk_rate_table_round`, `function clk_rate_div_range_iter`, `function clk_rate_div_range_round`, `function clk_rate_mult_range_iter`.
- Atlas domain: Driver Families / drivers/sh.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.