cros_ec_sensors_idx_to_reg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cros_ec_sensors_idx_to_reg(9) β€” the Kernel API Manual glow-up πŸŽ€

okay so bestie, welcome to cros_ec_sensors_idx_to_reg, a lil function from the Kernel API Manual that does exactly one iconic thing: it takes an index and turns it into an offset in shared memory ✨ that's it, that's the whole vibe. no cap.


✨ NAME ✨

cros_ec_sensors_idx_to_reg β€” convert index into offset in shared memory πŸ¦‹


🌸 SYNOPSIS 🌸

unsigned int cros_ec_sensors_idx_to_reg (struct
       cros_ec_sensors_core_state *st , unsigned int idx );

like, yes, that signature is a whole two lines, she's long, she's serving, she's real πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • st β€” pointer to state information for device 🫢 literally the state struct, your main character, the source of truth
  • idx β€” sensor index (should be element of enum sensor_index) πŸ‘‘ key word should β€” it's giving "please use the enum," iykyk

⭐ RETURN ⭐

address to read at πŸ”₯ that's the whole payoff, bestie, an address


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c β€” that's where she lives, go visit 🏑

and the whole friend group of related functions, no one left out fr fr:


and that's the page, bestie πŸ’œ she's sourced from ./drivers/iio/common/cros_ec_s..., dated October 2026, and she goes by cros_ec_sensors_idx_to_reg(9) β€” periodt πŸŒˆπŸŽ€

πŸ“¦ where this page comes from