[PATCH 3/3] power: supply: samsung-sdi-battery: Set the charging temperature range

From: Alexey Charkov

Date: Mon Nov 09 2026 - 04:47:40 EST


Give each battery a charging range equal to its operating range, as the
firmware parsing does when charge-temp-range-celsius is absent, since
these static descriptions skip that parsing: keep their behaviour
unchanged.

Leave any correction of these limits to a separate change, but note
that they follow the charge-block thresholds of the matching vendor
kernels, which count in tenths of a degree: the -50C and -30C lower
limits look like a unit slip in the original import, as -50 there
means -5C.

Signed-off-by: Alexey Charkov <alchark@xxxxxxxxxxx>
---
drivers/power/supply/samsung-sdi-battery.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/power/supply/samsung-sdi-battery.c b/drivers/power/supply/samsung-sdi-battery.c
index 33565002ee27..da283735df3b 100644
--- a/drivers/power/supply/samsung-sdi-battery.c
+++ b/drivers/power/supply/samsung-sdi-battery.c
@@ -659,6 +659,8 @@ static struct samsung_sdi_battery samsung_sdi_batteries[] = {
.temp_alert_min = 0,
.temp_alert_max = 40,
.temp_max = 60,
+ .temp_charge_min = -50,
+ .temp_charge_max = 60,
.resist_table = samsung_temp2res,
.resist_table_size = ARRAY_SIZE(samsung_temp2res),
/* If you have tables for more temperatures, add them */
@@ -703,6 +705,8 @@ static struct samsung_sdi_battery samsung_sdi_batteries[] = {
.temp_alert_min = 0,
.temp_alert_max = 40,
.temp_max = 47,
+ .temp_charge_min = -30,
+ .temp_charge_max = 47,
.resist_table = samsung_temp2res,
.resist_table_size = ARRAY_SIZE(samsung_temp2res),
/* If you have tables for more temperatures, add them */
@@ -747,6 +751,8 @@ static struct samsung_sdi_battery samsung_sdi_batteries[] = {
.temp_alert_min = 0,
.temp_alert_max = 43,
.temp_max = 49,
+ .temp_charge_min = -50,
+ .temp_charge_max = 49,
.resist_table = samsung_temp2res,
.resist_table_size = ARRAY_SIZE(samsung_temp2res),
/* If you have tables for more temperatures, add them */
@@ -790,6 +796,8 @@ static struct samsung_sdi_battery samsung_sdi_batteries[] = {
.temp_alert_min = 0,
.temp_alert_max = 40,
.temp_max = 60,
+ .temp_charge_min = -50,
+ .temp_charge_max = 60,
.resist_table = samsung_temp2res,
.resist_table_size = ARRAY_SIZE(samsung_temp2res),
/* If you have tables for more temperatures, add them */
@@ -835,6 +843,8 @@ static struct samsung_sdi_battery samsung_sdi_batteries[] = {
.temp_alert_min = 0,
.temp_alert_max = 40,
.temp_max = 60,
+ .temp_charge_min = -5,
+ .temp_charge_max = 60,
.resist_table = samsung_temp2res,
.resist_table_size = ARRAY_SIZE(samsung_temp2res),
/* If you have tables for more temperatures, add them */
@@ -879,6 +889,8 @@ static struct samsung_sdi_battery samsung_sdi_batteries[] = {
.temp_alert_min = 0,
.temp_alert_max = 40,
.temp_max = 60,
+ .temp_charge_min = -5,
+ .temp_charge_max = 60,
.resist_table = samsung_temp2res,
.resist_table_size = ARRAY_SIZE(samsung_temp2res),
/* If you have tables for more temperatures, add them */

--
2.56.0