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

Commit e3a6ba82 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: usb: Add multi-lun support for UMS"

parents 74865993 5e7b3dad
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -185,7 +185,8 @@ Optional properties :
  for DMA latency in microsecs.
  for DMA latency in microsecs.
- qcom,android-usb-cdrom : if this property is present then device creates
- qcom,android-usb-cdrom : if this property is present then device creates
  a new LUN as CD-ROM
  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 :
Example Android USB device node :
	android_usb@fc42b0c8 {
	android_usb@fc42b0c8 {
		compatible = "qcom,android-usb";
		compatible = "qcom,android-usb";
+14 −5
Original line number Original line Diff line number Diff line
@@ -2034,11 +2034,18 @@ static int mass_storage_function_init(struct android_usb_function *f,
	config->fsg.nluns = 1;
	config->fsg.nluns = 1;
	name[0] = "lun";
	name[0] = "lun";
	if (dev->pdata && dev->pdata->cdrom) {
	if (dev->pdata && dev->pdata->cdrom) {
		config->fsg.nluns = 2;
		config->fsg.luns[config->fsg.nluns].cdrom = 1;
		config->fsg.luns[1].cdrom = 1;
		config->fsg.luns[config->fsg.nluns].ro = 1;
		config->fsg.luns[1].ro = 1;
		config->fsg.luns[config->fsg.nluns].removable = 0;
		config->fsg.luns[1].removable = 0;
		name[config->fsg.nluns] = "lun0";
		name[1] = "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;
	config->fsg.luns[0].removable = 1;
@@ -3172,6 +3179,8 @@ static int android_probe(struct platform_device *pdev)
				&pdata->swfi_latency);
				&pdata->swfi_latency);
		pdata->cdrom = of_property_read_bool(pdev->dev.of_node,
		pdata->cdrom = of_property_read_bool(pdev->dev.of_node,
				"qcom,android-usb-cdrom");
				"qcom,android-usb-cdrom");
		pdata->internal_ums = of_property_read_bool(pdev->dev.of_node,
				"qcom,android-usb-internal-ums");
	} else {
	} else {
		pdata = pdev->dev.platform_data;
		pdata = pdev->dev.platform_data;
	}
	}
+1 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ struct android_usb_platform_data {
	u32 swfi_latency;
	u32 swfi_latency;
	u8 usb_core_id;
	u8 usb_core_id;
	bool cdrom;
	bool cdrom;
	bool internal_ums;
};
};


#ifndef CONFIG_TARGET_CORE
#ifndef CONFIG_TARGET_CORE