From patchwork Fri Aug 12 03:22:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 12941883 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 978D5C3F6B0 for ; Fri, 12 Aug 2022 03:24:29 +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=iM04zfM+AL8nhEcQ2N8tP6segpWQPXnlSBjoiTmL5nA=; b=mVhvgeEJ6/O2Sy RkzUJsEmfhJnwO/ukaFf6T3maJxGCc83Hzttq37FUtNzMwzV8XUkccw49JhV3TWble1k5WuEZ6eCw LiTakp+6OxY0A6V1oA0zVBrciby7P75to71BISc6IZG0cBh5tQz4OX6d6HH2WFkvRvjfZD8LGXap/ y9+2M5tUnkIpekseyLFZ0aAdg2Dg4Q1UDGzQO3ZCwd9U8cVWMh3SBGkYbpfNU1JVx/xmID0Vby3uS MW8cSiZWYZ/dcsDqfVjuFq/AFZNa0GlSDmglZAC78kNXk8ZqODybcEwg6bEC5KKK3b6hwbT/82Avl hJAljXsp2/7C0aafDePg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMLGX-00DKeK-7H; Fri, 12 Aug 2022 03:23:17 +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 1oMLGP-00DJGa-LG for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 03:23:11 +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 27C3N4ta073657; Thu, 11 Aug 2022 22:23:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660274584; bh=ybRbRZ6XB/9I3M+k9jxHso72fMEjppEg2Jzo3Gg/Ci0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=t9xdV5DE+53kwx2mWKohA0OJLNiI6EeXAiD4LBZ3UCtHbvA6mp22jMz4qO5QXaPs3 zrzC3ZAV5KzWAP1UsnxVra+o2PAGjq2YeCiFZqy4xjlLRs9c+LNfGN9WcGP+yMXugY AFKD6kaZH6Jwjl8NYc9M5H0ZqQ3nnDAOBq48nM+c= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C3N4oL119559 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 22:23:04 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 11 Aug 2022 22:23:04 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE110.ent.ti.com (157.170.170.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; Thu, 11 Aug 2022 22:23:04 -0500 Received: from ubuntu.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C3MkOr096105; Thu, 11 Aug 2022 22:22:57 -0500 From: Matt Ranostay To: , , CC: , , , , Matt Ranostay Subject: [PATCH v2 1/6] Documentation: tps6594x: Add DT bindings for the TPS6594x PMIC Date: Thu, 11 Aug 2022 20:22:37 -0700 Message-ID: <20220812032242.564026-2-mranostay@ti.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220812032242.564026-1-mranostay@ti.com> References: <20220812032242.564026-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-20220811_202309_811046_EBC544EB X-CRM114-Status: GOOD ( 12.58 ) 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 | 56 +++++++++++++++++++ 1 file changed, 56 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..9b5e17f63709 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/ti,tps6594x.yaml @@ -0,0 +1,56 @@ +# 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 + +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"; + }; + }; + }; + +... From patchwork Fri Aug 12 03:22:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 12941884 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 78B14C25B06 for ; Fri, 12 Aug 2022 03:24:39 +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=KB3lgSyKDyczPbCPpgmiqiSlDl8G8qxfvtMdB8Uhm2E=; b=2t371V1+oFk8P+ wLqRIYLWLzlBfDRhhsFZX8wF0sDYLK4kbaKoPT56IPuz/38MINFPZ7JPSa/IbdIJqm6xXQVmc6OuC chXu2E2hu5chVdOAeaqjacqzBgltAmszQFG74mXKxvV7XRRXvvtopX9I8nCjoFGRqfX+D/xm/KTTR YUE//dIxk+LCx3AGk6tzctapdyyB2RMUTC/apjdX91qNk9eJo/KwzysWCFRh39gb3mhrAB611GXWP hNGPElz3V61hQ84CJcCAl2M4CbUOC99D8ETjnoaZYC/df7MKpYasf1kWcA2L8Lx/9dhNvKZ+6VaVi sOczmWvYRXcuZY7TsNbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMLGj-00DM9Q-QH; Fri, 12 Aug 2022 03:23:30 +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 1oMLGe-00DL6s-Rw for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 03:23:27 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 27C3NChV053088; Thu, 11 Aug 2022 22:23:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660274592; bh=/ILrLLMrJAFaMZATpOR2wZM00euBK5sFXu979Ha7kTg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=eB1zhDTcQlHqAKL85r7coGvppl7a6JYoOTEUD3cViqaVhoeCtC+9+wp0puVSjoAEY YOaY1Lw+G5CbG/A8wG0FAD/FU2kVw37vLBulOhFj0PZdK2AfzBozTKyIkKPIngNES4 AeWs5sbOB24994ON71u8OyHXsvP2Bn3UjJkS/ZSc= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C3NCL9020623 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 22:23:12 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) 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; Thu, 11 Aug 2022 22:23:12 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE109.ent.ti.com (10.64.6.30) 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; Thu, 11 Aug 2022 22:23:12 -0500 Received: from ubuntu.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C3MkOs096105; Thu, 11 Aug 2022 22:23:05 -0500 From: Matt Ranostay To: , , CC: , , , , Matt Ranostay Subject: [PATCH v2 2/6] MFD: TPS6594x: Add new PMIC device driver for TPS6594x chips Date: Thu, 11 Aug 2022 20:22:38 -0700 Message-ID: <20220812032242.564026-3-mranostay@ti.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220812032242.564026-1-mranostay@ti.com> References: <20220812032242.564026-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-20220811_202325_041278_316C460F X-CRM114-Status: GOOD ( 24.53 ) 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: - Regulators - 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 | 121 +++++++++++++++++++++++++++++++++++ include/linux/mfd/tps6594x.h | 84 ++++++++++++++++++++++++ 4 files changed, 220 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 abb58ab1a1a4..4845683ae1d0 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1547,6 +1547,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 858cacf659d6..7ff6a8a57d55 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -105,6 +105,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..ff265b91db3e --- /dev/null +++ b/drivers/mfd/tps6594x.c @@ -0,0 +1,121 @@ +// 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-regulator" }, + { .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 Fri Aug 12 03:22:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 12941885 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 EE4FDC25B0F for ; Fri, 12 Aug 2022 03:24: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=sRrI360ojPI5u0+d1JXDoFEd82g/i5LI+lg9GA0Gj0I=; b=q73IZtAJNC1kX/ jnfnEeLx2asYrr0bGpGM9k+4T5Oi2r0f0EwRPv6785xZgO8X4OlCKCgK3UmFV1r2mGvY6t9WQDE0S KrbKCsBZtnENfE0fFuPXNYvtpVHxbKvTEMCzBI4AqAUEInovSQcyFutZtDW3V0reCvcil0c2pvfUD 4OJjZLkPI8/sMiXJ4Oa+RA+1hHlixXj3OSApzH9SpGo2TvpVIPEmouYGI5LkyLgMh5IhHS2isRJVQ H6UCdLx8ZWWLQveXv9+k+kLBbwvuuzA8l40RPtm89U+1phKkw7mij/qEu/0IAPT4xIyblDFh/xUrT elmJKJRf1n4FyMWYQDMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMLGv-00DMuk-JU; Fri, 12 Aug 2022 03:23:41 +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 1oMLGf-00DLLJ-CI for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 03:23:27 +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 27C3NL8k076848; Thu, 11 Aug 2022 22:23:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660274601; bh=tMIgJSV7Y1RQfwAdmqGWZgkhahQLp4IB2kJp6Rhgy/o=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qT5UFu75rw/EZsAZMlh5kjQZECZuyG7j1h1TXSJlu5a3kzEwT9BgyPoKxe9ms6JoP YA+5wV7jdih31OqBZ/aft83sskvpjICxDzEP2ep71O0Lq+dtxkK5zZ/uhqXG0gL4/e rQuM1tUsLUpjoCLdCVe42grEkCWKQW+t5knP1zP8= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C3NLPY125075 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 22:23:21 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) 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; Thu, 11 Aug 2022 22:23:21 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE102.ent.ti.com (10.64.6.23) 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; Thu, 11 Aug 2022 22:23:21 -0500 Received: from ubuntu.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C3MkOt096105; Thu, 11 Aug 2022 22:23:13 -0500 From: Matt Ranostay To: , , CC: , , , , Matt Ranostay Subject: [PATCH v2 3/6] rtc: rtc-tps6594x: Add support for TPS6594X PMIC RTC Date: Thu, 11 Aug 2022 20:22:39 -0700 Message-ID: <20220812032242.564026-4-mranostay@ti.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220812032242.564026-1-mranostay@ti.com> References: <20220812032242.564026-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-20220811_202325_559248_86A8618F X-CRM114-Status: GOOD ( 24.72 ) 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 b8de25118ad0..df8e78eed5fb 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -593,6 +593,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 aab22bc63432..d854e162275a 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -177,6 +177,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 Fri Aug 12 03:22: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: 12941886 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 40DB9C25B0D for ; Fri, 12 Aug 2022 03:25:08 +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=JqEYkzYPQbBcvVb02hT5mfG5qMIA2NxeiIP+KIpBJbI=; b=ovTUKAYkKgzZgd uFwCLldE6yyjvLcfCCgUqKPoRZEQ607Kn8sKyTeXwWfeZXBQsuCu1MdcKZ9AQqj5/zRglqPlE/vKW X5KtA3idat5ATgYSclRdiV47FS3tXnDd1rAInnhpFYSvkv//I16Pq4QZPHjxtBO0ACoVCM7sCxeSz srhxvBdnAz0gkTi1MrrXlPycjI8XGlhALZxffFA1TmYVw/0OLgZhWIxBsr/pg5cQabYjiyAiE1MSg CNAq3zkaQjMLhstNWvbCNx/JdN8mCHRCNiCsg+WOMSMP4mIA1+8RLRLu9wgwWrUPE3bMSEL9nYhVW QCY0czJTQipoFrJJ6SIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMLHH-00DPCS-FM; Fri, 12 Aug 2022 03:24:03 +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 1oMLGl-00DMOK-Bu for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 03:23:32 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 27C3NTR0053121; Thu, 11 Aug 2022 22:23:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660274609; bh=6rPE/bXMV/XtZVzrkJNNtd/XO2H6ocUbL1oqvByw9Vw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=CDMZ3U7JTXYJIBOqFT9aA8FKsfSyGQFSva/DO+YS/aHdOxjRK4PBm3NEqdEOn2G/3 lgjYnArGhPOr9GSKR4HBgxhbmZ6sLYATJbrzDbLileAhXUSZo0d6NsIXJWN/VKxUMi ZAjrkssv5btjSfvFBih5HoJfz+ghlhJrMQKJZyVk= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C3NTLs125108 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 22:23:29 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 11 Aug 2022 22:23:28 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE105.ent.ti.com (157.170.170.35) 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; Thu, 11 Aug 2022 22:23:28 -0500 Received: from ubuntu.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C3MkOu096105; Thu, 11 Aug 2022 22:23:22 -0500 From: Matt Ranostay To: , , CC: , , , Subject: [PATCH v2 4/6] arm64: dts: ti: k3-j7200-common-proc-board: Add TPS6594x PMIC node Date: Thu, 11 Aug 2022 20:22:40 -0700 Message-ID: <20220812032242.564026-5-mranostay@ti.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220812032242.564026-1-mranostay@ti.com> References: <20220812032242.564026-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-20220811_202331_478354_6935BF26 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 + RTC definition for J7200 common processor board device tree. Signed-off-by: Keerthy --- .../boot/dts/ti/k3-j7200-common-proc-board.dts | 16 ++++++++++++++++ 1 file changed, 16 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 121975dc8239..6deab4f9a04b 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 @@ -353,3 +353,19 @@ &pcie1_ep { num-lanes = <2>; status = "disabled"; }; + +&wkup_i2c0 { + status = "okay"; +}; + +&wkup_i2c0 { + tps6594x: tps6594x@48 { + compatible = "ti,tps6594x"; + reg = <0x48>; + ti,system-power-controller; + + rtc { + compatible = "ti,tps6594x-rtc"; + }; + }; +}; From patchwork Fri Aug 12 03:22: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: 12941887 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 865A9C25B06 for ; Fri, 12 Aug 2022 03:25:44 +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=Ee0sFM+Kd5uRCxaeCs4GuQSD9Iafg2eFtTkY+lbRJf8=; b=iIZhA3iO1Hsk8u N7of8VJVEzQ7kqGIwyVFJExj5fHcAzwan4mXxmNcnr5MQE8tLPrvb0VUvExp7qoUvfLL+CnFRlsuo yyzbzDxcyZusYljRDQCn28Sq6DCwA/jNEKQVXqxp016svk57q5cDrMFUcjRik8/PXdCJ1EkHkYsph q0GpzkFJImN86QEkFLA4sU0aLFIzyyX+ByEglmKHYN63brGAY7RN5qQkjzO7L/nYGC5flaqOmDPM3 wrfYMOYrx0ph8/jY0+impHeKxjx2X9FOMQNP9EbEEBAIHqR+Ai8yqhomY5c0nBRUSnoQxpVULylqA vRbIvDNuluQq5RxSLxZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMLHp-00DS07-Ee; Fri, 12 Aug 2022 03:24:37 +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 1oMLGt-00DMpy-QH for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 03:23:41 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 27C3NbGd076876; Thu, 11 Aug 2022 22:23:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660274617; bh=Jj6n3h/aXvvo2nkr+eTMi1f20oQKf1OldZ2XmgcaBM8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pHER2XPJNh+glFZuiXPLJ6VshsYHPXi/6mT7OyMC4jxqBN616trneo0Wcerjs9ONl mwQD/FAEkeiLAR0q8fl1yvWhYrQ3jsSdTfjx/3AIS9PViQEtvp9W/9WSkRTz8uTwgt vLx1bU6Rv1wtomgpa1BiA/nvl/yxw3gw2Qm/B0a8= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C3NbnK119665 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 22:23:37 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 11 Aug 2022 22:23:37 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE105.ent.ti.com (157.170.170.35) 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; Thu, 11 Aug 2022 22:23:37 -0500 Received: from ubuntu.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C3MkOv096105; Thu, 11 Aug 2022 22:23:30 -0500 From: Matt Ranostay To: , , CC: , , , , Matt Ranostay Subject: [PATCH v2 5/6] arm64: dts: ti: k3-j721e-common-proc-board: Add TPS6594x PMIC node Date: Thu, 11 Aug 2022 20:22:41 -0700 Message-ID: <20220812032242.564026-6-mranostay@ti.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220812032242.564026-1-mranostay@ti.com> References: <20220812032242.564026-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-20220811_202339_923908_AB4541C5 X-CRM114-Status: UNSURE ( 9.31 ) 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 + RTC definition for j721e common processor board device tree. Signed-off-by: Matt Ranostay --- .../boot/dts/ti/k3-j721e-common-proc-board.dts | 16 ++++++++++++++++ 1 file changed, 16 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 b1691ac3442d..f7b8b40993bd 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 @@ -995,3 +995,19 @@ &main_mcan12 { &main_mcan13 { status = "disabled"; }; + +&wkup_i2c0 { + status = "okay"; +}; + +&wkup_i2c0 { + tps6594x: tps6594x@48 { + compatible = "ti,tps6594x"; + reg = <0x48>; + ti,system-power-controller; + + rtc { + compatible = "ti,tps6594x-rtc"; + }; + }; +}; From patchwork Fri Aug 12 03:22: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: 12941888 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 3F552C25B06 for ; Fri, 12 Aug 2022 03:26:21 +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=nZbcJPaxLxWBFHHR+MFSit2oFfqkeJpaeUlQ7OkErkc=; b=IRKtF6npFxDiT7 v4EQBSFQw4C6kn/GuzblS2Oa1lA5L3rGs2tESVbaGsiOVk3t6pc3zamu/LkOjLmcoBvvuWN2VnJOu oodGsB97gSqpwaP7LlMQdAmBwpmbMH1Q619T/1AzXLi+xe4A/cgVlhGtkl0MZH5aRnHFHmZi4vmQR WXNpDSfYIOc60cg3n2bkz1CFx2jwXMbRck0GcMzthk3DSf090nb2zFG6/KI82xp/1RuuLSz2hffTr OgxfQFsJUS6K/kDXxJ02sc1rB2zZazPIg5aNEQCddkwOWLoYfe8Ai6hvNrSq2IFMHkQlYcSCNdLJb D51g3XOnQf09MNI5ceFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMLIR-00DUr7-GZ; Fri, 12 Aug 2022 03:25:15 +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 1oMLH2-00DNjj-9T for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2022 03:23:49 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 27C3Nkdd073789; Thu, 11 Aug 2022 22:23:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1660274626; bh=HnC7he2GVetXqMlW5ITNKLWHNTlIWm5BgOftHuYkAXg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pZKJtKfqXkdNMO/USlyBauP/+6flSpazBJRxE0hUuG7bD1/F4KPEEB/izujYrc0+i vkfpHPoyEmPk4sxmHGtSLelGGXpU04j7/wlbk1HDQfuUNg+2PeQ5lqtZr5Q66oyoX8 MoEpBWcYvWaK1rl9Gjc5CPHWemL1P0fGOjQTFp8w= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 27C3Nkme125207 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 11 Aug 2022 22:23:46 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Thu, 11 Aug 2022 22:23:45 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE113.ent.ti.com (10.64.6.34) 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; Thu, 11 Aug 2022 22:23:45 -0500 Received: from ubuntu.ent.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 27C3MkOw096105; Thu, 11 Aug 2022 22:23:38 -0500 From: Matt Ranostay To: , , CC: , , , , Matt Ranostay Subject: [PATCH v2 6/6] arm64: dts: ti: k3-j721s2-common-proc-board: Add TPS6594x PMIC node Date: Thu, 11 Aug 2022 20:22:42 -0700 Message-ID: <20220812032242.564026-7-mranostay@ti.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220812032242.564026-1-mranostay@ti.com> References: <20220812032242.564026-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-20220811_202348_403039_9C2888C4 X-CRM114-Status: UNSURE ( 9.31 ) 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 + RTC definition for j721s2 common processor board device tree. Signed-off-by: Matt Ranostay --- .../boot/dts/ti/k3-j721s2-common-proc-board.dts | 16 ++++++++++++++++ 1 file changed, 16 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 b210cc07c539..0156a700f5df 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 @@ -429,3 +429,19 @@ &main_mcan15 { &main_mcan17 { status = "disabled"; }; + +&wkup_i2c0 { + status = "okay"; +}; + +&wkup_i2c0 { + tps6594x: tps6594x@48 { + compatible = "ti,tps6594x"; + reg = <0x48>; + ti,system-power-controller; + + rtc { + compatible = "ti,tps6594x-rtc"; + }; + }; +};