soc: qcom: rpmh: Add rpmh_write_sleep_and_wake() function

Let clients call rpmh_write_sleep_and_wake() to immediately
write cached sleep and wake data to the TCSes.

Change-Id: I04a94ee622a39a0aa0e829f4c40190a870fb2fb1
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
This commit is contained in:
Maulik Shah 2020-05-01 16:38:11 +05:30
parent 08c5639165
commit 3601181d1b
2 changed files with 20 additions and 0 deletions

View File

@ -530,6 +530,21 @@ int rpmh_flush(struct rpmh_ctrlr *ctrlr)
return ret;
}
/**
* rpmh_write_sleep_and_wake: Writes the buffered wake and sleep sets to TCSes
*
* @dev: The device making the request
*
* Return:
* * 0 - Success
* * Error code - Otherwise
*/
int rpmh_write_sleep_and_wake(const struct device *dev)
{
return rpmh_flush(get_rpmh_ctrlr(dev));
}
EXPORT_SYMBOL(rpmh_write_sleep_and_wake);
/**
* rpmh_invalidate: Invalidate sleep and wake sets in batch_cache
*

View File

@ -22,6 +22,8 @@ int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
int rpmh_mode_solver_set(const struct device *dev, bool enable);
int rpmh_write_sleep_and_wake(const struct device *dev);
void rpmh_invalidate(const struct device *dev);
#else
@ -43,6 +45,9 @@ static inline int rpmh_write_batch(const struct device *dev,
static int rpmh_mode_solver_set(const struct device *dev, bool enable)
{ return -ENODEV; }
static int rpmh_write_sleep_and_wake(const struct device *dev)
{ return -ENODEV; }
static inline void rpmh_invalidate(const struct device *dev)
{
}