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

Commit 98b9b566 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Matt Wagantall
Browse files

USB: android: override bcdDevice only if userspace passes it



The composite driver assigns the bcdDevice field in the device
descriptor to the current kernel version. Android composite driver
is overriding this with the default value 0xFFFF. Override bcdDevice
only if the userspace passes a value by writing into
/sys/class/android_usb/android0/bcdDevice file.

Change-Id: I19c62754ea6ae59a71a6aa472964f1a9f622c8e5
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 1a46de94
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -256,7 +256,6 @@ static struct usb_device_descriptor device_desc = {
	.bDeviceClass         = USB_CLASS_PER_INTERFACE,
	.idVendor             = __constant_cpu_to_le16(VENDOR_ID),
	.idProduct            = __constant_cpu_to_le16(PRODUCT_ID),
	.bcdDevice            = __constant_cpu_to_le16(0xffff),
	.bNumConfigurations   = 1,
};

@@ -3174,6 +3173,7 @@ static ssize_t enable_store(struct device *pdev, struct device_attribute *attr,
		 */
		cdev->desc.idVendor = device_desc.idVendor;
		cdev->desc.idProduct = device_desc.idProduct;
		if (device_desc.bcdDevice)
			cdev->desc.bcdDevice = device_desc.bcdDevice;
		cdev->desc.bDeviceClass = device_desc.bDeviceClass;
		cdev->desc.bDeviceSubClass = device_desc.bDeviceSubClass;