mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Csókás, Bence" <csokas.bence@prolan.hu>
To: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: "Csókás, Bence" <csokas.bence@prolan.hu>,
	"Samuel Holland" <samuel@sholland.org>,
	"Sebastian Reichel" <sre@kernel.org>
Subject: [PATCH v5 4/8] power: ip5xxx_power: Add battery type for 4.4V
Date: Tue, 19 Nov 2024 19:07:36 +0100	[thread overview]
Message-ID: <20241119180741.2237692-4-csokas.bence@prolan.hu> (raw)
In-Reply-To: <20241119180741.2237692-1-csokas.bence@prolan.hu>

IP53xx series supports 4.4V batteries. Add support for it
to compatible parts (that have `vbat_max` set to >= 4.4 V).

Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu>
---
 drivers/power/supply/ip5xxx_power.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/power/supply/ip5xxx_power.c b/drivers/power/supply/ip5xxx_power.c
index a939dbfe8d23..f64767b81c3b 100644
--- a/drivers/power/supply/ip5xxx_power.c
+++ b/drivers/power/supply/ip5xxx_power.c
@@ -10,6 +10,7 @@
 #define IP5XXX_BAT_TYPE_4_2V			0x0
 #define IP5XXX_BAT_TYPE_4_3V			0x1
 #define IP5XXX_BAT_TYPE_4_35V			0x2
+#define IP5XXX_BAT_TYPE_4_4V			0x3
 #define IP5XXX_CHG_STAT_IDLE			0x0
 #define IP5XXX_CHG_STAT_TRICKLE		0x1
 #define IP5XXX_CHG_STAT_CONST_VOLT		0x2
@@ -365,6 +366,9 @@ static int ip5xxx_battery_get_voltage_max(struct ip5xxx *ip5xxx, int *val)
 	case IP5XXX_BAT_TYPE_4_35V:
 		*val = 4350000;
 		break;
+	case IP5XXX_BAT_TYPE_4_4V:
+		*val = 4400000;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -492,6 +496,9 @@ static int ip5xxx_battery_set_voltage_max(struct ip5xxx *ip5xxx, int val)
 	case 4350000:
 		rval = IP5XXX_BAT_TYPE_4_35V;
 		break;
+	case 4400000:
+		rval = IP5XXX_BAT_TYPE_4_4V;
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
2.34.1



  parent reply	other threads:[~2024-11-19 18:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 18:07 [PATCH v5 1/8] power: ip5xxx_power: Use regmap_field API Csókás, Bence
2024-11-19 18:07 ` [PATCH v5 2/8] power: ip5xxx_power: Fix return value on ADC read errors Csókás, Bence
2024-12-05 11:00   ` Sebastian Reichel
2024-11-19 18:07 ` [PATCH v5 3/8] power: ip5xxx_power: Allow for more parameters to be configured Csókás, Bence
2024-12-06 19:51   ` Kees Bakker
2024-12-08 13:00     ` Csókás Bence
2024-11-19 18:07 ` Csókás, Bence [this message]
2024-11-19 18:07 ` [PATCH v5 5/8] power: ip5xxx_power: Check for optional bits Csókás, Bence
2024-12-05 11:01   ` Sebastian Reichel
2024-11-19 18:07 ` [PATCH v5 6/8] power: ip5xxx_power: Fall back to Charge End bit if status register is absent Csókás, Bence
2024-11-19 18:07 ` [PATCH v5 7/8] dt-bindings: trivial-devices: Add Injoinic IP5306 Csókás, Bence
2024-11-19 18:07 ` [PATCH v5 8/8] power: ip5xxx_power: Add support for IP5306 Csókás, Bence
2024-12-05  1:36 ` (subset) [PATCH v5 1/8] power: ip5xxx_power: Use regmap_field API Sebastian Reichel
2024-12-05 11:02   ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241119180741.2237692-4-csokas.bence@prolan.hu \
    --to=csokas.bence@prolan.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=samuel@sholland.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®