.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
1 | 2 | /* |
---|
2 | 3 | * drivers/base/power/common.c - Common device power management code. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp. |
---|
5 | | - * |
---|
6 | | - * This file is released under the GPLv2. |
---|
7 | 6 | */ |
---|
8 | | - |
---|
9 | 7 | #include <linux/kernel.h> |
---|
10 | 8 | #include <linux/device.h> |
---|
11 | 9 | #include <linux/export.h> |
---|
.. | .. |
---|
160 | 158 | * For a detailed function description, see dev_pm_domain_attach_by_id(). |
---|
161 | 159 | */ |
---|
162 | 160 | struct device *dev_pm_domain_attach_by_name(struct device *dev, |
---|
163 | | - char *name) |
---|
| 161 | + const char *name) |
---|
164 | 162 | { |
---|
165 | 163 | if (dev->pm_domain) |
---|
166 | 164 | return ERR_PTR(-EEXIST); |
---|
.. | .. |
---|
190 | 188 | EXPORT_SYMBOL_GPL(dev_pm_domain_detach); |
---|
191 | 189 | |
---|
192 | 190 | /** |
---|
| 191 | + * dev_pm_domain_start - Start the device through its PM domain. |
---|
| 192 | + * @dev: Device to start. |
---|
| 193 | + * |
---|
| 194 | + * This function should typically be called during probe by a subsystem/driver, |
---|
| 195 | + * when it needs to start its device from the PM domain's perspective. Note |
---|
| 196 | + * that, it's assumed that the PM domain is already powered on when this |
---|
| 197 | + * function is called. |
---|
| 198 | + * |
---|
| 199 | + * Returns 0 on success and negative error values on failures. |
---|
| 200 | + */ |
---|
| 201 | +int dev_pm_domain_start(struct device *dev) |
---|
| 202 | +{ |
---|
| 203 | + if (dev->pm_domain && dev->pm_domain->start) |
---|
| 204 | + return dev->pm_domain->start(dev); |
---|
| 205 | + |
---|
| 206 | + return 0; |
---|
| 207 | +} |
---|
| 208 | +EXPORT_SYMBOL_GPL(dev_pm_domain_start); |
---|
| 209 | + |
---|
| 210 | +/** |
---|
193 | 211 | * dev_pm_domain_set - Set PM domain of a device. |
---|
194 | 212 | * @dev: Device whose PM domain is to be set. |
---|
195 | 213 | * @pd: PM domain to be set, or NULL. |
---|