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

Commit 2c7d104e authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_mtp: Change the icon to camera for PTP composition" into msm-4.8

parents fc1ad2f0 50439244
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -330,10 +330,12 @@ struct mtp_ext_config_desc_function {
};

/* MTP Extended Configuration Descriptor */
struct {
struct mtp_ext_config_desc {
	struct mtp_ext_config_desc_header	header;
	struct mtp_ext_config_desc_function    function;
} mtp_ext_config_desc = {
};

static struct mtp_ext_config_desc mtp_ext_config_desc = {
	.header = {
		.dwLength = __constant_cpu_to_le32(sizeof(mtp_ext_config_desc)),
		.bcdVersion = __constant_cpu_to_le16(0x0100),
@@ -1271,6 +1273,13 @@ static int mtp_ctrlrequest(struct usb_composite_dev *cdev,
			value = (w_length < sizeof(mtp_ext_config_desc) ?
					w_length : sizeof(mtp_ext_config_desc));
			memcpy(cdev->req->buf, &mtp_ext_config_desc, value);

			/* update compatibleID if PTP */
			if (dev->function.fs_descriptors == fs_ptp_descs) {
				struct mtp_ext_config_desc *d = cdev->req->buf;

				d->function.compatibleID[0] = 'P';
			}
		}
	} else if ((ctrl->bRequestType & USB_TYPE_MASK) == USB_TYPE_CLASS) {
		DBG(cdev, "class request: %d index: %d value: %d length: %d\n",