cdns_i2c_clk_notifier_cb(9)
β¨ 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:
enum cdns_i2c_mode(9)enum cdns_i2c_slave_state(9)struct cdns_i2c(9)cdns_i2c_init(9)cdns_i2c_runtime_suspend(9)cdns_i2c_runtime_resume(9)cdns_i2c_clear_bus_hold(9)cdns_i2c_slave_isr(9)cdns_i2c_master_isr(9)cdns_i2c_isr(9)cdns_i2c_mrecv(9)cdns_i2c_msend(9)cdns_i2c_master_reset(9)cdns_i2c_master_xfer(9)cdns_i2c_master_xfer_atomic(9)cdns_i2c_func(9)cdns_i2c_calc_divs(9)cdns_i2c_setclk(9)cdns_i2c_detect_transfer_size(9)cdns_i2c_probe(9)cdns_i2c_remove(9)cdns_i2c_shutdown(9)
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
- 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