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

Commit f54d2cfe authored by David Dai's avatar David Dai Committed by Gerrit - the friendly Code Review server
Browse files

interconnect: qcom: fix up endianness for rpmh messages



Fix up le32 and le16 to int errors when converting from
le types to cpu.

Change-Id: I45b267195210a6ec4f2a4175eddcc541ec081043
Signed-off-by: default avatarDavid Dai <daidavid1@codeaurora.org>
parent 342ec64e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -61,23 +61,23 @@ static void bcm_aggregate(struct qcom_icc_bcm *bcm)
	for (bucket = 0; bucket < QCOM_ICC_NUM_BUCKETS; bucket++) {
		for (i = 0; i < bcm->num_nodes; i++) {
			temp = bcm->nodes[i]->sum_avg[bucket] *
				bcm->aux_data.width;
				le16_to_cpu(bcm->aux_data.width);
			do_div(temp, bcm->nodes[i]->buswidth *
				bcm->nodes[i]->channels);
			agg_avg[bucket] = max(agg_avg[bucket], temp);

			temp = bcm->nodes[i]->max_peak[bucket] *
				bcm->aux_data.width;
				le16_to_cpu(bcm->aux_data.width);
			do_div(temp, bcm->nodes[i]->buswidth);
			agg_peak[bucket] = max(agg_peak[bucket], temp);
		}

		temp = agg_avg[bucket] * 1000ULL;
		do_div(temp, bcm->aux_data.unit);
		do_div(temp, le32_to_cpu(bcm->aux_data.unit));
		bcm->vote_x[bucket] = temp;

		temp = agg_peak[bucket] * 1000ULL;
		do_div(temp, bcm->aux_data.unit);
		do_div(temp, le32_to_cpu(bcm->aux_data.unit));
		bcm->vote_y[bucket] = temp;
	}

+2 −2
Original line number Diff line number Diff line
@@ -127,8 +127,8 @@ int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev)
		return -EINVAL;
	}

	bcm->aux_data.unit = le32_to_cpu(data->unit);
	bcm->aux_data.width = le16_to_cpu(data->width);
	bcm->aux_data.unit = data->unit;
	bcm->aux_data.width = data->width;
	bcm->aux_data.vcd = data->vcd;
	bcm->aux_data.reserved = data->reserved;
	INIT_LIST_HEAD(&bcm->list);
+2 −2
Original line number Diff line number Diff line
@@ -66,9 +66,9 @@ struct tcs_request {
#define BCM_TCS_CMD(commit, valid, vote_x, vote_y)		\
	(((commit) << BCM_TCS_CMD_COMMIT_SHFT) |		\
	((valid) << BCM_TCS_CMD_VALID_SHFT) |			\
	((cpu_to_le32(vote_x) &					\
	((vote_x &						\
	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) |	\
	((cpu_to_le32(vote_y) &					\
	((vote_y &						\
	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT))

#endif /* __SOC_QCOM_TCS_H__ */