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

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

Merge "USB: android: Enable cdrom lun creation from device tree"

parents ad63ba6f 8374a362
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -232,6 +232,8 @@ Optional properties :
  turnaround timeout is observed on enabling streaming. Hence it is required
  to see these errors and number of erros on enabling this at USB level to make
  final decision to enable this feature or not.
- qcom,android-usb-cdrom : if this property is present then device creates
  a new LUN as CD-ROM.
- qcom,android-usb-uicc-nluns : Number of mass storage LUNs (8 bits) required
  for the UICC card.
Example Android USB device node :
+10 −0
Original line number Diff line number Diff line
@@ -2208,6 +2208,14 @@ static int mass_storage_function_init(struct android_usb_function *f,
	snprintf(name[0], MAX_LUN_NAME, "lun");
	config->fsg.luns[0].removable = 1;

	if (dev->pdata && dev->pdata->cdrom) {
		config->fsg.luns[config->fsg.nluns].cdrom = 1;
		config->fsg.luns[config->fsg.nluns].ro = 1;
		config->fsg.luns[config->fsg.nluns].removable = 0;
		snprintf(name[config->fsg.nluns], MAX_LUN_NAME, "rom");
		config->fsg.nluns++;
	}

	if (uicc_nluns > FSG_MAX_LUNS - config->fsg.nluns) {
		uicc_nluns = FSG_MAX_LUNS - config->fsg.nluns;
		pr_debug("limiting uicc luns to %d\n", uicc_nluns);
@@ -3532,6 +3540,8 @@ static int android_probe(struct platform_device *pdev)

		pdata->streaming_func_count = len;

		pdata->cdrom = of_property_read_bool(pdev->dev.of_node,
			"qcom,android-usb-cdrom");
		ret = of_property_read_u8(pdev->dev.of_node,
				"qcom,android-usb-uicc-nluns",
				&pdata->uicc_nluns);
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ struct android_usb_platform_data {
	char streaming_func[MAX_STREAMING_FUNCS][FUNC_NAME_LEN];
	int  streaming_func_count;
	u8 uicc_nluns;
	bool cdrom;
};

#ifndef CONFIG_TARGET_CORE