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

Commit 64b9ed48 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qcom_geni_se: Add a check in QUP common driver to vote for BW"

parents af9f6791 b6399d24
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@ Optional properties:
- qcom,msm-bus,num-paths: Number of paths to put vote for.
- qcom,msm-bus,num-paths: Number of paths to put vote for.
- qcom,msm-bus,vectors-bus-ids: Master and slave Endpoint IDs for DDR
- qcom,msm-bus,vectors-bus-ids: Master and slave Endpoint IDs for DDR
				and Corex/2x paths.
				and Corex/2x paths.
- qcom,vote-for-bw: Boolean flag to check if ab/ib vote should be given
		    as bandwidth or BCM threashold.


Optional subnodes:
Optional subnodes:
qcom,iommu_qupv3_geni_se_cb:	Child node representing the QUPV3 context
qcom,iommu_qupv3_geni_se_cb:	Child node representing the QUPV3 context
+13 −4
Original line number Original line Diff line number Diff line
@@ -87,6 +87,8 @@ struct bus_vectors {
 * @num_usecases:	One usecase to vote for both QUPv3 clock and DDR paths.
 * @num_usecases:	One usecase to vote for both QUPv3 clock and DDR paths.
 * @pdata:		To register our client handle with the ICB driver.
 * @pdata:		To register our client handle with the ICB driver.
 * @update:		Usecase index for icb voting.
 * @update:		Usecase index for icb voting.
 * @vote_for_bw:	To check if we have to vote for BW or BCM threashold
			in ab/ib ICB voting.
 */
 */
struct geni_se_device {
struct geni_se_device {
	struct device *dev;
	struct device *dev;
@@ -122,6 +124,7 @@ struct geni_se_device {
	int num_usecases;
	int num_usecases;
	struct msm_bus_scale_pdata *pdata;
	struct msm_bus_scale_pdata *pdata;
	int update;
	int update;
	bool vote_for_bw;
};
};


/* Offset of QUPV3 Hardware Version Register */
/* Offset of QUPV3 Hardware Version Register */
@@ -741,9 +744,11 @@ static int geni_se_rmv_ab_ib(struct geni_se_device *geni_se_dev,


	if (geni_se_dev->num_paths == 2) {
	if (geni_se_dev->num_paths == 2) {
		geni_se_dev->pdata->usecase[new_update].vectors[0].ab  =
		geni_se_dev->pdata->usecase[new_update].vectors[0].ab  =
			CONV_TO_BW(geni_se_dev->cur_ab);
			geni_se_dev->vote_for_bw ?
			CONV_TO_BW(geni_se_dev->cur_ab) : geni_se_dev->cur_ab;
		geni_se_dev->pdata->usecase[new_update].vectors[0].ib  =
		geni_se_dev->pdata->usecase[new_update].vectors[0].ib  =
			CONV_TO_BW(geni_se_dev->cur_ib);
			geni_se_dev->vote_for_bw ?
			CONV_TO_BW(geni_se_dev->cur_ib) : geni_se_dev->cur_ib;
	}
	}


	if (bus_bw_update && geni_se_dev->num_paths != 2)
	if (bus_bw_update && geni_se_dev->num_paths != 2)
@@ -892,9 +897,11 @@ static int geni_se_add_ab_ib(struct geni_se_device *geni_se_dev,


	if (geni_se_dev->num_paths == 2) {
	if (geni_se_dev->num_paths == 2) {
		geni_se_dev->pdata->usecase[new_update].vectors[0].ab  =
		geni_se_dev->pdata->usecase[new_update].vectors[0].ab  =
			CONV_TO_BW(geni_se_dev->cur_ab);
			geni_se_dev->vote_for_bw ?
			CONV_TO_BW(geni_se_dev->cur_ab) : geni_se_dev->cur_ab;
		geni_se_dev->pdata->usecase[new_update].vectors[0].ib  =
		geni_se_dev->pdata->usecase[new_update].vectors[0].ib  =
			CONV_TO_BW(geni_se_dev->cur_ib);
			geni_se_dev->vote_for_bw ?
			CONV_TO_BW(geni_se_dev->cur_ib) : geni_se_dev->cur_ib;
	}
	}


	if (bus_bw_update && geni_se_dev->num_paths != 2)
	if (bus_bw_update && geni_se_dev->num_paths != 2)
@@ -1799,6 +1806,8 @@ static int geni_se_probe(struct platform_device *pdev)
		}
		}
	}
	}


	geni_se_dev->vote_for_bw = of_property_read_bool(dev->of_node,
							"qcom,vote-for-bw");
	geni_se_dev->iommu_s1_bypass = of_property_read_bool(dev->of_node,
	geni_se_dev->iommu_s1_bypass = of_property_read_bool(dev->of_node,
							"qcom,iommu-s1-bypass");
							"qcom,iommu-s1-bypass");
	geni_se_dev->bus_bw_set = default_bus_bw_set;
	geni_se_dev->bus_bw_set = default_bus_bw_set;