From patchwork Sat Jan 6 13:35:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 760477 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01on2071.outbound.protection.outlook.com [40.107.239.71]) (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 E55C1747C; Sat, 6 Jan 2024 13:36: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=cASncjrKf7+9sq9r8FTiua0WBjCjh8lEtOktl3hhJ+08dqfh7/oFJVnF9GZiipGntrT3VxfrgDHR08mKKEYSMq+tF4euknxJ8tYXcWZhxZvVjWpn0rvVs38jwFgsOQjWc75NJizaMYPwF6IlblqDj/w4+RuYAa85BM27/1+mo7wGtyjMhQW1c0acGEvK/eO/p6H+r7OND0b3zaT/BDyZOFtZzqN6OrDS0rxt3X6x5z5KsQzIh1iAg5SvIcF/eEzarXgc8uqKjfTgHrXQcLbfCFfpPfAXmNmuAhAVHBR/skEBiECE9dAk70YCT9Dig8uwklogiTn6J6dBouRPxdJuAg== 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=Wwk6m9u3N0UKtKoL5dnXMW81O2EX6msPg70iq+GdFFY=; b=dSz+0rrvjuui2/mBRaNySy470WS3z3PPM2lJp+cK3V0NcyaWPrqf6ejGitAlJ0OEHn+Z0RGciVAO0uIBBubWu1mXuUKWMfSwskwTphevfdYDZuGLxQZRsIH7iaQUcfa52qGC3qhWcOjPyl/V11lveML6s9GuXZsuJvpT6gshVHC74m8x2+wqjgopMfbWoitnLpfSp1ksN9xV11p39/e7uYLIJrKfIA1DlB4TCY9oXkgbPFRAuFU4aqHGpmfWcYew/y10Mfb7LYTxcmIP6ha+Z1zQRnODLtGAV3QmeKUyGUG3vYe94G1eeGk0h5nf48OOY9wGkjD1my8Mo5bQQWGmjQ== 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 MA0PR01MB8931.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:bc::7) 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 13:36:05 +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 13:36:05 +0000 From: Bhavin Sharma To: sre@kernel.org Cc: Bhavin Sharma , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hardevsinh Palaniya , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] power: supply: Add STC3117 fuel gauge unit driver Date: Sat, 6 Jan 2024 19:05:43 +0530 Message-Id: <20240106133546.936261-1-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: BMXPR01CA0096.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::36) To MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MAZPR01MB6957:EE_|MA0PR01MB8931:EE_ X-MS-Office365-Filtering-Correlation-Id: 23e466bf-b959-4700-8ef0-08dc0ebc6eb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wx7sa/bgOBdFMfIsvSauCm6saU5r6H2hdGnzQ95yKnuZhBHc2bva0v5vM81GtnJv4V6lDRL5Zg2QP8Hg7Zdt2DbOvTIp5Tb5h80NkfL0VOapWBQAE3swQIyRmA7pKLWPdzLU6ZlMBzGeWW/S9PLIw8h56aBVNlRO0ZFo41CgbLKnCLSPBKRhFosary4RSENWdkDeE+sF2pr8aW4IquH85a3efUsmRF8BWVe/Cb8j2Yvm11qR49Ob+f+uoLv7Q18pZjNDha1gMLk6PYFoyu4a3D1c0JYu3Qd+Qbfp3IUt0HgYhWuDWmPTmMmmBbVd7LJOGSnmczfTt1d/7Uj0IUMD0dq88R60qFazetid9v4kQmzD8NTxYAgmAFT4OqH0QarYDqYbH+fLEFFhRnIiuRajJIk1DlsvAzsV3Y/3k8pP8LvYnuCjQNT6e+dnv0hOPHqQjUABBpNIY2rfFWuS3tT5UysCyr1AHjDLCn8zE/acByP/yYH5i+c19UJNgFWmYJ2FDYTwajA/CYZIOXWKVeCkHGs2Z9qQbWJjsqhztT1pX/KELWsL0a8flRvNYslpEl5KVZyafPcbwD3XTgCfVadqZbG7mnegELZ5MfQ/xAOgyHhsJdA6O8QY7fI9dyLWsDBo 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)(366004)(376002)(346002)(39830400003)(396003)(136003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(38100700002)(44832011)(4326008)(5660300002)(2906002)(38350700005)(6512007)(478600001)(6666004)(6506007)(52116002)(83380400001)(26005)(2616005)(1076003)(54906003)(316002)(66946007)(66476007)(6916009)(36756003)(66556008)(8936002)(8676002)(6486002)(86362001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gCLHgOB53GooIwR64j4oVZlWSTn29LpAMHHeZxhGDmOA+aB4E3Dl65F3IxORJOGj2a+YloZiVT1gjtTRz27c99goAfsc6wJ1xFpCfmCt/30x9MniDjsvh/o/+Fhet9hmLopnKOw4R0qkq2a9dMczT9sMbZNMktUfb42TBZ/OTZoJ9CU1s+UbHXRelIFcZRTYNs8Lou0xyLVAmapoVWggop8DE3pkT2NA5eL7jkmllvpiNSuFKnomVcDM3GYiII+0fnXJhqT84bx0a5na7OdW3kY6paeIeQe2Ttd2m1FFQ2pQkFpctyq1YdCG0ZcUuAq+7zCYZkbhL35uKAtpXAEcXJSGY5nm8xA/JmuDZcSZpHNf9RYt1vHV9q+wXeBsNPnDPy0eluH/tcPoi2HnGwCCwjw3LkXB6mZOiWnVsSMnOb5/Wv6aNSowNDjTioR+f/Co9evhCIiKKUP8iSGgw7Z+/73dGbpK1lmQX0S4earfxM6/mvGYV0f+AfSv266eORureoz6PSXg9TVufzaRr9ejw2mE1W4lfrlT5DfxNcAyDNVYOMGsxHanF9S+DaTxk3gyUuTZQapJ6CIh/iejuwuAJfVSKhm0dgGAQi2OAM6jCTn2sBU9TZn4D80pH7zHcNJw+wtOXJ1H7A8FfZoENlmg++wOBh5cVQW2bugpA1lXCNKoTXYTusa2/9BA0IiYERwboLRNE67Phb2a0ld7pECIesDwMktP1IroKqSnDOaUf++qmO0s5HIFVL0Fn8FfEB6ukKpqLf6PdRRbYLFsDecdnGvEwzlUzvRHJ8x4TJOdBef+xJxeF3090mLo6cJbT1yansnC0qcxii0JOWL0HOq9PMQgepr3VIL4rJyN+IBPcvy2O7cc/dXnAiWU+u/bJ4y+ems6HDpupX+X+OwgZtSmvIG+bZSC2jBD0831fD+20mbAqQkFB2TeJ35DIJaxzHp9Yu1xTMvpolLFZ2Aiy98mnES/vEz0/SA3oAqIdI49TFOX+dBRi55GqwPSl+xDMKZYPlJ97p7NloKzH2tdiiHjYn55bxsVS524BgDQ39RkSRu0DyQiVzuwmPGbSdAHn+z6J6+JHZ6Wk0dfE/lwAnQ0Ig1LpPt0sNLxl23iXizz2K9qOaeoLgOsMRRJWztnzLl3JgayZ8KMEFG6dYX9bN8GXLEF1rARcdEsHzV43uERaDUYvRRmfu4ImGhDeYqZo/D8ZjS3IZIts5+UAUSayViLSC+R8vo7NT4RhH5vaiYBXHFWJRYpkMT8OqCzXBi79+gfwZNDAkSM7E9HfjSaj6xND6DEP74eC+RYscZDKOls9nh2nJC7VeIbD25tTUTA8iXZLJitMkOpWAxEyBX+G8xHY5QuMpZW8JYbjBOoYDcIzH3T4jfxs0fkT4FsAGOmfJWa/DcgQ9NdJmaZ6J+Fg3JtoPF9psV/3X4xkylQ0lG28amOMKaQNvPfSJhxwBQG4kjpmyaTrrbBQ/pJEwuyrqdEr8Q0jpR0z32rE3+CAvC+1rqtCvEL1R2TCG4OILiLzxc9LYMVv9G5vLNor4fp4pm0Pi7AGaXDkHKnbTpK0GE/pxq1ZvVUJk+CdLkk5JTM3SEPv3wl8Kjl3UYTYvGGPMZtwzzHKLPgxqknC3YHIEyWSmI= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: 23e466bf-b959-4700-8ef0-08dc0ebc6eb4 X-MS-Exchange-CrossTenant-AuthSource: MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2024 13:36:05.4940 (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: vza/vxOcwoSQ2y+TsFdNH6mUFvw4qWVrQfnHlBanx2aS5yF3MzZ2DJbPHgSBrd/otxIS+EFsf2CzqYdYBtGACgVXa3Lmgs13PMHlDG/Wigk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0PR01MB8931 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 diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig index f21cb0581..02df55b0d 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 58b567278..f8ed3e5a8 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 000000000..bf87bc1b9 --- /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 13:35:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 760935 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01on2071.outbound.protection.outlook.com [40.107.239.71]) (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 90E197494; Sat, 6 Jan 2024 13:36:12 +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=HpOrq9IYDkg/U91nxfM46FOdSh9PLm1/ho0Pv12Y1cPCjbbLokliG/aCUwcydxIoWEq9NlzPCI26LqjY+jARKK51EsU7GmHY03vu/E6Yr7rNjBenBexqOWBFGA8g3k9QjTIM/YlRYSbZFg4OyA6N1A3VuUcCmM1HfnCVrNvHPTUypiGSSDJ+eIZ0YLPLSMJ9eQgm6LkkWaTYFN4S7usLE1KQCnUowkEEZrlKT4CxOi3eTDK+bPeOSqm+9DMUKrdQDgwzW/UWVPt8vu2V9s8vknyKuW4YXibozmwfGiS00dK7C4EXRJsQU5yqZP5karEmYvOnsxKs5XWvvUdhkmaaFw== 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=YKHXj3F2NfYxp+0VyvmYXwCr4S5KoL8DGhvuXgVBe1k=; b=bdIf/Q/4zdD/T/nXA8aGaMKibgRPJnCBuQ39lkRkLjvxLUvKGY+DzO4wmPwg/qaBVSn7baJPGnoNpytotR5HY4Vfy0Yo8ZBDg7jM6ZfOyJt5qwBdhpsTYPX9gXsPb/VyHST5mAJ/4H//IJylws71lNU8ZyyahlmRBXkZlBXJQEl2kDcREqhtty13Ou+BM8zt15mtnUgu3XFt/RNSbYqT5sXoyTxTApTE4tFwWYEoIiPAIgcSfZPKKWQRE4w2vW7RPxpX/4XwGN1+t21lhi2COOFohEuRM9AeewgWqDQXzruLhdqOoQvJtoRRuW/rOB9VCxDxsh5bHjEkaDO9HHJDsQ== 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 MA0PR01MB8931.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:bc::7) 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 13:36:10 +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 13:36:10 +0000 From: Bhavin Sharma To: sre@kernel.org Cc: Bhavin Sharma , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hardevsinh Palaniya , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] dt-bindings: power: supply: stc3117: Convert to DT schema format Date: Sat, 6 Jan 2024 19:05:44 +0530 Message-Id: <20240106133546.936261-2-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240106133546.936261-1-bhavin.sharma@siliconsignals.io> References: <20240106133546.936261-1-bhavin.sharma@siliconsignals.io> X-ClientProxiedBy: BMXPR01CA0096.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::36) To MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MAZPR01MB6957:EE_|MA0PR01MB8931:EE_ X-MS-Office365-Filtering-Correlation-Id: a32f7af2-0684-473c-80f6-08dc0ebc71ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L4nMEUlJL1nSJgGaG+d7sEv9Ud0MJVpUpZOjXSVaNThUsdD4l4NR5W/VC4N4GQcdC/Zw4xM6LwpavN28z10ipSjOBNKjTf/c3pGXTsDphWGgmysrNB+Se17+3U+qGKucwyXFVuY/Ug/uCYgIAs1cPI0EQHPYEv2gRheFcx0nKodPD9T+s/3jY2wRF6HYWNpn1gBKjSUqvsx0yjA1/lzwfxGJL5QbR8iBPv9hWbuf2Lc5wK1B2a0TkdF+4BjEOe4N3UUsDgxJtGsvho2ZPgwlvZY0nO2vNTFrX1NGiccdU7hPsOp+le1HmjfxsXdcVBRtGwmKqPLXkR1OTh4oppXNSEWy3JXdtUl6WkVh8N0Y/gqlLyKKtmFDLSSbv8Vi7rJInuITjUgbCQ/jQmIUmY9mW3N9eL6MeGkxia1KbvRKXiaO/3LQ18Lb8YOG/gNNuswdqhpYJE4EnbJR5y2PdGTUS0KYhAQsVfa1t8XY7fjHOQaekBwJXwJmdX6VRipQgG7SvyU+D3GajfozepbMEJDxVgrKe+Qz6lJg1cbSF3qIf7yKEJbWqzCtuem7rV5fJPx6QDVi9PiOWUQmL9UnqYTaHp+GBl6KY/q5LzUrEHsova8= 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)(366004)(376002)(346002)(39830400003)(396003)(136003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(38100700002)(44832011)(4326008)(5660300002)(2906002)(38350700005)(6512007)(478600001)(6666004)(6506007)(52116002)(966005)(26005)(2616005)(1076003)(54906003)(316002)(66946007)(66476007)(6916009)(36756003)(66556008)(8936002)(8676002)(6486002)(86362001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s8dgmjUWA08k2jnZigZrjpO0B0vbo75Jq1a7lAu6yoV4ngct9rzkWL6uX4+s3b9lOy5lQpEznGbVOfPE0PC7gVhp3d1TgiwO3aRzGSwf/bheLu0HuE/rwM2K0gMO635yuB3najjFBxBMC6Jtt7Fg42SLqwteJn5PXMjPcVMMDH3lcg4W7w3YyxmB8jXyWe4sXG8kpnUVqB2JC9/NZcPhilu5qqztfopnwtNdGAyJlp0a/PHBGE3kJ8FceRPHYminA13fu5I+euPxndI8L90xbIyOvIfHyhHr3LmLSazZyBP4r82SvOVwg3dthLlU8HX7cRUjfVTlTVPwAb5S5uR7bovPfLVmFeRhbjwtk/FyBu6eUyz4/v1DOOHhvPSd6QWpmyDPIMntUNT+jNCLgnOlApUSD4EMOC+v0+EeTJqgJpg3hT83XDB0Jmv9zy7M/ovHPIfJCq6g076nB7Qgw2OJVt8NE73chwDeQDBtxflpzQUdjNtGomS06mH9d8snD2RXHCm3XKZUEcM16VF8cUYXjr81jgzaV0Fh10isXh73G7JGTcyw/oerww3SNW5U/0VwMmoIOpcDQ3TQ18NWA5eym0Ob/feE9HHCgtJNpK1BTwtwEROPZYQYv65iZ0An0OALiOBeibYI8JI2jGkSZYxstqfkc0z04rCdSRxOfrqMu9zFEl2pDX2VasVg5V9XhXjRl5GnKS12KkQRWjw266mgFCo1xSlKz0hqfQeG4QKFUe+6vjvZnwGQ7K/DRC6JKZK9+HQh9sT84JHM3P7hWJahX1d8cZsbumZ2lQ7F+TOTqf9oDtK/zi9tc837qE9zlLzX4dDJXG2f2a+2VSeQOmhtUfbJhaX0SGyGjgzvHv25o1T8AqLrmktdTQDkUMTPbxECRYvwKbeA+EU9YSgtVuff+9USfOYZiCyLaUcJbVKi5573WSabYGXCkyt9v71KD1S5bz6q0zLN3NtY6L8Md6z14kUgAnPghC+W7TbIJF7evx4pAgwFFIL6XS9nygvmGq4er4BfTXQVGGIz9hgqXoy7+EXqEEWcz0Wkl5tcDTCDxzn9IXSwLqKXr0W6u3QPpWj5wPjN3AePGC5s9kMYryPd8p4xPjavNvKRSEsP3OZK86JDDQHJw3817DXctwNtmMhtaLCbX3Y+5FFD8ZxxrPlBBKRifnEg0+Z9RR+kmCbHpmh2iS2SKwjScWcCOXwQiSsKrSd8O25Dyom26ivkBUVn7ybRIspbRIKRZWAzv/wVlqXfynEw2EQ5vHAMmld3LD22Zz83c0acKq3thN3qQ7DsRFqPv1p6uhUTneUeghJvL5KqI+NZ/uzxsjcv7v1HQz8rVG4ONmBNrKCrm4DX8VkmdnT69uICuS/6d1+fhmt0ib7gF9kzkpPbMJcCKGCNen+TUBSEMfLXX5jZqaCwmCyVBZ/Zc7T+Hjk2vFCs3IFCn/rj91Q+K0tnrj6crxZOKjGnEnLniz+zKm9ESmJUUqoaaAnE+C9WW7QqOvi7+3Lfx3PoshObdVSj3tW7DVjgdIiq2QmDHZSklk3zoNHJJS3DjqPuxQtpo0C1TWoT8ZIRogrt+dWldvb7tdIT5ZvG9U9LtvOZ+PSEUsXXapapRIV+Idg0Tnev5f/Z7ygowLcH3G8= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: a32f7af2-0684-473c-80f6-08dc0ebc71ce X-MS-Exchange-CrossTenant-AuthSource: MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2024 13:36:10.6740 (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: kxwNhclPz5KhwcHi42/MzYMjHUmRuMlKuOXWPAmx3+x1arUcGcaYsYQDDdUh9PgQNethsFCz/m6B35hcQ48iE0t6XMB8SFMtaNxZRGN7bEk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0PR01MB8931 Convert the binding to DT schema format. Changes in V2 resolved below errors: 1. string value is redundantly quoted with any quotes (quoted-strings) 2. found character '\t' that cannot start any token Signed-off-by: Bhavin Sharma --- .../bindings/power/supply/stc3117-fg.yaml | 41 +++++++++++++++++++ 1 file changed, 41 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 000000000..d6607a5ea --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/stc3117-fg.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/stc3117-fg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STC3117 Fuel Gauge Unit Power Supply + +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"; + }; + };