From patchwork Tue Sep 28 23:56:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William McVicker X-Patchwork-Id: 12524189 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1DE5C433EF for ; Wed, 29 Sep 2021 00:02:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6072A6134F for ; Wed, 29 Sep 2021 00:02:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6072A6134F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yatIqs1ae8RW5nmTFpZo9zo2rFMU5vAfE6cdii/8YpA=; b=Njyj3jaZfNkvvHlVUgtO9wnoxt /oDKWiKN9sYq1Yuct62FzJ4OaWW2BbT8g/6PaOWRmXY/3ZlPijfPhidfMJ0kEg0NThAV/pTjFPZZs eCjLU6ZGhCFofS+vo7E2UIz/uwNCp6VMfjexp6EZElHnd0+8cgW9sdOtpSiivhoOIaBKIe27DDZIe HDAUm1/XweppST1LRQGlCyWU6eiOIUO9xqmdxXURnKWHe75Kd3GxbPSB0f47GnDkylweE9I5yh2jv NBbF5eY7x7Ntz/znIfbyUx9g9itbzsrHB+KnkxXgbR4AnLKnHhEBuKHiDmAIbA0cE0cRp6i+xymIE VDOrU06w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVN1r-009P5l-6M; Wed, 29 Sep 2021 00:00:55 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVMyL-009NRl-7m for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 23:57:18 +0000 Received: by mail-pl1-x649.google.com with SMTP id c10-20020a170902aa4a00b0013b8ac279deso106103plr.9 for ; Tue, 28 Sep 2021 16:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=8a+pGr99SbxPPuDqxhZs4f7LER8gsJNgSzQRfQMX/ng=; b=cDq5EHjkB+BlLQ77eVTRDNuITFRj28ahb032+NylHFG6C5BUaYWmmJ4RDXzqb46L4a gxWX8hWE6q3yQByjEzaxt/goL0Lx8+Wj8NPtkLpHvmYERF4Ml8Z6IBJHSxR5VRtcAy/5 lGew9v8HMhlLKBREGnbOZPWoThQVPNisaI7K4kEfXkLFqGjlhZMPECrQk4zR9L32cins H4dUXJ7RYsQs4O+2jKithABkGhQ1oLBxiPQs0tjU20W472hPN364yVfG4YM/ymDXuIPF 6rx1621Da0O1VzynkZtiOc0QBJLgvnh1dU4ZfLesXMjwIp3Ya+Xy73FAN3w7owNkH43p RrfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=8a+pGr99SbxPPuDqxhZs4f7LER8gsJNgSzQRfQMX/ng=; b=VteEGmx0XwKKdUmo9JQM34p++xH2HuCETMtjUqOt//uP7Gy/FNO0q7AjqlH7IcYin3 gVRElrcIXTM/gSg6CLk2/klwNzresobxyz74Dbfi+lT+n9teL+s6cVbDc6l/+atlT1o0 YPwJ1k/BEKdJvxOjTvLXkQTDq+jvJ0NPWUYGNHLizfuWk+AwQJ6lpafaM5kPbyWoz4PW MbLUY9fc89h5dGZdEx3pY0r38KbyxxIOFNpT07IkZCMlLA6vZ7aBZhz7c3MoSt1TQmTZ ZcDN6eU/Q2g/ktpl49zBUvtuK4MxWArjjDNepwLREeWs1FLG7gq7gcU1qb8Dj8oSOcFr Vtuw== X-Gm-Message-State: AOAM533+umofXuYBlZVqZVxHcz67oOLaKazCcDCtR0P1/6JtbzHmkVKn LAvptJcUsoRX+0qX8Cmi4KCEZmLn1yfCNbpAbh4= X-Google-Smtp-Source: ABdhPJxwcUuJteV50bGQEoklWqMpHmLg3VDiAYG2hThPHuW4JGrF3F5rgRl8xIKiaEkUVnIZuEE/iKxS8oQm/Sm4z0o= X-Received: from willmcvicker.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:2dd0]) (user=willmcvicker job=sendgmr) by 2002:a17:90a:8b8d:: with SMTP id z13mr237355pjn.0.1632873434545; Tue, 28 Sep 2021 16:57:14 -0700 (PDT) Date: Tue, 28 Sep 2021 23:56:27 +0000 In-Reply-To: <20210928235635.1348330-1-willmcvicker@google.com> Message-Id: <20210928235635.1348330-11-willmcvicker@google.com> Mime-Version: 1.0 References: <20210928235635.1348330-1-willmcvicker@google.com> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog Subject: [PATCH v2 10/12] soc: samsung: pmu: modularize the Exynos ARMv8 PMU driver From: Will McVicker To: Russell King , Krzysztof Kozlowski , Catalin Marinas , Will Deacon , Michael Turquette , Stephen Boyd , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Linus Walleij , Alessandro Zummo , Alexandre Belloni , John Stultz , Thomas Gleixner Cc: Lee Jones , Geert Uytterhoeven , Saravana Kannan , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_165717_325482_87CA0739 X-CRM114-Status: GOOD ( 22.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to only modularize the Exynos ARMv8 PMU driver, we have to split it up from the ARM PMU driver. So make the following Kconfig changes: * EXYNOS_PMU -> EXYNOS_PMU_ARM64 * EXYNOS_PMU_ARM_DRIVERS -> EXYNOS_PMU_ARM This patch also includes the necessary modularization changes. Lastly, have EXYNOS_PMU_ARM64 use "default y if ARCH_EXYNOS && ARM64" instead of having ARCH_EXYNOS select it directly. Signed-off-by: Will McVicker --- arch/arm/mach-exynos/Kconfig | 2 +- arch/arm64/Kconfig.platforms | 1 - drivers/soc/samsung/Kconfig | 15 +++++++++------ drivers/soc/samsung/Makefile | 8 +++++--- drivers/soc/samsung/exynos-pmu.c | 13 +++++++------ drivers/soc/samsung/exynos-pmu.h | 2 +- include/linux/soc/samsung/exynos-pmu.h | 2 +- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index afc8cd062605..e97e1d8f7b00 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -13,7 +13,7 @@ menuconfig ARCH_EXYNOS select ARM_GIC select EXYNOS_IRQ_COMBINER select EXYNOS_THERMAL - select EXYNOS_PMU + select EXYNOS_PMU_ARM select EXYNOS_SROM select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS select GPIOLIB diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 67f60cc3c723..e5e4b9b2fb97 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -92,7 +92,6 @@ config ARCH_BRCMSTB config ARCH_EXYNOS bool "ARMv8 based Samsung Exynos SoC family" select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS - select EXYNOS_PMU select HAVE_S3C_RTC if RTC_CLASS select PINCTRL select PM_GENERIC_DOMAINS if PM diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig index d3746415be72..fdf1162ec98b 100644 --- a/drivers/soc/samsung/Kconfig +++ b/drivers/soc/samsung/Kconfig @@ -23,15 +23,18 @@ config EXYNOS_CHIPID Support for Samsung Exynos SoC ChipID and Adaptive Supply Voltage. This driver can also be built as module (exynos_chipid). -config EXYNOS_PMU - bool "Exynos PMU controller driver" if COMPILE_TEST - depends on ARCH_EXYNOS || ((ARM || ARM64) && COMPILE_TEST) - select EXYNOS_PMU_ARM_DRIVERS if ARM && ARCH_EXYNOS +config EXYNOS_PMU_ARM64 + tristate "Exynos PMU controller driver" + depends on ARCH_EXYNOS || (ARM64 && COMPILE_TEST) + default y if (ARCH_EXYNOS && ARM64) + help + Support for Samsung Exynos ARMv8 PMU controller. This driver can be + built-in or as a module (exynos-pmu). # There is no need to enable these drivers for ARMv8 -config EXYNOS_PMU_ARM_DRIVERS +config EXYNOS_PMU_ARM bool "Exynos PMU ARMv7-specific driver extensions" if COMPILE_TEST - depends on EXYNOS_PMU + depends on ARCH_EXYNOS || (ARM && COMPILE_TEST) config EXYNOS_PM_DOMAINS bool "Exynos PM domains" if COMPILE_TEST diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile index 2ae4bea804cf..cd55c72a052d 100644 --- a/drivers/soc/samsung/Makefile +++ b/drivers/soc/samsung/Makefile @@ -4,10 +4,12 @@ obj-$(CONFIG_EXYNOS_ASV_ARM) += exynos5422-asv.o obj-$(CONFIG_EXYNOS_CHIPID) += exynos_chipid.o exynos_chipid-y += exynos-chipid.o exynos-asv.o -obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o +obj-$(CONFIG_EXYNOS_PMU_ARM64) += exynos-pmu.o + +obj-$(CONFIG_EXYNOS_PMU_ARM) += exynos-pmu32.o +exynos-pmu32-y += exynos-pmu.o exynos3250-pmu.o \ + exynos4-pmu.o exynos5250-pmu.o exynos5420-pmu.o -obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \ - exynos5250-pmu.o exynos5420-pmu.o obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o obj-$(CONFIG_EXYNOS_REGULATOR_COUPLER) += exynos-regulator-coupler.o diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index a18c93a4646c..3dd0219c908c 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,7 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) * Split the data between ARM architectures because it is relatively big * and useless on other arch. */ -#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS +#ifdef CONFIG_EXYNOS_PMU_ARM #define exynos_pmu_data_arm_ptr(data) (&data) #else #define exynos_pmu_data_arm_ptr(data) NULL @@ -154,9 +155,9 @@ static struct platform_driver exynos_pmu_driver = { .probe = exynos_pmu_probe, }; -static int __init exynos_pmu_init(void) -{ - return platform_driver_register(&exynos_pmu_driver); +module_platform_driver(exynos_pmu_driver); -} -postcore_initcall(exynos_pmu_init); +MODULE_DESCRIPTION("Exynos PMU controller driver"); +MODULE_AUTHOR("Marek Szyprowski "); +MODULE_AUTHOR("Krzysztof Kozlowski "); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/soc/samsung/exynos-pmu.h b/drivers/soc/samsung/exynos-pmu.h index 5e851f32307e..4a7f03c79dd0 100644 --- a/drivers/soc/samsung/exynos-pmu.h +++ b/drivers/soc/samsung/exynos-pmu.h @@ -28,7 +28,7 @@ struct exynos_pmu_data { extern void __iomem *pmu_base_addr; -#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS +#ifdef CONFIG_EXYNOS_PMU_ARM /* list of all exported SoC specific data */ extern const struct exynos_pmu_data exynos3250_pmu_data; extern const struct exynos_pmu_data exynos4210_pmu_data; diff --git a/include/linux/soc/samsung/exynos-pmu.h b/include/linux/soc/samsung/exynos-pmu.h index a4f5516cc956..d7317e0902b8 100644 --- a/include/linux/soc/samsung/exynos-pmu.h +++ b/include/linux/soc/samsung/exynos-pmu.h @@ -19,7 +19,7 @@ enum sys_powerdown { }; extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); -#ifdef CONFIG_EXYNOS_PMU +#if IS_ENABLED(CONFIG_EXYNOS_PMU_ARM64) || IS_ENABLED(CONFIG_EXYNOS_PMU_ARM) extern struct regmap *exynos_get_pmu_regmap(void); #else static inline struct regmap *exynos_get_pmu_regmap(void)