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

Commit a778927e authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: gadget: Enable L1 suspend by default



Currently L1 suspend is disabled. Superspeed capable
device needs to support L1 suspend in HS/FS/LS mode.
Also, add module parameter to disable L1 suspend in
High speed mode.

Change-Id: Ie8e7f3949d276325305799640f2775343bd6b9da
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 4e2a8a0f
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -35,9 +35,10 @@
	(speed == USB_SPEED_SUPER ?\
	SSUSB_GADGET_VBUS_DRAW : CONFIG_USB_GADGET_VBUS_DRAW)

static bool enable_l1_for_hs;
module_param(enable_l1_for_hs, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(enable_l1_for_hs, "Enable support for L1 LPM for HS devices");
static bool disable_l1_for_hs;
module_param(disable_l1_for_hs, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(disable_l1_for_hs,
	"Disable support for L1 LPM for HS devices");

/**
 * struct usb_os_string - represents OS String to be reported by a gadget
@@ -1637,13 +1638,12 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
				if (gadget->speed >= USB_SPEED_SUPER) {
					cdev->desc.bcdUSB = cpu_to_le16(0x0310);
					cdev->desc.bMaxPacketSize0 = 9;
				} else if (gadget->l1_supported ||
						enable_l1_for_hs) {
				} else if (!disable_l1_for_hs) {
					cdev->desc.bcdUSB = cpu_to_le16(0x0210);
					DBG(cdev,
					"Config HS device with LPM(L1)\n");
				}
			} else if (gadget->l1_supported) {
			} else if (!disable_l1_for_hs) {
				cdev->desc.bcdUSB = cpu_to_le16(0x0210);
				DBG(cdev, "Config HS device with LPM(L1)\n");
			}
@@ -1678,7 +1678,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
		case USB_DT_BOS:
			if ((gadget_is_superspeed(gadget) &&
				(gadget->speed >= USB_SPEED_SUPER))
				 || gadget->l1_supported) {
				 || !disable_l1_for_hs) {
				value = bos_desc(cdev);
				value = min(w_length, (u16) value);
			}
+0 −1
Original line number Diff line number Diff line
@@ -752,7 +752,6 @@ struct usb_gadget {
	unsigned			is_selfpowered:1;
	unsigned			deactivated:1;
	unsigned			connected:1;
	bool				l1_supported;
	bool                            remote_wakeup;
};
#define work_to_gadget(w)	(container_of((w), struct usb_gadget, work))