From patchwork Fri Nov 20 05:17:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7664511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A3FE9F392 for ; Fri, 20 Nov 2015 05:24:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4D4420483 for ; Fri, 20 Nov 2015 05:24:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06A4B203A9 for ; Fri, 20 Nov 2015 05:24:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zze9B-0004QX-6U; Fri, 20 Nov 2015 05:22:09 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zze8x-00044C-BY for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2015 05:22:01 +0000 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NY302GXTLJUDZ10@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2015 14:21:30 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.122]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 68.20.17463.ADDAE465; Fri, 20 Nov 2015 14:21:30 +0900 (KST) X-AuditID: cbfee68e-f79f56d000004437-74-564eaddaae25 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id AD.1B.00996.ADDAE465; Fri, 20 Nov 2015 14:21:30 +0900 (KST) Received: from exypnos.sisodomain.com ([107.108.73.28]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NY300FUGLAIN310@mmp2.samsung.com>; Fri, 20 Nov 2015 14:21:30 +0900 (KST) From: Alim Akhtar To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF Date: Fri, 20 Nov 2015 10:47:09 +0530 Message-id: <1447996629-18232-6-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1447996629-18232-1-git-send-email-alim.akhtar@samsung.com> References: <1447996629-18232-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRmVeSWpSXmKPExsWyRsSkSvfWWr8wg4tXxCzmHznHavHm7Rom i9cvDC36H79mttj0+BqrxYzz+5gsXh75wWjRtvoDq8XxteEOnB637tR7bFrVyeZx59oeNo/N S+o9/h1j99jSf5fdo2/LKkaPz5vkAjiiuGxSUnMyy1KL9O0SuDK+P17AXrBNtuLay2msDYy7 JboYOTkkBEwk1p6awQZhi0lcuLceyObiEBJYwSjxYeFtFpii+8dOM0IkZjFK/Ng5lQXC+cko 8fTMIyaQKjYBbYm707eA2SICqhKf2xawgxQxC9xilHi07S4jSEJYIEHi2YmPYGNZgIpuvdkE VMTBwSvgLtGyuhxim6JE97MJYCdxCnhIbF+wF2ymEFDJsfmvGSFq9rFLHGsKgRgjIPFt8iEW kDESArISmw4wQ5RIShxccYNlAqPwAkaGVYyiqQXJBcVJ6UVGesWJucWleel6yfm5mxiB8XD6 37O+HYw3D1gfYhTgYFTi4b0h6RcmxJp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PcZmAb/26V9wVzm679+z3O/dXC159/77/ 6/RmdT+3NVKWNadd5C9W6Pz6YhX+41y6/9q5p/PZLr7UeeQasUPr8Z1cF4fPIqbHHZh2svSs F5368rESS3FGoqEWc1FxIgDkolmN0AIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151119_212155_831537_1D0F17BE X-CRM114-Status: GOOD ( 14.52 ) X-Spam-Score: -7.5 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, k.kozlowski@samsung.com, tjakobi@math.uni-bielefeld.de, ulf.hansson@linaro.org, m.reichl@fivetechno.de, javier@osg.samsung.com, kgene@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since we switch to use generic syscon regmap based reset/poweroff driver for exynos SoC, lets select it from ARCH_EXYNOS instead of enabling it from various defconfigs. This also select POWER_RESET as SYSCON-{reset, poweroff} drivers depends on it. Also because of the above changes we don't need special handling for reboot/poweroff in exynos pmu driver. This patch also removes the same from exynos pmu driver to keep git bisect working. Note: This will break reboot/poweroff on boards with older dtbs with a newer kernel. Signed-off-by: Alim Akhtar Reviewed-by: Javier Martinez Canillas Acked-by: Moritz Fischer Reviewed-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/Kconfig | 3 +++ arch/arm/mach-exynos/pmu.c | 43 ------------------------------------------ 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 3a10f1a8317a..d279edf9b10d 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -27,6 +27,9 @@ menuconfig ARCH_EXYNOS select SRAM select THERMAL select MFD_SYSCON + select POWER_RESET + select POWER_RESET_SYSCON + select POWER_RESET_SYSCON_POWEROFF help Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5) diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index de68938ee6aa..393c04aa727e 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c @@ -14,9 +14,6 @@ #include #include #include -#include -#include - #include "exynos-pmu.h" #include "regs-pmu.h" @@ -681,23 +678,6 @@ static unsigned int const exynos5420_list_disable_pmu_reg[] = { EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG, }; -static void exynos_power_off(void) -{ - unsigned int tmp; - - pr_info("Power down.\n"); - tmp = pmu_raw_readl(EXYNOS_PS_HOLD_CONTROL); - tmp ^= (1 << 8); - pmu_raw_writel(tmp, EXYNOS_PS_HOLD_CONTROL); - - /* Wait a little so we don't give a false warning below */ - mdelay(100); - - pr_err("Power down failed, please power off system manually.\n"); - while (1) - ; -} - static void exynos5420_powerdown_conf(enum sys_powerdown mode) { u32 this_cluster; @@ -875,14 +855,6 @@ static void exynos5420_pmu_init(void) pr_info("EXYNOS5420 PMU initialized\n"); } -static int pmu_restart_notify(struct notifier_block *this, - unsigned long code, void *unused) -{ - pmu_raw_writel(0x1, EXYNOS_SWRESET); - - return NOTIFY_DONE; -} - static const struct exynos_pmu_data exynos3250_pmu_data = { .pmu_config = exynos3250_pmu_config, .pmu_init = exynos3250_pmu_init, @@ -940,20 +912,11 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = { { /*sentinel*/ }, }; -/* - * Exynos PMU restart notifier, handles restart functionality - */ -static struct notifier_block pmu_restart_handler = { - .notifier_call = pmu_restart_notify, - .priority = 128, -}; - static int exynos_pmu_probe(struct platform_device *pdev) { const struct of_device_id *match; struct device *dev = &pdev->dev; struct resource *res; - int ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pmu_base_addr = devm_ioremap_resource(dev, res); @@ -978,12 +941,6 @@ static int exynos_pmu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pmu_context); - ret = register_restart_handler(&pmu_restart_handler); - if (ret) - dev_warn(dev, "can't register restart handler err=%d\n", ret); - - pm_power_off = exynos_power_off; - dev_dbg(dev, "Exynos PMU Driver probe done\n"); return 0; }