Loading drivers/soc/qcom/rpmh-internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ int rpmh_rsc_write_ctrl_data(struct rsc_drv *drv, const struct tcs_request *msg); int rpmh_rsc_invalidate(struct rsc_drv *drv); void rpmh_rsc_mode_solver_set(struct rsc_drv *drv, bool enable); bool rpmh_rsc_ctrlr_is_idle(struct rsc_drv *drv); void rpmh_tx_done(const struct tcs_request *msg, int r); Loading drivers/soc/qcom/rpmh-rsc.c +20 −0 Original line number Diff line number Diff line Loading @@ -533,6 +533,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 * Loading drivers/soc/qcom/rpmh.c +13 −0 Original line number Diff line number Diff line Loading @@ -568,3 +568,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); include/soc/qcom/rpmh.h +5 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ int rpmh_invalidate(const struct device *dev); int rpmh_mode_solver_set(const struct device *dev, bool enable); int rpmh_ctrlr_idle(const struct device *dev); #else static inline int rpmh_write(const struct device *dev, enum rpmh_state state, Loading @@ -49,6 +51,9 @@ static inline int rpmh_invalidate(const struct device *dev) static inline int rpmh_mode_solver_set(const struct device *dev, bool enable) { return -ENODEV; } static inline int rpmh_ctrlr_idle(const struct device *dev) { return -ENODEV; } #endif /* CONFIG_QCOM_RPMH */ #endif /* __SOC_QCOM_RPMH_H__ */ Loading
drivers/soc/qcom/rpmh-internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ int rpmh_rsc_write_ctrl_data(struct rsc_drv *drv, const struct tcs_request *msg); int rpmh_rsc_invalidate(struct rsc_drv *drv); void rpmh_rsc_mode_solver_set(struct rsc_drv *drv, bool enable); bool rpmh_rsc_ctrlr_is_idle(struct rsc_drv *drv); void rpmh_tx_done(const struct tcs_request *msg, int r); Loading
drivers/soc/qcom/rpmh-rsc.c +20 −0 Original line number Diff line number Diff line Loading @@ -533,6 +533,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 * Loading
drivers/soc/qcom/rpmh.c +13 −0 Original line number Diff line number Diff line Loading @@ -568,3 +568,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);
include/soc/qcom/rpmh.h +5 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ int rpmh_invalidate(const struct device *dev); int rpmh_mode_solver_set(const struct device *dev, bool enable); int rpmh_ctrlr_idle(const struct device *dev); #else static inline int rpmh_write(const struct device *dev, enum rpmh_state state, Loading @@ -49,6 +51,9 @@ static inline int rpmh_invalidate(const struct device *dev) static inline int rpmh_mode_solver_set(const struct device *dev, bool enable) { return -ENODEV; } static inline int rpmh_ctrlr_idle(const struct device *dev) { return -ENODEV; } #endif /* CONFIG_QCOM_RPMH */ #endif /* __SOC_QCOM_RPMH_H__ */