cros_ec_sensors_read_lpc(9)
π cros_ec_sensors_read_lpc(9) π
okay so bestie, welcome to the Kernel API Manual β this is the page for cros_ec_sensors_read_lpc, and honestly? it's giving "quiet hero of the sensor stack" energy. let's get into it π«Ά
β¨ NAME β¨
cros_ec_sensors_read_lpc β read acceleration data from EC shared memory.
like, that's the whole vibe. acceleration data. from the EC's shared memory. iconic behavior honestly πΈ
π SYNOPSIS π
int cros_ec_sensors_read_lpc (struct iio_dev *indio_dev , unsigned long
scan_mask , s16 *data );
look at her. three params, one return value, zero drama (as long as you use the right read function, which β plot twist β you will hear about in a sec π).
π¦ ARGUMENTS π¦
indio_devβ pointer to IIO device. this is the little device handle that tells the function which sensor party we're crashing πscan_maskβ bitmap of the sensor indices to scan. think of it as the guest list: it literally selects which sensor indices get scanned, one bit per sensor, no plus-ones πdataβ location to store data. this is where the good stuff lands, so pls make sure it's a real place in memory and not a vibe β¨
β NOTE β
okay this part is important so listen up: this is the safe function for reading the EC data. it guarantees that the data sampled was not modified by the EC while being read.
fr fr. no torn reads, no half-updated values, no "wait was that one byte from before or after" situation. it's the responsible one. the designated driver of the sensor read functions ππ¨ iykyk
π₯ RETURN π₯
0on success π-errnoon failure π
that's it. that's the contract. classic, clean, no cap.
π SEE ALSO π
the kernel file, because yes we cite our sources:
Kernel file ./drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
and the whole friend group of related functions β every single one, bestie, not skipping a single name:
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_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 yeah β cros_ec_sensors_read_data_unsafe(9) is right there in the list. notice how this page is not that one. you're welcome π«Ά)
π friendly reminder: this page comes to you from source ./drivers/iio/common/cros_ec_s... and is dated October 2026. slay, documented, timestamped, 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