STRUCT TEGRA_CLK_FRAC_DIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct tegra_clk_frac_div(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual 🫢 β€” today's main character is struct tegra_clk_frac_div, aka the fractional divider clock. she's a struct, she's iconic, and she's about to make ur clock tree make sense. periodt. ✨


🌸 NAME 🌸

struct tegra_clk_frac_div β€” fractional divider clock πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

struct tegra_clk_frac_div {
    struct clk_hw   hw;
    void __iomem    *reg;
    u8 flags;
    u8 shift;
    u8 width;
    u8 frac_width;
    spinlock_t *lock;
 };

like, that's the whole vibe right there. no cap. πŸ‘‘


πŸ¦‹ Members πŸ¦‹

  • hw β€” the handle between the common clock interfaces and the hardware-specific ones 🌈 the little bridge between two worlds, honestly kind of giving main character energy
  • reg β€” the register containing the divider πŸ“ that's where she lives
  • flags β€” hardware-specific flags 🚩 (scroll down, there's a whole section, it's a lot, i love it)
  • shift β€” shift to the divider bit field ➑️ how far u gotta scoot over
  • width β€” width of the divider bit field πŸ“ how many bits she's occupying
  • frac_width β€” width of the fractional bit field 🍰 the fractional one!! separate width!! yes bestie
  • lock β€” register lock πŸ”’ nobody touches the register without the lock, we respect boundaries here

✨ Description ✨

okay so the Flags section, and bestie, listen up, there are FOUR of them and each one does something different πŸ’…

  • TEGRA_DIVIDER_ROUND_UP β€” this flag indicates to round up the divider value πŸ”₯ round UP, not down, don't get it twisted
  • TEGRA_DIVIDER_FIXED β€” fixed rate PLL dividers have an additional override bit, and this flag indicates that this divider is for a fixed rate PLL πŸ“Œ iykyk
  • TEGRA_DIVIDER_INT β€” some modules cannot cope with the duty cycle when the fraction bit is set 😭 so this flag indicates to calculate a divider for which the fraction bit will be zero β€” yeah, we zero it out, it's the only way she'll behave
  • TEGRA_DIVIDER_UART β€” the UART module divider has an additional enable bit which is set when the divider value is not 0 πŸŽ€ this flag indicates that the divider is for the UART module ⭐
ngl these flags are doing a LOT of emotional labor for one u8. respect. 🫢

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/clk/tegra/clk.h β€” go read her, she's the source of truth πŸ’œ

and the whole friend group:

  • struct tegra_clk_sync_source(9)
  • struct tegra_clk_pll_freq_table(9)
  • struct pdiv_map(9)
  • struct div_nmp(9)
  • struct tegra_clk_pll_params(9)
  • struct tegra_clk_pll(9)
  • struct tegra_audio_clk_info(9)
  • struct tegra_clk_pll_out(9)
  • struct tegra_clk_periph_regs(9)
  • struct tegra_clk_periph_gate(9)
  • struct tegra_sdmmc_mux(9)

πŸ¦‹ okay that's the whole page bestie, u ate that πŸ’…

sign-off time: this lil masterpiece lives in ./drivers/clk/tegra, dated October 2026, and yes she's still serving struct tegra_clk_frac_div(9) energy πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from