From patchwork Fri Nov 29 11:40:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 846884 Received: from PNYPR01CU001.outbound.protection.outlook.com (mail-centralindiaazon11020092.outbound.protection.outlook.com [52.101.225.92]) (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 1CD4B17ADF7; Fri, 29 Nov 2024 11:43:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.225.92 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732880587; cv=fail; b=t6LZ8L3KAIbHTY+0iVn63+0BYx/lf7hPUgQd0ArLNtltGauKH3DZJW0fdxJlRlLpcbNSOr43WvhGSZgQ0IcAn1Fk0FNdQqHetgAotvKyWRnQT3M+EoQ+jVLVkkM8T6em0sK4MbZtXEDoT09xB5yJKGG/eIPgvO+GDW+ZaPjqix0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732880587; c=relaxed/simple; bh=6X3Dnj6OjIAyvdJzCrwvNKPWcoZ/syWnsPRkA4Zw3Xo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=oSCpX2JkzHCTYTF7tQqDvEiFaCoBWXo3ur/k8OpMt5MMDHnd0G2YagFn0uKHhpaDBJP9rEJAS6M1gHm6cMyYb7Plus9sjD2KARtQAAtpm05MggOM9IqUKL7B9vwMHeartXHpTM9ZmjrGVMP2KeGE6Qfi6ZrXE0xrwoDqFMai2k8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=siliconsignals.io; spf=pass smtp.mailfrom=siliconsignals.io; arc=fail smtp.client-ip=52.101.225.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=siliconsignals.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=siliconsignals.io ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R9fbSfCulyCsK/GyBU+LMKkj5aCldhGN00QQXu9dTnpZLc44ZZ6j2VgLN7RQvcJLq3LEC31wtJ3fpazUOqZbzuN189aS2OKXnUdioO6RZA1oEte+CGKfoyTmL3OE2HYxX/ADNOI1LKobS/VPntKjl/djnTgBlgWBhaia1hIoN+I2ZPYhI/e8X9R+x2/4BWNjolHRjC5VFm++qZjQ4ZyInMaQjnRjZ2Zh6UyfdFkpWmePA4/R0Ud20jVeFuNxuZ1oNIvEy+TcRvWmoVrOTKxs1O3f4G3ZfSRIXC3zmpKj2WjdekKeF2U4IuDsVGx7J/to6CMyjAD/w/h0eO1SwDBwwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vUbh4EZvl+66eGcbw+s+LGpb0O+CLLHFZURb+SZDcc4=; b=Sq4+WCsML2BcIfOqroqfurgYMu4VmVJpPXj4uz8TSuQ/IDE0kMoBQxlYBnihL58KyigDPmo1Y6xeSAX6GvhpylQnGSKwWXxEYzqyWxQQs43mJjMHX83sPn6zhhcQS9N60a+lHKDVJOZDdj3Rk8kdtRly25xca4kZDMHVZT2sRLRBgl3J++ySToHlslNH6/wIrubanHve6M5dQXdKF0Sef/qqiqshnsPhSN1Q7hMpkwUXK2IBXNEbvTGKzBC3VnMlxEiwS6GgQRCG+2ZzFMkWyumIFDzwI53m/8n7Myox9USqAMTmgfr31fBnOlvKS8dHQw1VY7cyEkwyHdfk2yplhw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siliconsignals.io; dmarc=pass action=none header.from=siliconsignals.io; dkim=pass header.d=siliconsignals.io; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siliconsignals.io; Received: from MA0P287MB1178.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:fc::7) by PN2P287MB0599.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:15e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.15; Fri, 29 Nov 2024 11:43:02 +0000 Received: from MA0P287MB1178.INDP287.PROD.OUTLOOK.COM ([fe80::56b4:3b88:bcc8:b1c2]) by MA0P287MB1178.INDP287.PROD.OUTLOOK.COM ([fe80::56b4:3b88:bcc8:b1c2%7]) with mapi id 15.20.8207.010; Fri, 29 Nov 2024 11:43:02 +0000 From: Bhavin Sharma To: sre@kernel.org, krzk+dt@kernel.org Cc: Bhavin Sharma , Hardevsinh Palaniya , Rob Herring , Conor Dooley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/2] dt-bindings: power: supply: Add STC3117 Fuel Gauge Date: Fri, 29 Nov 2024 17:10:45 +0530 Message-ID: <20241129114200.13351-2-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241129114200.13351-1-bhavin.sharma@siliconsignals.io> References: <20241129114200.13351-1-bhavin.sharma@siliconsignals.io> X-ClientProxiedBy: PN2PR01CA0086.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:23::31) To MA0P287MB1178.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:fc::7) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MA0P287MB1178:EE_|PN2P287MB0599:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d1bd618-8fae-42b0-75c0-08dd106afb3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: z6DSYohEo5qGmNCFR5EIqmuhU9aB6YKk605YRpyBVGhiRnaNxm1xi7ru4ra9nAVx1vn1saOifA+/IFN/UM81UoZ901wdrj9nbLggibCDWlh0yI4q/pn4ZVtbNcW9vbVnFWKMq2OH6+lDeSOJIlMGLVXa56ZHO1HkKpixuu36EbGoqJUsCkxB0CMm4Pkzhblgo6wdgmHt2zJ9GrwikWp0VAtj7v/lszRQDhn8B36hiOk56fZ++jp7asUMGflFCZZYPOP1LccE0Nk8wlwDGxNudLPKKdIP4kJHhZ/GDPZvvziwo+U6ZM8tIS9QFudmUS2X9NUeIQwSZAsbqgNrq+1boUsbnapVOWbto2rhppm5LLBxMcO+uVpvZ8B9vbPvZeGXWr2YgHMNcGaIbua0Fh2EwFhaYYCIF7RQ+KnejYwJBRLm9kAiluJAcV9x4iqoL9rSXST/Ft+17H8ysHEQjQgAtMDWkGR1kY6jxqwvPgdT5ZjEEZwP3P5ssuuaMumfEePEfYLsG1hmvXR8SbbAhtwQukSeaE5VLERI9833QYWHI7goPO2EkGvT3+LAF8llQjUjo1EMWNjkSgrM7xtRmg5x/u+MZBiWjzdQicaz9Z4HkTjGkfB02HHSux6LFOtGBFR+ZaSjIC7/vy3j46zust5gBbPFIINnp0i+4fr4fpxjnWKGwylHuwkSlzzXpX6vt7749yBOjAshBFGVPxd+cOKmc5/H66NGS3IVJJkrmsxUzldj0wCZVdMfrcdoI2N/7RpYaDVMKyolgEfRtYIt38PIUmIZZRFXCiJmP7S+ojcHcR9Cp9RhW81j8zgMAW/e8fEUdZYLFmpGVvWA78+Ll5q4Qi4xJIv5RHuQMrDbElbKbtygPge+pRIe6nMuuTWeVUzD8aacx3otlTAYgdvy+dea5SQtObD/5jUMi1VYbj7bjMYXbp9kQ6Z7f4o+sgCmUbSPGYfS3jBZjU64R6HxRlUe3rDz8JAWAMyGzsq0JqO2n1r5qx2mDHSEYJga852GbA8a1+d1X43m0wS0vkK0/G5O0MET1q3QRgy8YTc5XQ2/BMrc9AaBSde6cHuAJrgAWiwfxZRKV9qZin6/QrsnRUcz5O6iumYx3WGZ33HaqxK+iUgGTl1dJzkKJrBFvGTp5fSMA7oAeBo/etlHUrpCbAcGjrUa+sZtXbmr9ZzHknAKBMR20RodW4T8YXXfB0sXw2iPKz+2X31tukTA4cpO0LV4Jiyl/PjZQ9RRDvtn7lUcdo9KkDZka1Ak5mIEkrNQYCEbaSWqpzvm9ynBtJkd4MybdVbOLqNo+1ICWULYy7XoXPv5lUg4no2NCJVBY1xm6HzAvALCTtLHbj7Cfsd7qcr/9NWq/lnUHU57e2UNG4CFYxg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MA0P287MB1178.INDP287.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fq5koiwXfj7m13k/jiQ0DEikTl+s3tUX8hl5h4xkVchonWZTws8FfsmIn4Omd9Zwlg81jwmpnH96MIEaHDp5Pg9kxWbbP5LzA+D42bBVgy6F081h2M/TbAjaPcRmOvV/JvB2EDJH8xHy5GaU7/xq+iUsm72s8zIdsgItWgpWwfxG6rRYmsH3QZyHKPCYRmDC75BrCncYBbBWHBGrE2OhSFKFIfv40OAJuvYDxNBVPo6jH109IPuCdgl1kz7tCM/sOlNf/6pUQVf+1b15Cwh+SbBXLd9a1byBvDkAdABWk7wIQoOPQKR6wioyMmGTexk2igWdNljP2Idjg8o9eq03T8FufIwQPhvO45pGFiLDmL96P1FUf//iEfBQ0xwCXTl29TVHM7JwshQ6Q2Tcdz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dG1/0vrFN9giNMvVH0LB+fNRUHqA33PMq2tzUrHgPCNqVaRvNnftBpwMsgHK0jO10cIqCyd1C/2qG131YW9fdjNyPtDAHHAVGnNzL3PIbCiX9SjjRAh/JLOmw/DOY7nhqtL5PMIEQVh2b0GMW2OlZo= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: 9d1bd618-8fae-42b0-75c0-08dd106afb3a X-MS-Exchange-CrossTenant-AuthSource: MA0P287MB1178.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2024 11:43:02.5853 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 7ec5089e-a433-4bd1-a638-82ee62e21d37 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0jEUpQyKo2sJXS7hoEZFbAgGOnW0P9jIMtVQQYiftSt3GuIdfQMj1A7gFhzararWx6Rgakdza4+1rSEjQUoBWAqeYO7zRxDSKqczRJojbrg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN2P287MB0599 The STC3117 provides a simple fuel gauge via I2C. Add a DT schema to describe how to set it up in the device tree. Signed-off-by: Hardevsinh Palaniya Signed-off-by: Bhavin Sharma --- .../bindings/power/supply/st,stc3117.yaml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/st,stc3117.yaml diff --git a/Documentation/devicetree/bindings/power/supply/st,stc3117.yaml b/Documentation/devicetree/bindings/power/supply/st,stc3117.yaml new file mode 100644 index 000000000000..274e57be4bc6 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/st,stc3117.yaml @@ -0,0 +1,81 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/st,stc3117.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STC3117 Fuel Gauge Unit Power Supply + +maintainers: + - Hardevsinh Palaniya + - Bhavin Sharma + +description: | + The STC3117 includes the STMicroelectronics OptimGauge algorithm. + It provides accurate battery state-of-charge (SOC) monitoring, tracks + battery parameter changes with operation conditions, temperature, + and aging, and allows the application to get a battery state-of-health + (SOH) indication. + + An alarm output signals low SOC or low voltage conditions and also + indicates fault conditions like a missing or swapped battery. + + Datasheet is available at + https://www.st.com/resource/en/datasheet/stc3117.pdf + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + enum: + - st,stc3117 + + reg: + maxItems: 1 + + monitored-battery: + description: | + The fuel gauge uses the following battery properties: + - charge-full-design-microamp-hours + - voltage-min-design-microvolt + - voltage-max-design-microvolt + + sense-resistor: + $ref: /schemas/types.yaml#/definitions/phandle + description: Current sense resistor in milliohms + maxItems: 1 + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - monitored-battery + - sense-resistor + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + bat: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <2600000>; + voltage-min-design-microvolt = <3300000>; + voltage-max-design-microvolt = <4250000>; + }; + + battery@70 { + compatible = "st,stc3117"; + reg = <0x70>; + interrupt-parent = <&gpio0>; + interrupts = <31 IRQ_TYPE_LEVEL_LOW>; + monitored-battery = <&bat>; + sense-resistor = <10>; + }; + };