STRUCT CLK_DIVIDER(9)
okay so bestie, welcome to the struct clk_divider(9) page from the Kernel API Manual β itβs giving adjustable divider clock and weβre gonna read it together π
β¨
β¨ NAME β¨
struct clk_divider β adjustable divider clock π°οΈ
π SYNOPSIS π
struct clk_divider {
struct clk_hw hw;
void __iomem *reg;
u8 shift;
u8 width;
u16 flags;
const struct clk_div_table *table;
spinlock_t *lock;
};
π§© Members π§©
hwβ handle between common and hardware-specific interfaces β¨regβ register containing the divider πshiftβ shift to the divider bit field β¬ οΈwidthβ width of the divider bit field πflagsβ the flag vibes go like this πCLK_DIVIDER_ONE_BASEDβ by default the divisor is the value read from the register plus one. IfCLK_DIVIDER_ONE_BASEDis set then the divider is the raw value read from the register, with the value of zero considered invalid, unlessCLK_DIVIDER_ALLOW_ZEROis set. πCLK_DIVIDER_POWER_OF_TWOβ clock divisor is 2 raised to the value read from the hardware register π₯CLK_DIVIDER_ALLOW_ZEROβ Allow zero divisors. For dividers which haveCLK_DIVIDER_ONE_BASEDset, it is possible to end up with a zero divisor. Some hardware implementations gracefully handle this case and allow a zero divisor by not modifying their input clock (divide by one / bypass). π«ΆCLK_DIVIDER_HIWORD_MASKβ The divider settings are only in lower 16-bit of this register, and mask of divider bits are in higher 16-bit of this register. While setting the divider bits, higher 16-bit should also be updated to indicate changing divider bits. π§CLK_DIVIDER_ROUND_CLOSESTβ Makes the best calculated divider to be rounded to the closest integer instead of the up one. π―CLK_DIVIDER_READ_ONLYβ The divider settings are preconfigured and should not be changed by the clock framework. π«CLK_DIVIDER_MAX_AT_ZEROβ For dividers which are likeCLK_DIVIDER_ONE_BASEDexcept when the value read from the register is zero, the divisor is2^widthof the field. π₯CLK_DIVIDER_BIG_ENDIANβ By default little endian register accesses are used for the divider register. Setting this flag makes the register accesses big endian. πCLK_DIVIDER_EVEN_INTEGERSβ clock divisor is 2, 4, 6, 8, 10, etc. Formula is2 * (value read from hardware + 1). βοΈ
tableβ array of value/divider pairs, last entry should havediv = 0πlockβ register lock π
π Description π
Clock with an adjustable divider affecting its output frequency. Implements .recalc_rate, .set_rate and .determine_rate β¨π
π SEE ALSO π
- Kernel file
./include/linux/clk-provider.hclk frameworkflags(9) struct clk_rate_request(9)struct clk_duty(9)struct clk_spread_spectrum(9)struct clk_ops(9)struct clk_parent_data(9)struct clk_init_data(9)struct clk_hw(9)struct clk_fixed_rate(9)clk_hw_register_fixed_rate(9)devm_clk_hw_register_fixed_rate(9)devm_clk_hw_register_fixed_rate_parent_data(9)clk_hw_register_fixed_rate_parent_hw(9)clk_hw_register_fixed_rate_parent_data(9)clk_hw_register_fixed_rate_with_accuracy(9)clk_hw_register_fixed_rate_with_accuracy_parent_hw(9)clk_hw_register_fixed_rate_with_accuracy_parent_data(9)clk_hw_register_fixed_rate_parent_accuracy(9)struct clk_gate(9)clk_hw_register_gate(9)clk_hw_register_gate_parent_hw(9)clk_hw_register_gate_parent_data(9)devm_clk_hw_register_gate(9)devm_clk_hw_register_gate_parent_hw(9)devm_clk_hw_register_gate_parent_data(9)clk_register_divider(9)clk_hw_register_divider(9)clk_hw_register_divider_parent_hw(9)clk_hw_register_divider_parent_data(9)clk_hw_register_divider_table(9)clk_hw_register_divider_table_parent_hw(9)clk_hw_register_divider_table_parent_data(9)devm_clk_hw_register_divider(9)devm_clk_hw_register_divider_parent_hw(9)devm_clk_hw_register_divider_parent_data(9)devm_clk_hw_register_divider_table(9)struct clk_mux(9)struct clk_fixed_factor(9)devm_clk_hw_register_fixed_factor_parent_hw(9)struct clk_fractional_divider(9)struct clk_multiplier(9)clk_hw_get_dev(9)clk_hw_get_of_node(9)
mwah π this page is sourced/versioned at ./include/linux, dated October 2026, and itβs literally struct clk_divider(9) β k bye bestie, go slay those dividers ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms