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

Commit eec41f31 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: msm_audio_ion: add mask for Stream ID" into msm-4.9

parents 7cb7aff9 87405a22
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1067,6 +1067,9 @@ Optional properties:
	used in chipset. If ARM SMMU HW - use id value as 1,
	If QSMMU HW - use id value as 2.

 - qcom,smmu-sid-mask:
	Mask for the Stream ID part of SMMU SID.

 - qcom,smmu-enabled:
        It is possible that some MSM have SMMU in ADSP.  While other MSM use
	no SMMU. Audio lib introduce wrapper for ION APIs. The wrapper needs
+12 −1
Original line number Diff line number Diff line
@@ -723,6 +723,7 @@ static int msm_audio_ion_probe(struct platform_device *pdev)
	int rc = 0;
	const char *msm_audio_ion_dt = "qcom,smmu-enabled";
	const char *msm_audio_ion_smmu = "qcom,smmu-version";
	const char *msm_audio_ion_smmu_sid_mask = "qcom,smmu-sid-mask";
	bool smmu_enabled;
	enum apr_subsys_state q6_state;
	struct device *dev = &pdev->dev;
@@ -766,16 +767,26 @@ static int msm_audio_ion_probe(struct platform_device *pdev)

	if (smmu_enabled) {
		u64 smmu_sid = 0;
		u64 smmu_sid_mask = 0;
		struct of_phandle_args iommuspec;

		/* Get SMMU SID information from Devicetree */
		rc = of_property_read_u64(dev->of_node,
					  msm_audio_ion_smmu_sid_mask,
					  &smmu_sid_mask);
		if (rc) {
			dev_err(dev,
				"%s: qcom,smmu-sid-mask missing in DT node, using default\n",
				__func__);
			smmu_sid_mask = 0xFFFFFFFFFFFFFFFF;
		}
		rc = of_parse_phandle_with_args(dev->of_node, "iommus",
						"#iommu-cells", 0, &iommuspec);
		if (rc)
			dev_err(dev, "%s: could not get smmu SID, ret = %d\n",
				__func__, rc);
		else
			smmu_sid = iommuspec.args[0];
			smmu_sid = (iommuspec.args[0] & smmu_sid_mask);

		msm_audio_ion_data.smmu_sid_bits =
			smmu_sid << MSM_AUDIO_SMMU_SID_OFFSET;