cros_ec_sens..._data_unsafe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

cros_ec_sensors_read_data_unsafe β€” bestie, this is the one that reads acceleration data straight out of EC shared memory πŸŽ€


✨ SYNOPSIS ✨

int cros_ec_sensors_read_data_unsafe (struct iio_dev *indio_dev ,
unsigned long scan_mask , s16 *data );

🫢 ARGUMENTS 🫢

  • indio_dev β€” pointer to the IIO device, ok so this is literally your main character ✨
  • scan_mask β€” a bitmap of the sensor indices to scan, like a little guest list of which sensors get to come to the party πŸ’Œ
  • data β€” the location to store data, i.e. where the vibes (and the bytes) get dropped off πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this is the unsafe function for reading the EC data. And when we say unsafe we mean it β€” it does not guarantee that the EC will not modify the data as it is being read in 😭

Like, the EC can absolutely be out here changing things mid-read. No promises, no cap. It's giving "we're doing this raw and we know it" πŸ’€


🌸 RETURN 🌸

0 on success, -errno on failure. Periodt πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c β€” go read the source, iykyk πŸ‘‘


🌷 and that's the whole page bestie 🌷

Signed off from ./drivers/iio/common/cros_ec_s..., dated October 2026, and yes the page you're reading is cros_ec_sens..._data_unsafe(9) β€” the gang's all here, love that for us πŸ§šπŸ’œ

πŸ“¦ where this page comes from