sound/soc/codecs/tlv320aic32x4-clk.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/tlv320aic32x4-clk.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/tlv320aic32x4-clk.c- Extension
.c- Size
- 12053 bytes
- Lines
- 500
- Domain
- Driver Families
- Bucket
- sound/soc
- 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.
- 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/clk-provider.hlinux/clkdev.hlinux/regmap.hlinux/device.htlv320aic32x4.h
Detected Declarations
struct clk_aic32x4struct clk_aic32x4_pll_muldivstruct aic32x4_clkdescfunction clk_aic32x4_pll_preparefunction clk_aic32x4_pll_unpreparefunction clk_aic32x4_pll_is_preparedfunction clk_aic32x4_pll_get_muldivfunction clk_aic32x4_pll_set_muldivfunction clk_aic32x4_pll_calc_ratefunction clk_aic32x4_pll_calc_muldivfunction clk_aic32x4_pll_recalc_ratefunction clk_aic32x4_pll_determine_ratefunction clk_aic32x4_pll_set_ratefunction clk_aic32x4_pll_set_parentfunction clk_aic32x4_pll_get_parentfunction clk_aic32x4_codec_clkin_set_parentfunction clk_aic32x4_codec_clkin_get_parentfunction clk_aic32x4_div_preparefunction clk_aic32x4_div_unpreparefunction clk_aic32x4_div_set_ratefunction clk_aic32x4_div_determine_ratefunction clk_aic32x4_div_recalc_ratefunction clk_aic32x4_bdiv_set_parentfunction clk_aic32x4_bdiv_get_parentfunction aic32x4_register_clocksexport aic32x4_register_clocks
Annotated Snippet
struct clk_aic32x4 {
struct clk_hw hw;
struct device *dev;
struct regmap *regmap;
unsigned int reg;
};
/*
* struct clk_aic32x4_pll_muldiv - Multiplier/divider settings
* @p: Divider
* @r: first multiplier
* @j: integer part of second multiplier
* @d: decimal part of second multiplier
*/
struct clk_aic32x4_pll_muldiv {
u8 p;
u16 r;
u8 j;
u16 d;
};
struct aic32x4_clkdesc {
const char *name;
const char * const *parent_names;
unsigned int num_parents;
const struct clk_ops *ops;
unsigned int reg;
};
static int clk_aic32x4_pll_prepare(struct clk_hw *hw)
{
struct clk_aic32x4 *pll = to_clk_aic32x4(hw);
return regmap_update_bits(pll->regmap, AIC32X4_PLLPR,
AIC32X4_PLLEN, AIC32X4_PLLEN);
}
static void clk_aic32x4_pll_unprepare(struct clk_hw *hw)
{
struct clk_aic32x4 *pll = to_clk_aic32x4(hw);
regmap_update_bits(pll->regmap, AIC32X4_PLLPR,
AIC32X4_PLLEN, 0);
}
static int clk_aic32x4_pll_is_prepared(struct clk_hw *hw)
{
struct clk_aic32x4 *pll = to_clk_aic32x4(hw);
unsigned int val;
int ret;
ret = regmap_read(pll->regmap, AIC32X4_PLLPR, &val);
if (ret < 0)
return ret;
return !!(val & AIC32X4_PLLEN);
}
static int clk_aic32x4_pll_get_muldiv(struct clk_aic32x4 *pll,
struct clk_aic32x4_pll_muldiv *settings)
{
/* Change to use regmap_bulk_read? */
unsigned int val;
int ret;
ret = regmap_read(pll->regmap, AIC32X4_PLLPR, &val);
if (ret < 0)
return ret;
settings->r = val & AIC32X4_PLL_R_MASK;
settings->p = (val & AIC32X4_PLL_P_MASK) >> AIC32X4_PLL_P_SHIFT;
ret = regmap_read(pll->regmap, AIC32X4_PLLJ, &val);
if (ret < 0)
return ret;
settings->j = val;
ret = regmap_read(pll->regmap, AIC32X4_PLLDMSB, &val);
if (ret < 0)
return ret;
settings->d = val << 8;
ret = regmap_read(pll->regmap, AIC32X4_PLLDLSB, &val);
if (ret < 0)
return ret;
settings->d |= val;
return 0;
}
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/clkdev.h`, `linux/regmap.h`, `linux/device.h`, `tlv320aic32x4.h`.
- Detected declarations: `struct clk_aic32x4`, `struct clk_aic32x4_pll_muldiv`, `struct aic32x4_clkdesc`, `function clk_aic32x4_pll_prepare`, `function clk_aic32x4_pll_unprepare`, `function clk_aic32x4_pll_is_prepared`, `function clk_aic32x4_pll_get_muldiv`, `function clk_aic32x4_pll_set_muldiv`, `function clk_aic32x4_pll_calc_rate`, `function clk_aic32x4_pll_calc_muldiv`.
- Atlas domain: Driver Families / sound/soc.
- 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.