mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
interconnect: Add helpers for enabling/disabling a path
There is a repeated pattern in multiple drivers where they want to switch the bandwidth between zero and some other value. This is happening often in the suspend/resume callbacks. Let's add helper functions to enable and disable the path, so that callers don't have to take care of remembering the bandwidth values and handle this in the framework instead. With this patch the users can call icc_disable() and icc_enable() to lower their bandwidth request to zero and then restore it back to it's previous value. Suggested-by: Evan Green <evgreen@chromium.org> Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Link: https://lore.kernel.org/r/20200507120846.8354-1-georgi.djakov@linaro.org Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
This commit is contained in:
parent
360a10285e
commit
7d374b2090
3 changed files with 52 additions and 1 deletions
|
@ -30,6 +30,8 @@ struct icc_path *icc_get(struct device *dev, const int src_id,
|
|||
struct icc_path *of_icc_get(struct device *dev, const char *name);
|
||||
struct icc_path *devm_of_icc_get(struct device *dev, const char *name);
|
||||
void icc_put(struct icc_path *path);
|
||||
int icc_enable(struct icc_path *path);
|
||||
int icc_disable(struct icc_path *path);
|
||||
int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
|
||||
void icc_set_tag(struct icc_path *path, u32 tag);
|
||||
|
||||
|
@ -57,6 +59,16 @@ static inline void icc_put(struct icc_path *path)
|
|||
{
|
||||
}
|
||||
|
||||
static inline int icc_enable(struct icc_path *path)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int icc_disable(struct icc_path *path)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw)
|
||||
{
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue