STRUCT SCMI_SENSOR_INFO(9)
π struct scmi_sensor_info π
okay so bestie, welcome to the Kernel API Manual β¨ β this is the page for struct scmi_sensor_info(9), and ngl it's kind of the main character of SCMI sensor land π. Pull up a chair (or a terminal), grab a π, and let's get into it.
πΈ NAME πΈ
struct scmi_sensor_info β literally represents information related to one of the available sensors π. One sensor, one struct, no cap.
β¨ SYNOPSIS β¨
here's the whole shape of her, verbatim, don't touch a single character π«Ά:
struct scmi_sensor_info {
unsigned int id;
unsigned int type;
int scale;
unsigned int num_trip_points;
bool async;
bool update;
bool timestamped;
int tstamp_scale;
unsigned int num_axis;
struct scmi_sensor_axis_info *axis;
struct scmi_sensor_intervals_info intervals;
unsigned int sensor_config;
#define SCMI_SENS_CFG_UPDATE_SECS_MASK GENMASK(31, 16);
#define SCMI_SENS_CFG_GET_UPDATE_SECS(x)
FIELD_GET(SCMI_SENS_CFG_UPDATE_SECS_MASK, (x));
#define SCMI_SENS_CFG_UPDATE_EXP_MASK GENMASK(15, 11);
#define SCMI_SENS_CFG_GET_UPDATE_EXP(x)
({
int __signed_exp =
FIELD_GET(SCMI_SENS_CFG_UPDATE_EXP_MASK, (x));
if (__signed_exp & BIT(4))
__signed_exp |= GENMASK(31, 5);
__signed_exp;
});
#define SCMI_SENS_CFG_ROUND_MASK GENMASK(10, 9);
#define SCMI_SENS_CFG_ROUND_AUTO 2;
#define SCMI_SENS_CFG_ROUND_UP 1;
#define SCMI_SENS_CFG_ROUND_DOWN 0;
#define SCMI_SENS_CFG_TSTAMP_ENABLED_MASK BIT(1);
#define SCMI_SENS_CFG_TSTAMP_ENABLE 1;
#define SCMI_SENS_CFG_TSTAMP_DISABLE 0;
#define SCMI_SENS_CFG_IS_TSTAMP_ENABLED(x)
FIELD_GET(SCMI_SENS_CFG_TSTAMP_ENABLED_MASK, (x));
#define SCMI_SENS_CFG_SENSOR_ENABLED_MASK BIT(0);
#define SCMI_SENS_CFG_SENSOR_ENABLE 1;
#define SCMI_SENS_CFG_SENSOR_DISABLE 0;
char name[SCMI_MAX_STR_SIZE];
#define SCMI_SENS_CFG_IS_ENABLED(x) FIELD_GET(BIT(0),
(x));
bool extended_scalar_attrs;
unsigned int sensor_power;
unsigned int resolution;
int exponent;
struct scmi_range_attrs scalar_attrs;
};
like, yes, those #defines are chilling inside the struct definition, that's just how she lives π β copy them exactly, bestie, don't get creative.
π¦ Members π¦
okay so now the actual field-by-field tour, this is the good part π:
idβ the Sensor ID. that's her government name.typeβ the Sensor type, and it's chosen amongst one ofenum scmi_sensor_classπ·οΈ.scaleβ a power-of-10 multiplier that gets applied to the sensor unit π’.num_trip_pointsβ the number of maximum configurable trip points π¦.asyncβ flag for asynchronous read support β‘.updateβ flag for continuous update notification support π.timestampedβ flag for timestamped read support β°.tstamp_scaleβ power-of-10 multiplier applied to the sensor timestamps so you can represent it in seconds β±οΈ.num_axisβ the number of supported axis, if any. reported as0for scalar sensors π§.axisβ pointer to an array ofnum_axisdescriptors π.intervalsβ descriptor of available update intervals π.sensor_configβ a bitmask reporting the current sensor configuration, as detailed in the SCMI specification; it can be accessed and modified through the accompanying macros π§.nameβ a NULL-terminated string representing the sensor name as advertised by the SCMI platform π·οΈβ¨.extended_scalar_attrsβ flag to indicate the presence of additional extended attributes for this sensor π©.sensor_powerβ extended attribute representing the average power consumed by the sensor in microwatts (uW) when it is active. reported here only for scalar sensors. set to0if not reported by this sensor π.resolutionβ extended attribute representing the resolution of the sensor. reported here only for scalar sensors. set to0if not reported by this sensor π―.exponentβ extended attribute representing the power-of-10 multiplier that is applied to the resolution field. reported here only for scalar sensors. set to0if not reported by this sensor π.scalar_attrsβ extended attributes representing minimum and maximum measurable values by this sensor. reported here only for scalar sensors. set to0if not reported by this sensor ππ.
ok quick vibe check π«Ά: those last four are scalar sensors only, and they get set to 0 whenever the sensor just doesn't report them. not a bug, that's just the convention, periodt.
π SEE ALSO π
go look at the Kernel file ./include/linux/scmi_protocol.h β and then the whole friend group π:
struct scmi_base_info(9), struct scmi_clk_proto_ops(9), struct scmi_perf_proto_ops(9), struct scmi_power_proto_ops(9), struct scmi_sensor_reading(9), struct scmi_range_attrs(9), struct scmi_sensor_axis_info(9), struct scmi_sensor_intervals_info(9), struct scmi_sensor_proto_ops(9), struct scmi_reset_proto_ops(9), struct scmi_voltage_info(9), struct scmi_voltage_proto_ops(9), struct scmi_powercap_info(9), struct scmi_powercap_proto_ops(9), struct scmi_pinctrl_proto_ops(9), struct scmi_notify_ops(9), struct scmi_handle(9), module_scmi_driver(9), module_scmi_protocol(9)
kisses bestie, go read some sensor data π
this page lives at source ./include/linux π, version/date October 2026 π, and she's filed under struct scmi_sensor_info(9) β slay, ate, no crumbs, bye π
β¨
π¦ 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