From patchwork Sat Feb 17 08:20:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 774202 Received: from mail.andi.de1.cc (mail.andi.de1.cc [178.238.236.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 500FB1B7F2; Sat, 17 Feb 2024 08:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.238.236.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158047; cv=none; b=ojbLstEj/Vku0moYTMmG5UYalJB2zQM9a00k/C48kba5OPQbVjnB9oBOPNU6KpKM8tu2Ag39ucW6Nk/vMxPwNnDzBnA2RNklMc+zLOUtnQT5IluEWG43PRS9+kaQZbHWCV/ZL721E0x4QZlI9fFuSKuQpi4G5l6HSA8QtNAGSqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158047; c=relaxed/simple; bh=rlrKqJgDDoZsSfU8eHHfyWZ3HpVBBXtH8uA9Pgt9aF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DgFPB+U/YHs4AY/TwPLmwMMn9TNr73soKOoDeo4RkZShSbpVWf+q3uBYN/knhEMV7wCTFYi9ddqmmy65YT6bWzEiIjtexKoTvVpvGXVjVaq1nQYMY7UvU1303KMdOtksnCz15+7E5bQBPZV/cMjd2VB251uLHjLpDZS4ulq68p8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=ADr0PuQp; arc=none smtp.client-ip=178.238.236.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="ADr0PuQp" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lU5OchIEvF38TLlRSscnw+iYzDDWri1rHhV16S0CVpM=; b=ADr0PuQpZRMBepM64LjFYaaOi+ tkcPwSo+I4qeLQBDaLa7fpFBaydlqooJTMus9WqxsFLTM+d1iNkEL0VRu4Fjh6LpZPeFp0giGVtHK DU9OFYbk/eWc8xwDi1D2t1pnvfUg4EpUifsLuUxgZSppXbapvwxBAKh3QuxeldXe4O2T74OJ1I81t veGV819ckIuaf0kFaxrP92fvo8KK7R3Q67tOwcHFY/7q8GvGX4Y+a/rfLQU9b92s5UKzyRXsL7ftG XYo7ETnB5CI+UxLwHUYcjoSjjVqvIQzSUG4H5f59p5hAxAscqE7n8w3JtNnzgMRpd4eGRdHyBULWm lXiVV34A==; Received: from p2003010777002c001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:107:7700:2c00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbFvz-009WA1-GY; Sat, 17 Feb 2024 09:20:31 +0100 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1rbFvy-00Dabd-37; Sat, 17 Feb 2024 09:20:30 +0100 From: Andreas Kemnade To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, bcousson@baylibre.com, tony@atomide.com, andreas@kemnade.info, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Cc: Conor Dooley Subject: [PATCH v4 1/5] dt-bindings: mfd: ti,twl: Document system-power-controller Date: Sat, 17 Feb 2024 09:20:03 +0100 Message-Id: <20240217082007.3238948-2-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240217082007.3238948-1-andreas@kemnade.info> References: <20240217082007.3238948-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add system-power-controller property because these chips can power off the device. Signed-off-by: Andreas Kemnade Acked-by: Conor Dooley --- Documentation/devicetree/bindings/mfd/ti,twl.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentation/devicetree/bindings/mfd/ti,twl.yaml index c04d57ba22b49..52ed228fb1e7e 100644 --- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml +++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml @@ -34,6 +34,8 @@ properties: interrupt-controller: true + system-power-controller: true + "#interrupt-cells": const: 1 From patchwork Sat Feb 17 08:20:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 773881 Received: from mail.andi.de1.cc (mail.andi.de1.cc [178.238.236.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5013B1CD23; Sat, 17 Feb 2024 08:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.238.236.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158047; cv=none; b=RhdXvrxkoLsUjTKcSXCkpEJ5dePAEtHFKqQ3hAaSvDrsx9yT0Ppsede5v3QseuqUUB+spYKjzdHA1qNyQE7pQEaUpVzwdo3z6FNqPHQKpf8JJMOT6MWTCs7iOcB1LpCQfXGHXnva+GuZue2fiYBoKwQfOu5AeN0Cy6NRuoHK9yI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158047; c=relaxed/simple; bh=w91rU8ULQEAl2yC2K+2JFdu1mPXgT91a33YAroU1V7Q=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H4O3I93V/zcngLpkgy/8dRglG3vAfd3Vn73rWZYTCTW8xvzWEkrs1xdseJ3ChfX4KiYeoCDnRzLRWR3TnxsbkUwqAsFQp6cfo3q/bychXeIwbGAHOhZ/HmF0I4e7l3JXSIa5ALwM4qXo60//qgvE2DPJyC5vWyHX1Z9XtIDIRFE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=ySj3BOqz; arc=none smtp.client-ip=178.238.236.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="ySj3BOqz" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=t7Kt1H92S1Uo0WtagmmqZO9iJoXliNnTy7y2hbdMW6c=; b=ySj3BOqzDv6V6LUOJA80aQGK2K h82bVen1rFf66iJOzOxPHpmbmGTF4GmNe684LXyhkDxtv80O6Fjn13SgI8j5LDKHCvSPUGFf6u+dU Hx0Ws2fUnwAvHSsSBShkYQFU85PO12uPDvuI+Vgb0BVWltQUZ5OZ7AM9v7IwfAIMq1oIg2/hzEqKb rWi4TD+FBenkuVrh3RzAKAF5YPSIu57te1CmEEQ286YBjYDwkpLQjvlXzvw+OPc70ADrQYJ1rDwEw hOdJKltecWjCbkuu0Vu0klh8KBlahvGC1q/2Wj5CKrh4AEV0mlaPD1dnm9UJBdzVvJf2doV5wUMW/ 7/pVuYNw==; Received: from p2003010777002c001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:107:7700:2c00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbFw0-009WA5-DZ; Sat, 17 Feb 2024 09:20:32 +0100 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1rbFvz-00Dabj-2w; Sat, 17 Feb 2024 09:20:31 +0100 From: Andreas Kemnade To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, bcousson@baylibre.com, tony@atomide.com, andreas@kemnade.info, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v4 2/5] twl-core: add power off implementation for twl603x Date: Sat, 17 Feb 2024 09:20:04 +0100 Message-Id: <20240217082007.3238948-3-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240217082007.3238948-1-andreas@kemnade.info> References: <20240217082007.3238948-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If the system-power-controller property is there, enable power off. Implementation is based on a Linux v3.0 vendor kernel. Signed-off-by: Andreas Kemnade --- drivers/mfd/twl-core.c | 28 ++++++++++++++++++++++++++++ include/linux/mfd/twl.h | 1 + 2 files changed, 29 insertions(+) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 6e384a79e3418..c130ffef182f1 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -124,6 +124,11 @@ #define TWL6030_BASEADD_RSV 0x0000 #define TWL6030_BASEADD_ZERO 0x0000 +/* Some fields in TWL6030_PHOENIX_DEV_ON */ +#define TWL6030_APP_DEVOFF BIT(0) +#define TWL6030_CON_DEVOFF BIT(1) +#define TWL6030_MOD_DEVOFF BIT(2) + /* Few power values */ #define R_CFG_BOOT 0x05 @@ -687,6 +692,20 @@ static void twl_remove(struct i2c_client *client) twl_priv->ready = false; } +static void twl6030_power_off(void) +{ + int err; + u8 val; + + err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val, TWL6030_PHOENIX_DEV_ON); + if (err) + return; + + val |= TWL6030_APP_DEVOFF | TWL6030_CON_DEVOFF | TWL6030_MOD_DEVOFF; + twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val, TWL6030_PHOENIX_DEV_ON); +} + + static struct of_dev_auxdata twl_auxdata_lookup[] = { OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL), { /* sentinel */ }, @@ -852,6 +871,15 @@ twl_probe(struct i2c_client *client) goto free; } + if (twl_class_is_6030()) { + if (of_device_is_system_power_controller(node)) { + if (!pm_power_off) + pm_power_off = twl6030_power_off; + else + dev_warn(&client->dev, "Poweroff callback already assigned\n"); + } + } + status = of_platform_populate(node, NULL, twl_auxdata_lookup, &client->dev); diff --git a/include/linux/mfd/twl.h b/include/linux/mfd/twl.h index c062d91a67d92..85dc406173dba 100644 --- a/include/linux/mfd/twl.h +++ b/include/linux/mfd/twl.h @@ -461,6 +461,7 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) #define TWL4030_PM_MASTER_GLOBAL_TST 0xb6 +#define TWL6030_PHOENIX_DEV_ON 0x06 /*----------------------------------------------------------------------*/ /* Power bus message definitions */ From patchwork Sat Feb 17 08:20:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 774201 Received: from mail.andi.de1.cc (mail.andi.de1.cc [178.238.236.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 501711CD28; Sat, 17 Feb 2024 08:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.238.236.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158047; cv=none; b=I+9r1CRNoCYwIU1spbuB4oF29U69YtMzWK3upPvxuWKveM/IDam9yQi0Yy4XsIYKUvz8fxqqr3Wfmr4Xv/aIVLWOkbyp6NbI8yBrp7PT27T2xqIiA+d38qfdBESoyv8Z/L6WJhmOoknGFEUC9ktqtj+02daEI3syQttbo4DkKhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158047; c=relaxed/simple; bh=PAuqh5EVeV6fdrZQXgisgrEu31gqCwBh1o5uwtMpIls=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QI/CKAO+4/Z5+Dp+XxBvktzUAbatlXSaBa8lXzuySRzRNFguqRC8iu4mBji4D0vP3EFk7oTYOlNTiXlQXsI98zDdlUvC7tTcmOANntecO4TsDqmEr5WFG6yQXkk+rWVmiYZVjmHqcXwy77f6tTZyiKmpe0+POW23dReBpCInn4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=HFgKWKF3; arc=none smtp.client-ip=178.238.236.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="HFgKWKF3" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y+sKDGaqS2L6Nx5yacVQMNpKJL6zl7yFpsfABK8t+go=; b=HFgKWKF3hO8LSHBZAi+30+DVGV 746TXBBVXztO3evsHoxXE328X4ITFEYgixAu2ZY4EvGxm+8Ip7Vj4rzhLlKs7ym+IYZOtfItnUhaW 4hW6LLXQUAHiVll94R1mSZeoUlm+k+mNOqerfQf3WHEshabahHLd1eNp385ZytKH1bh99LYHcUmt7 5gSc1pFLsz0TPXIHk+6IQ6NCenNI1lj9PA2ZpyBQ4B1eNpofMvsYKDusyrgOq3it9vwDzC5UAZtgR F6xXSUF7+qqM0ktD4FCTVzsboNKb9tonRDbvfsF8+5QwpysIYYxzbjGntnab8ASZ8LpqGUpPzxBr4 RECTBKPg==; Received: from p2003010777002c001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:107:7700:2c00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbFw1-009WAQ-7k; Sat, 17 Feb 2024 09:20:33 +0100 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1rbFw0-00Dabo-2I; Sat, 17 Feb 2024 09:20:32 +0100 From: Andreas Kemnade To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, bcousson@baylibre.com, tony@atomide.com, andreas@kemnade.info, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v4 3/5] ARM: dts: omap-embt2ws: system-power-controller for bt200 Date: Sat, 17 Feb 2024 09:20:05 +0100 Message-Id: <20240217082007.3238948-4-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240217082007.3238948-1-andreas@kemnade.info> References: <20240217082007.3238948-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Configure the TWL6032 as system power controller to let the device power off. Signed-off-by: Andreas Kemnade --- arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts index 24f7d0285f799..339e52ba3614b 100644 --- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts +++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts @@ -85,6 +85,7 @@ twl: pmic@48 { interrupts = ; /* IRQ_SYS_1N cascaded to gic */ interrupt-controller; #interrupt-cells = <1>; + system-power-controller; rtc { compatible = "ti,twl4030-rtc"; From patchwork Sat Feb 17 08:20:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 774200 Received: from mail.andi.de1.cc (mail.andi.de1.cc [178.238.236.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 310A51D551; Sat, 17 Feb 2024 08:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.238.236.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158050; cv=none; b=UUV4fij6+agp2sUOhELNoLyd8t6NptuK0tsn2NNPlQ9/qaA9rk/Y0MZP5lsphAArfXrkfbATzDYJGtkftrvWNMO/pqIb8SbydAyYdvjcXkh12Q9cmKeq4oD/MiuQDvj9/hTEKkEm9P+t3e9dyCLszNOwqZil9pXmRZAAYSzwtGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158050; c=relaxed/simple; bh=mTx5rLvb+qeLP7/2Etiy9qFxFZOTX39JjEhVVDlk1fU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pTChfyssq+/nXAW6xYklOFr9wGTjvo674jJuVOUia9GbvtDcVw/phdHwmW7AY857waud8BK6tUHPUNwJzuV7vvHeC9y4k9lyMzy+yt5WnkJJ30nwEifqv/L3sNK3hkrkiZ569q6IWMUYzElEBQJOU2LeDl57YRx1c+6K8lEjM98= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=hFep6WkN; arc=none smtp.client-ip=178.238.236.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="hFep6WkN" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a89o6bX8GlKda8ggAeuclGq0WwOCA8K95wZOP4xrmIM=; b=hFep6WkNlk+zVzBjVwuuo3GwhI 6fXDh0WoEC1rZW4IR39wUZhACUvzF72bzCixbYV3IPMNd+43bwBR+8pWAthCp3KwJms9JHJfN7OsX 9TAOcINnv6+qGHWwUUOISeITVss4s9ZVX8ysXaRPq7gfcFUI+wnq1Cf0iHgXRdJQ6Nqed1X5HZvNH 3DF7eHCgEtrKCoF6OSZcpDFesVc2PaiwNxyvGSR7k6j8OoqQtW+oloaeGxfQo9ErvUGbLpQokXwWx w1VvWiecB8+iug2rO4rRfMayYFYnfnLZNdXmU0FVjjrfozhW2lZPSBt3f0stnurivqyHLejDp797b 74V9XOQw==; Received: from p2003010777002c001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:107:7700:2c00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbFw1-009WAY-V7; Sat, 17 Feb 2024 09:20:33 +0100 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1rbFw1-00Dabs-1N; Sat, 17 Feb 2024 09:20:33 +0100 From: Andreas Kemnade To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, bcousson@baylibre.com, tony@atomide.com, andreas@kemnade.info, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v4 4/5] ARM: dts: omap4-panda-common: Enable powering off the device Date: Sat, 17 Feb 2024 09:20:06 +0100 Message-Id: <20240217082007.3238948-5-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240217082007.3238948-1-andreas@kemnade.info> References: <20240217082007.3238948-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 As the TWL6030 chip is the main power controller here, declare it as system-power-controller Signed-off-by: Andreas Kemnade --- arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi b/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi index f528511c2537b..97706d6296a68 100644 --- a/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi @@ -408,6 +408,7 @@ twl: twl@48 { reg = <0x48>; /* IRQ# = 7 */ interrupts = ; /* IRQ_SYS_1N cascaded to gic */ + system-power-controller; }; twl6040: twl@4b { From patchwork Sat Feb 17 08:20:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 773879 Received: from mail.andi.de1.cc (mail.andi.de1.cc [178.238.236.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 310711D54F; Sat, 17 Feb 2024 08:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.238.236.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158050; cv=none; b=kj7hL0PStxgH+lxEyHEh5q++tedYyakYvyeQfSuEVtM827VGBx1Ry4jqjXvbRPK6obL7IeoiBVj0fpwQtH7i2vg5X3sXz+3qfUqbSVFJAFcfaTw2LGArfc/WDqrhLIugyYXEI6kXG1E2ML1nWKcw1OpK91PZQ+ZYb5oaPc6uEUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708158050; c=relaxed/simple; bh=6sRPoZ3Ar/8gydeQdoTDVVaduVMOVcG5NbSDDkFAjtc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bPU1uslhEIsHa1H9lOi0lR+fI1yUGMTaQ1nge1aDesO67rU4NoRKPqdjz6p76snMTsxlyYYwq9P+SE7AmIJVU22KxZv/9oeCCbbYMcF+7ruAGxSgvi/6XowTnSbMDXl6ZpDQ+uIjvcKwR8I+Zq/qmB0pG+HurAIJ7xJ2whdrQWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info; spf=pass smtp.mailfrom=kemnade.info; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b=mxbfM98H; arc=none smtp.client-ip=178.238.236.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kemnade.info Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kemnade.info header.i=@kemnade.info header.b="mxbfM98H" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oiyq9kLog9Cp/R7ZfxBUXhF6KOaPMsO94BpECX+dYb0=; b=mxbfM98HHkXyp4E+iRyalJMa5g QYVSWJA1O5+4A2b23uy1Cf8S7+FqY9kCsLUwmbqrfNcxDHigsaMTdbYOjlNfHRy27XtOO7b04EBYw qWEYIEi1TSgffJSyCsao83o/jfTOUr2AKXBI1Ka46+jWPBNT8YuSSivyxlD2aydVwWzfE7QZ1aYjI MSJideydVD3tD6ITiELRouwFdM42IxNCapqep1Xrk3oWLqs7uloB1ZBKElhse9XZUCcVqEzUm4MQ5 WbMb/e9Af7tcFY3tVi4q7mn+sdV5sm/d4uo+XAut+lbwbIi7h4qjoaV2+u4ksGxHBrYh6WXN2Z4ho cGwOGvLQ==; Received: from p2003010777002c001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:107:7700:2c00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbFw2-009WAg-IO; Sat, 17 Feb 2024 09:20:34 +0100 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1rbFw2-00Dabx-0D; Sat, 17 Feb 2024 09:20:34 +0100 From: Andreas Kemnade To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, bcousson@baylibre.com, tony@atomide.com, andreas@kemnade.info, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v4 5/5] mfd: twl4030-power: accept standard property for power controller Date: Sat, 17 Feb 2024 09:20:07 +0100 Message-Id: <20240217082007.3238948-6-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240217082007.3238948-1-andreas@kemnade.info> References: <20240217082007.3238948-1-andreas@kemnade.info> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of only accepting the ti specific properties accept also the standard property. For uniformity, search in the parent node for the tag. The code for powering off is also isolated from the rest in this file. So it is a pure Linux design decision to put it here. Signed-off-by: Andreas Kemnade --- drivers/mfd/twl4030-power.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 1595e9c76132d..0bca948ab6bae 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -686,6 +686,9 @@ static bool twl4030_power_use_poweroff(const struct twl4030_power_data *pdata, if (of_property_read_bool(node, "ti,use_poweroff")) return true; + if (of_device_is_system_power_controller(node->parent)) + return true; + return false; }