Lines Matching refs:pwrctrl

6 #define dev_fmt(fmt) "pwrctrl: " fmt
15 #include <linux/pci-pwrctrl.h>
25 struct pci_pwrctrl *pwrctrl = container_of(nb, struct pci_pwrctrl, nb);
28 if (dev_fwnode(dev) != dev_fwnode(pwrctrl->dev))
52 * @pwrctrl: PCI power control data
55 void pci_pwrctrl_init(struct pci_pwrctrl *pwrctrl, struct device *dev)
57 pwrctrl->dev = dev;
58 dev_set_drvdata(dev, pwrctrl);
63 * pci_pwrctrl_device_set_ready() - Notify the pwrctrl subsystem that the PCI
66 * @pwrctrl: PCI power control data.
76 int pci_pwrctrl_device_set_ready(struct pci_pwrctrl *pwrctrl)
80 if (!pwrctrl->dev)
83 pwrctrl->nb.notifier_call = pci_pwrctrl_notify;
84 ret = bus_register_notifier(&pci_bus_type, &pwrctrl->nb);
93 * pci_pwrctrl_device_unset_ready() - Notify the pwrctrl subsystem that the PCI
96 * @pwrctrl: PCI power control data.
98 void pci_pwrctrl_device_unset_ready(struct pci_pwrctrl *pwrctrl)
106 bus_unregister_notifier(&pci_bus_type, &pwrctrl->nb);
112 struct pci_pwrctrl *pwrctrl = data;
114 pci_pwrctrl_device_unset_ready(pwrctrl);
121 * @dev: Device managing this pwrctrl provider.
122 * @pwrctrl: PCI power control data.
128 struct pci_pwrctrl *pwrctrl)
132 ret = pci_pwrctrl_device_set_ready(pwrctrl);
138 pwrctrl);
144 struct pci_pwrctrl *pwrctrl = dev_get_drvdata(dev);
146 if (!pwrctrl)
149 return pwrctrl->power_off(pwrctrl);
174 * pci_pwrctrl_power_off_devices - Power off pwrctrl devices
178 * Recursively traverse all pwrctrl devices for the devicetree hierarchy
193 struct pci_pwrctrl *pwrctrl = dev_get_drvdata(dev);
195 if (!pwrctrl)
198 return pwrctrl->power_on(pwrctrl);
234 * pci_pwrctrl_power_on_devices - Power on pwrctrl devices
238 * Recursively traverse all pwrctrl devices for the devicetree hierarchy
242 * Return: 0 on success, -EPROBE_DEFER if any pwrctrl driver is not bound, an
272 * Check whether the pwrctrl device really needs to be created or not. The
273 * pwrctrl device will only be created if the node satisfies below requirements:
276 * pwrctrl driver (AND)
278 * device (OR) in the remote endpoint parent node to indicate pwrctrl
337 /* Now create the pwrctrl device */
340 dev_err(parent, "Failed to create pwrctrl device for node: %s\n", np->name);
348 * pci_pwrctrl_create_devices - Create pwrctrl devices
352 * Recursively create pwrctrl devices for the devicetree hierarchy below
392 * pci_pwrctrl_destroy_devices - Destroy pwrctrl devices
396 * Recursively destroy pwrctrl devices for the devicetree hierarchy below