distribution/projects/Amlogic/patches/linux/S922X/0036-power-supply-rk818-charger-Add-support-for-POWER_SUP.patch

44 lines
1.3 KiB
Diff

From 86961d63570de22e15808865e213d8c45bb78024 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Thu, 10 Nov 2022 20:05:16 +0100
Subject: [PATCH 36/52] power: supply: rk818-charger: Add support for
POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN
Report total battery capacity.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/power/supply/rk818_charger.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/power/supply/rk818_charger.c b/drivers/power/supply/rk818_charger.c
index 979165c98e5a..cdef0dcd1f8c 100644
--- a/drivers/power/supply/rk818_charger.c
+++ b/drivers/power/supply/rk818_charger.c
@@ -518,6 +518,14 @@ static int rk818_charger_get_property(struct power_supply *psy,
val->intval = 3000000;
break;
+ case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
+ val->intval = 11400000;
+ return 0;
+
+ case POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN:
+ val->intval = 0;
+ return 0;
+
default:
return -EINVAL;
}
@@ -583,6 +591,8 @@ static enum power_supply_property rk818_charger_props[] = {
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
POWER_SUPPLY_PROP_PRECHARGE_CURRENT,
+ POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
+ POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
// inherited from BSP battery driver
POWER_SUPPLY_PROP_CURRENT_NOW,
--
2.34.1