STRUCT SCMI_SENSOR_INTERVALS_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct scmi_sensor_intervals_info β€” the vibe check on sensor update intervals πŸ’–

Okay bestie, so this is from the Kernel API Manual and it's literally all about describing the number and type of available update intervals for SCMI sensors. No cap, it's giving "I keep track of when your sensor data refreshes" energy. Let's get into it. 🫢


✨ NAME ✨

struct scmi_sensor_intervals_info β€” describes number and type of available update intervals

Like, it's the main character struct that tells you how many intervals you got and what flavor they are. Periodt. πŸ’…


🌸 SYNOPSIS 🌸

struct scmi_sensor_intervals_info {
    bool segmented;
    unsigned int count;
  #define SCMI_SENS_INTVL_SEGMENT_LOW     0;
  #define SCMI_SENS_INTVL_SEGMENT_HIGH    1;
  #define SCMI_SENS_INTVL_SEGMENT_STEP    2;
    unsigned int *desc;
  #define SCMI_SENS_INTVL_GET_SECS(x)             FIELD_GET(GENMASK(20, 5), (x));
  #define SCMI_SENS_INTVL_GET_EXP(x)
({
      int __signed_exp = FIELD_GET(GENMASK(4, 0), (x));
      if (__signed_exp & BIT(4))
  __signed_exp |= GENMASK(31, 5);
      __signed_exp;
  });
  #define SCMI_MAX_PREALLOC_POOL                  16;
    unsigned int prealloc_pool[SCMI_MAX_PREALLOC_POOL];
};

Look at all those macros β€” they're iconic, they're doing the most, and they're exactly what you need to decode the interval descriptors. The SCMI_SENS_INTVL_SEGMENT_* defines? Literally the three members of a segmented interval, in order. And those FIELD_GET macros? They're the key to unlocking the bits. πŸ”₯


πŸŽ€ Members πŸŽ€

  • segmented β€” Flag for segmented intervals' representation. When True there will be exactly 3 intervals in desc, with each entry representing a member of a segment in this order: {lowest update interval, highest update interval, step size}. So yes, bestie, when it's segmented you get the low, the high, and the step β€” the holy trinity of interval info. πŸ™
  • count β€” Number of intervals described in desc. Simple as that. It's the count. The number. The amount. You get it. πŸ’―
  • desc β€” Array of count interval descriptor bitmask represented as detailed in the SCMI specification: it can be accessed using the accompanying macros. So don't try to rawdog the bits yourself, use SCMI_SENS_INTVL_GET_SECS(x) and SCMI_SENS_INTVL_GET_EXP(x) β€” they're literally right there for you. 😌
  • prealloc_pool β€” A minimal preallocated pool of desc entries used to avoid lesser-than-64-bytes dynamic allocation for small count values. It's the "don't bother the allocator for tiny stuff" squad. SCMI_MAX_PREALLOC_POOL is 16, so you got 16 slots of preallocated goodness. Waste not, want not. 🧚
Ngl, the SCMI_MAX_PREALLOC_POOL macro is defined as 16; with a semicolon inside the struct β€” that's just how the header does it. Don't @ me, it's literally in the original. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/scmi_protocol.h β€” and all these other structs and functions, because the kernel is a whole social network and everyone's connected:

  • 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_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)

That's the whole page, bestie. Source is ./include/linux, and it's dated October 2026 (yes, future vibes). Stay slay, stay curious, and remember: always read your interval descriptors with the macros provided. 😘✨

🌸 with love from the Kernel API Manual 🌸

πŸ“¦ where this page comes from