From 924d577057538e703db959d26945ea3bb26fec4c Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Mon, 26 Jun 2023 16:02:44 +0800 Subject: [PATCH] soc: rockchip: opp_select: adjust memory voltage by otp Signed-off-by: Finley Xiao Change-Id: Icfed6bd8766329b10ddb6d5d78e5306a013389cb --- drivers/soc/rockchip/rockchip_opp_select.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/soc/rockchip/rockchip_opp_select.c b/drivers/soc/rockchip/rockchip_opp_select.c index 82559daad5fb..40d1ec6dc0c0 100644 --- a/drivers/soc/rockchip/rockchip_opp_select.c +++ b/drivers/soc/rockchip/rockchip_opp_select.c @@ -1484,9 +1484,14 @@ static void rockchip_adjust_opp_by_otp(struct device *dev, if (opp->rate > opp_info.max_freq * 1000000) continue; - opp->supplies->u_volt += opp_info.volt * 1000; - if (opp->supplies->u_volt > opp->supplies->u_volt_max) - opp->supplies->u_volt = opp->supplies->u_volt_max; + opp->supplies[0].u_volt += opp_info.volt * 1000; + if (opp->supplies[0].u_volt > opp->supplies[0].u_volt_max) + opp->supplies[0].u_volt = opp->supplies[0].u_volt_max; + if (opp_table->regulator_count > 1) { + opp->supplies[1].u_volt += opp_info.volt * 1000; + if (opp->supplies[1].u_volt > opp->supplies[1].u_volt_max) + opp->supplies[1].u_volt = opp->supplies[1].u_volt_max; + } } mutex_unlock(&opp_table->lock);