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

Commit 4f630862 authored by Vikram Mulukutla's avatar Vikram Mulukutla
Browse files

drivers: regulator: cpr-regulator: Add support for the new scm_call2 API



The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Use the new API while maintaining backward
compatibility.

Change-Id: I9e93d2120d91a014da244dd1291eaa941235c4a8
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent 7dec07a2
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -312,6 +312,7 @@ static u64 cpr_read_efuse_row(struct cpr_regulator *cpr_vreg, u32 row_num,
{
	int rc;
	u64 efuse_bits;
	struct scm_desc desc = {0};
	struct cpr_read_req {
		u32 row_address;
		int addr_type;
@@ -328,12 +329,22 @@ static u64 cpr_read_efuse_row(struct cpr_regulator *cpr_vreg, u32 row_num,
		return efuse_bits;
	}

	req.row_address = cpr_vreg->efuse_addr + row_num * BYTES_PER_FUSE_ROW;
	req.addr_type = 0;
	desc.args[0] = req.row_address = cpr_vreg->efuse_addr +
					row_num * BYTES_PER_FUSE_ROW;
	desc.args[1] = req.addr_type = 0;
	desc.arginfo = SCM_ARGS(2);
	efuse_bits = 0;

	if (!is_scm_armv8()) {
		rc = scm_call(SCM_SVC_FUSE, SCM_FUSE_READ,
			&req, sizeof(req), &rsp, sizeof(rsp));
	} else {
		rc = scm_call2(SCM_SIP_FNID(SCM_SVC_FUSE, SCM_FUSE_READ),
				&desc);
		rsp.row_data[0] = desc.ret[0];
		rsp.row_data[1] = desc.ret[1];
		rsp.status = desc.ret[2];
	}

	if (rc) {
		cpr_err(cpr_vreg, "read row %d failed, err code = %d",