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

Commit 1a653bca authored by Udipto Goswami's avatar Udipto Goswami Committed by Manu Gautam
Browse files

usb_bam: Set default BAM type as DWC3 if not specified



'Commit 8db85a3d ("platform: msm: Add USB BAM support to
ChipIdea/RMNET")' mandates BAM type to be present in the dtsi
file. Absence of this field leads to BAM probe failure.

Fix this by setting the default BAM type to DWC3 if the field
is not available.

Change-Id: I3970855e1d3682901b7557512c68bad1f77260a1
Signed-off-by: default avatarUdipto Goswami <ugoswami@codeaurora.org>
parent 3eb9c77d
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -1246,7 +1246,7 @@ static struct msm_usb_bam_data *usb_bam_dt_to_data(
	struct device_node *node = pdev->dev.of_node;
	int rc = 0;
	u8 i = 0;
	u32 bam;
	u32 bam = DWC3_CTRL;
	u32 addr = 0;
	u32 threshold, max_connections = 0;
	static struct usb_bam_pipe_connect *usb_bam_connections;
@@ -1256,12 +1256,9 @@ static struct msm_usb_bam_data *usb_bam_dt_to_data(
	if (!usb_bam_data)
		return NULL;

	rc = of_property_read_u32(node, "qcom,bam-type", &bam);
	if (rc) {
		log_event_err("%s: bam type is missing in device tree\n",
			__func__);
		return NULL;
	}
	/* override bam-type if specified, default is dwc3 */
	of_property_read_u32(node, "qcom,bam-type", &bam);

	if (bam >= MAX_BAMS) {
		log_event_err("%s: Invalid bam type %d in device tree\n",
			__func__, bam);