cros_ec_sensors_read_cmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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. 0 is the green flag, anything negative is the red flag and she will let you know via errno. πŸ™ˆ

🌈 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 πŸ’œ:


🧚 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