From patchwork Sat Jan 6 10:14:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 761011 Received: from IND01-MAX-obe.outbound.protection.outlook.com (mail-maxind01on2086.outbound.protection.outlook.com [40.107.222.86]) (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 710FF63AD; Sat, 6 Jan 2024 10:15:04 +0000 (UTC) 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=arcselector9901; d=microsoft.com; cv=none; b=emJrmf3OiPbUZNLToRiLYzJ+9xAdIT5+nsWSC5thpLW6wFO3+qgCL4OmlzsmO1sLCsiz2e9jrxO9auZPkFqn6uyn2ylKG+FbDqE/BEO9pgrqDkupO+xv71HLidFqtIQNUoCId3PeewjEunVsJOKWQY2Ny8Gn+eyH8IeEkc9qqqvmtlVaBRMOgaUsqvfzM7FHEKIzX7C2DtYbt87vrAaSpCcCTdSzbeG8trqzpM5qiGteHJK2I57iMcpmLWO+mnnHzgQH+WUkKfK+OicRo/nHj91Wss58K1qE8IerhvzLLNcBmQZYONnkIWcj0GU8/bd80pTiqe79mJbTVL8cBq1RSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=SKbsOvS3h/6ph5Yn17rW62p6NRXFpYAADO0Z3Sik828=; b=D+x4GIBCGz6HKX5YnhLOtlxJwtCfuP+RZWXyo0F8uhEIdiWEulEzIqmDEUwpjDDBN5pxyUU8vUJL6s9XYqs0RiEpIZCIGxDiKs3QfIcrnhyUL/yLb5mp+C0ZMfAEhlfCrWbTbdA2kMOyMSUH73JPCZbbYxuW+IQYxZBnC5oGZYY5uqGizFrWdckI1aNNXDHzDRIiBzdXTV/bXOcy06Ypn35MXLLqd3v9Iq7tX9dRqi9y0Ras73+KeAf3G078POtOXgwO8eV7MIRhnbxLAB99Zuj1RE9etr6KPXU1FZF7sEAk26AvE570IpuT9qeBEHCcj6s2CfMRIaePuZvRG0OxBQ== 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 MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) by MA0PR01MB6415.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:74::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.18; Sat, 6 Jan 2024 10:15:00 +0000 Received: from MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM ([fe80::c1b:b2aa:7fc0:6532]) by MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM ([fe80::c1b:b2aa:7fc0:6532%7]) with mapi id 15.20.7159.015; Sat, 6 Jan 2024 10:14:59 +0000 From: Bhavin Sharma To: sre@kernel.org Cc: Bhavin Sharma , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] power: supply: Add STC3117 fuel gauge unit driver Date: Sat, 6 Jan 2024 15:44:33 +0530 Message-Id: <20240106101435.2927116-1-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: BMXPR01CA0079.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::19) To MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) 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: MAZPR01MB6957:EE_|MA0PR01MB6415:EE_ X-MS-Office365-Filtering-Correlation-Id: 486f088f-aa27-4a7d-0643-08dc0ea0570d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dy4pHl18hYKsvOY6rbMjg1Y6gjKyozbamcrXk92S4kljc7bXZDRroykEjQEhroeO9egTJxW1RFykqNGmbD8lpth5vRFEeBzxtntnaSmgRdqv6sWxKg0gDGCLWpqC/eqZ1/Y8dg23weUALEqsk6C3kitfpF3T/Icu43oVUc8n5xw1k0AMQbJghr2yU6lbTdK6/bwGq+a2KUVIWHz4mJK8J3wYur91lCG5VZkQ+3ko4B4cg1eSq37gEuU1XbD40I0+Oeo97KtuQuxt7NziSsUI95Y+Fvmko54/1ilUBipkacilCfEvnNaaByzNh2aILq4R9SuCHasz7lVTm4UABfp8SLWscX9XSAupct6vnmTxwCV2iLi8Bt2SOFlPcwbFc2wpxHGVCQlDS9mBEO/slW3egmmPa7frSG8KhIj/TYJiw30N7m/6mR+S5UtmyTOrscMuASQfZ7CLmQpJ8owwr5zBxLo+WFL3HtKI6f0v3PrQ2OseA+EbJy6/lPF06RcUK6gEtHXUI0WdaOuatQw7SmrJvL9F7lSE6ZzuLLq5WfIh90Lrv4ouIgzU4sRNeDYVeO2K7YTMe7BuVQMPmmeu4jPFRfe8Z7MX3ISwbGggTH0HNLl14WExSEODpcSkbmSQkH6+ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(346002)(366004)(39830400003)(376002)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(38100700002)(44832011)(4326008)(5660300002)(2906002)(38350700005)(6512007)(478600001)(6666004)(52116002)(6506007)(83380400001)(1076003)(26005)(2616005)(54906003)(66946007)(6916009)(36756003)(66556008)(316002)(66476007)(8936002)(8676002)(6486002)(86362001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ivEnmKfwFgp7k4aGN+Nmi5hFJLhrP3h/fCmuDU3E00ZTYV5gHRu45Vnx1xGVMtqs5mmL2ROwGdZTN6GTf3+nDEszkKvhW1Rs032+sj2Wbr4C4US/pBsa5d5so8B5TYRKzpfccXGmR+tKzRr0spUwBQhBnCWYFj6iBJkvmgQdJ+Fk054Mn8+FaSG/YAGU1o4jj/Hhm5JPENRtUZb+hWwhfR/7k+lKbyQWT7TkPMYcwgWIp3qLLr9c/tv9njBbZB1GGXF7Ao/9CPCc9JIGmXN3FwzshdD7glFITHjOvhylZByf11DVDqrHH6qyJT30daxVQII30mDxTHwhqRqRcmpfRfj2PEJUwJ5QK9frFzMGbllK73yUr/vNUErhnhbJ+R92ISg1ojbPeYExDsoFkWR1znNW0uWwR0DKpoX+tFM+N27hUA6U7UPbC8H6EJ0CSkN6K6x1y33rUCkE1Ly2AMlO3CEWn4lQLLhft3wkpXkJSDl2p8SGe0Rb6GjLHFia4rjGsEbnyubDDOdZz0YaYW7WgTHjKfdFPjhm4kpQl5oK/TZGk7iPabRRiM1mashMFT5U10OSuI7cvVdgj8Gm1t3Y1etPRjnIQ3Mya1G+2Y2+fpINmKJaY+V6i5ZBb1yjDx6Nz2k8+RRl8S7q5p1dND1GbA2R2PM1zTHNCkrL0xUZ+Xo53pny3PgcJ3w/YiqXpTJfDx7nWG0zblp3zuisXfwKSpBUMo63V09MExjc06G/yJwSqCfxuwbaZ6RNo1uDN2H4Hz+UduAPGiL7AAU9lI7y3yvT9PmmKPEnUo8+jUHD+ZUjnAv1tfllTD31p/x0G0EkskzAZ/YX2xdqwPa+yXpg33K7uUxxFfypZev5ddAzpcZH+4Fq/ynzrb9mDOZA3wvfp4Q/8jiFxOsYNK80k81JR+oZiuyMEgyoX6dPlOKl52gcKSh6qrucs80c4G0n8NeM5AlwufWRgbnVugpMOg4Xbg0vsnFyUyYYtXVexH9hmLu5iYt0H3IkAWX8Jptfw7gNs7ZJAcMZEPNOlQhVgJiqrhi6r86Cv7QxNGhDl/v5arGX5ZihNMqQn0ATwCBTCizQK+UQxGpQLj+KZRi+q6n5H/XNyu6I8DEU4CBiMABAEi3QIQSkpbRv2hpmw5NY5JhgdpnwNl4vuEHKKOhCdTJLT/j+NDWY63ouisNcSkZuSroRuAv+7mpcLE3Wdc+tsPImzlOsjQd92beqWl/rI/NY+2AIwL0h85A43gZLyKLG+IcPPX4X1dCfP5XCqBXzMX7JEgXYgf7v59O6MshAWlksGbnnYWpcvqBw9OuDRQG9yQ7yn4Ikr+PXfIMmFU7cZliuqA9FOkEIzYOiEYewCpO+ckht22537EP9qAR75BfjvLZM+T00qimymAuNctF+N5T3YzcYcUXPLBHv4Sz5WiIZLdKrBYYJG5dKMusco3FhbXiknvt6krkZWPPrwbDB8XuRz+z9EilD4X9/Co4aNjouPQfK5Ck4ULXvJxWw4qjJ7wT63mui+5Q0qqP5J9WkidQuR+IWETrSRqZg5itGpjFXUn9+bSJxW5/wvr17MA6zpBPWzdG1jXZd9jMdOyRj+BYXqvBeJLy/I6CyIS9ErWOAQDr2yg3Xe4BeWHEfKHhP+Ao= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: 486f088f-aa27-4a7d-0643-08dc0ea0570d X-MS-Exchange-CrossTenant-AuthSource: MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2024 10:14:59.9227 (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: QfwWCD2dhq/qc3YICx+Mvy2nYK8CqJRlsLww2ms4Bok6zP7QpMGi/mbVSVow0n1rj6uqxye7LROFLIpvyXBaPGDw1JYeiet/1H+5Yu13J4Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0PR01MB6415 Adding support for stc3117 fuel gauge driver with minimal functionality to read voltage level currently Signed-off-by: Bhavin Sharma --- drivers/power/supply/Kconfig | 7 ++ drivers/power/supply/Makefile | 1 + drivers/power/supply/stc3117_fuel_gauge.c | 136 ++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 drivers/power/supply/stc3117_fuel_gauge.c +MODULE_VERSION("v1.0"); + diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig index f21cb05815ec..02df55b0d5f0 100644 --- a/drivers/power/supply/Kconfig +++ b/drivers/power/supply/Kconfig @@ -875,6 +875,13 @@ config FUEL_GAUGE_SC27XX Say Y here to enable support for fuel gauge with SC27XX PMIC chips. +config FUEL_GAUGE_STC3117 + tristate "STMicroelectronics STC3117 fuel gauge driver" + depends on I2C + help + Say Y here to enable support for fuel gauge with STC3117 + PMIC chips. + config CHARGER_UCS1002 tristate "Microchip UCS1002 USB Port Power Controller" depends on I2C diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile index 58b567278034..f8ed3e5a8882 100644 --- a/drivers/power/supply/Makefile +++ b/drivers/power/supply/Makefile @@ -104,6 +104,7 @@ obj-$(CONFIG_CHARGER_CROS_USBPD) += cros_usbpd-charger.o obj-$(CONFIG_CHARGER_CROS_PCHG) += cros_peripheral_charger.o obj-$(CONFIG_CHARGER_SC2731) += sc2731_charger.o obj-$(CONFIG_FUEL_GAUGE_SC27XX) += sc27xx_fuel_gauge.o +obj-$(CONFIG_FUEL_GAUGE_STC3117) += stc3117_fuel_gauge.o obj-$(CONFIG_CHARGER_UCS1002) += ucs1002_power.o obj-$(CONFIG_CHARGER_BD99954) += bd99954-charger.o obj-$(CONFIG_CHARGER_WILCO) += wilco-charger.o diff --git a/drivers/power/supply/stc3117_fuel_gauge.c b/drivers/power/supply/stc3117_fuel_gauge.c new file mode 100644 index 000000000000..bb033ac54858 --- /dev/null +++ b/drivers/power/supply/stc3117_fuel_gauge.c @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * stc3117_fuel_gauge.c - STMicroelectronics STC3117 Fuel Gauge Driver + * + * Copyright (c) 2024 Silicon Signals Pvt Ltd. + * Author: Bhavin Sharma + * Hardevsinh Palaniya + */ + + +#include +#include +#include +#include +#include +#include + +#define VOLTAGE_REG_ADDR 0x08 +#define VOLTAGE_REG_ADDR_SIZE 1 //in bytes +#define VOLTAGE_DATA_SIZE 2 //in bytes +#define LSB_VALUE 2200 //in micro-volts + + +static int stc3117_probe(struct i2c_client *client); +static void stc3117_dev_remove(struct i2c_client *client); + +static int stc3117_get_property(struct power_supply *psy, + enum power_supply_property psp, union power_supply_propval *val); +static int stc3117_get_batt_volt(const struct i2c_client *client); + +const struct i2c_client *tmp_client; +struct power_supply *stc_sply; + +static const struct of_device_id stc3117_of_match[] = { + { .compatible = "st,stc3117-fgu" }, + {}, +}; + +MODULE_DEVICE_TABLE(of, stc3117_of_match); + +static const struct i2c_device_id stc3117_id[] = { + {"stc3117", 0}, + {}, +}; + + +MODULE_DEVICE_TABLE(i2c, stc3117_id); + +struct i2c_driver stc3117_i2c_driver = { + .driver = { + .name = "stc3117_i2c_driver", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(stc3117_of_match), + }, + .probe = stc3117_probe, + .id_table = stc3117_id, + .remove = stc3117_dev_remove, +}; + + +static enum power_supply_property stc3117_battery_props[] = { + POWER_SUPPLY_PROP_VOLTAGE_NOW, +}; + +static const struct power_supply_desc stc3117_battery_desc = { + .name = "stc3117-battery", + .type = POWER_SUPPLY_TYPE_BATTERY, + .get_property = stc3117_get_property, + .properties = stc3117_battery_props, + .num_properties = ARRAY_SIZE(stc3117_battery_props), +}; + +static int stc3117_get_property(struct power_supply *psy, + enum power_supply_property psp, union power_supply_propval *val) +{ + switch (psp) { + case POWER_SUPPLY_PROP_VOLTAGE_NOW: + val->intval = stc3117_get_batt_volt(tmp_client); + break; + default: + return -EINVAL; + } + return 0; +} + + +static int stc3117_get_batt_volt(const struct i2c_client *stc_client) +{ + int ret, volt = 0; + char i2c_tx = VOLTAGE_REG_ADDR, i2c_rx[2] = {0}; + + ret = i2c_master_send(stc_client, &i2c_tx, VOLTAGE_REG_ADDR_SIZE); + if (ret > 0) { + + ret = i2c_master_recv(stc_client, i2c_rx, VOLTAGE_DATA_SIZE); + if (ret > 0) { + + volt = (i2c_rx[1] << 8) + i2c_rx[0]; + volt *= LSB_VALUE; + + return volt; + } + } + + return ret; +} + +static int stc3117_probe(struct i2c_client *client) +{ + struct power_supply_config psy_cfg = {}; + struct device *dev; + + dev = &client->dev; + + psy_cfg.of_node = dev->of_node; + + tmp_client = client; + + stc_sply = power_supply_register(dev, &stc3117_battery_desc, &psy_cfg); + if (IS_ERR(stc_sply)) + pr_err("failed to register battery\n"); + + return 0; +} + +static void stc3117_dev_remove(struct i2c_client *client) +{ + power_supply_unregister(stc_sply); +} + +module_i2c_driver(stc3117_i2c_driver); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Bhavin Sharma "); +MODULE_AUTHOR("Hardevsinh Palaniya "); +MODULE_DESCRIPTION("STC3117 Fuel Gauge Driver"); From patchwork Sat Jan 6 10:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 760644 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01on2045.outbound.protection.outlook.com [40.107.239.45]) (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 34AB46FAD; Sat, 6 Jan 2024 10:15:09 +0000 (UTC) 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=arcselector9901; d=microsoft.com; cv=none; b=Eh0+RyqnWmxhet6RNkF8QcwDfmjqBAaCwfcH4wUhFvtViGYwvxExWlbhxTdBKpn+Z18dVmnaugiT9JsJMay9SC+HZnRoKuNwkhmtfYxxluCXUOgDZwY3anEOO+TANQ1UJeZaQR0T4pBVa5z2ZPztZJC7JvGqIA1CIP0zTEmYGlzvcaTyX0dP+5z47fQi/BaE/cbS0RHjpa58IMGC1stu9V0PG4QMay9s3xiXiSCVO+rSucpUDAmG3GBCWGvefOrsiMDMSl62R3QQQvsqcr/dEIOo6DW4VGARyjxN427imkmE+aSoOKXyR5T64bD/m+kBEi4KLZG9xmG72i4HWIxICQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Gt0RsM/VIpEIaJ4Odhf1rpxdTv+cTD4RIvTWMcGdaj0=; b=GIwChduNqQWTomi4O8MJSF66yBeLOw+q2yV6ip6kZEUgbkXaRDmz2emSC0G4Ki361aMzACAD4vvUukGWF3zOHhYh9g/1ONtmPG/EpSQOwNZRynu9BcQ925hWoUXIzPKCBqbtcTOzwZCArus86ZRFh8lPOOcp7U0Aw8Eow12kP/CmtBct1l5Q3LhQ9Se9NstgI33BTRS0fA3aX6DRSc3uHO/EXSD8vYuWWI27ckPzWflTu6+pbyxo376y0EAIOcQtdUENtzKEQahYTcyrQ9ji9Mrefgv/aJ4anDV0QDVnbH8ScNClY3KwwKRIIuX/Jv9xgfhg6wv0EWIma7Kh9M5cyw== 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 MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) by MA0PR01MB6415.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:74::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.18; Sat, 6 Jan 2024 10:15:07 +0000 Received: from MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM ([fe80::c1b:b2aa:7fc0:6532]) by MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM ([fe80::c1b:b2aa:7fc0:6532%7]) with mapi id 15.20.7159.015; Sat, 6 Jan 2024 10:15:07 +0000 From: Bhavin Sharma To: sre@kernel.org Cc: Bhavin Sharma , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] dt-bindings: power: supply: stc3117: Convert to DT schema format Date: Sat, 6 Jan 2024 15:44:34 +0530 Message-Id: <20240106101435.2927116-2-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240106101435.2927116-1-bhavin.sharma@siliconsignals.io> References: <20240106101435.2927116-1-bhavin.sharma@siliconsignals.io> X-ClientProxiedBy: BMXPR01CA0079.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::19) To MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) 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: MAZPR01MB6957:EE_|MA0PR01MB6415:EE_ X-MS-Office365-Filtering-Correlation-Id: 67e35b58-1f06-4429-8952-08dc0ea05b79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vqEpkuOlk5WMpnFEsvz/96NTNndfzp2+pO8zCzmjOEVOfESN+GW6QXgjxcPAoXRFhV42MqV09wDe2Pc+aJTl6VnM9QhVdHQrhzRIFL01zrmKWaVWVr2lsaNxodcFomcfFF9yQca68y47ELlmI9ncUW9uz4XWZOhWN/lt5HZTejIenumDu+F7/xYIJkc82wDKsGndvchPRu73cQBJg6pgBEX+dhwFC7yz9M/MCy94aLLmdLK62VFoNNvYcKJRajr7RwJcyXsW5/eHnGJmU4Yb1VQVR0NihcXsmfVYjli9vHecjiaACTJG/b0f2mcup8p+DjdJeDvAtiwMU0mxsKOvrppKKuFyYRc5bKIzs9wgtAiRUWJPc84uHCBwzvK8YLOP+kbqlgBoJiPweDYeeIgPsTMoz51JdWvbYmt94ZfD3D7hNXqTaq132uT23skH+Qibm4jc3HUEGa7Gf6k777lt3Fh9HV3P0wgz02LLTdiJgx8Mtca1NpwGCA/ablFfzRHjy6vfnCFmijp3QM4iz7+jJPhNs9iRJ9XW37bLI5YBJHlcjAAdI6qiJUmP1ABf0U0gf6uhGKe9S00KG16bAg6tmNcZ1gk5OnDbbmr4eGG3ZaA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(346002)(366004)(39830400003)(376002)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(38100700002)(44832011)(4326008)(5660300002)(2906002)(38350700005)(6512007)(478600001)(6666004)(52116002)(6506007)(1076003)(26005)(2616005)(54906003)(66946007)(6916009)(36756003)(66556008)(316002)(66476007)(8936002)(8676002)(6486002)(86362001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xRarUwOrFjXHwjBEfZCXWFAwd2Z9sUqEchicOZ5aVHvAKAIFHxf5Cs6dkZLTeA0IOK1eq4xbghhvGRpITu78jB+WBr644NXi0JTO8vQgulg2TvfdsUrHEUm2ej7VtdyIKkVCrGv1D4OruRBkl6VV/9favWVzzvlEAsCtTCGyqLpI9A03VqK7XkulOPxeDXoa2AHFvycx3Ieburv5ZXrYFFRrW7VueTCZr3XW0nIK5kO2vX8ZYh8jQzLSYamvHnRbSY6pqASgtGwvuSdxx9+KI1OHd2trp3ntcDDFVBZXpzoUm2pb+4qVlwCXoDgac8E8Hm/qVFUCJ5/xyZh7t73WbzlfY4/8vCVRmCtJJsBNf71OT3Tjk3MyOZIsKov8OKD+zmTqwpDrR7E6w6M0jK4vsvTLKnCGW1ts7adLgkxtXSCf/k6oNhvCUmVfUZr+4yn7yEDXBsO1miTIC0JcfKRR+CE66+1vlTsCXVe6esVsETSax5FmIwSIu+5WE9Izy4FdhTa93FoeNxoAlig+ZG14M25rv+7HlKOxsm3EZjuQn/o4gSeeyHIBJKQda6MfBZLFFZymNqYJpBgUQO8Jr9EOQW2svkpSJvQaPEaQxbQgtB4EwwYaVWNxdiRiqugeW2IvA8jf/hfkRy1YUeTe9NPDbDlgBnnaVXFsA4bofUlVTm0szOpiUGbQmhGnvrp0jEJhJjk+xpsCzfepY4t3kjP/eGSOXpBMsIc2nfU53C83yruwaP4Bc9pnasFiHROBwAJ8QoSjbsEmEXacvfh+HcGt1/iVRNKRhmndduVAaUBhr48YvbfXvJvVKOxw2R8bYLIZqmgkTw9ZBUzZKrU5v5ZWWaoNrxrGAglZmPakIZDzGkcxAFILHYrd56MfIdN4QDIKr6SWAhFG7guph+UiuYuxNn2FPv/U5qbv0+WNA/YGF0y7zNj+41EceTeBuQNyk8Mjtbb7pH0wcx5VraITiW5Z2GPhLoMQ411tz+6Xjc6s7xsmgK/CJ1p9nKVADd9z8tFSTNDMFIAYJOX3t8u0Oq8NRwK1yWObOIryad0AjVE66V7OvVJ/khAZCcgFsL5ojZ6+bUF0mRWu8Uw0Ei/2tTV7wqi6aJkJ8uoua8SLE6o9/V22pKsGcLflgwsZTc0OnFkGOpaXT1KO8Gp9yw765nmHm1P7SxvbCKOuM6RtyJVVOy/H2seiCQPoq+pz70Eh2VchCJ7//JCbKZlJSdiVQpHgPsH5A6DgQ2ZersyYlwFHIJyeivWVuSQ4n5wrq+HxEQJ9jgmTRF5LbzrykOahzHTAdQpFDHlI0gMdVUISvsKgQo2Lo5X0sGyeVQ1VN0Knzmrzs1DU/T8awP4zG/jZRm/4/nEzSnB6HfbKZi5LkWetRBYhwmM1EIhX2EhB+XGf/2yzUdyrneiESK/nD2RVem6JyfVYv++ReCC2zvO8UhdXhCO/3+B0FUqx2QyxvF4yvn8PqOVx6VLFbUVAKEUu4NSqW5+RIl5KsUnkXZmgOGDWjnfvt5HjR/H5UyBLhwW3Hr0GtUpUdTjpz2w8q40M0vQA+amB2IXyomEQgaV9A0CSeIm8/AaPFngbAkSS0qfPIfax3Fpvmw71kjmehDeMWzTK/SDTMcJsuvAklUT73uz5t1Q= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: 67e35b58-1f06-4429-8952-08dc0ea05b79 X-MS-Exchange-CrossTenant-AuthSource: MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2024 10:15:07.2847 (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: 856rxs90wy4shiF7VKkbwUPHdRSfKGFNOR/dJ9wFmOvpfexre5RQSIfHiSXkpW8WoUQfrhmFxUdm/r54looxCVnWxl8+iM9iHkG2pEFIjKo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0PR01MB6415 Convert the binding to DT schema format. Signed-off-by: Bhavin Sharma --- .../bindings/power/supply/stc3117-fg.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/stc3117-fg.yaml diff --git a/Documentation/devicetree/bindings/power/supply/stc3117-fg.yaml b/Documentation/devicetree/bindings/power/supply/stc3117-fg.yaml new file mode 100644 index 000000000000..2c33132ab785 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/stc3117-fg.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/power/supply/sc27xx-fg.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: STMicroelectronics STC3117 Fuel Gauge Unit Power Supply Bindings + +maintainers: + - Bhavin Sharma + - Hardevsinh Palaniya + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + enum: + - st,stc3117-fgu + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + &i2c6 { + #address-cells = <1>; + #size-cells = <0>; + + st3117: stc3117@70 { + compatible = "st,stc3117-fgu"; + reg = <0x70>; + status = "okay"; + }; + }; +