mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fenglin Wu via B4 Relay <devnull+fenglin.wu.oss.qualcomm.com@kernel.org>
To: Sebastian Reichel <sre@kernel.org>,
	 Bjorn Andersson <andersson@kernel.org>
Cc: Subbaraman Narayanamurthy
	<subbaraman.narayanamurthy@oss.qualcomm.com>,
	 David Collins <david.collins@oss.qualcomm.com>,
	linux-pm@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,  kernel@oss.qualcomm.com,
	Fenglin Wu <fenglin.wu@oss.qualcomm.com>
Subject: [PATCH 1/5] power: supply: core: add resistance power supply property
Date: Fri, 23 May 2025 09:39:18 +0800	[thread overview]
Message-ID: <20250523-qcom_battmgr_update-v1-1-2bb6d4e0a56e@oss.qualcomm.com> (raw)
In-Reply-To: <20250523-qcom_battmgr_update-v1-0-2bb6d4e0a56e@oss.qualcomm.com>

From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>

Some battery drivers provide the ability to export resistance as a
parameter. Add resistance power supply property for that purpose.

Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
 Documentation/ABI/testing/sysfs-class-power | 10 ++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  1 +
 include/linux/power_supply.h                |  1 +
 3 files changed, 12 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 560124cc31770cde03bcdbbba0d85a5bd78b15a0..22a565a6a1c509461b8c483e12975295765121d6 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -552,6 +552,16 @@ Description:
 			Integer > 0: representing full cycles
 			Integer = 0: cycle_count info is not available
 
+What:		/sys/class/power_supply/<supply_name>/resistance
+Date:		May 2025
+Contact:	linux-arm-msm@vger.kernel.org
+Description:
+		Reports the resistance of the battery power supply.
+
+		Access: Read
+
+		Valid values: Represented in microohms
+
 **USB Properties**
 
 What:		/sys/class/power_supply/<supply_name>/input_current_limit
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index a438f7983d4f6a832e9d479184c7c35453e1757c..dd829148eb6fda5dcd7eab53fc70f99081763714 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -220,6 +220,7 @@ static struct power_supply_attr power_supply_attrs[] __ro_after_init = {
 	POWER_SUPPLY_ATTR(MANUFACTURE_YEAR),
 	POWER_SUPPLY_ATTR(MANUFACTURE_MONTH),
 	POWER_SUPPLY_ATTR(MANUFACTURE_DAY),
+	POWER_SUPPLY_ATTR(RESISTANCE),
 	/* Properties of type `const char *' */
 	POWER_SUPPLY_ATTR(MODEL_NAME),
 	POWER_SUPPLY_ATTR(MANUFACTURER),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index c4cb854971f53a244ba7742a15ce7a5515da6199..de3e88810e322546470b21258913abc7707c86a7 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -174,6 +174,7 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_MANUFACTURE_YEAR,
 	POWER_SUPPLY_PROP_MANUFACTURE_MONTH,
 	POWER_SUPPLY_PROP_MANUFACTURE_DAY,
+	POWER_SUPPLY_PROP_RESISTANCE,
 	/* Properties of type `const char *' */
 	POWER_SUPPLY_PROP_MODEL_NAME,
 	POWER_SUPPLY_PROP_MANUFACTURER,

-- 
2.34.1



  reply	other threads:[~2025-05-23  1:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23  1:39 [PATCH 0/5] power: supply: Add several features support in qcom-battmgr driver Fenglin Wu via B4 Relay
2025-05-23  1:39 ` Fenglin Wu via B4 Relay [this message]
2025-05-23  1:39 ` [PATCH 2/5] power: supply: core: Add state_of_health power supply property Fenglin Wu via B4 Relay
2025-05-23  1:39 ` [PATCH 3/5] power: supply: qcom_battmgr: Add resistance " Fenglin Wu via B4 Relay
2025-05-23  1:39 ` [PATCH 4/5] power: supply: qcom-battmgr: Add state_of_health " Fenglin Wu via B4 Relay
2025-05-23  1:39 ` [PATCH 5/5] power: supply: qcom-battmgr: Add charge control support Fenglin Wu via B4 Relay
2025-05-23 21:29   ` György Kurucz
2025-05-26  6:19     ` Fenglin Wu
2025-05-26  8:27       ` neil.armstrong
2025-05-26  8:43         ` Fenglin Wu
2025-05-27 16:42       ` me
2025-05-29  7:14         ` Fenglin Wu

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=20250523-qcom_battmgr_update-v1-1-2bb6d4e0a56e@oss.qualcomm.com \
    --to=devnull+fenglin.wu.oss.qualcomm.com@kernel.org \
    --cc=andersson@kernel.org \
    --cc=david.collins@oss.qualcomm.com \
    --cc=fenglin.wu@oss.qualcomm.com \
    --cc=kernel@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=subbaraman.narayanamurthy@oss.qualcomm.com \
    /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®