xiic_setclk(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, welcome to xiic_setclk(9) from the Kernel API Manual ✨ this one is literally called xiic_setclk β€” and it sets the configured clock rate. slay πŸ’…


✨ SYNOPSIS ✨

int xiic_setclk (struct xiic_i2c *i2c );

πŸŽ€ ARGUMENTS πŸŽ€

  • i2c β€” Pointer to the xiic device structure. iconic pointer behavior, no notes πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the timing register values are calculated according to the input clock frequency and the configured scl frequency. for the full details, please refer the AXI I2C PG and NXP I2C Spec πŸ“šβœ¨

the supported frequencies are 100KHz, 400KHz and 1MHz. periodt πŸ’…


🌸 RETURN 🌸

  • 0 on success (Supported frequency selected or not configurable in SW) 🫢
  • -EINVAL on failure (scl frequency not supported or THIGH is 0) 😭
lowkey important: that -EINVAL case is the vibe check failing β€” scl not supported or THIGH being 0 is a no from the function πŸ’€

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/i2c/busses/i2c-xiic.c
  • struct xiic_i2c(9)
  • struct timing_regs(9)

go read those if you want the whole friend group of related things, iykyk πŸ‘‘πŸ’œ


catch you later bestie 🫢 this page came from ./drivers/i2c/busses, dated October 2026, and it’s serving full Kernel API Manual energy. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from