Skip to content

Commit fe2af40

Browse files
Georgi Djakovvireshk
authored andcommitted
opp: Update the bandwidth on OPP frequency changes
If the OPP bandwidth values are populated, we want to switch also the interconnect bandwidth in addition to frequency and voltage. Signed-off-by: Georgi Djakov <[email protected]> Reviewed-by: Matthias Kaehlcke <[email protected]> Reviewed-by: Sibi Sankar <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 120e117 commit fe2af40

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/opp/core.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
808808
unsigned long freq, old_freq, temp_freq;
809809
struct dev_pm_opp *old_opp, *opp;
810810
struct clk *clk;
811-
int ret;
811+
int ret, i;
812812

813813
opp_table = _find_opp_table(dev);
814814
if (IS_ERR(opp_table)) {
@@ -909,6 +909,17 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
909909
dev_err(dev, "Failed to set required opps: %d\n", ret);
910910
}
911911

912+
if (!ret && opp_table->paths) {
913+
for (i = 0; i < opp_table->path_count; i++) {
914+
ret = icc_set_bw(opp_table->paths[i],
915+
opp->bandwidth[i].avg,
916+
opp->bandwidth[i].peak);
917+
if (ret)
918+
dev_err(dev, "Failed to set bandwidth[%d]: %d\n",
919+
i, ret);
920+
}
921+
}
922+
912923
put_opp:
913924
dev_pm_opp_put(opp);
914925
put_old_opp:

0 commit comments

Comments
 (0)