cros_ec_sensors_read_cmd(9)
π cros_ec_sensors_read_cmd β kernel API manual, but make it make sense
okay so real talk, bestie, this is cros_ec_sensors_read_cmd(9) from the Kernel API Manual, and it is exactly what it says on the tin: it grabs data using the EC command protocol. that's the whole vibe. she's a getter. she gets. π
β¨ NAME β¨
cros_ec_sensors_read_cmd β retrieve data using the EC command protocol π¦
πΈ SYNOPSIS πΈ
int cros_ec_sensors_read_cmd (struct iio_dev *indio_dev , unsigned long
scan_mask , s16 *data );
like, that's the whole signature. three arguments, one int coming back at you. no cap. β¨
π ARGUMENTS π
indio_devβ pointer to IIO device π honestly the main character of this whole function. it's giving "the device we're reading from."scan_maskβ bitmap of the sensor indices to scan π₯ so this is your little checklist of which sensors you're asking about, one bit per index. pick your faves.dataβ location to store data π the function writes the results here. it's the drop-off spot. bring your own buffer, she's not allocating one for you, and that's on periodt.
β RETURN β
0 on success, -errno on failure. π
like yeah that's it. zero means slay, negative errno means something went sideways and the number tells you what. classic kernel behaviour, we respect it. π«Ά
ngl bestie, always check the return value.0is the green flag, anything negative is the red flag and she will let you know viaerrno. π
π SEE ALSO π
the actual source lives at:
Kernel file ./drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
and here's the whole friend group, all eleven of them, no one left out π:
cros_ec_sensors_core_init(9)cros_ec_sensors_core_register(9)cros_ec_motion_send_host_cmd(9)cros_ec_sensors_idx_to_reg(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_capture(9)cros_ec_sensors_core_read(9)cros_ec_sensors_core_read_avail(9)cros_ec_sensors_core_write(9)
π§ sign-off π§
this lil page came to you from source ./drivers/iio/common/cros_ec_s..., dated October 2026, and it's cros_ec_sensors_read_cmd(9) forever and always. go read your sensor data, bestie, and check your errno. mwah ππ
β¨
π¦ 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