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

Commit 5e7b3dad authored by wujin's avatar wujin Committed by jin wu
Browse files

msm: usb: Add multi-lun support for UMS



UMS(usb mass storage) need a new lun for internal
storage.So add a new lun number for internal mass storage.

Change-Id: I17ccb8f85d458567a1f1b35366b8b0834397601f
Signed-off-by: default avatarJin Wu <jinw@codeaurora.org>
parent 8899bb86
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -185,7 +185,8 @@ Optional properties :
  for DMA latency in microsecs.
- qcom,android-usb-cdrom : if this property is present then device creates
  a new LUN as CD-ROM

- qcom,android-usb-internal-ums : if this property is present then device
  creates a new LUN as internal usb mass storage
Example Android USB device node :
	android_usb@fc42b0c8 {
		compatible = "qcom,android-usb";
+14 −5
Original line number Diff line number Diff line
@@ -1993,11 +1993,18 @@ static int mass_storage_function_init(struct android_usb_function *f,
	config->fsg.nluns = 1;
	name[0] = "lun";
	if (dev->pdata && dev->pdata->cdrom) {
		config->fsg.nluns = 2;
		config->fsg.luns[1].cdrom = 1;
		config->fsg.luns[1].ro = 1;
		config->fsg.luns[1].removable = 0;
		name[1] = "lun0";
		config->fsg.luns[config->fsg.nluns].cdrom = 1;
		config->fsg.luns[config->fsg.nluns].ro = 1;
		config->fsg.luns[config->fsg.nluns].removable = 0;
		name[config->fsg.nluns] = "lun0";
		config->fsg.nluns++;
	}
	if (dev->pdata && dev->pdata->internal_ums) {
		config->fsg.luns[config->fsg.nluns].cdrom = 0;
		config->fsg.luns[config->fsg.nluns].ro = 0;
		config->fsg.luns[config->fsg.nluns].removable = 1;
		name[config->fsg.nluns] = "lun1";
		config->fsg.nluns++;
	}

	config->fsg.luns[0].removable = 1;
@@ -3131,6 +3138,8 @@ static int android_probe(struct platform_device *pdev)
				&pdata->swfi_latency);
		pdata->cdrom = of_property_read_bool(pdev->dev.of_node,
				"qcom,android-usb-cdrom");
		pdata->internal_ums = of_property_read_bool(pdev->dev.of_node,
				"qcom,android-usb-internal-ums");
	} else {
		pdata = pdev->dev.platform_data;
	}
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ struct android_usb_platform_data {
	u32 swfi_latency;
	u8 usb_core_id;
	bool cdrom;
	bool internal_ums;
};

#ifndef CONFIG_TARGET_CORE