STRUCT CROS_EC_SENSORS_CORE_STATE(9)
π struct cros_ec_sensors_core_state(9) β the Kernel API Manual glow-up
okay so picture this: it's a big ol' C struct living in the Kernel API Manual, section 9, and its whole personality is "state data for EC sensors IIO driver". that's it, that's the job. and honestly? it ate. let's get into it π«Ά
β¨ NAME β¨
struct cros_ec_sensors_core_state β literally just the state data for the EC sensors IIO driver. main character energy for a struct, ngl π
πΈ SYNOPSIS πΈ
here's the whole shape of her, exactly as she is, no edits bestie:
struct cros_ec_sensors_core_state {
struct cros_ec_device *ec;
struct mutex cmd_lock;
struct cros_ec_command *msg;
struct ec_params_motion_sense param;
struct ec_response_motion_sense *resp;
enum motionsensor_type type;
bool range_updated;
int curr_range;
struct calib_data {
s16 offset;
u16 scale;
} calib[CROS_EC_SENSOR_MAX_AXIS];
s8 sign[CROS_EC_SENSOR_MAX_AXIS];
u8 samples[CROS_EC_SAMPLE_SIZE];
int (*read_ec_sensors_data)(struct iio_dev *indio_dev, unsigned long
scan_mask, s16 *data);
u32 fifo_max_event_count;
int frequencies[6];
};
likeβ¦ she's serving structure. the nested struct calib_data in there? iconic. β¨
π Members π
breaking down every single member because we do NOT skip:
ecβ the cros EC device structure. yeah, the whole device. she's holding the keys πcmd_lockβ astruct mutexlock that stops simultaneous access to the commands. no cutting the line, no double-dipping, periodt πmsgβ the cros EC command structure π―paramβ motion sensor parameters structure, the input side of the convorespβ motion sensor response structure, the reply side. it's giving call and response π¦typeβ type of motion sensor (enum motionsensor_type, if you were curious π)range_updatedβ True if the range of the sensor has been updated. she keeps receipts πcurr_rangeβ if updated, the current range value. and bestie, listen: it gets reapplied at every resume. every single one. commitment πcalibβ the calibration parameters. quick note that matters: trigger captured data will always provide the calibrated data. so like, don't worry about it, it's already handled πsamplesβ a static array holding data from a single capture. for each channel we need 2 bytes, except for the timestamp β the timestamp is always last and is always 8-byte aligned. alignment is self-care, fr fr β¨read_ec_sensors_dataβ the function used for accessing sensors values. the lil worker bee πfifo_max_event_countβ size of the EC sensor FIFO π¦frequenciesβ table of known available frequencies: 0, Min and Max in mHz π΅
ngl the members list above is exactly what the page gives us β no more, no less. if you're looking for the tea on sign, that's not spilled here π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/iio/common/cros_ec_sensors_core.hβ go read her, iykyk π
and that's the whole vibe check, bestie π this little gem comes to you from ./include/linux/iio/common, dated October 2026, and it's filed under struct cros...s_core_state(9) in the Kernel API Manual. slay, stay hydrated, and always align your timestamps πβ¨π¦
π¦ 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