atmel_smc_cs_conf_set_cycle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atmel_smc_cs_conf_set_cycle(9) β€” a Kernel API Manual moment

okay bestie, welcome to the Kernel API Manual for atmel_smc_cs_conf_set_cycle(9) β€” no cap, this is the little function that sets one (1) xx_CYCLE parameter inside your SMC CS conf to a specific value. she's small, she's focused, she ate. ✨


πŸŽ€ NAME πŸŽ€

atmel_smc_cs_conf_set_cycle β€” set the SMC CS conf xx_CYCLE parameter to a specific value. that's it, that's the whole assignment, and she did it flawlessly. πŸ’–


✨ SYNOPSIS ✨

int atmel_smc_cs_conf_set_cycle (struct atmel_smc_cs_conf *conf ,
unsigned int shift , unsigned int ncycles );

🫢 ARGUMENTS 🫢

  • conf β€” the SMC CS conf descriptor. your main character struct, the one holding everything. πŸ‘‘
  • shift β€” the position of the xx_CYCLE field in the CYCLE register. iykyk, it's the offset of where the field lives. 🎯
  • ncycles β€” the value you're assigning to this xx_CYCLE parameter, and bestie it's expressed in MCK clk cycles. clock cycles, not vibes. ⏱️

πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does is literal perfection: this function encodes the ncycles value exactly as described in the datasheet (section "SMC Cycle Register" β€” yes, go read it, it's giving reference material πŸ“), and then stores the result in the conf->setup field at shift position. slay. πŸŽ€

the way that return values work here, let's break it down:

  • returns -EINVAL if shift is invalid πŸ™ˆ
  • returns -ERANGE if ncycles does not fit in the field 😭
  • and 0 otherwise πŸ’–
ngl, that second one matters: if your ncycles is too chunky for the field, you get -ERANGE, not a silent truncation. respect the boundaries. πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/mfd/atmel-smc.c plus her whole friend group:


🌈 and that's the whole page, bestie β€” brought to you by ./drivers/mfd, dated October 2026, starring atmel_smc_cs_conf_set_cycle(9). go set those cycles, periodt. πŸ’œπŸ¦‹πŸŒ»

πŸ“¦ where this page comes from