STRUCT SCPI_OPS(9)
π 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 bydvfs_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 bydvfs_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
- 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