STRUCT SCMI_SENSOR_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 of enum 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 as 0 for scalar sensors 🧭.
  • axis β€” pointer to an array of num_axis descriptors πŸ‘‰.
  • 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 to 0 if not reported by this sensor πŸ”‹.
  • resolution β€” extended attribute representing the resolution of the sensor. reported here only for scalar sensors. set to 0 if 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 to 0 if 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 to 0 if 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