STRUCT TI_SCI_CLK_OPS(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

โœจ struct ti_sci_clk_ops(9) โœจ

okay so bestie, welcome to the Kernel API Manual ๐Ÿ’… this is the whole entire vibe of struct ti_sci_clk_ops โ€” the clock control operations struct. it's giving "let me manage your clocks for you" energy, and honestly? iconic.


๐ŸŒธ NAME ๐ŸŒธ

struct ti_sci_clk_ops โ€” Clock control operations ๐Ÿ•โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

bestie. look at this struct. it's a whole menu of function pointers and it is lowkey a lot, but we're gonna get through it together ๐Ÿซถ

struct ti_sci_clk_ops {
    int (*get_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid, bool needs_ssc, bool can_change_freq, bool enable_input_term);
    int (*idle_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid);
    int (*put_clock)(const struct ti_sci_handle *handle, u32 did, u32 cid);
    int (*is_auto)(const struct ti_sci_handle *handle, u32 did, u32 cid, bool *req_state);
    int (*is_on)(const struct ti_sci_handle *handle, u32 did, u32 cid, bool *req_state, bool *current_state);
    int (*is_off)(const struct ti_sci_handle *handle, u32 did, u32 cid, bool *req_state, bool *current_state);
    int (*set_parent)(const struct ti_sci_handle *handle, u32 did, u32 cid, u32 parent_id);
    int (*get_parent)(const struct ti_sci_handle *handle, u32 did, u32 cid, u32 *parent_id);
    int (*get_num_parents)(const struct ti_sci_handle *handle, u32 did, u32 cid, u32 *num_parents);
    int (*get_best_match_freq)(const struct ti_sci_handle *handle, u32 did, u32 cid, u64 min_freq, u64 target_freq, u64 max_freq, u64 *match_freq);
    int (*set_freq)(const struct ti_sci_handle *handle, u32 did, u32 cid, u64 min_freq, u64 target_freq, u64 max_freq);
    int (*get_freq)(const struct ti_sci_handle *handle, u32 did, u32 cid, u64 *current_freq);
 };

๐Ÿ’  MEMBERS ๐Ÿ’ 

๐Ÿ• get_clock

Request for activation of clock and manage by processor โ€” literally the "hey bestie, wake up" call for your clock.

  • needs_ssc: 'true' if Spread Spectrum clock is desired.
  • can_change_freq: 'true' if frequency change is desired.
  • enable_input_term: 'true' if input termination is desired.

๐Ÿ˜ด idle_clock

Request for Idling a clock managed by processor. nap time fr fr.

๐Ÿซณ put_clock

Release the clock to be auto managed by TISCI โ€” letting go and letting the firmware take the wheel โœจ

๐Ÿค– is_auto

Is the clock being auto managed โ€” vibe check on who's actually in charge here.

  • req_state: state indicating if the clock is auto managed.

๐ŸŸข is_on

Is the clock ON โ€” the moment of truth.

  • req_state: if the clock is requested to be forced ON.
  • current_state: if the clock is currently ON.

๐Ÿ”ด is_off

Is the clock OFF โ€” the opposite moment of truth.

  • req_state: if the clock is requested to be forced OFF.
  • current_state: if the clock is currently Gated.

๐Ÿ‘‘ set_parent

Set the clock source of a specific device clock โ€” choosing your clock's main character ancestor.

  • parent_id: Parent clock identifier to set.

๐Ÿ” get_parent

Get the current clock source of a specific device clock โ€” finding out who your clock's parent actually is.

  • parent_id: Parent clock identifier which is the parent.

๐Ÿงฎ get_num_parents

Get the number of parents of the current clock source โ€” counting the whole family tree.

  • num_parents: returns the number of parent clocks.

๐ŸŽฏ get_best_match_freq

Find a best matching frequency for a frequency range. matchmaking, but for clock speeds ๐Ÿ’˜

  • match_freq: Best matching frequency in Hz.

โšก set_freq

Set the Clock frequency.

๐Ÿ“ get_freq

Get the Clock frequency.

  • current_freq: Frequency in Hz that the clock is at.

๐Ÿ’… NOTE ๐Ÿ’…

okay so for ALL of these functions, the following parameters are generic in nature โ€” they show up everywhere, so memorize the squad ๐Ÿซถ

  • -handle โ€” Pointer to TISCI handle as retrieved by *ti_sci_get_handle
  • -did โ€” Device identifier this request is for
  • -cid โ€” Clock identifier for the device for this request. Each device has it's own set of clock inputs. This indexes which clock input to modify.
  • -min_freq โ€” The minimum allowable frequency in Hz. This is the minimum allowable programmed frequency and does not account for clock tolerances and jitter.
  • -target_freq โ€” The target clock frequency in Hz. A frequency will be processed as close to this target frequency as possible.
  • -max_freq โ€” The maximum allowable frequency in Hz. This is the maximum allowable programmed frequency and does not account for clock tolerances and jitter.
Request for the clock โ€” NOTE: the client MUST maintain integrity of usage count by balancing get_clock with put_clock. No refcounting is managed by driver for that purpose. not me stressing this but fr fr, balance them or you WILL have a bad time ๐Ÿ˜ญ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

Kernel file ./include/linux/soc/ti/ti_sci_protocol.h โ€” go read it, iykyk ๐Ÿงš

  • struct ti_sci_version_info(9)
  • struct ti_sci_core_ops(9)
  • struct ti_sci_dev_ops(9)
  • struct ti_sci_pm_ops(9)
  • struct ti_sci_resource_desc(9)
  • struct ti_sci_rm_core_ops(9)
  • struct ti_sci_rm_irq_ops(9)
  • struct ti_sci_msg_rm_ring_cfg(9)
  • struct ti_sci_rm_ringacc_ops(9)
  • struct ti_sci_rm_psil_ops(9)
  • struct ti_sci_rm_udmap_ops(9)
  • struct ti_sci_proc_ops(9)
  • struct ti_sci_ops(9)
  • struct ti_sci_handle(9)
  • struct ti_sci_resource(9)

๐Ÿ’– that's the whole page bestie ๐Ÿ’– brought to you from ./include/linux/soc/ti, dated October 2026, and yes the page is literally titled struct ti_sci_clk_ops(9) because we keep it consistent ๐Ÿ‘‘ slay, go manage some clocks, periodt โœจ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from