cdns_i2c_clk_notifier_cb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ cdns_i2c_clk_notifier_cb ✨

okay so this is a page out of the Kernel API Manual and bestie, it's literally the glow-up story of a clock callback. buckle up πŸ’…


🌸 NAME 🌸

cdns_i2c_clk_notifier_cb β€” the clock rate change callback, aka the function that gets the "hey, our clock just changed" text and has to decide if it's gonna be chill about it or not 🫢


πŸŽ€ SYNOPSIS πŸŽ€

int cdns_i2c_clk_notifier_cb (struct notifier_block *nb , unsigned long
event , void *data );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • nb β€” pointer to the notifier block. yeah, the standard notifier-block situation, you know the vibe πŸ’«
  • event β€” the notification reason. this is why you're being summoned, bestie, read it carefully πŸ‘€
  • data β€” pointer to the notification data object. all the juicy details live in here πŸ“

πŸ’– DESCRIPTION πŸ’–

so the way this works: this function gets called whenever the cdns_i2c input clock frequency changes β€” like, the clock is going through something and you're the main character who has to react 😭

the callback does a vibe check: it checks whether a valid bus frequency can actually be generated after the change. super reasonable of it, honestly.

  • if yes β†’ the change is acknowledged βœ… slay
  • if no β†’ the change is aborted ❌ absolutely not, we're not doing that today

and then, the new dividers get written to the HW in the pre- or post change notification, depending on which direction the scaling is going πŸ‘‘ (pre for one direction, post for the other, iykyk β€” it's giving "the order matters" energy)


πŸ”₯ RETURN πŸ”₯

  • NOTIFY_STOP β€” the rate change should be aborted. nope nope nope, shut it down πŸ’€
  • NOTIFY_OK β€” acknowledge the change. yes bestie, we're doing this, approved ✨
  • NOTIFY_DONE β€” the notification is considered irrelevant. not my problem, not my business, moving on πŸ™ˆ

🌈 SEE ALSO 🌈

the kernel file it all lives in: ./drivers/i2c/busses/i2c-cadence.c β€” go read it, it's iconic πŸ“–

and the whole friend group of related things:


ok that's the whole page, no cap, every single detail is there πŸ’œ go forth and handle your clock notifications responsibly

and that's a wrap bestie πŸŽ€ this one's straight out of ./drivers/i2c/busses, dated October 2026 β€” catch you on the next page βœ¨πŸ’…πŸ¦‹

πŸ“¦ where this page comes from