zl3073x_chan_tod_adjust(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– zl3073x_chan_tod_adjust πŸ’–

okay bestie, so this is a page from the Kernel API Manual and it's literally all about zl3073x_chan_tod_adjust β€” atomic ToD read-modify-write with a rollover guard. yes that's a lot of words, we'll get there 🫢


✨ NAME ✨

zl3073x_chan_tod_adjust β€” atomic ToD read-modify-write, but make it safe, with a rollover guard so nothing gets clobbered mid-tick πŸŽ€


🌸 SYNOPSIS 🌸

int zl3073x_chan_tod_adjust (struct zl3073x_dev *zldev , u8 ch , struct timespec64 delta );

like, that's the whole signature. slay. look at it. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • zldev β€” pointer to the zl3073x device, aka the whole vibe you're working on
  • ch β€” the DPLL channel index, so it knows which channel we're doing this to
  • delta β€” the time adjustment you wanna apply, as a struct timespec64

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the whole thing, and honestly it's giving careful-girl energy:

It reads the next-Hz ToD and the current ToD, then checks whether there's enough time left before the next 1 Hz rollover to safely finish the write. That's the guard! πŸ›‘οΈ

And it'll re-read β€” yes, again β€” if:

  • the 1 Hz tick crossed somewhere in between the two reads 😭 (rude), or
  • there's less than 20 ms left before the next rollover

Once everything checks out, it applies delta and writes the result back. periodt. πŸ’…


🧚 CONTEXT 🧚

real talk: the caller must serialize all zl3073x_chan_tod_* calls externally. that's on you, bestie, not on this function. no cap.

⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • <0 on error πŸ’€

🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/dpll/zl3073x/chan.c, and here's the whole friend group:


and that's the page!! πŸ“ it comes from ./drivers/dpll/zl3073x, dated October 2026 (yes, the future, main character energy fr fr ⏳✨) β€” mwah, go read your ToD safely πŸ’œ

πŸ“¦ where this page comes from