drivers/clk/actions/owl-composite.c
Source file repositories/reference/linux-study-clean/drivers/clk/actions/owl-composite.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/actions/owl-composite.c- Extension
.c- Size
- 5279 bytes
- Lines
- 208
- 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/regmap.howl-composite.h
Detected Declarations
function owl_comp_get_parentfunction owl_comp_set_parentfunction owl_comp_disablefunction owl_comp_enablefunction owl_comp_is_enabledfunction owl_comp_div_determine_ratefunction owl_comp_div_recalc_ratefunction owl_comp_div_set_ratefunction owl_comp_fact_determine_ratefunction owl_comp_fact_recalc_ratefunction owl_comp_fact_set_ratefunction owl_comp_fix_fact_determine_ratefunction owl_comp_fix_fact_recalc_ratefunction owl_comp_fix_fact_set_rate
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
//
// OWL composite clock driver
//
// Copyright (c) 2014 Actions Semi Inc.
// Author: David Liu <liuwei@actions-semi.com>
//
// Copyright (c) 2018 Linaro Ltd.
// Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
#include <linux/clk-provider.h>
#include <linux/regmap.h>
#include "owl-composite.h"
static u8 owl_comp_get_parent(struct clk_hw *hw)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
return owl_mux_helper_get_parent(&comp->common, &comp->mux_hw);
}
static int owl_comp_set_parent(struct clk_hw *hw, u8 index)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
return owl_mux_helper_set_parent(&comp->common, &comp->mux_hw, index);
}
static void owl_comp_disable(struct clk_hw *hw)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
struct owl_clk_common *common = &comp->common;
owl_gate_set(common, &comp->gate_hw, false);
}
static int owl_comp_enable(struct clk_hw *hw)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
struct owl_clk_common *common = &comp->common;
owl_gate_set(common, &comp->gate_hw, true);
return 0;
}
static int owl_comp_is_enabled(struct clk_hw *hw)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
struct owl_clk_common *common = &comp->common;
return owl_gate_clk_is_enabled(common, &comp->gate_hw);
}
static int owl_comp_div_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
struct owl_divider_hw *div = &comp->rate.div_hw;
return divider_determine_rate(&comp->common.hw, req, div->table,
div->width, div->div_flags);
}
static unsigned long owl_comp_div_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
return owl_divider_helper_recalc_rate(&comp->common, &comp->rate.div_hw,
parent_rate);
}
static int owl_comp_div_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
return owl_divider_helper_set_rate(&comp->common, &comp->rate.div_hw,
rate, parent_rate);
}
static int owl_comp_fact_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct owl_composite *comp = hw_to_owl_comp(hw);
long rate;
rate = owl_factor_helper_round_rate(&comp->common,
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/regmap.h`, `owl-composite.h`.
- Detected declarations: `function owl_comp_get_parent`, `function owl_comp_set_parent`, `function owl_comp_disable`, `function owl_comp_enable`, `function owl_comp_is_enabled`, `function owl_comp_div_determine_rate`, `function owl_comp_div_recalc_rate`, `function owl_comp_div_set_rate`, `function owl_comp_fact_determine_rate`, `function owl_comp_fact_recalc_rate`.
- 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.