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

Commit 62921a91 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: qcom: rpmh-rsc: return if the controller is idle"

parents 5f90cd10 c0afbe02
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ int rpmh_rsc_send_data(struct rsc_drv *drv, const struct tcs_request *msg);
int rpmh_rsc_write_ctrl_data(struct rsc_drv *drv,
			     const struct tcs_request *msg);
int rpmh_rsc_invalidate(struct rsc_drv *drv);
bool rpmh_rsc_ctrlr_is_idle(struct rsc_drv *drv);

void rpmh_tx_done(const struct tcs_request *msg, int r);

+20 −0
Original line number Diff line number Diff line
@@ -496,6 +496,26 @@ static int tcs_ctrl_write(struct rsc_drv *drv, const struct tcs_request *msg)
	return ret;
}

/**
 *  rpmh_rsc_ctrlr_is_idle: Check if any of the AMCs are busy.
 *
 *  @drv: The controller
 *
 *  Returns true if the TCSes are engaged in handling requests.
 */
bool rpmh_rsc_ctrlr_is_idle(struct rsc_drv *drv)
{
	int m;
	struct tcs_group *tcs = get_tcs_of_type(drv, ACTIVE_TCS);

	for (m = tcs->offset; m < tcs->offset + tcs->num_tcs; m++) {
		if (!tcs_is_free(drv, m))
			return false;
	}

	return true;
}

/**
 * rpmh_rsc_write_ctrl_data: Write request to the controller
 *