From 803cb62a1861bf76e65b17f559ab1bbf4970ce9b Mon Sep 17 00:00:00 2001
From: Sergey Larin <cerg2010cerg2010@mail.ru>
Date: Sat, 9 Feb 2019 19:00:23 +0300
Subject: [PATCH] power: supply: max17040: Set initial RCOMP value

This should fix incorrect capacity reporting.

Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
---
 drivers/power/supply/max17040_battery.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
index de5e791e0055..dd75c8045ff1 100644
--- a/drivers/power/supply/max17040_battery.c
+++ b/drivers/power/supply/max17040_battery.c
@@ -219,6 +219,7 @@ static int max17040_probe(struct i2c_client *client,
 
 	max17040_reset(client);
 	max17040_get_version(client);
+	max17040_write_reg(client, MAX17040_RCOMP, 0xff00);
 
 	INIT_DEFERRABLE_WORK(&chip->work, max17040_work);
 	queue_delayed_work(system_power_efficient_wq, &chip->work,
-- 
2.22.0

