From patchwork Thu Dec 19 09:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 852277 Received: from PNYPR01CU001.outbound.protection.outlook.com (mail-centralindiaazon11020089.outbound.protection.outlook.com [52.101.225.89]) (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 9A070221D86; Thu, 19 Dec 2024 09:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.225.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734601782; cv=fail; b=cXF29RmcmNa0AVjizRt6bFwFVPYwTbA6n9FMbBD0j2FHSuv3iJxbLfoTnwA7Pdpgu0iHjj49l5yGF/I9acTTnJ1FYpuGNel75x9DNPzkDpNyOhIbbOG0CaslHQaQbsZwxBGyCjzGbejBHR6wvQSgNTF5j1EpCofGhszIIIweJDc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734601782; c=relaxed/simple; bh=DRWGgBTQhmElipPaBAZu6qa58ut42e7kPONlbpnjIiY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UD/bDmXUpUXAG0wRkKRPFyUZ/WoGuzGT56p2KXOvXnjRD8jMe2JkGXG4cm3OvZENcrJH7u+5tjBO66dbRadci686W8v/cU7G6pBkCP/N1390EYWDiJE0GCp2p6Zzzhas8KrQxNyV7ogdoptdLjUzwTNTkNaFYprqCQULMDPfV4E= 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.89 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=zU5ewIeo/YMAtiHW1nYWoJmZC70/zfsv9KXu03Cs6WyVdCuMLBe1ZNsrDdl0qDk4GUTMDV3NQ+Un/0JXqBNqqwPxH9X6w7L3tiv0vpXHFQ9bULEMvaft7cHnmIPyya6aCTowje/YFQTuVnmWA6OsUEcqCvZzf7p1YWB3TX1ZjXV3W9PO7PzTf8qp0F3OLtPExH+7IAuHUlq4tPeLYmNzEXvPJEY6WOcCHfHPwV8QqB+FyG/rp0z2Sz/gkRWVrNOYusU3OxeCmlalt5f/tZeeoF7RqpC5ZTTmpJdYNs+ZxbttW5E5QAZwjrVxC9NsNyKPZP/vPeRxcEx+wGNHCoOLRA== 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=lCm7ItCw4wPMTrI2v9hR0Md+/nl27Vc+gRCSKPCrad0=; b=hTRU4a0HFdJHW9SaKw37DxOb6V6Wg5x7MfW9KLvSh/BrRDxnM44hDfuwisaqel/I6pWBAF8YiDgdx3EQbGoOIL8ga8qG4rbqsn1aaCHCAy4PT4aIljMd69LD8iQG7M168L+7Xj2dtcZJVvR2uSy+pYKKkkAPmSbrGCbYcgUyTxk5CWwIYG0ZPvF1nvYv+i4dC3gq2yNqAMpjS1mzBEd4DD2J9OkvNe4/Q70JpsQRnb0Bz1sejZzkFMpOpxUFZhNwEq+FKkCTx9mnVj/AW9fpqZ53/31MQzvFNn2aMpiWtXWyj3md7KSZpehZ1I6RQyqsJeSct1SKan5T2N86KCpkBg== 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 PN2PPFF679F9759.INDP287.PROD.OUTLOOK.COM (2603:1096:c04:1::15d) by PN0P287MB1187.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:18d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Thu, 19 Dec 2024 09:49:39 +0000 Received: from PN2PPFF679F9759.INDP287.PROD.OUTLOOK.COM ([fe80::740f:ab98:2be1:538]) by PN2PPFF679F9759.INDP287.PROD.OUTLOOK.COM ([fe80::740f:ab98:2be1:538%4]) with mapi id 15.20.8251.015; Thu, 19 Dec 2024 09:49:39 +0000 From: Bhavin Sharma To: sre@kernel.org Cc: Hardevsinh Palaniya , Krzysztof Kozlowski , Bhavin Sharma , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v12 1/2] dt-bindings: power: supply: Add STC3117 Fuel Gauge Date: Thu, 19 Dec 2024 15:19:11 +0530 Message-Id: <20241219094915.19059-2-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241219094915.19059-1-bhavin.sharma@siliconsignals.io> References: <20241219094915.19059-1-bhavin.sharma@siliconsignals.io> X-ClientProxiedBy: BMXP287CA0004.INDP287.PROD.OUTLOOK.COM (2603:1096:b00:2c::23) To PN2PPFF679F9759.INDP287.PROD.OUTLOOK.COM (2603:1096:c04:1::15d) 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: PN2PPFF679F9759:EE_|PN0P287MB1187:EE_ X-MS-Office365-Filtering-Correlation-Id: 75d10263-7960-4bf2-62b5-08dd201274a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: JthqiVPGHE9cAwvviKkTt+sKsMvFadNMLZQf7SJtxhldUmNe8THIEZPevDwRFSKfc5QXV93QboHXO1lr9epCIsSnbV9ZTiVwg3oIve+10A8jjH6cMzK1+C9dVr1NEZnjpe26oNcem+2klVmPiP2j+DtdWN/yr9Mc0Bq9yvWMNgeI3UoxdCRp9dsCGvRACw6bAaiYDYjD5MyFzcAqaLUbg6BG3dxJQVkcS6+VIonDOWHvNDZ5SvdoJRISllgNf37Aam2ulL2J/TaoboTbMKjtUGQ3BJX2OoyIvoo/PZDr5DJ2bmWYSYXfiuOoVAFv0FtJfGebpxatffiDEI2+3I8NrV4U90o31gJ0X6R2bUu5BHM8xNp8eUW9fmiouoWK89GhTj9npODGFcWffrZIG3w3hafUYz7J6xnhjhAgSIa3vOgzD5ujpJ0gXhdMi4w/FRZcWQb2IKUfQ1yaqiYo5Lnn4OOp9ELGFWnxJZqJNxE5OL0oQGQwx9XHBIjaypzR84Ql+VyQyfDz26ROJS/y8TKD7hRNhkD6vsRWcREuaZWjsoj38+Xd8WL2G2ILAMBQ1DLb6Ac9a2rbJkpUZAObvydSIM0qeK4+yPN/csjm5sQVdzoKH19/AcHdG2jyj0WCp20fX54kp8NOhgjX93+N3RUEVmIw/uZXAgEmShXM2a6oGUm48IUW0a2IoxGQDkm8F6JaSDP6Xa2mejeT+WfL22cdZOmvfY2mzLU7aKZmgUaXIU7APY0gJSI5+LUHtCVOuJoghNCYMJMpqcjsCeT0fpOu3c96Uma9043sPfixfUwqaMnxD17hvBTM1VdARjYS9iGO9BJAgfdjRRGHqPxdvTZebxeLBq7ctmnPFi/s7KDs0lTZNp9CcZ3Bt2D2P1EuvbgSnqwAbFVkPQ8PTcinrV749TaKGCwWvg2l09c7Hl1OM+kEgazpy/DTl9Fpb8BtqRlaxXulBraShRtPoToHeFViqy68AnXRtHT9nJgxJrNXxNyQ7M9XfCU/hmGK4dvKJIGIvPcEQ88C3lW1fZyD24AAYd2ZbvNWGJbjufnIJT08Sj9XskA91lB8mgTbFRwkUPWmWrJSbc9PFdBdx1OxWmIkL05tEypBc/zGvp2iNWYkVAPFuuWUHlbpv/GoyNHiVrBptq9yQz+G248v14fLJYaqAZs8lTelBulHwX1soABmcfDX7oTe4IkBUH8m+PTBaDRknVLIRcnu85BZgMFvvL3+KZglp2fCHeFhlRJLlmU4sM6/uRFwWjFLOZwMoZKDHTf3gj8JLkOle9ZJynu2tJ9eGwkueMFx4RCyUbX/nkhg0epMbQwRgJ79LEq4Gm7NJtveDVG43TXtNpOdQQkIXZA/sLVyVs9VpLdWoGw7afQ4mGGxnPpsmuMq0JaBu99FCuRCkb5wZxVSRVQPBKk/MA71WQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PN2PPFF679F9759.INDP287.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OzENtH5u44HD7QDKD/kbxjUm9KvBM9xSYlh6kq0zcCA5qYunpYhf0TzM7sQZKor11QoQnSKDYo7q/h7eVhiOIN77sstvKe6G/OC1uhDgV532CQgkC5bhzgkUHPHgdfbQVj3NGex1aNc3SsIULzbsdQ4LNCDM627Ujh14HBd3Z6KEAEdju9d/rfqQP86g/+ZBNC4ui7TzAXP9AXJWAtvcU5Rj7JHIDHfUjz7adeSqCdobX8jIzsYcfNmnf+h96ikyshEB2XYzIPBra2GWWKfQtUN8dyvcq4vKLTbPbH4fvdsArqanqPCvqp9MvFjaTCAjWnmR0K1nSVxzCGrSabUGwCOGzSjxlDDlg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Wbbl5eTa3pvrN2KyHnexDIcGcPHzFcnN7WTHCd6M8dO7znwjZ6ircVodgnK945aMxSF9QdDutnP8s2yns4UJItSvEAuHkKvNbOPZ9htFOC9q+RbY+/+osGxyH862HNOzpsjUj0AwA3kNUgMWTGg+l0eechq1KilBxpePJ9P5J2lLVHygy/BpKJBmWw2qM/RcJQR6ntclpfTu8= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: 75d10263-7960-4bf2-62b5-08dd201274a0 X-MS-Exchange-CrossTenant-AuthSource: PN2PPFF679F9759.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2024 09:49:39.5891 (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: CHuKQv8/FeNG0ftDuW08BlCB0GlvS0kJcQjAhQhEohqhZMvFM9EyxGDEiS9idXlejDLmsujOTWL305DBJKrQwMgvy1VrSavjEXQML2D1xyQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN0P287MB1187 From: Hardevsinh Palaniya The STC3117 provides a simple fuel gauge via I2C. Add a DT schema to describe how to set it up in the device tree. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Hardevsinh Palaniya --- .../bindings/power/supply/st,stc3117.yaml | 74 +++++++++++++++++++ 1 file changed, 74 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..e486131a27a9 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/st,stc3117.yaml @@ -0,0 +1,74 @@ +# 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 + + shunt-resistor-micro-ohms: + description: Current sense resistor + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - monitored-battery + - shunt-resistor-micro-ohms + +unevaluatedProperties: false + +examples: + - | + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + battery@70 { + compatible = "st,stc3117"; + reg = <0x70>; + interrupt-parent = <&gpio0>; + interrupts = <31 IRQ_TYPE_LEVEL_LOW>; + monitored-battery = <&bat>; + shunt-resistor-micro-ohms = <10000>; + }; + };