Lines Matching defs:dev
19 * @dev: Device to handle.
25 int dev_pm_get_subsys_data(struct device *dev)
33 spin_lock_irq(&dev->power.lock);
35 if (dev->power.subsys_data) {
36 dev->power.subsys_data->refcount++;
40 dev->power.subsys_data = psd;
41 pm_clk_init(dev);
45 spin_unlock_irq(&dev->power.lock);
56 * @dev: Device to handle.
61 void dev_pm_put_subsys_data(struct device *dev)
65 spin_lock_irq(&dev->power.lock);
67 psd = dev_to_psd(dev);
72 dev->power.subsys_data = NULL;
77 spin_unlock_irq(&dev->power.lock);
84 * @dev: Device to attach.
87 * The @dev may only be attached to a single PM domain. By iterating through
102 int dev_pm_domain_attach(struct device *dev, bool power_on)
106 if (dev->pm_domain)
109 ret = acpi_dev_pm_attach(dev, power_on);
111 ret = genpd_dev_pm_attach(dev);
119 * @dev: The device used to lookup the PM domain.
122 * As @dev may only be attached to a single PM domain, the backend PM domain
139 * domain, NULL in case @dev don't need a PM domain, else an ERR_PTR().
143 struct device *dev_pm_domain_attach_by_id(struct device *dev,
146 if (dev->pm_domain)
149 return genpd_dev_pm_attach_by_id(dev, index);
155 * @dev: The device used to lookup the PM domain.
160 struct device *dev_pm_domain_attach_by_name(struct device *dev,
163 if (dev->pm_domain)
166 return genpd_dev_pm_attach_by_name(dev, name);
172 * @dev: Device to detach.
176 * dev_pm_domain_attach_by_id(), thus it detaches @dev from its PM domain.
183 void dev_pm_domain_detach(struct device *dev, bool power_off)
185 if (dev->pm_domain && dev->pm_domain->detach)
186 dev->pm_domain->detach(dev, power_off);
192 * @dev: Device to start.
201 int dev_pm_domain_start(struct device *dev)
203 if (dev->pm_domain && dev->pm_domain->start)
204 return dev->pm_domain->start(dev);
212 * @dev: Device whose PM domain is to be set.
220 void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd)
222 if (dev->pm_domain == pd)
225 WARN(pd && device_is_bound(dev),
227 dev->pm_domain = pd;
228 device_pm_check_callbacks(dev);