STRUCT SCPI_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct scpi_ops(9) β€” the Kernel API Manual glow-up ✨

okay so welcome to the Kernel API Manual, bestie πŸŽ€ and today's main character is struct scpi_ops β€” the whole entire vibe of this page is: it represents the various operations provided by SCP through SCPI message protocol. that's it, that's the thesis πŸ’… no cap.


✨ NAME ✨

struct scpi_ops β€” literally represents the various operations provided by SCP through SCPI message protocol 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

struct scpi_ops {
    u32 (*get_version)(void);
    int (*clk_get_range)(u16, unsigned long *, unsigned long *);
    unsigned long (*clk_get_val)(u16);
    int (*clk_set_val)(u16, unsigned long);
    int (*dvfs_get_idx)(u8);
    int (*dvfs_set_idx)(u8, u8);
    struct scpi_dvfs_info *(*dvfs_get_info)(u8);
    int (*device_domain_id)(struct device *);
    int (*get_transition_latency)(struct device *);
    int (*add_opps_to_device)(struct device *);
    int (*sensor_get_capability)(u16 *sensors);
    int (*sensor_get_info)(u16 sensor_id, struct scpi_sensor_info *);
    int (*sensor_get_value)(u16, u64 *);
    int (*device_get_power_state)(u16);
    int (*device_set_power_state)(u16, u8);
 };

like, look at her. fifteen function pointers. fifteen. she's booked and busy πŸ‘‘


🌸 Members 🌸

  • get_version β€” returns the major and minor revision on the SCPI message protocol. version check, slay ✨
  • clk_get_range β€” gets clock range limit (min - max in Hz). the whole spectrum, iykyk πŸ’œ
  • clk_get_val β€” gets clock value (in Hz). one number, one vibe πŸŽ€
  • clk_set_val β€” sets the clock value, and heads up: setting to 0 will disable the clock (if supported). so zero is not a normal number here, it's a choice 😭
  • dvfs_get_idx β€” gets the Operating Point of the given power domain. and OPP is an index to the list return by dvfs_get_info πŸ”₯ (yes, "return", that's the original wording, we keep it fr fr)
  • dvfs_set_idx β€” sets the Operating Point of the given power domain. and again, OPP is an index to the list return by dvfs_get_info 🌈 matching set, we love a pair 🫢
  • dvfs_get_info β€” returns the DVFS capabilities of the given power domain. it includes the OPP list and the latency information. the whole package deal πŸ’…
  • device_domain_id β€” gets the scpi domain id for a given device. who's your domain, bestie πŸ‘€
  • get_transition_latency β€” gets the DVFS transition latency for a given device. how long the glow-up takes ⭐
  • add_opps_to_device β€” adds all the OPPs for a given device. not some, all, we don't do half measures πŸ’–
  • sensor_get_capability β€” get the list of capabilities for the sensors. what can they even do πŸ¦‹
  • sensor_get_info β€” get the information of the specified sensor. the tea on that one specific sensor πŸ“
  • sensor_get_value β€” gets the current value of the sensor. right now, live, no cap πŸ“‘
  • device_get_power_state β€” gets the power state of a power domain. are we awake or nah πŸ’€
  • device_set_power_state β€” sets the power state of a power domain. putting her to sleep or waking her up, your call πŸ‘‘

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/scpi_protocol.h β€” go read the source, it's giving required reading πŸ“šβœ¨


real talk though: every pointer above has a specific signature and a specific job β€” don't be out here swapping them around and hoping for the best, that's how you get undefined behaviour and a very sad kernel πŸ˜­πŸ’€

and that's the page!! πŸŽ€ cute little sign-off for you: this one comes from ./include/linux, dated October 2026, and it's filed under struct scpi_ops(9) 🫢✨ bye bestie, go forth and call your function pointers responsibly πŸ’œ

πŸ“¦ where this page comes from