From patchwork Tue Dec 10 08:09:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 849029 Received: from PNZPR01CU001.outbound.protection.outlook.com (mail-centralindiaazon11021134.outbound.protection.outlook.com [40.107.51.134]) (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 AD61B172BD5; Tue, 10 Dec 2024 08:11:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.51.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733818278; cv=fail; b=f+iEU9aJpj4IFRBpFiKZhmAjq6c3VhvkFh037xK8OPqAUnndPTRz8sF/Jkoug7K747GXx3Y9eddDSfxV6+0FAKi5OCvbswkAFiwSjplbMvdSymlaTMW1bOBtPF/iRss+axyp9oWlZ2LX69XZuB+HxW+uqrRkwZVTJ2NbEQSQOZw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733818278; c=relaxed/simple; bh=uA/JNnIfkJuRvIkGtgQRRHavOh+A2L1KsNGn5JjoFIY=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=lrqZWF+kad4pSNgukV02MkjS+yn2L7QYFs30uHqFw8c4jHGVtJz3kCsq+sdX1bG0csMaWgztzibRmiSj8BHhNKHgSrnefIcVv31KGZ+bbEyRBK8pG8vpsHySo4vB3qOnZKY66FdBAat92EfgbvtyU62bTS/AUI0LxqIVyXNw4Jo= 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=40.107.51.134 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=ZJQRCtGkIiQ2xwjE+gkWG0p59ATn8SmXuZQMwCsnNrgPMhhdVDK1YpbHtxynYHKvRGmOdeiT2VzyVNipsSVUGjYwtPxZIJY3ZV9LBgesxTj7Ul58u+2jn8y9VOewl3JvMuD1uC102pZyRnK5TArjhpgsvlF4S1dim+aq7Sz9v6ec8Z+OofCDIH9DwSI25NBTS7GJr3KBVaJABFjjHfpmRkkCCpI5RonAVw8EnXcqebLMb2PHosIbiUh3zL8wbkl49E74brRind1o9QTKSAmO5iQ48Vh+lumpz0fVZ1vN9ohLBj4h94MfzKKifDgosj1k1scdt00CiBEFEDypb4MWfw== 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=dvYEJFOhTZyp+/PE2t9vs949K1+gwEVhvViEPR8WKZk=; b=vGToVspSzY9AU7F105sPd2zXmyGi6d/1ej6Gzifm0Zv2idCE98njqSdo6YzhXXgGol9EyNH5XJfzF2QUCZrUfl5CTY+dAgpTrm3pS+RCD7O8pWGW9dUz/T7CUxrg3Ld6GFa52C8kFFFJv55wKnxsMHFRPdf0kBqNRQok9Lz0xylnqJbOp3xdZF1hTkoh9ye4feeUj6rlUpa55EX1fIX9bcqi5+mNAkKCWFGRWQf6M2NwO7AN9G6uJvcba4VdugEBC71oBYroEVglb3sBDgsQq9w6qP9F1W41vSiGwxIl+QIpgHiplH1z6oB8E5ALScwcwoZR/kEpDECLNBcX6e+NeQ== 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 MA0P287MB1195.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:fc::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Tue, 10 Dec 2024 08:11:09 +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.8230.010; Tue, 10 Dec 2024 08:11:09 +0000 From: Bhavin Sharma To: sre@kernel.org Cc: Bhavin Sharma , Hardevsinh Palaniya , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 0/2] power: supply: Add STC3117 Fuel Gauge Date: Tue, 10 Dec 2024 13:39:44 +0530 Message-Id: <20241210080954.5067-1-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: PN3PR01CA0112.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:96::20) 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_|MA0P287MB1195:EE_ X-MS-Office365-Filtering-Correlation-Id: 396f7b60-6d86-41e3-fbe9-08dd18f23432 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-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Lw6Tve8AGOUues/XWMGjKUFKS+hzTbz1Xqh76ZUs?= =?utf-8?q?1IoqXlPr9+6dfoTEt1oJP4yniQOfpgyJMpWy83FU6AJUNOy8ZqTK1CacpWjWeivLm?= =?utf-8?q?4t5fBnoxm4M2MOq8HqiXHOJTGmru3tXUlekXYoJeyIb0PgF5ovGFvGVOxsiYlKMSS?= =?utf-8?q?smhDxIjAuw8UcYKp3B32GX/Y9Ed00E6laB+GqLy5CkQ8BJ9T2No1w4LuybGyF8o+T?= =?utf-8?q?mGZZ+7L36n+OmBxu8kO2Nh2BtA6P2YO3ygLHmmzKnWycvAIco7l0RHl5gqNakL75W?= =?utf-8?q?1yJbI/2QUiIbAcnAAkM9WcuCZn9iuJnRvOH0sG8XuFBTnSTf2q/j0zUGUI+g5HMDy?= =?utf-8?q?67RwtpbCWVVwp2pVent+VoYIN9IZC/xIaLmqvtltr5UnZzWKYjU2efjwKZIh+QuGG?= =?utf-8?q?vD2TiN55rJUuONhsHtKEmi9HtzUoMlcrBQ0G3SmoXdY/q3frUQ8gcxYA=3D?= 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)(376014)(366016)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?rpb3PtajTWguLmw8l1xNg5sY3q29?= =?utf-8?q?2LQir/D7jDZxl895FpGsLXe9lvS8ZJMyQcXfodJ9bL8qQcerq+0DpYKVhOCjqGiHN?= =?utf-8?q?+4rlZld1wbtw/ozurlpUsYjJqPM8hWeKwkbhl9tWfY4W3ND7dncB6YGs4DExEN2xf?= =?utf-8?q?MyVmtgZcvxpC1lNhtUAWn6axB9OHy8YoaWrLg2jayl7Og4xXkYSvXMmzvR8gOnRdY?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0XYvXdyYSHA54Oql1mnLnpdcZNbQfyGYOYBF59rhluYU4CaMKJd0+J?= =?utf-8?q?HwVoYrndPaAJJS5/TIVw826EFLHpsuPyE8z+sfMks0hTBjLHgQew0oZQkcuSDTutG?= =?utf-8?q?E6LKZN1Axgrr+7k41K6NYJxXp5qKy9y9jzvbx2gNUTIPgG6wVy/GNgs1pWuj1RNt1?= =?utf-8?q?qCp9a2QVGAWPLlL/wJolskRCd3YErLCrJL1pGOoiUurkiBdSmC/vrgMtcbE6X5Lmc?= =?utf-8?q?nEF8oNFCuZPu/PA5nnfug3ZMkM593SEbUJ/4sHf4nkmFJ8aePm4ltQbtH1xMGwsLG?= =?utf-8?q?kK93HTgE73+IqWR/lCMNp+ECH77MM5ithe6GAe8iFjTNgvaawZ0ngUoRuhhJ/lShn?= =?utf-8?q?fvs/xCpafd+AfyOV4f0qGsm6/3yvFqdCVvHl5QVmbyKgveKj9tjckEAZAHBqp3SBL?= =?utf-8?q?LIe+c3FJk6REYYIJNPE/vmGjftX0lr+VuMj5Lk+jN+3DtfXt+K9QnYw=3D?= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: 396f7b60-6d86-41e3-fbe9-08dd18f23432 X-MS-Exchange-CrossTenant-AuthSource: PN2PPFF679F9759.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2024 08:11:09.5352 (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: dPQzHXhE8VlHjZ2mR8xszWF1mGQGzVLSEURtrc/48CosF2TFO97A0vOdZGIa3mTmaYozbjgNhzuJiaUFIwLGjddVmVZ6Du/BKplIv3oB/9Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0P287MB1195 Adds initial support for the STC3117 fuel gauge. v7 -> v8 - Add output of test_power_supply_properties.sh script. - Change 0X to 0x in macros. - Fix typos and Specify units in property comments. - Remove stc3117_update_battery_status function. - Convert voltage and current from mV/mA to uV/uA. - Represent temperature in tenths of a degree Celsius (1/10 °C). - Export average current and open-circuit voltage (OCV). - Use devm_delayed_work_autocancel. Link for V7: https://lore.kernel.org/linux-pm/20241202094328.14395-1-bhavin.sharma@siliconsignals.io/T/#t v6 -> v7 - Removes extra spaces. - Fixes error handling. - Fixes the logic for checking battery status. - Fixes typos. - Removes unnecessary commas. Link for v6: https://lore.kernel.org/linux-pm/20241130094531.14885-2-bhavin.sharma@siliconsignals.io/T/#t v5 -> v6 - Use shunt-resistor-micro-ohms property instead of sense-resistor. - Remove the battery node from the binding examples. - Add interrupt bindings to the example. - Correct the Signed-off-by (SoB) order in the commit. Link for v5: https://lore.kernel.org/linux-pm/20241129114200.13351-1-bhavin.sharma@siliconsignals.io/T/#t v4 -> v5 - Fix variable names - Limit code line length to 80 columns - Add interrupt and monitor-battery properties to bindings - Correct error handling with return dev_err_probe() Link for v4: https://lore.kernel.org/linux-pm/21c08a45-34f1-443c-97d4-6baf9fa01b67@kernel.org/T/#t v3 -> v4 - Added support for current, soc, temp, and status properties. - Addressed comments and feedback provided by Krzysztof and Sebastian. Link for v3: https://lore.kernel.org/linux-pm/20240205051321.4079933-1-bhavin.sharma@siliconsignals.io/T/#t v2 -> v3 - Resolved DTC warnings and errors - Formatted the changelogs - Added monitored battery properties - Replaced 'additionalProperties' with 'unevaluatedProperties' - Replaced '&i2c6' with 'i2c' Link for v2: https://lore.kernel.org/linux-pm/202401080530.0hMWnrIg-lkp@intel.com/T/#t v1 -> v2 - String value is redundantly quoted with any quotes (quoted-strings) - Found character '\t' that cannot start any token Link for v1: https://lore.kernel.org/linux-pm/46bba29c-330d-417d-ad84-ceb5207fdb55@wanadoo.fr/T/#t Hardevsinh Palaniya(1): dt-bindings: power: supply: Add STC3117 Fuel Gauge Bhavin Sharma (2): power: supply: Add STC3117 fuel gauge unit driver .../bindings/power/supply/st,stc3117.yaml | 74 +++ MAINTAINERS | 8 + drivers/power/supply/Kconfig | 7 + drivers/power/supply/Makefile | 1 + drivers/power/supply/stc3117_fuel_gauge.c | 608 ++++++++++++++++++ 5 files changed, 698 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/st,stc3117.yaml create mode 100644 drivers/power/supply/stc3117_fuel_gauge.c