From patchwork Wed Nov 9 06:55:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 13037201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE066C433FE for ; Wed, 9 Nov 2022 06:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lv5VRTVCipXSlSe5tROj+d8tZ4k+ZBlJVy+ku8aajl0=; b=PbTGuDV3Vk4R+q zoK0WHl3iODRHm4v50nK4gn4w4CURdW+l0t04QRzKh4PePXbzYk1yYVpYzH6Lo71DXDKaFb8P/ZH4 pz3I43PTRhjQgf+1kCvZpTJstfEoehK2Mv1QcuPmFwZ6pK3HDPRctQBBTudTtZGGbnfFD4neBu4+E Mz5kkzRuR3G5uwVoxN0PxRzdQCSKx2BqLZWmzaV6Z4IUdTUW78jSy22DuY0/4ZoyqTL87BL6xi0Z2 zEvoT+85wX2epr/FGimQhj05XWGKCufqfr86pNdMY8AgN5rVtqWr3nnTf5MUnwlXIMNtKUyNDZmCq qLj0m4C/VU/2fd8eGGLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0O-00BPxf-MY; Wed, 09 Nov 2022 06:56:12 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0G-00BPud-8f for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 06:56:05 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2A96tv8D095409; Wed, 9 Nov 2022 00:55:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667976957; bh=mKUDdJKT+Ky4ObyLz8kIj9aWEi7c/KxZ4F/S8X4K74o=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=WbSrjh4/UqNEMRV6Z2veW6wpKAbPfkWZB7xzPrGvCZF/UYpYEhKHvsCVFs1TPhJLi CWH4rczVPCPN8ne/X85/LAskI4kamXVtXQC6CitL4dKFXQan+FuuY+4Q+h3M9cT/re WT0jsdqebD8kpC7hSkOiuFd9wBbN1WfTWnheWGEc= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A96tvUS091524 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Nov 2022 00:55:57 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 9 Nov 2022 00:55:57 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 9 Nov 2022 00:55:57 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A96tsUq029738; Wed, 9 Nov 2022 00:55:56 -0600 From: Matt Ranostay To: , , , , , , , , CC: , , , , Matt Ranostay Subject: [PATCH v3 1/7] Documentation: tps6594x: Add DT bindings for the TPS6594x PMIC Date: Tue, 8 Nov 2022 22:55:40 -0800 Message-ID: <20221109065546.24912-2-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221109065546.24912-1-mranostay@ti.com> References: <20221109065546.24912-1-mranostay@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_225604_427433_FD8165D6 X-CRM114-Status: GOOD ( 12.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Matt Ranostay --- .../devicetree/bindings/mfd/ti,tps6594x.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/ti,tps6594x.yaml diff --git a/Documentation/devicetree/bindings/mfd/ti,tps6594x.yaml b/Documentation/devicetree/bindings/mfd/ti,tps6594x.yaml new file mode 100644 index 000000000000..be87f0037bf9 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/ti,tps6594x.yaml @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/ti,tps6594x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TPS6594x Power Management Integrated Circuit (PMIC) + +maintainers: + - Keerthy + +properties: + compatible: + contains: + enum: + - ti,tps6594x + + reg: + const: 0x48 + description: I2C slave address + + ti,system-power-controller: + type: boolean + description: PMIC is controlling the system power. + + rtc: + type: object + $ref: /schemas/rtc/rtc.yaml# + unevaluatedProperties: false + properties: + compatible: + const: ti,tps6594x-rtc + + gpio: + type: object + unevaluatedProperties: false + properties: + compatible: + const: ti,tps6594x-gpio + +additionalProperties: false + +required: + - compatible + - reg + +examples: + - | + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + pmic: pmic@48 { + compatible = "ti,tps6594x"; + reg = <0x48>; + + rtc { + compatible = "ti,tps6594x-rtc"; + }; + + gpio { + compatible = "ti,tps6594x-gpio"; + }; + }; + }; + +... From patchwork Wed Nov 9 06:55:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 13037202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03C68C433FE for ; Wed, 9 Nov 2022 06:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vVb58HmaEqRUtVXKjA8oNNZeKOlnm9JpLlL8qC3lRB8=; b=u1QEwzgRBN4hd/ cnKESzeixCXu4SSpvLJa/qHdClnSTVbH3Q6OOBP3ov2fcDhB8N2BE4/3OPqIqsXj7EZSk/A/JVy21 ZcvcdU7DCURweHooAP9MoVOmsb7E1J80xOLd/I/dCKRgaTxf6UqfKgGUtt5zOTRNYuqkWyLOA704k pA7AOFWvgQNl8xx3puRPlxumcfMr3BGJQRpJQYaEBhvLbuUXSm+xRf2+WpUWgkLqsJPnTzLhAPlTH GsxNTcwCqZqv9zBvZlbTgtPtob5uUQR3s8mqgJeJCYnjXJjEfaz5m+qu713yDp827JAtIzQsZx3Kx pyuk3b3P/tPDeYYoekdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0d-00BQ9U-G6; Wed, 09 Nov 2022 06:56:27 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0X-00BQ1D-Kr for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 06:56:23 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2A96u4T8094828; Wed, 9 Nov 2022 00:56:04 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667976964; bh=8OAt3RZALX8sIDJR9YkX4PwiuTaZosaCVKI+GD64Uzw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=FHpHfZf9Y28q50UXTiYLZQTy8u/Qk7hebqLO1rnBXxWLkKe7xnscTkQ8cusUF9rWS Ewj1UCruyhq+GdagWP1d2om1+Vs5FfO8NCQGjdSlIcpROdBDk7+ZXvmr8nwLzK6Xsa HoIhvdDp4XBz1yuF/mo4S60JIadSjItSWadWxWwk= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A96u4oK091641 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Nov 2022 00:56:04 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 9 Nov 2022 00:56:03 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 9 Nov 2022 00:56:03 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A96txjR024969; Wed, 9 Nov 2022 00:56:02 -0600 From: Matt Ranostay To: , , , , , , , , CC: , , , , Keerthy , Matt Ranostay Subject: [PATCH v3 2/7] MFD: TPS6594x: Add new PMIC device driver for TPS6594x chips Date: Tue, 8 Nov 2022 22:55:41 -0800 Message-ID: <20221109065546.24912-3-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221109065546.24912-1-mranostay@ti.com> References: <20221109065546.24912-1-mranostay@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_225621_813309_CDACF29B X-CRM114-Status: GOOD ( 24.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Keerthy The TPS6594x chip is a PMIC, and contains the following components: - GPIO controller - RTC However initially only RTC is supported. Signed-off-by: Keerthy Signed-off-by: Matt Ranostay --- drivers/mfd/Kconfig | 14 ++++ drivers/mfd/Makefile | 1 + drivers/mfd/tps6594x.c | 120 +++++++++++++++++++++++++++++++++++ include/linux/mfd/tps6594x.h | 84 ++++++++++++++++++++++++ 4 files changed, 219 insertions(+) create mode 100644 drivers/mfd/tps6594x.c create mode 100644 include/linux/mfd/tps6594x.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 6e920442366c..9a6dc6b69058 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1596,6 +1596,20 @@ config MFD_TI_LP873X This driver can also be built as a module. If so, the module will be called lp873x. +config MFD_TPS6594X + tristate "TI TPS6594X Power Management IC" + depends on I2C && OF + select MFD_CORE + select REGMAP_I2C + help + If you say yes here then you get support for the TPS6594X series of + Power Management Integrated Circuits (PMIC). + These include voltage regulators, RTS, configurable + General Purpose Outputs (GPO) that are used in portable devices. + + This driver can also be built as a module. If so, the module + will be called tps6594x. + config MFD_TI_LP87565 tristate "TI LP87565 Power Management IC" depends on I2C && OF diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 4dd479212b3a..51d7bfcd0a27 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -101,6 +101,7 @@ obj-$(CONFIG_MFD_TPS65910) += tps65910.o obj-$(CONFIG_MFD_TPS65912) += tps65912-core.o obj-$(CONFIG_MFD_TPS65912_I2C) += tps65912-i2c.o obj-$(CONFIG_MFD_TPS65912_SPI) += tps65912-spi.o +obj-$(CONFIG_MFD_TPS6594X) += tps6594x.o obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o diff --git a/drivers/mfd/tps6594x.c b/drivers/mfd/tps6594x.c new file mode 100644 index 000000000000..0de7946b6b8b --- /dev/null +++ b/drivers/mfd/tps6594x.c @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Driver for tps6594x PMIC chips + * + * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ + * Author: Keerthy + */ + +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config tps6594x_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = TPS6594X_REG_MAX, +}; + +static const struct mfd_cell tps6594x_cells[] = { + { .name = "tps6594x-gpio" }, + { .name = "tps6594x-rtc" }, +}; + +static struct tps6594x *tps; + +static void tps6594x_power_off(void) +{ + regmap_write(tps->regmap, TPS6594X_FSM_NSLEEP_TRIGGERS, + TPS6594X_FSM_NSLEEP_NSLEEP1B | TPS6594X_FSM_NSLEEP_NSLEEP2B); + + regmap_write(tps->regmap, TPS6594X_INT_STARTUP, + TPS6594X_INT_STARTUP_NPWRON_START_INT | + TPS6594X_INT_STARTUP_ENABLE_INT | TPS6594X_INT_STARTUP_RTC_INT | + TPS6594X_INT_STARTUP_SOFT_REBOOT_INT); + + regmap_write(tps->regmap, TPS6594X_INT_MISC, + TPS6594X_INT_MISC_BIST_PASS_INT | + TPS6594X_INT_MISC_EXT_CLK_INT | TPS6594X_INT_MISC_TWARN_INT); + + regmap_write(tps->regmap, TPS6594X_CONFIG_1, + TPS6594X_CONFIG_NSLEEP1_MASK | TPS6594X_CONFIG_NSLEEP2_MASK); + + regmap_write(tps->regmap, TPS6594X_FSM_I2C_TRIGGERS, + TPS6594X_FSM_I2C_TRIGGERS_I2C0); +} + +static int tps6594x_probe(struct i2c_client *client) +{ + struct tps6594x *ddata; + struct device_node *node = client->dev.of_node; + unsigned int otpid; + int ret; + + ddata = devm_kzalloc(&client->dev, sizeof(*ddata), GFP_KERNEL); + if (!ddata) + return -ENOMEM; + + ddata->dev = &client->dev; + + ddata->regmap = devm_regmap_init_i2c(client, &tps6594x_regmap_config); + if (IS_ERR(ddata->regmap)) { + ret = PTR_ERR(ddata->regmap); + dev_err(ddata->dev, + "Failed to initialize register map: %d\n", ret); + return ret; + } + + ret = regmap_read(ddata->regmap, TPS6594X_REG_DEV_REV, &otpid); + if (ret) { + dev_err(ddata->dev, "Failed to read OTP ID\n"); + return ret; + } + + ddata->rev = otpid; + i2c_set_clientdata(client, ddata); + + ret = mfd_add_devices(ddata->dev, PLATFORM_DEVID_AUTO, tps6594x_cells, + ARRAY_SIZE(tps6594x_cells), NULL, 0, NULL); + if (ret) { + dev_err(ddata->dev, "Failed to register cells\n"); + return ret; + } + + tps = ddata; + + if (of_property_read_bool(node, "ti,system-power-controller")) + pm_power_off = tps6594x_power_off; + + return 0; +} + +static const struct of_device_id of_tps6594x_match_table[] = { + { .compatible = "ti,tps6594x", }, + {} +}; +MODULE_DEVICE_TABLE(of, of_tps6594x_match_table); + +static const struct i2c_device_id tps6594x_id_table[] = { + { "tps6594x", 0 }, + {} +}; +MODULE_DEVICE_TABLE(i2c, tps6594x_id_table); + +static struct i2c_driver tps6594x_driver = { + .driver = { + .name = "tps6594x", + .of_match_table = of_tps6594x_match_table, + }, + .probe_new = tps6594x_probe, + .id_table = tps6594x_id_table, +}; +module_i2c_driver(tps6594x_driver); + +MODULE_AUTHOR("J Keerthy "); +MODULE_DESCRIPTION("TPS6594X PMIC device driver"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/tps6594x.h b/include/linux/mfd/tps6594x.h new file mode 100644 index 000000000000..5a6af0da9223 --- /dev/null +++ b/include/linux/mfd/tps6594x.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Core driver interface for TI TPS6594x PMIC family + * + * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ + */ + +#ifndef __MFD_TPS6594X_H +#define __MFD_TPS6594X_H + +#include + +/* TPS6594x chip ID list */ +#define TPS6594X 0x00 + +/* All register addresses */ +#define TPS6594X_REG_DEV_REV 0x01 +#define TPS6594X_INT_STARTUP 0x65 +#define TPS6594X_INT_MISC 0x66 +#define TPS6594X_CONFIG_1 0x7d +#define TPS6594X_FSM_I2C_TRIGGERS 0x85 +#define TPS6594X_FSM_NSLEEP_TRIGGERS 0x86 + +#define TPS6594X_RTC_SECONDS 0xb5 +#define TPS6594X_RTC_MINUTES 0xb6 +#define TPS6594X_RTC_HOURS 0xb7 +#define TPS6594X_RTC_DAYS 0xb8 +#define TPS6594X_RTC_MONTHS 0xb9 +#define TPS6594X_RTC_YEARS 0xba +#define TPS6594X_RTC_WEEKS 0xbb +#define TPS6594X_ALARM_SECONDS 0xbc +#define TPS6594X_ALARM_MINUTES 0xbd +#define TPS6594X_ALARM_HOURS 0xbe +#define TPS6594X_ALARM_DAYS 0xbf +#define TPS6594X_ALARM_MONTHS 0xc0 +#define TPS6594X_ALARM_YEARS 0xc1 +#define TPS6594X_RTC_CTRL_1 0xc2 +#define TPS6594X_RTC_CTRL_2 0xc3 +#define TPS6594X_RTC_STATUS 0xc4 +#define TPS6594X_RTC_INTERRUPTS 0xc5 +#define TPS6594X_REG_MAX 0xd0 + +/* Register field definitions */ +#define TPS6594X_DEV_REV_DEV_ID 0xff + +#define TPS6594X_INT_STARTUP_NPWRON_START_INT BIT(0) +#define TPS6594X_INT_STARTUP_ENABLE_INT BIT(1) +#define TPS6594X_INT_STARTUP_RTC_INT BIT(2) +#define TPS6594X_INT_STARTUP_FSD_INT BIT(4) +#define TPS6594X_INT_STARTUP_SOFT_REBOOT_INT BIT(5) + +#define TPS6594X_INT_MISC_BIST_PASS_INT BIT(0) +#define TPS6594X_INT_MISC_EXT_CLK_INT BIT(1) +#define TPS6594X_INT_MISC_TWARN_INT BIT(3) + +#define TPS6594X_CONFIG_NSLEEP1_MASK BIT(6) +#define TPS6594X_CONFIG_NSLEEP2_MASK BIT(7) + +#define TPS6594X_FSM_I2C_TRIGGERS_I2C0 BIT(0) + +#define TPS6594X_FSM_NSLEEP_NSLEEP1B BIT(0) +#define TPS6594X_FSM_NSLEEP_NSLEEP2B BIT(1) + +#define TPS6594X_RTC_CTRL_REG_GET_TIME BIT(6) +#define TPS6594X_RTC_CTRL_REG_STOP_RTC BIT(0) +#define TPS6594X_RTC_INTERRUPTS_REG_IT_ALARM BIT(3) + +#define TPS6594X_RTC_STATUS_RUN BIT(1) + +/** + * struct tps6594x - state holder for the tps6594x driver + * @dev: struct device pointer for MFD device + * @rev: revision of the tps6594x + * @lock: lock guarding the data structure + * @regmap: register map of the tps6594x PMIC + * + * Device data may be used to access the TPS6594X chip + */ +struct tps6594x { + struct device *dev; + u8 rev; + struct regmap *regmap; +}; +#endif /* __MFD_TPS6594X_H */ From patchwork Wed Nov 9 06:55:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 13037203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CEF32C433FE for ; Wed, 9 Nov 2022 06:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rkk+NWmsWUZI4kTYEjda8LASJDVd1Es55pfTYGU7bbo=; b=Nebx4hkehQIB66 NdMGTvZw8fsJ4QTNItthNqEsG4YFRVOV6qMaTX9hnRAYXFdgzvswMesSwlzwiFJNzmYjXW03zs24C N38tR3geiffpc04r0lbU8HuTS4whLwIHzdMVQv0nDuWQKLQPh9OTuZtP3ZcBPW808MG7lKbbD2eNX Fyvt5Ct7Ty4CN6ZbS71BLEtRrmRmu8oXMAGIAf96WhTdYzUFrB0VeSng1+j9+wmGhqa1AJuHtjC3I 6+JoSu0P3kXQxAsZZmklkDQH6yz1rqR5OWvAUnQKU7u87hudJJE6BCn/h6d4Ll4Lipnbdgm9HkBSU 9UGcF+q7rauvrov38d0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0y-00BQjv-1n; Wed, 09 Nov 2022 06:56:48 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0Y-00BQ2N-DG for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 06:56:24 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2A96u9nG094845; Wed, 9 Nov 2022 00:56:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667976969; bh=2I9D0z5EcfXn1L3QlWvR7842WCuURZEYWCZfdD2MvJY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=QqqQr4KJu4BQXSPsahwMQT8qanXdQ/4x+aVxyfoeUHZ1tL+5V5HRJElBQWzcCTEfp CPsNQNf3rd9XxZkKYDU+86RyhD8sGtKPLRDU84aatQ+YBO9/8Nv+NczLLL/MTjTWuf VCa8wDwQrGGX/2hkRDatWfBaTYFY5ottdZVA0/KY= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A96u9FX117947 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Nov 2022 00:56:09 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 9 Nov 2022 00:56:08 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 9 Nov 2022 00:56:08 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A96u5hK116509; Wed, 9 Nov 2022 00:56:07 -0600 From: Matt Ranostay To: , , , , , , , , CC: , , , , Keerthy , Matt Ranostay Subject: [PATCH v3 3/7] rtc: rtc-tps6594x: Add support for TPS6594X PMIC RTC Date: Tue, 8 Nov 2022 22:55:42 -0800 Message-ID: <20221109065546.24912-4-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221109065546.24912-1-mranostay@ti.com> References: <20221109065546.24912-1-mranostay@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_225622_585173_4901CFA7 X-CRM114-Status: GOOD ( 24.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Keerthy Add support for TPS6594X PMIC RTC. However, currently only get/set of time + date functionality is supported. Signed-off-by: Keerthy Signed-off-by: Matt Ranostay --- drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-tps6594x.c | 181 +++++++++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 drivers/rtc/rtc-tps6594x.c diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 35298c651730..0adb2c2570b8 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -588,6 +588,16 @@ config RTC_DRV_TPS65910 This driver can also be built as a module. If so, the module will be called rtc-tps65910. +config RTC_DRV_TPS6594X + tristate "TI TPS6594X RTC driver" + depends on MFD_TPS6594X + help + If you say yes here you get support for the RTC of TI TPS6594X series PMIC + chips. + + This driver can also be built as a module. If so, the module + will be called rtc-tps6594x. + config RTC_DRV_RC5T583 tristate "RICOH 5T583 RTC driver" depends on MFD_RC5T583 diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index c2d474985919..cf46d88bc4b0 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -176,6 +176,7 @@ obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o obj-$(CONFIG_RTC_DRV_TI_K3) += rtc-ti-k3.o obj-$(CONFIG_RTC_DRV_TPS6586X) += rtc-tps6586x.o obj-$(CONFIG_RTC_DRV_TPS65910) += rtc-tps65910.o +obj-$(CONFIG_RTC_DRV_TPS6594X) += rtc-tps6594x.o obj-$(CONFIG_RTC_DRV_TWL4030) += rtc-twl.o obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o obj-$(CONFIG_RTC_DRV_VT8500) += rtc-vt8500.o diff --git a/drivers/rtc/rtc-tps6594x.c b/drivers/rtc/rtc-tps6594x.c new file mode 100644 index 000000000000..e9f904d0a769 --- /dev/null +++ b/drivers/rtc/rtc-tps6594x.c @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * rtc-tps6594x.c -- TPS6594x Real Time Clock driver. + * + * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com + * + * TODO: alarm support + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct tps6594x_rtc { + struct rtc_device *rtc; + struct device *dev; +}; + +#define TPS6594X_NUM_TIME_REGS (TPS6594X_RTC_YEARS - TPS6594X_RTC_SECONDS + 1) + +static int tps6594x_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + unsigned char rtc_data[TPS6594X_NUM_TIME_REGS]; + struct tps6594x *tps6594x = dev_get_drvdata(dev->parent); + int ret; + + /* Reset TPS6594X_RTC_CTRL_REG_GET_TIME bit to zero, required for latch */ + ret = regmap_update_bits(tps6594x->regmap, TPS6594X_RTC_CTRL_1, + TPS6594X_RTC_CTRL_REG_GET_TIME, 0); + if (ret < 0) { + dev_err(dev, "RTC CTRL reg update failed, err: %d\n", ret); + return ret; + } + + /* Copy RTC counting registers to static registers or latches */ + ret = regmap_update_bits(tps6594x->regmap, TPS6594X_RTC_CTRL_1, + TPS6594X_RTC_CTRL_REG_GET_TIME, TPS6594X_RTC_CTRL_REG_GET_TIME); + if (ret < 0) { + dev_err(dev, "RTC CTRL reg update failed, err: %d\n", ret); + return ret; + } + + ret = regmap_bulk_read(tps6594x->regmap, TPS6594X_RTC_SECONDS, + rtc_data, TPS6594X_NUM_TIME_REGS); + if (ret < 0) { + dev_err(dev, "RTC_SECONDS reg read failed, err = %d\n", ret); + return ret; + } + + tm->tm_sec = bcd2bin(rtc_data[0]); + tm->tm_min = bcd2bin(rtc_data[1]); + tm->tm_hour = bcd2bin(rtc_data[2]); + tm->tm_mday = bcd2bin(rtc_data[3]); + tm->tm_mon = bcd2bin(rtc_data[4]) - 1; + tm->tm_year = bcd2bin(rtc_data[5]) + 100; + + return ret; +} + +static int tps6594x_rtc_set_time(struct device *dev, struct rtc_time *tm) +{ + unsigned char rtc_data[TPS6594X_NUM_TIME_REGS]; + struct tps6594x *tps6594x = dev_get_drvdata(dev->parent); + int ret, retries = 5; + unsigned int val; + + rtc_data[0] = bin2bcd(tm->tm_sec); + rtc_data[1] = bin2bcd(tm->tm_min); + rtc_data[2] = bin2bcd(tm->tm_hour); + rtc_data[3] = bin2bcd(tm->tm_mday); + rtc_data[4] = bin2bcd(tm->tm_mon + 1); + rtc_data[5] = bin2bcd(tm->tm_year - 100); + + /* Stop RTC while updating the RTC time registers */ + ret = regmap_update_bits(tps6594x->regmap, TPS6594X_RTC_CTRL_1, + TPS6594X_RTC_CTRL_REG_STOP_RTC, 0); + if (ret < 0) { + dev_err(dev, "RTC stop failed, err = %d\n", ret); + return ret; + } + + /* Waiting till RTC isn't running */ + do { + ret = regmap_read(tps6594x->regmap, TPS6594X_RTC_STATUS, &val); + if (ret < 0) { + dev_err(dev, "RTC_STATUS reg read failed, err = %d\n", ret); + return ret; + } + msleep(20); + } while (--retries && (val & TPS6594X_RTC_STATUS_RUN)); + + if (!retries) { + dev_err(dev, "RTC_STATUS is still RUNNING\n"); + return -ETIMEDOUT; + } + + ret = regmap_bulk_write(tps6594x->regmap, TPS6594X_RTC_SECONDS, + rtc_data, TPS6594X_NUM_TIME_REGS); + if (ret < 0) { + dev_err(dev, "RTC_SECONDS reg write failed, err = %d\n", ret); + return ret; + } + + /* Start back RTC */ + ret = regmap_update_bits(tps6594x->regmap, TPS6594X_RTC_CTRL_1, + TPS6594X_RTC_CTRL_REG_STOP_RTC, + TPS6594X_RTC_CTRL_REG_STOP_RTC); + if (ret < 0) + dev_err(dev, "RTC start failed, err = %d\n", ret); + + return ret; +} + +static const struct rtc_class_ops tps6594x_rtc_ops = { + .read_time = tps6594x_rtc_read_time, + .set_time = tps6594x_rtc_set_time, +}; + +static int tps6594x_rtc_probe(struct platform_device *pdev) +{ + struct tps6594x *tps6594x = dev_get_drvdata(pdev->dev.parent); + struct tps6594x_rtc *tps6594x_rtc = NULL; + int ret; + + tps6594x_rtc = devm_kzalloc(&pdev->dev, sizeof(struct tps6594x_rtc), GFP_KERNEL); + if (!tps6594x_rtc) + return -ENOMEM; + + tps6594x_rtc->dev = &pdev->dev; + platform_set_drvdata(pdev, tps6594x_rtc); + + /* Start RTC */ + ret = regmap_update_bits(tps6594x->regmap, TPS6594X_RTC_CTRL_1, + TPS6594X_RTC_CTRL_REG_STOP_RTC, + TPS6594X_RTC_CTRL_REG_STOP_RTC); + if (ret < 0) { + dev_err(&pdev->dev, "RTC_CTRL write failed, err = %d\n", ret); + return ret; + } + + tps6594x_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, + &tps6594x_rtc_ops, THIS_MODULE); + if (IS_ERR(tps6594x_rtc->rtc)) { + ret = PTR_ERR(tps6594x_rtc->rtc); + dev_err(&pdev->dev, "RTC register failed, err = %d\n", ret); + return ret; + } + + return 0; +} + +#ifdef CONFIG_OF +static const struct of_device_id of_tps6594x_rtc_match[] = { + { .compatible = "ti,tps6594x-rtc", }, + {}, +}; +MODULE_DEVICE_TABLE(of, of_tps6594x_rtc_match); +#endif + +static struct platform_driver tps6594x_rtc_driver = { + .probe = tps6594x_rtc_probe, + .driver = { + .name = "tps6594x-rtc", + .of_match_table = of_match_ptr(of_tps6594x_rtc_match), + }, +}; + +module_platform_driver(tps6594x_rtc_driver); + +MODULE_ALIAS("platform:tps6594x_rtc"); +MODULE_DESCRIPTION("TI TPS6594x series RTC driver"); +MODULE_AUTHOR("Keerthy J "); +MODULE_LICENSE("GPL"); From patchwork Wed Nov 9 06:55:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 13037205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B40CEC4332F for ; Wed, 9 Nov 2022 06:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gVWF40oUeICttkUooT328HcXUWnLL065wCDf3LRzKic=; b=PAMChhAVjqg2g0 dDj/CuKKcGLPZW4AvbRcRwsHOjgwMRnG8h5nURPs2zmcncTjww4YT4lP4nhnqid2kY85yC5MP7Ua0 9um+6cqRpM4IXnR/jjGXg1bGstVSeFUpENIZwITQ4O8f5R7NYJLsMbY/MYW8nYUf2F8+6W11q3Nn+ EfZaNUM/9P3wqfxFbCklDpckFYJ8EWluARg+AC3NAKJGeK0k7krHERd5nDKYhpRGAXKrEbZUXB5mL CDRtBO6o0wKzzi7m8qN9pQ0kVpoIvvvssvdSi7RCONO/l5kpb1b8pIgn77VowKmySAdQxxH1HtdxT DxcMd7jE5o60vcvxRsGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf1O-00BRQR-8O; Wed, 09 Nov 2022 06:57:14 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0d-00BQ9p-OE for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 06:56:29 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uEMj106623; Wed, 9 Nov 2022 00:56:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667976974; bh=3aOCoqxf65TlmrWhKMuEUXu7+vkeJELw89gYY75D+yg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=K/g0rbIjZY9eSuHAqLtiv7r/Hdg2FkQf+ibjQWMHKFKcKnHXDHjQLHvA8PTDNq8V4 m7eIQWvO9UB2Qs3uz2/+3iCANvtM3MXyUyeOohQAxDqPUjebVJUu/s5fjKXC+j6M60 pWevSI4ytFNsW3ETduRXxaYkj5+1FFDHHZh8GxPw= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A96uEuE121959 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Nov 2022 00:56:14 -0600 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 9 Nov 2022 00:56:13 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 9 Nov 2022 00:56:13 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uAEE030003; Wed, 9 Nov 2022 00:56:12 -0600 From: Matt Ranostay To: , , , , , , , , CC: , , , , Matt Ranostay , Keerthy Subject: [PATCH v3 4/7] gpio: tps6594x: add GPIO support for TPS6594x PMIC Date: Tue, 8 Nov 2022 22:55:43 -0800 Message-ID: <20221109065546.24912-5-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221109065546.24912-1-mranostay@ti.com> References: <20221109065546.24912-1-mranostay@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_225627_914883_9282F0FD X-CRM114-Status: GOOD ( 20.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for TPS6594X PMICs GPIO interface that has 11 that can be configured as input or outputs. Tested-by: Keerthy Signed-off-by: Matt Ranostay --- drivers/gpio/Kconfig | 7 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-tps6594x.c | 142 +++++++++++++++++++++++++++++++++++ include/linux/mfd/tps6594x.h | 6 ++ 4 files changed, 156 insertions(+) create mode 100644 drivers/gpio/gpio-tps6594x.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 8c756cb29214..0225e6bddf0a 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1405,6 +1405,13 @@ config GPIO_TPS65912 help This driver supports TPS65912 GPIO chip. +config GPIO_TPS6594X + tristate "TI TPS6594X GPIO driver" + depends on MFD_TPS6594X + help + Select this option to enable GPIO driver for the TPS6954X + PMIC chip family. There are 11 GPIOs that can be configured. + config GPIO_TPS68470 tristate "TPS68470 GPIO" depends on INTEL_SKL_INT3472 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 8629e9eaf79e..e67a9b787b09 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -158,6 +158,7 @@ obj-$(CONFIG_GPIO_TPS65218) += gpio-tps65218.o obj-$(CONFIG_GPIO_TPS6586X) += gpio-tps6586x.o obj-$(CONFIG_GPIO_TPS65910) += gpio-tps65910.o obj-$(CONFIG_GPIO_TPS65912) += gpio-tps65912.o +obj-$(CONFIG_GPIO_TPS6594X) += gpio-tps6594x.o obj-$(CONFIG_GPIO_TPS68470) += gpio-tps68470.o obj-$(CONFIG_GPIO_TQMX86) += gpio-tqmx86.o obj-$(CONFIG_GPIO_TS4800) += gpio-ts4800.o diff --git a/drivers/gpio/gpio-tps6594x.c b/drivers/gpio/gpio-tps6594x.c new file mode 100644 index 000000000000..f530ac17f73f --- /dev/null +++ b/drivers/gpio/gpio-tps6594x.c @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * GPIO driver for TI TPS6594x PMICs + * + * Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/ + */ + +#include +#include +#include +#include + +#include +#include + +#define GPIO_CFG_MASK BIT(0) +#define NGPIOS_PER_REG 8 + +struct tps6594x_gpio { + struct gpio_chip gpio_chip; + struct tps6594x *tps; +}; + +static int tps6594x_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) +{ + struct tps6594x_gpio *gpio = gpiochip_get_data(gc); + int ret, val; + + ret = regmap_read(gpio->tps->regmap, TPS6594X_GPIO1_CONF + offset, &val); + if (ret) + return ret; + + if (val & GPIO_CFG_MASK) + return GPIO_LINE_DIRECTION_OUT; + + return GPIO_LINE_DIRECTION_IN; +} + +static int tps6594x_gpio_direction_input(struct gpio_chip *gc, unsigned int offset) +{ + struct tps6594x_gpio *gpio = gpiochip_get_data(gc); + + return regmap_update_bits(gpio->tps->regmap, TPS6594X_GPIO1_CONF + offset, + GPIO_CFG_MASK, 0); +} + +static int tps6594x_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value) +{ + struct tps6594x_gpio *gpio = gpiochip_get_data(gc); + unsigned int reg = TPS6594X_GPIO_OUT_1, shift = offset; + + if (shift >= NGPIOS_PER_REG) { + reg = TPS6594X_GPIO_OUT_2; + shift -= NGPIOS_PER_REG; + } + + regmap_update_bits(gpio->tps->regmap, reg, BIT(shift), value ? BIT(shift) : 0); + + return regmap_update_bits(gpio->tps->regmap, TPS6594X_GPIO1_CONF + offset, + GPIO_CFG_MASK, GPIO_CFG_MASK); +} + +static int tps6594x_gpio_get(struct gpio_chip *gc, unsigned int offset) +{ + struct tps6594x_gpio *gpio = gpiochip_get_data(gc); + unsigned int reg = TPS6594X_GPIO_IN_1; + int ret, val; + + if (offset >= NGPIOS_PER_REG) { + reg = TPS6594X_GPIO_IN_2; + offset -= NGPIOS_PER_REG; + } + + ret = regmap_read(gpio->tps->regmap, reg, &val); + if (ret) + return ret; + + return !!(val & BIT(offset)); +} + +static void tps6594x_gpio_set(struct gpio_chip *gc, unsigned int offset, + int value) +{ + struct tps6594x_gpio *gpio = gpiochip_get_data(gc); + unsigned int reg = TPS6594X_GPIO_OUT_1; + + if (offset >= NGPIOS_PER_REG) { + reg = TPS6594X_GPIO_OUT_2; + offset -= NGPIOS_PER_REG; + } + + regmap_update_bits(gpio->tps->regmap, reg, BIT(offset), value ? BIT(offset) : 0); +} + +static const struct gpio_chip template_chip = { + .label = "tps6594x-gpio", + .owner = THIS_MODULE, + .get_direction = tps6594x_gpio_get_direction, + .direction_input = tps6594x_gpio_direction_input, + .direction_output = tps6594x_gpio_direction_output, + .get = tps6594x_gpio_get, + .set = tps6594x_gpio_set, + .base = -1, + .ngpio = 11, + .can_sleep = true, +}; + +static int tps6594x_gpio_probe(struct platform_device *pdev) +{ + struct tps6594x *tps = dev_get_drvdata(pdev->dev.parent); + struct tps6594x_gpio *gpio; + + gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); + if (!gpio) + return -ENOMEM; + + gpio->tps = dev_get_drvdata(pdev->dev.parent); + gpio->gpio_chip = template_chip; + gpio->gpio_chip.parent = tps->dev; + + return devm_gpiochip_add_data(&pdev->dev, &gpio->gpio_chip, gpio); +} + +static const struct of_device_id of_tps6594x_gpio_match[] = { + { .compatible = "ti,tps6594x-gpio", }, + {}, +}; +MODULE_DEVICE_TABLE(of, of_tps6594x_gpio_match); + +static struct platform_driver tps6594x_gpio_driver = { + .driver = { + .name = "tps6594x-gpio", + .of_match_table = of_match_ptr(of_tps6594x_gpio_match), + }, + .probe = tps6594x_gpio_probe, +}; +module_platform_driver(tps6594x_gpio_driver); + +MODULE_ALIAS("platform:tps6594x-gpio"); +MODULE_AUTHOR("Matt Ranostay "); +MODULE_DESCRIPTION("TPS6594X GPIO driver"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/tps6594x.h b/include/linux/mfd/tps6594x.h index 5a6af0da9223..c2440f5f43d3 100644 --- a/include/linux/mfd/tps6594x.h +++ b/include/linux/mfd/tps6594x.h @@ -21,6 +21,12 @@ #define TPS6594X_FSM_I2C_TRIGGERS 0x85 #define TPS6594X_FSM_NSLEEP_TRIGGERS 0x86 +#define TPS6594X_GPIO1_CONF 0x31 +#define TPS6594X_GPIO_OUT_1 0x3d +#define TPS6594X_GPIO_OUT_2 0x3e +#define TPS6594X_GPIO_IN_1 0x3f +#define TPS6594X_GPIO_IN_2 0x40 + #define TPS6594X_RTC_SECONDS 0xb5 #define TPS6594X_RTC_MINUTES 0xb6 #define TPS6594X_RTC_HOURS 0xb7 From patchwork Wed Nov 9 06:55:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 13037204 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A292C4332F for ; Wed, 9 Nov 2022 06:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jNOG5M+CHo+RcvkuwaZ3zrVhqOmsj6SnVHQI/jT9YWU=; b=GiOZ+rE0733Ugb 2XikLmsQ1f1IPIiXCYHXHGUi7j45IeODCBkPr3ygXH16CBZSU1ocecru+N/LYhEPeG1DXKCyfvINu g6Vh5x07p9PsbOvFNeUjPDb39LVfHoWJqByEVElC1AtqJvyA5uugq9fEA1ySbaWDFxHUBTVerUsJ3 hBdBOEivPDMTD8cW1Bm30fD3OoQ8WRvGvzA1J/Lq/EAh+oNGi7LvQIhAUWrCZNEeN6sOgXm0Abw7f e5pbEtuU5Oa/Smjo5eXnl8Dec6hhQ4rxatqgrh8sIUL9wdgQDuaIznspaX33FG4hz5lUMTxcKgYAt rVX5ZMy2fwx+KsCpgZnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf19-00BR1A-3X; Wed, 09 Nov 2022 06:56:59 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0c-00BQ9Z-Nj for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 06:56:28 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uJrT034523; Wed, 9 Nov 2022 00:56:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667976979; bh=cDGS+tQXKjWXPg6qNR/iYrL37iBJHv+ZSCGWXLGBWSw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=tyvSXg1HTJoQ/a/AO0KurFcVUMf1Oi3peaUBvkiQt+6GJVP6LQr+0E+ndOEwYNZuH YWluXkXg4wX/Y/aX8mPLx0jXhFec80yOpBtfc+wLwkyAsf8+DCcuRXoej5dD+wymFO xvPo846oM2eUByXTdlttuyS5KqTP/cxYwuHbl27E= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A96uIag118028 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Nov 2022 00:56:19 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 9 Nov 2022 00:56:18 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 9 Nov 2022 00:56:18 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uF13089878; Wed, 9 Nov 2022 00:56:17 -0600 From: Matt Ranostay To: , , , , , , , , CC: , , , , Keerthy , Matt Ranostay Subject: [PATCH v3 5/7] arm64: dts: ti: k3-j7200-common-proc-board: Add TPS6594x PMIC node Date: Tue, 8 Nov 2022 22:55:44 -0800 Message-ID: <20221109065546.24912-6-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221109065546.24912-1-mranostay@ti.com> References: <20221109065546.24912-1-mranostay@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_225626_874956_FAFCFA84 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Keerthy Add TPS6594x PMIC, GPIO, and RTC definitions for J7200 common processor board device tree. Signed-off-by: Keerthy Signed-off-by: Matt Ranostay --- .../boot/dts/ti/k3-j7200-common-proc-board.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts index 6240856e4863..9514751739fe 100644 --- a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +++ b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts @@ -333,3 +333,20 @@ &pcie1_ep { num-lanes = <2>; status = "disabled"; }; + +&wkup_i2c0 { + status = "okay"; + tps6594x: tps6594x@48 { + compatible = "ti,tps6594x"; + reg = <0x48>; + ti,system-power-controller; + + rtc { + compatible = "ti,tps6594x-rtc"; + }; + + gpio { + compatible = "ti,tps6594x-gpio"; + }; + }; +}; From patchwork Wed Nov 9 06:55:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 13037206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 231CEC433FE for ; Wed, 9 Nov 2022 06:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1Swe9HgSrOWLXQ0/0YP9J+sYl6ICMH+MPj2UKqcwgLY=; b=TNCgZRMPMJ9Twm ZrVtZbQQMAcbTLyddDXHRMEdcA+1oonS8biiaoyyRTJPOjiUe84oQEX08AxWJxLl8Mehe1Ez29Mvv HO+OPS8+gBPyhWPR8tx9DFhJzds//ILPDbFutyaM5pUJr1tykEZgrfF6eUf+FRGrl3BPrcnN+r97g JzdV83YhclYiyDuwbXNxuUoHHwDLDcnY1fLOBcujbC3a4vFt0WCna9TaoRqMr3PXzrP6larudkiE0 JOnGPMPlECr2BEa7VqaXAVDtVMnQ7BNwahxU/JBDijOVtvqsK3322Aflz13rydfND/bORpX8aiPEy s7jA3MIBRf1fLMMH+OiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf1b-00BRrN-GW; Wed, 09 Nov 2022 06:57:27 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0e-00BQEG-Ls for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 06:56:30 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uNwl034538; Wed, 9 Nov 2022 00:56:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667976984; bh=8KoFVjJGNhPFJHtJgJgPoLDTOMnWquhXh4SIu91I0us=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BwN5rgeksQM6QtV1G3CatnF5R063aMbaiz6r+zlLZNKEnIfNxNT/DtMvuuUG5eWGF sqJy4sEAJa+fE16tsQ5pfZogVXTNi9vKAaJ0r+f5oqvdVnWpc8lBIoUTnyRnDfA1uE l8M8Asp+RXzUD8cjiucZINMSVAd+EHoVgYAdW2sQ= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A96uNXl118052 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Nov 2022 00:56:23 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 9 Nov 2022 00:56:23 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 9 Nov 2022 00:56:23 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uKF4116672; Wed, 9 Nov 2022 00:56:22 -0600 From: Matt Ranostay To: , , , , , , , , CC: , , , , Matt Ranostay Subject: [PATCH v3 6/7] arm64: dts: ti: k3-j721e-common-proc-board: Add TPS6594x PMIC node Date: Tue, 8 Nov 2022 22:55:45 -0800 Message-ID: <20221109065546.24912-7-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221109065546.24912-1-mranostay@ti.com> References: <20221109065546.24912-1-mranostay@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_225628_808621_73DE0C77 X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add TPS6594x PMIC, GPIO, and RTC definitions for J721E common processor board device tree. Signed-off-by: Matt Ranostay --- .../boot/dts/ti/k3-j721e-common-proc-board.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts b/arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts index 1861598f3bb4..93bc7433ab06 100644 --- a/arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts +++ b/arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts @@ -904,3 +904,20 @@ &main_mcan2 { pinctrl-0 = <&main_mcan2_pins_default>; phys = <&transceiver4>; }; + +&wkup_i2c0 { + status = "okay"; + tps6594x: tps6594x@48 { + compatible = "ti,tps6594x"; + reg = <0x48>; + ti,system-power-controller; + + rtc { + compatible = "ti,tps6594x-rtc"; + }; + + gpio { + compatible = "ti,tps6594x-gpio"; + }; + }; +}; From patchwork Wed Nov 9 06:55:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 13037207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABADDC4332F for ; Wed, 9 Nov 2022 06:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4vznX3ZLhFjJzB2wqInQwEOhVnY1017Wru0PXeLKiPQ=; b=snhGNSjkyM8RCF iDliKTQcgDWM5h2fTVvKHn7eKlS8v3j+NemVEUUWGUuPJzRcrcnHWy1WQFcAfiIgbrxvI0BFNQQf3 Vm757uekrqt55z4cOI5oT1RThS6OfYwsAY5ifgLB8149gq8e0/g4n//07gRehjmMmHEP0uCsOUKUK HmPH0GPOH1GoWDOsVXK8hpeNxzJQW2geiGGDEI1HWS+fhlGXoFLTu5rnbLu6Hnc/LeV4lnBKQcGrO BC9fAXwdY7iGOHL1F3UF6za9gtM9zs9fUYIQtBwZj0O1mRlaneAA3WZQk6kqr1ThanrZtptZtmiZh Yk21tAhBMzKmmMIvcPrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf1t-00BSN3-2M; Wed, 09 Nov 2022 06:57:45 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osf0r-00BQXY-3k for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 06:56:42 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uSnO106659; Wed, 9 Nov 2022 00:56:28 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1667976988; bh=pyT0Nnu0s3nEaTacWsWURM1V97hqEA+3TatyRE9aUlg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=H5a6SL2l+hDqkZsuVxM/8Xw3kgOMwvMXP8kDSbJ49ybQi+hlMK9gHmncZ1eylH8Yq 8UDIg98AWRcDlWyWJSn9tQ98C+h6ZvtKagPRYtErDVLILRknoCfIbD+A7qzOiNUT8P B62oaFhgx5Vxo6X2NHFxLZQH5UMpwBWi+AJ7wLsI= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2A96uS8d091798 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Nov 2022 00:56:28 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 9 Nov 2022 00:56:28 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 9 Nov 2022 00:56:28 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2A96uPxF116707; Wed, 9 Nov 2022 00:56:27 -0600 From: Matt Ranostay To: , , , , , , , , CC: , , , , Matt Ranostay Subject: [PATCH v3 7/7] arm64: dts: ti: k3-j721s2-common-proc-board: Add TPS6594x PMIC node Date: Tue, 8 Nov 2022 22:55:46 -0800 Message-ID: <20221109065546.24912-8-mranostay@ti.com> X-Mailer: git-send-email 2.38.GIT In-Reply-To: <20221109065546.24912-1-mranostay@ti.com> References: <20221109065546.24912-1-mranostay@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_225641_265030_E4EA25AD X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add TPS6594x PMIC, GPIO, and RTC definitions for j721s2 common processor board device tree. Signed-off-by: Matt Ranostay --- .../boot/dts/ti/k3-j721s2-common-proc-board.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts b/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts index a7aa6cf08acd..918c0c8d02cf 100644 --- a/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts +++ b/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts @@ -309,3 +309,20 @@ &mcu_mcan1 { pinctrl-0 = <&mcu_mcan1_pins_default>; phys = <&transceiver2>; }; + +&wkup_i2c0 { + status = "okay"; + tps6594x: tps6594x@48 { + compatible = "ti,tps6594x"; + reg = <0x48>; + ti,system-power-controller; + + rtc { + compatible = "ti,tps6594x-rtc"; + }; + + gpio { + compatible = "ti,tps6594x-gpio"; + }; + }; +};