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

Commit fef655d1 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb_bam: Enable SPS_BAM_SMMU_EN with BAM device



Enable SPS_BAM_SMMU_EN flag with USB BAM device while registering
with SPS driver if USB device is enabling SMMU functionality. SPS
driver uses this flag to use iova or physical address to program
BAM registers.

Change-Id: Iccefd9ad1f31172d107c82ffe5ce7b87c40e106c
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 7eb6f74c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1194,6 +1194,7 @@ static int usb_bam_init(struct platform_device *pdev)
	struct usb_bam_ctx_type *ctx = dev_get_drvdata(&pdev->dev);
	enum usb_ctrl bam_type = ctx->usb_bam_data->bam_type;
	struct sps_bam_props props;
	struct device *dev;

	memset(&props, 0, sizeof(props));

@@ -1211,6 +1212,14 @@ static int usb_bam_init(struct platform_device *pdev)
	if (ctx->usb_bam_data->disable_clk_gating)
		props.options |= SPS_BAM_NO_LOCAL_CLK_GATING;

	dev = &ctx->usb_bam_pdev->dev;
	if (dev && dev->parent && !device_property_present(dev->parent,
						"qcom,smmu-s1-bypass")) {
		pr_info("%s: setting SPS_BAM_SMMU_EN flag with (%s)\n",
						__func__, dev_name(dev));
		props.options |= SPS_BAM_SMMU_EN;
	}

	ret = sps_register_bam_device(&props, &ctx->h_bam);
	if (ret < 0) {
		log_event_err("%s: register bam error %d\n", __func__, ret);