STRUCT SCMI_CLK_PROTO_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 that rate is 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