cros_ec_sensors_idx_to_reg(9)
π 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 truthidxβ sensor index (should be element ofenum 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:
cros_ec_sensors_core_init(9)cros_ec_sensors_core_register(9)cros_ec_motion_send_host_cmd(9)cros_ec_sensors_read_until_not_busy(9)cros_ec_sensors_read_data_unsafe(9)cros_ec_sensors_read_lpc(9)cros_ec_sensors_read_cmd(9)cros_ec_sensors_capture(9)cros_ec_sensors_core_read(9)cros_ec_sensors_core_read_avail(9)cros_ec_sensors_core_write(9)
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
- 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