Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ceb6c9c8 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

USB / PM: Drop CONFIG_PM_RUNTIME from the USB core



After commit b2b49ccb (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
depend on CONFIG_PM (or even dropped in some cases).

Replace CONFIG_PM_RUNTIME with CONFIG_PM in the USB core code
and documentation.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6ed23b80
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -32,10 +32,9 @@ Date: January 2008
KernelVersion:	2.6.25
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		If CONFIG_PM_RUNTIME is enabled then this file
		is present.  When read, it returns the total time (in msec)
		that the USB device has been connected to the machine.  This
		file is read-only.
		If CONFIG_PM is enabled, then this file is present.  When read,
		it returns the total time (in msec) that the USB device has been
		connected to the machine.  This file is read-only.
Users:
		PowerTOP <powertop@lists.01.org>
		https://01.org/powertop/
@@ -45,10 +44,9 @@ Date: January 2008
KernelVersion:	2.6.25
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		If CONFIG_PM_RUNTIME is enabled then this file
		is present.  When read, it returns the total time (in msec)
		that the USB device has been active, i.e. not in a suspended
		state.  This file is read-only.
		If CONFIG_PM is enabled, then this file is present.  When read,
		it returns the total time (in msec) that the USB device has been
		active, i.e. not in a suspended state.  This file is read-only.

		Tools can use this file and the connected_duration file to
		compute the percentage of time that a device has been active.
+9 −10
Original line number Diff line number Diff line
@@ -104,16 +104,15 @@ What: /sys/bus/usb/devices/.../power/usb2_hardware_lpm
Date:		September 2011
Contact:	Andiry Xu <andiry.xu@amd.com>
Description:
		If CONFIG_PM_RUNTIME is set and a USB 2.0 lpm-capable device
		is plugged in to a xHCI host which support link PM, it will
		perform a LPM test; if the test is passed and host supports
		USB2 hardware LPM (xHCI 1.0 feature), USB2 hardware LPM will
		be enabled for the device and the USB device directory will
		contain a file named power/usb2_hardware_lpm.  The file holds
		a string value (enable or disable) indicating whether or not
		USB2 hardware LPM is enabled for the device. Developer can
		write y/Y/1 or n/N/0 to the file to enable/disable the
		feature.
		If CONFIG_PM is set and a USB 2.0 lpm-capable device is plugged
		in to a xHCI host which support link PM, it will perform a LPM
		test; if the test is passed and host supports USB2 hardware LPM
		(xHCI 1.0 feature), USB2 hardware LPM will be enabled for the
		device and the USB device directory will contain a file named
		power/usb2_hardware_lpm.  The file holds a string value (enable
		or disable) indicating whether or not USB2 hardware LPM is
		enabled for the device. Developer can write y/Y/1 or n/N/0 to
		the file to enable/disable the feature.

What:		/sys/bus/usb/devices/.../removable
Date:		February 2012
+9 −8
Original line number Diff line number Diff line
@@ -47,14 +47,15 @@ dynamic PM is implemented in the USB subsystem, although system PM is
covered to some extent (see Documentation/power/*.txt for more
information about system PM).

Note: Dynamic PM support for USB is present only if the kernel was
built with CONFIG_USB_SUSPEND enabled (which depends on
CONFIG_PM_RUNTIME).  System PM support is present only if the kernel
was built with CONFIG_SUSPEND or CONFIG_HIBERNATION enabled.

(Starting with the 3.10 kernel release, dynamic PM support for USB is
present whenever the kernel was built with CONFIG_PM_RUNTIME enabled.
The CONFIG_USB_SUSPEND option has been eliminated.)
System PM support is present only if the kernel was built with CONFIG_SUSPEND
or CONFIG_HIBERNATION enabled.  Dynamic PM support for USB is present whenever
the kernel was built with CONFIG_PM enabled.

[Historically, dynamic PM support for USB was present only if the
kernel had been built with CONFIG_USB_SUSPEND enabled (which depended on
CONFIG_PM_RUNTIME).  Starting with the 3.10 kernel release, dynamic PM support
for USB was present whenever the kernel was built with CONFIG_PM_RUNTIME
enabled.  The CONFIG_USB_SUSPEND option had been eliminated.]


	What is Remote Wakeup?
+1 −5
Original line number Diff line number Diff line
@@ -1493,10 +1493,6 @@ int usb_resume(struct device *dev, pm_message_t msg)
	return status;
}

#endif /* CONFIG_PM */

#ifdef CONFIG_PM_RUNTIME

/**
 * usb_enable_autosuspend - allow a USB device to be autosuspended
 * @udev: the USB device which may be autosuspended
@@ -1876,7 +1872,7 @@ int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable)
	return ret;
}

#endif /* CONFIG_PM_RUNTIME */
#endif /* CONFIG_PM */

struct bus_type usb_bus_type = {
	.name =		"usb",
+0 −11
Original line number Diff line number Diff line
@@ -429,7 +429,6 @@ static int check_root_hub_suspended(struct device *dev)
	return 0;
}

#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
static int suspend_common(struct device *dev, bool do_wakeup)
{
	struct pci_dev		*pci_dev = to_pci_dev(dev);
@@ -528,7 +527,6 @@ static int resume_common(struct device *dev, int event)
	}
	return retval;
}
#endif	/* SLEEP || RUNTIME */

#ifdef	CONFIG_PM_SLEEP

@@ -607,8 +605,6 @@ static int hcd_pci_restore(struct device *dev)

#endif	/* CONFIG_PM_SLEEP */

#ifdef	CONFIG_PM_RUNTIME

static int hcd_pci_runtime_suspend(struct device *dev)
{
	int	retval;
@@ -630,13 +626,6 @@ static int hcd_pci_runtime_resume(struct device *dev)
	return retval;
}

#else

#define hcd_pci_runtime_suspend	NULL
#define hcd_pci_runtime_resume	NULL

#endif	/* CONFIG_PM_RUNTIME */

const struct dev_pm_ops usb_hcd_pci_pm_ops = {
	.suspend	= hcd_pci_suspend,
	.suspend_noirq	= hcd_pci_suspend_noirq,
Loading