STRUCT PSE_CONTROLLER_OPS(9)
πΈ 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 byof_load_pse_pisandpcdev->pi[x]->pairset[y].npis 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 inmW.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 theget_voltageregulator callback, inuV.pi_get_pw_limitβ gets the configured power limit of the PSE PI, inmW.pi_set_pw_limitβ configures the power limit of the PSE PI, inmW.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 thedevm_pse_irq_helperhelper β 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
- 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