STRUCT PSE_CONTROLLER_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct pse_controller_ops(9) 🌸

okay bestie, welcome to the Kernel API Manual entry for struct pse_controller_ops β€” literally the callback squad that every PSE controller driver has to bring to the function-pointer party πŸ’… no cap.


✨ NAME ✨

struct pse_controller_ops β€” the PSE controller driver callbacks. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct pse_controller_ops {
    int (*setup_pi_matrix)(struct pse_controller_dev *pcdev);
    int (*pi_get_admin_state)(struct pse_controller_dev *pcdev, int id, struct pse_admin_state *admin_state);
    int (*pi_get_pw_status)(struct pse_controller_dev *pcdev, int id, struct pse_pw_status *pw_status);
    int (*pi_get_ext_state)(struct pse_controller_dev *pcdev, int id, struct pse_ext_state_info *ext_state_info);
    int (*pi_get_pw_class)(struct pse_controller_dev *pcdev, int id);
    int (*pi_get_actual_pw)(struct pse_controller_dev *pcdev, int id);
    int (*pi_enable)(struct pse_controller_dev *pcdev, int id);
    int (*pi_disable)(struct pse_controller_dev *pcdev, int id);
    int (*pi_get_voltage)(struct pse_controller_dev *pcdev, int id);
    int (*pi_get_pw_limit)(struct pse_controller_dev *pcdev, int id);
    int (*pi_set_pw_limit)(struct pse_controller_dev *pcdev, int id, int max_mW);
    int (*pi_get_pw_limit_ranges)(struct pse_controller_dev *pcdev, int id, struct pse_pw_limit_ranges *pw_limit_ranges);
    int (*pi_get_prio)(struct pse_controller_dev *pcdev, int id);
    int (*pi_set_prio)(struct pse_controller_dev *pcdev, int id, unsigned int prio);
    int (*pi_get_pw_req)(struct pse_controller_dev *pcdev, int id);
 };

like, fifteen-ish callbacks all hanging out in one struct. main character energy fr fr πŸ‘‘


πŸ’– MEMBERS πŸ’–

  • setup_pi_matrix β€” sets up the PI matrix of the PSE controller. the PSE PIs devicetree nodes have already been parsed by of_load_pse_pis and pcdev->pi[x]->pairset[y].np is already populated by the time this runs, so don't you dare redo that work πŸ™ˆ. this callback is the one that should establish the relationship between the PSE controller hardware ports and the PSE Power Interfaces β€” either through software mapping or hardware configuration, dealer's choice ✨.
  • pi_get_admin_state β€” gets the operational state of the PSE PI. this ops is mandatory, bestie, you literally cannot skip it πŸ’€.
  • pi_get_pw_status β€” gets the power detection status of the PSE PI. also mandatory. neither of these is optional, i don't make the rules 🫢.
  • pi_get_ext_state β€” gets the extended state of the PSE PI.
  • pi_get_pw_class β€” gets the power class of the PSE PI.
  • pi_get_actual_pw β€” gets actual power of the PSE PI, measured in mW.
  • pi_enable β€” configures the PSE PI as enabled. slay πŸ”₯.
  • pi_disable β€” configures the PSE PI as disabled. the opposite slay.
  • pi_get_voltage β€” returns voltage similarly to the get_voltage regulator callback, in uV.
  • pi_get_pw_limit β€” gets the configured power limit of the PSE PI, in mW.
  • pi_set_pw_limit β€” configures the power limit of the PSE PI, in mW.
  • pi_get_pw_limit_ranges β€” gets the supported power limit configuration range. heads up: the driver is in charge of the memory allocation and should return the number of ranges 🧚.
  • pi_get_prio β€” gets the PSE PI priority.
  • pi_set_prio β€” configures the PSE PI priority.
  • pi_get_pw_req β€” gets the power requested by a PD before enabling the PSE PI. this is only relevant when an interrupt is registered using the devm_pse_irq_helper helper β€” iykyk 😌.

🌈 SEE ALSO 🌈

Kernel file ./include/linux/pse-pd/pse.h, plus the whole friend group:

  • struct pse_irq_desc(9)
  • struct pse_control_config(9)
  • struct pse_admin_state(9)
  • struct pse_pw_status(9)
  • struct pse_ext_state_info(9)
  • struct pse_pw_limit_ranges(9)
  • struct ethtool_pse_control_status(9)
  • struct pse_pi_pairset(9)
  • struct pse_pi(9)
  • struct pse_ntf(9)
  • struct pse_controller_dev(9)
  • enum pse_budget_eval_strategies(9)

go read them. all of them. i'll wait πŸ’œ

okay that's the whole page, periodt πŸŽ€ this cutie lives in ./include/linux/pse-pd and was dated October 2026 β€” drink some water, go write your callbacks, and remember: the ops are mandatory, but the vibes are forever πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from