From patchwork Fri May 30 07:35:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fenglin Wu via B4 Relay X-Patchwork-Id: 893371 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C01A51EA7DB; Fri, 30 May 2025 07:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748590540; cv=none; b=b91lqCLqdKnTLtSdbe1iKskVX2yd5SPuy6HTwNzx35M+e5X54DzqgEIta+or2GstSLWDqtdnsd/pkqXgbP2rI2jeY0tORCxlL5EXt7g/uIhRm/7c80TyxWbXTDcSTd5OATL69W8l5uvuXEvHz44vCdfKJ2DYyTCegpyhDv1d16g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748590540; c=relaxed/simple; bh=D+uMpcIjU+XNGgExEF0M/EWM2T9xFedeFZkRfusIy5E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uCTaYuDocC2RJKF1guvpZB0lMWkLMKqzPh4dX6sIQe3o0c0PbfucKJ8qt2BDGb95YbQUz+1EiOQej7YpCTRMvjn03A23lh6ucxRIYQgr3ZHBLC1TNxxidVCxL4a3FsNeA6unz+Tq30L4mV09jIgVJx43utiNh5j9XO6KLV5X1o4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lNOYMDHi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lNOYMDHi" Received: by smtp.kernel.org (Postfix) with ESMTPS id 406E2C4CEEE; Fri, 30 May 2025 07:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748590540; bh=D+uMpcIjU+XNGgExEF0M/EWM2T9xFedeFZkRfusIy5E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=lNOYMDHiFH+g4W/WbaWOSDz3eOcOhHogMemphnL8wdlLAV7NhPZ5eCk/V5TOfGJrO Q3g5/SDiWzLXkC7kMgTBFwJY/Ta6FS0+sFejYQSAvivWqJGWiVjfC2kp6kK6UPpGRJ nZ6URLrf4fHA4d38qu6ae/S/qx8+icIi/bcynxjel9dfPDTdoVtfZGF8Qht5K2GrVR AlwHJ4+SawsO/kWGOEVwAipMtycwm83nq4SGVFrI0DPtpP0SCRBOi2Y4M047QzReBo pCx/fHH8qlb4Q7sk1A0cJ8xa7l0r1LfqF+24zsnvkDN7JhncSKrHAjs9Aw1FZNqbd6 I88s9wRsJb+9g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 285C2C5B549; Fri, 30 May 2025 07:35:40 +0000 (UTC) From: Fenglin Wu via B4 Relay Date: Fri, 30 May 2025 15:35:06 +0800 Subject: [PATCH v2 1/8] power: supply: core: Add resistance power supply property Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250530-qcom_battmgr_update-v2-1-9e377193a656@oss.qualcomm.com> References: <20250530-qcom_battmgr_update-v2-0-9e377193a656@oss.qualcomm.com> In-Reply-To: <20250530-qcom_battmgr_update-v2-0-9e377193a656@oss.qualcomm.com> To: Sebastian Reichel , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heikki Krogerus , Greg Kroah-Hartman Cc: Subbaraman Narayanamurthy , David Collins , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@oss.qualcomm.com, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, Fenglin Wu X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748590538; l=2414; i=fenglin.wu@oss.qualcomm.com; s=20240327; h=from:subject:message-id; bh=f6uhUoiZgOE/CV2wIB6Vwbi/lg0mxjoGmX0Qx7uMFHM=; b=bRRnA/Ob9AaILBJiPUmZMjq9yJNhHxR/BgxQEaXQ+Zz51RXd/ECxaLQIjQG3VyJtVVxb07cYj dxo45CcU6J3DFYf9f7zsg1pJ9F2EZH8VvtqQhbDoex3eJbzw4X4DeD+ X-Developer-Key: i=fenglin.wu@oss.qualcomm.com; a=ed25519; pk=BF8SA4IVDk8/EBCwlBehKtn2hp6kipuuAuDAHh9s+K4= X-Endpoint-Received: by B4 Relay for fenglin.wu@oss.qualcomm.com/20240327 with auth_id=406 X-Original-From: Fenglin Wu Reply-To: fenglin.wu@oss.qualcomm.com From: Fenglin Wu 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 --- 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//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//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,