コード例 #1
0
ファイル: dwc3-pci.c プロジェクト: forgivemyheart/linux
static int dwc3_pci_runtime_suspend(struct device *dev)
{
	struct dwc3_pci		*dwc = dev_get_drvdata(dev);

	if (device_run_wake(dev))
		return dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D3);

	return -EBUSY;
}
コード例 #2
0
ファイル: device_pm.c プロジェクト: 0x000000FF/edison-linux
/**
 * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device.
 * @dev: Device to enable/disable the platform to wake up.
 * @enable: Whether to enable or disable the wakeup functionality.
 */
int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
{
	struct acpi_device *adev;

	if (!device_run_wake(phys_dev))
		return -EINVAL;

	adev = ACPI_COMPANION(phys_dev);
	if (!adev) {
		dev_dbg(phys_dev, "ACPI companion missing in %s!\n", __func__);
		return -ENODEV;
	}

	return acpi_device_wakeup(adev, ACPI_STATE_S0, enable);
}
コード例 #3
0
ファイル: device_pm.c プロジェクト: DecimalMan/linux-misc
/**
 * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device.
 * @dev: Device to enable/disable the platform to wake up.
 * @enable: Whether to enable or disable the wakeup functionality.
 */
int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
{
	struct acpi_device *adev;
	acpi_handle handle;

	if (!device_run_wake(phys_dev))
		return -EINVAL;

	handle = ACPI_HANDLE(phys_dev);
	if (!handle || acpi_bus_get_device(handle, &adev)) {
		dev_dbg(phys_dev, "ACPI handle without context in %s!\n",
			__func__);
		return -ENODEV;
	}

	return __acpi_device_run_wake(adev, enable);
}