STRUCT SCMI_CLK_PROTO_OPS(9)
π struct scmi_clk_proto_ops(9) β Kernel API Manual, but make it make sense
okay so bestie, let me introduce you to struct scmi_clk_proto_ops β no cap, this is the whole vibe of the SCMI Clock Protocol. It's literally the little bundle of function pointers that says "here's every clock operation the protocol can do for you." Think of it as the group chat roster of clock ops: everybody who's allowed to touch a clock is in here. π°οΈβ¨
πΈ NAME πΈ
struct scmi_clk_proto_ops β represents the various operations provided by SCMI Clock Protocol π
Like, the operations. All of them. This struct is the plug. π«Ά
β¨ SYNOPSIS β¨
struct scmi_clk_proto_ops {
int (*count_get)(const struct scmi_protocol_handle *ph);
const struct scmi_clock_info __must_check *(*info_get) (const struct scmi_protocol_handle *ph, u32 clk_id);
int (*rate_get)(const struct scmi_protocol_handle *ph, u32 clk_id, u64 *rate);
int (*rate_set)(const struct scmi_protocol_handle *ph, u32 clk_id, u64 rate);
int (*determine_rate)(const struct scmi_protocol_handle *ph, u32 clk_id, unsigned long *rate);
const struct scmi_clock_rates __must_check *(*all_rates_get) (const struct scmi_protocol_handle *ph, u32 clk_id);
int (*enable)(const struct scmi_protocol_handle *ph, u32 clk_id, bool atomic);
int (*disable)(const struct scmi_protocol_handle *ph, u32 clk_id, bool atomic);
int (*state_get)(const struct scmi_protocol_handle *ph, u32 clk_id, bool *enabled, bool atomic);
int (*config_oem_get)(const struct scmi_protocol_handle *ph, u32 clk_id, enum scmi_clock_oem_config oem_type, u32 *oem_val, u32 *attributes, bool atomic);
int (*config_oem_set)(const struct scmi_protocol_handle *ph, u32 clk_id, enum scmi_clock_oem_config oem_type, u32 oem_val, bool atomic);
int (*parent_get)(const struct scmi_protocol_handle *ph, u32 clk_id, u32 *parent_id);
int (*parent_set)(const struct scmi_protocol_handle *ph, u32 clk_id, u32 parent_id);
};
lowkey iconic that a struct this small can do this much. π
π Members π
bestie, here's the whole cast, one by one, main character energy each:
count_getβ get the count of clocks provided by SCMI. literally just "how many clocks we got?" π’info_getβ get the information of the specified clock. the lil bio for one specific clock β¨rate_getβ request the current clock rate of a clock. "what speed are you at rn?" πrate_setβ set the clock rate of a clock. now we're changing it fr fr β‘determine_rateβ determine the effective rate that can be supported by a clock calculating the closest allowed rate. note thatrateis an input/output parameter used both to describe the requested rate and report the closest match. so it's giving "you asked for this, here's what you're actually getting" β the rate walks in as your request and leaves as the answer πall_rates_getβ get the list of all available rates for the specified clock. the full menu, not just one item πenableβ enables the specified clock. wake up babe π₯disableβ disables the specified clock. nap time, clock version π΄state_getβ get the status of the specified clock. vibe check on whether it's on or off π¦config_oem_getβ get the value of an OEM specific clock config. vendor-flavoured settings, but reading them πconfig_oem_setβ set the value of an OEM specific clock config. and now writing them πparent_getβ get the parent id of a clk. who's your clock's parent? πparent_setβ set the parent of a clock. reparenting, clock edition π§
π¦ SEE ALSO π¦
Kernel file ./include/linux/scmi_protocol.h β plus the whole extended friend group, go say hi:
struct scmi_base_info(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_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)
ngl, if you're touching clocks through SCMI, this struct is the whole personality. read it, love it, don't invent ops that aren't in it. ππ
k bye bestie, that's a wrap π«Ά this page lives in ./include/linux, dated October 2026, and it's struct scmi_clk_proto_ops(9) β slay, go forth and clock 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