From patchwork Thu Jul 19 16:00:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946475 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="qNr1P6de"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf142b1Xz9s4r for ; Fri, 20 Jul 2018 02:02:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731919AbeGSQpQ (ORCPT ); Thu, 19 Jul 2018 12:45:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731524AbeGSQpQ (ORCPT ); Thu, 19 Jul 2018 12:45:16 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8605B2084C; Thu, 19 Jul 2018 16:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016085; bh=D+58itQZgV68hrLLo2N6MXp4AwzkIoVYcBsqkfeb1u0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qNr1P6dezZuRHJxEBigXNbjeGBQtqoqiVBb1yr9V+Pz4GQCC+RsVh1Ae0CeWU0avb 2TDNr8PVslLhI9DVwQcF84dRRDTHF7sqUYsiDIgUUUSoU4Rg5DHpGgeQGd63KcDhDQ MXcWSVX5mEF0zBC+E5dPrUNm4d9VNyPFSf2GxB74= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 01/10] pinctrl: samsung: Define suspend and resume callbacks for all banks and SoCs Date: Thu, 19 Jul 2018 18:00:41 +0200 Message-Id: <20180719160050.22566-2-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Suspend and resume callbacks in Exynos/S5Pv210 pin controller drivers, save and restore state of registers. This operations should be done for all banks which have external interrupts (as denoted by using EXYNOS_PIN_BANK_EINTG/EINTW macros). Add all banks of Exynos5260 and Exynos5420. This is necessary step for supporting suspend to RAM. Signed-off-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c index d82820fc349a..44c6b753f692 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c @@ -616,16 +616,22 @@ static const struct samsung_pin_ctrl exynos5260_pin_ctrl[] __initconst = { .nr_banks = ARRAY_SIZE(exynos5260_pin_banks0), .eint_gpio_init = exynos_eint_gpio_init, .eint_wkup_init = exynos_eint_wkup_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, }, { /* pin-controller instance 1 data */ .pin_banks = exynos5260_pin_banks1, .nr_banks = ARRAY_SIZE(exynos5260_pin_banks1), .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, }, { /* pin-controller instance 2 data */ .pin_banks = exynos5260_pin_banks2, .nr_banks = ARRAY_SIZE(exynos5260_pin_banks2), .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, }, }; @@ -842,30 +848,40 @@ static const struct samsung_pin_ctrl exynos5420_pin_ctrl[] __initconst = { .nr_banks = ARRAY_SIZE(exynos5420_pin_banks0), .eint_gpio_init = exynos_eint_gpio_init, .eint_wkup_init = exynos_eint_wkup_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos5420_pin_banks1, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks1), .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos5420_pin_banks2, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks2), .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 3 data */ .pin_banks = exynos5420_pin_banks3, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks3), .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 4 data */ .pin_banks = exynos5420_pin_banks4, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks4), .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, .retention_data = &exynos4_audio_retention_data, }, }; From patchwork Thu Jul 19 16:00:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946463 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="L5o0gddc"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wdzz3hczz9s4r for ; Fri, 20 Jul 2018 02:01:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732015AbeGSQpU (ORCPT ); Thu, 19 Jul 2018 12:45:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731524AbeGSQpT (ORCPT ); Thu, 19 Jul 2018 12:45:19 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 283DC20857; Thu, 19 Jul 2018 16:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016089; bh=5bBHxPpz8nwJf099V1DL1EbLbQRgzCDoEhcXGdI5NtM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L5o0gddceZD5HsrGvPn3tNc1LQRfaWbWM9KKDYaO62hUzTiC0sfCkesNw48LyNq10 HyrYNmmK0p9hQ5po+fYnlX5gAc+DweydT14ArOBkuxbIGFwFMqs6N/5iGkELvl0H1Z 0SKd5uRu6dvPuNin7bWgxn07GDHeIOSRsgrXwQ2U= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 02/10] pinctrl: samsung: Document suspend and resume members Date: Thu, 19 Jul 2018 18:00:42 +0200 Message-Id: <20180719160050.22566-3-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add missing documentation for suspend and resume members of struct samsung_pin_ctrl and samsung_pinctrl_drv_data. Signed-off-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-samsung.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index f0cda9424dfe..aac16cc8362a 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -223,6 +223,10 @@ struct samsung_retention_data { * interrupts for the controller. * @eint_wkup_init: platform specific callback to setup the external wakeup * interrupts for the controller. + * @suspend: platform specific suspend callback, executed during pin controller + * device suspend, see samsung_pinctrl_suspend() + * @resume: platform specific resume callback, executed during pin controller + * device suspend, see samsung_pinctrl_resume() */ struct samsung_pin_ctrl { const struct samsung_pin_bank_data *pin_banks; @@ -255,6 +259,10 @@ struct samsung_pin_ctrl { * @pin_base: starting system wide pin number. * @nr_pins: number of pins supported by the controller. * @retention_ctrl: retention control runtime data. + * @suspend: platform specific suspend callback, executed during pin controller + * device suspend, see samsung_pinctrl_suspend() + * @resume: platform specific resume callback, executed during pin controller + * device suspend, see samsung_pinctrl_resume() */ struct samsung_pinctrl_drv_data { struct list_head node; From patchwork Thu Jul 19 16:00:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="CDfFJvLo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf001MfDz9s7c for ; Fri, 20 Jul 2018 02:01:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732048AbeGSQpX (ORCPT ); Thu, 19 Jul 2018 12:45:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:59638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731524AbeGSQpW (ORCPT ); Thu, 19 Jul 2018 12:45:22 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0785220856; Thu, 19 Jul 2018 16:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016093; bh=91rWWIiKHNVXXRYVfmTQWnydZhLCoSp+ZLGfP5qKiwo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CDfFJvLoky3bg8trK63nHj1OkspLzXY04nkydavAjBzXQfROsHu8Rwh+/NxsgOBHB QLEoC53y8xHRXc/f4845Qn7mkmhBb7rXdlQGIlrO10RVSE9cLy/wMzfEeEeWTlbPOd Hx2Z4g8twKUs+U5jY7TAfvNjw/MwuAWwGws5PXX4= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 03/10] pinctrl: samsung: Document hidden requirement about one external wakeup Date: Thu, 19 Jul 2018 18:00:43 +0200 Message-Id: <20180719160050.22566-4-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hardware (S5Pv210 and all Exynos SoCs) provides only 32 external interrupts which can wakeup device from deep sleep modes. On S5Pv210 these are gph0-gph3. On all Exynos designs these are gpx0-gpx3. There is only pne 32-bit register for controlling the external wakeup interrupt mask (masking and unmasking waking capability of these interrupts). This lead to implementation in pinctrl driver and machine code which was using static memory for storing the mask value and not caring about multiple devices of pin controller... because only one pin controller device will be handling these. This corresponds to hidden assumption in parsing the Device Tree. Make this assumption an explicit requirement. Signed-off-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index 5e00a21de2bf..f7700c9e0d0b 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -145,8 +145,13 @@ A. External GPIO Interrupts: For supporting external gpio interrupts, the B. External Wakeup Interrupts: For supporting external wakeup interrupts, a child node representing the external wakeup interrupt controller should be - included in the pin-controller device node. This child node should include - the following properties. + included in the pin-controller device node. + + Only one pin-controller device node can include external wakeup interrupts + child node (in other words, only one External Wakeup Interrupts + pin-controller is supported). + + This child node should include following properties: - compatible: identifies the type of the external wakeup interrupt controller The possible values are: From patchwork Thu Jul 19 16:00:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="e8XiPsi7"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf0x6TZqz9s4r for ; Fri, 20 Jul 2018 02:02:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732051AbeGSQp1 (ORCPT ); Thu, 19 Jul 2018 12:45:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:59712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731524AbeGSQp1 (ORCPT ); Thu, 19 Jul 2018 12:45:27 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CB2122084C; Thu, 19 Jul 2018 16:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016097; bh=DeQcgj6tQKiRLII0PJEulPlaskqMIJmCj6JlOgXr9xc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e8XiPsi71w83RdB4Re22/MBNdAjZwmqKTb6YIbZToBnvK6K4RY+GQCHyiOgT/qHNw qDhKNeogkiyVNPOSpG0yfeUE+IkfwSOPj7gj9q5JPwwDymc3Ncfd7lSTccH5jgrNW1 aCGdSpmOP+RR9m2oBoqJlFVHq57sT926OZGg+DYE= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 04/10] pinctrl: samsung: Add dedicated compatible for S5Pv210 wakeup interrupts Date: Thu, 19 Jul 2018 18:00:44 +0200 Message-Id: <20180719160050.22566-5-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The S5Pv210 external wakeup interrupts differ from Exynos therefore separate compatible is needed. Duplicate existing flavor specific data from exynos4210_wkup_irq_chip and add new compatible for S5Pv210. At this point this new compatible does not bring anything new and works exactly as "samsung,exynos4210-wakeup-eint". Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/pinctrl/samsung-pinctrl.txt | 2 ++ drivers/pinctrl/samsung/pinctrl-exynos.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index f7700c9e0d0b..843a6cbf4774 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -161,6 +161,8 @@ B. External Wakeup Interrupts: For supporting external wakeup interrupts, a found on Samsung S3C2412 and S3C2413 SoCs, - samsung,s3c64xx-wakeup-eint: represents wakeup interrupt controller found on Samsung S3C64xx SoCs, + - samsung,s5pv210-wakeup-eint: represents wakeup interrupt controller + found on Samsung S5Pv210 SoCs, - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller found on Samsung Exynos4210 and S5PC110/S5PV210 SoCs. - samsung,exynos7-wakeup-eint: represents wakeup interrupt controller diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index a263ddd94945..29d86d704b0c 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -346,6 +346,22 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) /* * irq_chip for wakeup interrupts */ +static const struct exynos_irq_chip s5pv210_wkup_irq_chip __initconst = { + .chip = { + .name = "s5pv210_wkup_irq_chip", + .irq_unmask = exynos_irq_unmask, + .irq_mask = exynos_irq_mask, + .irq_ack = exynos_irq_ack, + .irq_set_type = exynos_irq_set_type, + .irq_set_wake = exynos_wkup_irq_set_wake, + .irq_request_resources = exynos_irq_request_resources, + .irq_release_resources = exynos_irq_release_resources, + }, + .eint_con = EXYNOS_WKUP_ECON_OFFSET, + .eint_mask = EXYNOS_WKUP_EMASK_OFFSET, + .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, +}; + static const struct exynos_irq_chip exynos4210_wkup_irq_chip __initconst = { .chip = { .name = "exynos4210_wkup_irq_chip", @@ -380,6 +396,8 @@ static const struct exynos_irq_chip exynos7_wkup_irq_chip __initconst = { /* list of external wakeup controllers supported */ static const struct of_device_id exynos_wkup_irq_ids[] = { + { .compatible = "samsung,s5pv210-wakeup-eint", + .data = &s5pv210_wkup_irq_chip }, { .compatible = "samsung,exynos4210-wakeup-eint", .data = &exynos4210_wkup_irq_chip }, { .compatible = "samsung,exynos7-wakeup-eint", From patchwork Thu Jul 19 16:00:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="QrVsHUf9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf0v37L3z9s4r for ; Fri, 20 Jul 2018 02:02:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732071AbeGSQpb (ORCPT ); Thu, 19 Jul 2018 12:45:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:59810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731524AbeGSQpa (ORCPT ); Thu, 19 Jul 2018 12:45:30 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A183A2084E; Thu, 19 Jul 2018 16:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016101; bh=nxNJtOPSTJRdELFUguqwOHbRZDo7RJWK4ILoo73H2mc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QrVsHUf9c1WF2MQ/5UIOcjPFjU6YVw5UDZQHCtB1sBz5T0fdpQAiMSSPqu2z45edq lXBkLIudu2M6s8WYVIAf9PgFe/+bRiEXlg3xrSCclnlelHzVdEH8CVP8WuZ3+LE75i Z6YFEefssdkMx20y/3P4GWTzW/NMArpBCt3JF6fc= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 05/10] ARM: exynos: Define EINT_WAKEUP_MASK registers for S5Pv210 and Exynos5433 Date: Thu, 19 Jul 2018 18:00:45 +0200 Message-Id: <20180719160050.22566-6-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org S5Pv210 and Exynos5433/Exynos7 have different address of EINT_WAKEUP_MASK register. Rename existing S5P_EINT_WAKEUP_MASK to avoid confusion and add new ones. Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/suspend.c | 2 +- include/linux/soc/samsung/exynos-regs-pmu.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 0ec52f442b97..991938e19e17 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -272,7 +272,7 @@ static int exynos5420_cpu_suspend(unsigned long arg) static void exynos_pm_set_wakeup_mask(void) { /* Set wake-up mask registers */ - pmu_raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK); + pmu_raw_writel(exynos_get_eint_wake_mask(), EXYNOS_EINT_WAKEUP_MASK); pmu_raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK); } diff --git a/include/linux/soc/samsung/exynos-regs-pmu.h b/include/linux/soc/samsung/exynos-regs-pmu.h index 66dcb9ec273a..eb0d240df7a7 100644 --- a/include/linux/soc/samsung/exynos-regs-pmu.h +++ b/include/linux/soc/samsung/exynos-regs-pmu.h @@ -42,7 +42,7 @@ #define EXYNOS_SWRESET 0x0400 #define S5P_WAKEUP_STAT 0x0600 -#define S5P_EINT_WAKEUP_MASK 0x0604 +#define EXYNOS_EINT_WAKEUP_MASK 0x0604 #define S5P_WAKEUP_MASK 0x0608 #define S5P_WAKEUP_MASK2 0x0614 @@ -180,6 +180,9 @@ #define S5P_CORE_WAKEUP_FROM_LOCAL_CFG (0x3 << 8) #define S5P_CORE_AUTOWAKEUP_EN (1 << 31) +/* Only for S5Pv210 */ +#define S5PV210_EINT_WAKEUP_MASK 0xC004 + /* Only for EXYNOS4210 */ #define S5P_CMU_CLKSTOP_LCD1_LOWPWR 0x1154 #define S5P_CMU_RESET_LCD1_LOWPWR 0x1174 @@ -641,6 +644,7 @@ | EXYNOS5420_KFC_USE_STANDBY_WFI3) /* For EXYNOS5433 */ +#define EXYNOS5433_EINT_WAKEUP_MASK (0x060C) #define EXYNOS5433_USBHOST30_PHY_CONTROL (0x0728) #define EXYNOS5433_PAD_RETENTION_AUD_OPTION (0x3028) #define EXYNOS5433_PAD_RETENTION_MMC2_OPTION (0x30C8) From patchwork Thu Jul 19 16:00:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="iYrjsXye"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf0s6mRNz9s4r for ; Fri, 20 Jul 2018 02:02:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732091AbeGSQpf (ORCPT ); Thu, 19 Jul 2018 12:45:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732090AbeGSQpe (ORCPT ); Thu, 19 Jul 2018 12:45:34 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7714D20858; Thu, 19 Jul 2018 16:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016104; bh=VRSi07jrIg2lyvU+OFOnaL1qAX7XceK63njhxjy/oZk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iYrjsXyeVbYdtv0bqWZMG7o6kI3XrH/XPk3Uy0uqPPpj3RzhcqXotIjDFsv20MDsV ZSbpnPR5G0lxyEiyH8i+5wPYf7NPx6AfSjuXfyYaJI4vEIdpIVKbJYyFjvGdhCvYcP OzowL6ruAsDW61Hn5pITmSMwIrrjuw/HfLtqH97A= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 06/10] pinctrl: samsung: Write external interrupt mask Date: Thu, 19 Jul 2018 18:00:46 +0200 Message-Id: <20180719160050.22566-7-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The pinctrl driver defines IRQ chip handling external wakeup interrupts, therefore from logical point of view, it is the owner of external interrupt mask. However the register controlling the mask belongs to Power Management Unit address space. Therefore reuse existing PMU syscon regmap handle, passed via retention data. The pinctrl driver will write external interrupt mask during late suspend. ARMv7 designs (S5Pv210 and Exynos) ================================== This duplicates setting mask with machine code arch/arm/mach-exynos/suspend.c and arch/arm/mach-s5pv210/pm.c but it is not a problem - the wakeup mask register will be written twice. The difference between implementation here and ARMv7 machine code (arch/arm/mach-*) is the time of writing the mask. The machine code is writing the mask during system suspend path, after offlining secondary CPUs and just before doing actual suspend. The implementation in pinctrl driver uses late suspend ops, therefore it will write the mask much earlier. Hopefully after all drivers will enable or disable its interrupt wakeup (enable_irq_wake() etc). ARMv8 designs (Exynos5433 and Exynos7) ================================== This was not done before thus it brings one step closer into suspend support. Signed-off-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 50 ++++++++++++++++++++++++++++- drivers/pinctrl/samsung/pinctrl-samsung.h | 3 ++ include/linux/soc/samsung/exynos-regs-pmu.h | 2 ++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 29d86d704b0c..40ef14956876 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -37,6 +38,8 @@ struct exynos_irq_chip { u32 eint_con; u32 eint_mask; u32 eint_pend; + u32 eint_wake_mask_value; + u32 eint_wake_mask_reg; }; static inline struct exynos_irq_chip *to_exynos_irq_chip(struct irq_chip *chip) @@ -215,6 +218,7 @@ static struct exynos_irq_chip exynos_gpio_irq_chip = { .eint_con = EXYNOS_GPIO_ECON_OFFSET, .eint_mask = EXYNOS_GPIO_EMASK_OFFSET, .eint_pend = EXYNOS_GPIO_EPEND_OFFSET, + /* eint_wake_mask_value not used */ }; static int exynos_eint_irq_map(struct irq_domain *h, unsigned int virq, @@ -330,6 +334,8 @@ u32 exynos_get_eint_wake_mask(void) static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) { + struct irq_chip *chip = irq_data_get_irq_chip(irqd); + struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq); @@ -339,6 +345,7 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) exynos_eint_wake_mask |= bit; else exynos_eint_wake_mask &= ~bit; + our_chip->eint_wake_mask_value = exynos_eint_wake_mask; return 0; } @@ -360,6 +367,9 @@ static const struct exynos_irq_chip s5pv210_wkup_irq_chip __initconst = { .eint_con = EXYNOS_WKUP_ECON_OFFSET, .eint_mask = EXYNOS_WKUP_EMASK_OFFSET, .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, + .eint_wake_mask_value = EXYNOS_EINT_WAKEUP_MASK_DISABLED, + /* Only difference with exynos4210_wkup_irq_chip: */ + .eint_wake_mask_reg = S5PV210_EINT_WAKEUP_MASK, }; static const struct exynos_irq_chip exynos4210_wkup_irq_chip __initconst = { @@ -376,6 +386,8 @@ static const struct exynos_irq_chip exynos4210_wkup_irq_chip __initconst = { .eint_con = EXYNOS_WKUP_ECON_OFFSET, .eint_mask = EXYNOS_WKUP_EMASK_OFFSET, .eint_pend = EXYNOS_WKUP_EPEND_OFFSET, + .eint_wake_mask_value = EXYNOS_EINT_WAKEUP_MASK_DISABLED, + .eint_wake_mask_reg = EXYNOS_EINT_WAKEUP_MASK, }; static const struct exynos_irq_chip exynos7_wkup_irq_chip __initconst = { @@ -392,6 +404,8 @@ static const struct exynos_irq_chip exynos7_wkup_irq_chip __initconst = { .eint_con = EXYNOS7_WKUP_ECON_OFFSET, .eint_mask = EXYNOS7_WKUP_EMASK_OFFSET, .eint_pend = EXYNOS7_WKUP_EPEND_OFFSET, + .eint_wake_mask_value = EXYNOS_EINT_WAKEUP_MASK_DISABLED, + .eint_wake_mask_reg = EXYNOS5433_EINT_WAKEUP_MASK, }; /* list of external wakeup controllers supported */ @@ -560,6 +574,27 @@ int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) return 0; } +static void +exynos_pinctrl_set_eint_wakeup_mask(struct samsung_pinctrl_drv_data *drvdata, + struct exynos_irq_chip *irq_chip) +{ + struct regmap *pmu_regs; + + if (!drvdata->retention_ctrl || !drvdata->retention_ctrl->priv) { + dev_warn(drvdata->dev, + "No retention data configured bank with external wakeup interrupt. Wake-up mask will not be set.\n"); + return; + } + + pmu_regs = drvdata->retention_ctrl->priv; + dev_info(drvdata->dev, + "Setting external wakeup interrupt wakeup mask: 0x%x\n", + irq_chip->eint_wake_mask_value); + + regmap_write(pmu_regs, irq_chip->eint_wake_mask_reg, + irq_chip->eint_wake_mask_value); +} + static void exynos_pinctrl_suspend_bank( struct samsung_pinctrl_drv_data *drvdata, struct samsung_pin_bank *bank) @@ -582,11 +617,24 @@ static void exynos_pinctrl_suspend_bank( void exynos_pinctrl_suspend(struct samsung_pinctrl_drv_data *drvdata) { struct samsung_pin_bank *bank = drvdata->pin_banks; + struct exynos_irq_chip *irq_chip = NULL; int i; - for (i = 0; i < drvdata->nr_banks; ++i, ++bank) + for (i = 0; i < drvdata->nr_banks; ++i, ++bank) { if (bank->eint_type == EINT_TYPE_GPIO) exynos_pinctrl_suspend_bank(drvdata, bank); + else if (bank->eint_type == EINT_TYPE_WKUP) { + if (!irq_chip) { + irq_chip = bank->irq_chip; + exynos_pinctrl_set_eint_wakeup_mask(drvdata, + irq_chip); + } else if (bank->irq_chip != irq_chip) { + dev_warn(drvdata->dev, + "More than one external wakeup interrupt chip configured (bank: %s). This is not supported by hardware nor by driver.\n", + bank->name); + } + } + } } static void exynos_pinctrl_resume_bank( diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index aac16cc8362a..e571bbd7139b 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -227,6 +227,9 @@ struct samsung_retention_data { * device suspend, see samsung_pinctrl_suspend() * @resume: platform specific resume callback, executed during pin controller * device suspend, see samsung_pinctrl_resume() + * + * External wakeup interrupts must define at least eint_wkup_init, + * retention_data and suspend in order for proper suspend/resume to work. */ struct samsung_pin_ctrl { const struct samsung_pin_bank_data *pin_banks; diff --git a/include/linux/soc/samsung/exynos-regs-pmu.h b/include/linux/soc/samsung/exynos-regs-pmu.h index eb0d240df7a7..5addaf5ccbce 100644 --- a/include/linux/soc/samsung/exynos-regs-pmu.h +++ b/include/linux/soc/samsung/exynos-regs-pmu.h @@ -42,6 +42,8 @@ #define EXYNOS_SWRESET 0x0400 #define S5P_WAKEUP_STAT 0x0600 +/* Value for EXYNOS_EINT_WAKEUP_MASK disabling all external wakeup interrupts */ +#define EXYNOS_EINT_WAKEUP_MASK_DISABLED 0xffffffff #define EXYNOS_EINT_WAKEUP_MASK 0x0604 #define S5P_WAKEUP_MASK 0x0608 #define S5P_WAKEUP_MASK2 0x0614 From patchwork Thu Jul 19 16:00:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="ISKKcTH8"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf0H5ZLSz9s4w for ; Fri, 20 Jul 2018 02:01:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732143AbeGSQpj (ORCPT ); Thu, 19 Jul 2018 12:45:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:59994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732090AbeGSQpi (ORCPT ); Thu, 19 Jul 2018 12:45:38 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 503C520857; Thu, 19 Jul 2018 16:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016108; bh=h8wR3dDRUsP3fJlkx3Gj+7p7ZaX8RtG0eW1pK6n130U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ISKKcTH8u3hb/6CWV0/AqotgPHD83M+dnHsQIAeSwqBTiEF8FSrgBSCv1gnO6xR61 /cJ7NDWvvH10OYuJWBKIz9jc2gCgLyuNk9VWnV8/4IN8m6T90tM9GYIvYA3Q4FxybD yatIf62SAb+9P9voGFANbYV09fc0Z6Ic6Pbk2HXY= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 07/10] ARM: dts: s5pv210: Switch to S5Pv210 specific pinctrl wakeup compatible Date: Thu, 19 Jul 2018 18:00:47 +0200 Message-Id: <20180719160050.22566-8-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The pin controller block of S5Pv210 for handling external wakeup interrupts is different than in newer designs (Exynos). Signed-off-by: Krzysztof Kozlowski --- arch/arm/boot/dts/s5pv210.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/s5pv210.dtsi b/arch/arm/boot/dts/s5pv210.dtsi index 67358562a6ea..75f454a210d6 100644 --- a/arch/arm/boot/dts/s5pv210.dtsi +++ b/arch/arm/boot/dts/s5pv210.dtsi @@ -120,7 +120,7 @@ interrupts = <30>; wakeup-interrupt-controller { - compatible = "samsung,exynos4210-wakeup-eint"; + compatible = "samsung,s5pv210-wakeup-eint"; interrupts = <16>; interrupt-parent = <&vic0>; }; From patchwork Thu Jul 19 16:00:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="1Ritjcpo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf0h23Msz9s8f for ; Fri, 20 Jul 2018 02:02:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732146AbeGSQpn (ORCPT ); Thu, 19 Jul 2018 12:45:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:60120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732090AbeGSQpm (ORCPT ); Thu, 19 Jul 2018 12:45:42 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2FABD2084E; Thu, 19 Jul 2018 16:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016112; bh=FVHpr9r//JYD/0uePoYwYWwe9stYrK8DHRwDirQYf6s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=1Ritjcpoy1z+8lKoVau46Oc+Rt8pkoI3stMAYsODG6aMpq9FKFSyu+BQ1JrvCfEdo 7C4m/k9euhxA175QdHHL5XPksvF4wgpK9Hv1uXGaZXqu25q/sm6V/H1Ji0Xu0vEgXx DxAsYQ9qAbuf0egUS4Kx9RcX+ohYmSNsE8WmFFac= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 08/10] ARM: s5pv210: Remove legacy setting of external wakeup interrupts Date: Thu, 19 Jul 2018 18:00:48 +0200 Message-Id: <20180719160050.22566-9-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Since Exynos/S5Pv210 pin-controller driver is taking care about setting the external wakeup interrupts mask, the legacy code can be removed. Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s5pv210/common.h | 1 - arch/arm/mach-s5pv210/pm.c | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-s5pv210/common.h b/arch/arm/mach-s5pv210/common.h index 0a188134deae..cb36058bc35e 100644 --- a/arch/arm/mach-s5pv210/common.h +++ b/arch/arm/mach-s5pv210/common.h @@ -10,7 +10,6 @@ #define __ARCH_ARM_MACH_S5PV210_COMMON_H #ifdef CONFIG_PM_SLEEP -u32 exynos_get_eint_wake_mask(void); void s5pv210_cpu_resume(void); void s5pv210_pm_init(void); #else diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index f491249ab658..b336df0c57f3 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c @@ -32,6 +32,11 @@ static struct sleep_save s5pv210_core_save[] = { */ static u32 s5pv210_irqwake_intmask = 0xffffffff; +static u32 s5pv210_read_eint_wakeup_mask(void) +{ + return __raw_readl(S5P_EINT_WAKEUP_MASK); +} + /* * Suspend helpers. */ @@ -59,8 +64,10 @@ static void s5pv210_pm_prepare(void) { unsigned int tmp; - /* Set wake-up mask registers */ - __raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK); + /* + * Set wake-up mask registers + * S5P_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend. + */ __raw_writel(s5pv210_irqwake_intmask, S5P_WAKEUP_MASK); /* ensure at least INFORM0 has the resume address */ @@ -89,6 +96,7 @@ static void s5pv210_pm_prepare(void) */ static int s5pv210_suspend_enter(suspend_state_t state) { + u32 eint_wakeup_mask = s5pv210_read_eint_wakeup_mask(); int ret; s3c_pm_debug_init(); @@ -96,10 +104,10 @@ static int s5pv210_suspend_enter(suspend_state_t state) S3C_PMDBG("%s: suspending the system...\n", __func__); S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__, - s5pv210_irqwake_intmask, exynos_get_eint_wake_mask()); + s5pv210_irqwake_intmask, eint_wakeup_mask); if (s5pv210_irqwake_intmask == -1U - && exynos_get_eint_wake_mask() == -1U) { + && eint_wakeup_mask == -1U) { pr_err("%s: No wake-up sources!\n", __func__); pr_err("%s: Aborting sleep\n", __func__); return -EINVAL; From patchwork Thu Jul 19 16:00:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946468 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="QHS7ET0m"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf0f4yg7z9s9G for ; Fri, 20 Jul 2018 02:02:10 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731989AbeGSQpq (ORCPT ); Thu, 19 Jul 2018 12:45:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:60198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732162AbeGSQpq (ORCPT ); Thu, 19 Jul 2018 12:45:46 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 02CFA20862; Thu, 19 Jul 2018 16:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016116; bh=FZC4YA6gs87CSmlDC6wU93X0U0dw0YS5bjmojJz9LPE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QHS7ET0mzicHUrNu7EYfgI2SNVt78bdorJHeqRV03lYGBHPpzrS++VG+VW+sRzLd+ HYqAyEHUqHF/em9F7PVoVphT+seA8KgaG0+ODGz4ZcfEVrTP62tjViu/KtIpLQeCG9 MnOqh35DGOm+0jaF1VaFANCSl4JrjBBj98L4fW/A= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 09/10] ARM: exynos: Remove legacy setting of external wakeup interrupts Date: Thu, 19 Jul 2018 18:00:49 +0200 Message-Id: <20180719160050.22566-10-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Since Exynos/S5Pv210 pin-controller driver is taking care about setting the external wakeup interrupts mask, the legacy code can be removed. Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/common.h | 2 -- arch/arm/mach-exynos/suspend.c | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index dcd21bb95e3b..035e51c5f0fc 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -113,8 +113,6 @@ void exynos_firmware_init(void); void exynos_set_boot_flag(unsigned int cpu, unsigned int mode); void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode); -extern u32 exynos_get_eint_wake_mask(void); - #ifdef CONFIG_PM_SLEEP extern void __init exynos_pm_init(void); #else diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 991938e19e17..554d6ea2cb3c 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -88,6 +88,11 @@ static const struct exynos_wkup_irq exynos5250_wkup_irq[] = { { /* sentinel */ }, }; +static u32 exynos_read_eint_wakeup_mask(void) +{ + return pmu_raw_readl(EXYNOS_EINT_WAKEUP_MASK); +} + static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) { const struct exynos_wkup_irq *wkup_irq; @@ -271,8 +276,10 @@ static int exynos5420_cpu_suspend(unsigned long arg) static void exynos_pm_set_wakeup_mask(void) { - /* Set wake-up mask registers */ - pmu_raw_writel(exynos_get_eint_wake_mask(), EXYNOS_EINT_WAKEUP_MASK); + /* + * Set wake-up mask registers + * EXYNOS_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend. + */ pmu_raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK); } @@ -482,6 +489,7 @@ static void exynos5420_pm_resume(void) static int exynos_suspend_enter(suspend_state_t state) { + u32 eint_wakeup_mask = exynos_read_eint_wakeup_mask(); int ret; s3c_pm_debug_init(); @@ -489,10 +497,10 @@ static int exynos_suspend_enter(suspend_state_t state) S3C_PMDBG("%s: suspending the system...\n", __func__); S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__, - exynos_irqwake_intmask, exynos_get_eint_wake_mask()); + exynos_irqwake_intmask, eint_wakeup_mask); if (exynos_irqwake_intmask == -1U - && exynos_get_eint_wake_mask() == -1U) { + && eint_wakeup_mask == EXYNOS_EINT_WAKEUP_MASK_DISABLED) { pr_err("%s: No wake-up sources!\n", __func__); pr_err("%s: Aborting sleep\n", __func__); return -EINVAL; From patchwork Thu Jul 19 16:00:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 946467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="OAtlN1ki"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Wf0W0Kzrz9s7c for ; Fri, 20 Jul 2018 02:02:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732351AbeGSQpv (ORCPT ); Thu, 19 Jul 2018 12:45:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:60284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732162AbeGSQpu (ORCPT ); Thu, 19 Jul 2018 12:45:50 -0400 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDD2520856; Thu, 19 Jul 2018 16:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532016120; bh=PYEkuazbbieej7kfZSsRKhklgXYa/ZHgDw3X975qgRM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OAtlN1ki/xXzDCWQ9GE2GC5mIFj63hqJFUedCHeK2jSAIfCs0Q0mqtQu9Rm0q6mAu 3FXrZq7bUjn7+Qxb9Dl02MVbIYKQNKbHjX950Op8arv/E1bgmSxyYQ1j+SudDrTT0p CGdTRS+HZHlu7ATpPwlZA3AupZRskTblkDER+3Ms= From: Krzysztof Kozlowski To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , Rob Herring , Mark Rutland , Kukjin Kim , Russell King , Arnd Bergmann , Alim Akhtar , Pankaj Dubey , Marek Szyprowski , =?utf-8?q?Pawe=C5=82_Chmiel?= , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 10/10] pinctrl: samsung: Remove legacy API for handling external wakeup interrupts mask Date: Thu, 19 Jul 2018 18:00:50 +0200 Message-Id: <20180719160050.22566-11-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180719160050.22566-1-krzk@kernel.org> References: <20180719160050.22566-1-krzk@kernel.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Remove the legacy, ugly API of exposing the static value of external wakeup interrupts mask, because all arch-machine users where converted to use generic implementation from pinctrl driver. Signed-off-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 40ef14956876..eec174a65c6f 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -325,13 +325,6 @@ int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d) return ret; } -static u32 exynos_eint_wake_mask = 0xffffffff; - -u32 exynos_get_eint_wake_mask(void) -{ - return exynos_eint_wake_mask; -} - static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) { struct irq_chip *chip = irq_data_get_irq_chip(irqd); @@ -342,10 +335,9 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) pr_info("wake %s for irq %d\n", on ? "enabled" : "disabled", irqd->irq); if (!on) - exynos_eint_wake_mask |= bit; + our_chip->eint_wake_mask_value |= bit; else - exynos_eint_wake_mask &= ~bit; - our_chip->eint_wake_mask_value = exynos_eint_wake_mask; + our_chip->eint_wake_mask_value &= ~bit; return 0; }