lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240223-rk806-regulator-ranges-v1-2-3904ab70d250@theobroma-systems.com>
Date: Fri, 23 Feb 2024 14:11:23 +0100
From: Quentin Schulz <foss+kernel@...il.net>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
 Matti Vaittinen <mazziesaccount@...il.com>, 
 shengfei Xu <xsf@...k-chips.com>, 
 Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: linux-kernel@...r.kernel.org, 
 Quentin Schulz <quentin.schulz@...obroma-systems.com>, 
 Quentin Schulz <foss+kernel@...il.net>
Subject: [PATCH 2/2] regulator: rk808: fix LDO range on RK806

From: Quentin Schulz <quentin.schulz@...obroma-systems.com>

The linear ranges aren't really matching what they should be. Indeed,
the range is inclusive of the min value, so it makes sense the previous
range does NOT include the max step value representing the min value of
the range in question.

Since 3.4V is represented by the decimal value 232, the previous range
max step value should be 231 and not 232.

No expected change in behavior since 3.4V was mapped with step 232 from
the first range but is now mapped with step 232 from the second range.

While at it, remove the incorrect comment from the second range.

Fixes: f991a220a447 ("regulator: rk808: add rk806 support")
Cc: Quentin Schulz <foss+kernel@...il.net>
Signed-off-by: Quentin Schulz <quentin.schulz@...obroma-systems.com>
---
 drivers/regulator/rk808-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index bfab5468cc54..d89ae7f16d7a 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -1023,8 +1023,8 @@ static const struct linear_range rk806_buck_voltage_ranges[] = {
 };
 
 static const struct linear_range rk806_ldo_voltage_ranges[] = {
-	REGULATOR_LINEAR_RANGE(500000, 0, 232, 12500), /* 500mV ~ 3400mV */
-	REGULATOR_LINEAR_RANGE(3400000, 233, 255, 0), /* 500mV ~ 3400mV */
+	REGULATOR_LINEAR_RANGE(500000, 0, 231, 12500), /* 500mV ~ 3400mV */
+	REGULATOR_LINEAR_RANGE(3400000, 232, 255, 0),
 };
 
 static const struct regulator_desc rk806_reg[] = {

-- 
2.43.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ