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

Commit 919176ed authored by Lina Iyer's avatar Lina Iyer
Browse files

drivers: qcom: rpmh: export controller idle status



Allow the controller state be read by platform drivers. This is useful
for PM drivers which can choose to disallow idle modes when the
controller is busy.

Change-Id: Ic5790c01e9438440ba80be6572fb919501fafc6c
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
Signed-off-by: default avatarRaju P.L.S.S.S.N <rplsssn@codeaurora.org>
parent c0afbe02
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -511,3 +511,16 @@ int rpmh_invalidate(const struct device *dev)
	return ret;
}
EXPORT_SYMBOL(rpmh_invalidate);

/**
 * rpmh_ctrlr_idle: Return the controller idle status
 *
 * @dev: the device making the request
 */
int rpmh_ctrlr_idle(const struct device *dev)
{
	struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev);

	return rpmh_rsc_ctrlr_is_idle(ctrlr_to_drv(ctrlr));
}
EXPORT_SYMBOL(rpmh_ctrlr_idle);
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ int rpmh_flush(const struct device *dev);

int rpmh_invalidate(const struct device *dev);

int rpmh_ctrlr_idle(const struct device *dev);

#else

static inline int rpmh_write(const struct device *dev, enum rpmh_state state,
@@ -46,6 +48,9 @@ static inline int rpmh_flush(const struct device *dev)
static inline int rpmh_invalidate(const struct device *dev)
{ return -ENODEV; }

static inline int rpmh_ctrlr_idle(const struct device *dev)
{ return -ENODEV; }

#endif /* CONFIG_QCOM_RPMH */

#endif /* __SOC_QCOM_RPMH_H__ */