From af7120040773fd06ead9e4bf36855987faa64561 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Thu, 10 Nov 2022 20:05:16 +0100
Subject: [PATCH 337/463] 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 0325225fe53ab..1ec41b563dfce 100644
--- a/drivers/power/supply/rk818_charger.c
+++ b/drivers/power/supply/rk818_charger.c
@@ -519,6 +519,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.46.0

