All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa@samsung.com>
To: linux-samsung-soc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	Kukjin Kim <kgene.kim@samsung.com>, Arnd Bergmann <arnd@arndb.de>,
	Olof Johansson <olof@lixom.net>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Thomas Abraham <thomas.abraham@linaro.org>,
	Tomasz Figa <t.figa@samsung.com>,
	linux-pm@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH 13/28] ARM: EXYNOS: pm_domains: Remove legacy power domain registration code
Date: Fri, 14 Jun 2013 21:32:49 +0200	[thread overview]
Message-ID: <1371238384-1504-14-git-send-email-t.figa@samsung.com> (raw)
In-Reply-To: <1371238384-1504-1-git-send-email-t.figa@samsung.com>

This patch removes static definitions of power domains and code
responsible for registering them and adding devices to them, since only
DT based boot is now supported on Exynos.

Cc: linux-pm@vger.kernel.org
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 arch/arm/mach-exynos/pm_domains.c | 94 +--------------------------------------
 1 file changed, 1 insertion(+), 93 deletions(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index beb946d..1703593 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -74,16 +74,6 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
 	return exynos_pd_power(domain, false);
 }
 
-#define EXYNOS_GPD(PD, BASE, NAME)			\
-static struct exynos_pm_domain PD = {			\
-	.base = (void __iomem *)BASE,			\
-	.name = NAME,					\
-	.pd = {						\
-		.power_off = exynos_pd_power_off,	\
-		.power_on = exynos_pd_power_on,	\
-	},						\
-}
-
 static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
 					 struct device *dev)
 {
@@ -156,7 +146,7 @@ static struct notifier_block platform_nb = {
 	.notifier_call = exynos_pm_notifier_call,
 };
 
-static __init int exynos_pm_dt_parse_domains(void)
+static __init int exynos4_pm_init_power_domain(void)
 {
 	struct platform_device *pdev;
 	struct device_node *np;
@@ -192,88 +182,6 @@ static __init int exynos_pm_dt_parse_domains(void)
 
 	return 0;
 }
-
-static __init __maybe_unused void exynos_pm_add_dev_to_genpd(struct platform_device *pdev,
-						struct exynos_pm_domain *pd)
-{
-	if (pdev->dev.bus) {
-		if (!pm_genpd_add_device(&pd->pd, &pdev->dev))
-			pm_genpd_dev_need_restore(&pdev->dev, true);
-		else
-			pr_info("%s: error in adding %s device to %s power"
-				"domain\n", __func__, dev_name(&pdev->dev),
-				pd->name);
-	}
-}
-
-EXYNOS_GPD(exynos4_pd_mfc, S5P_PMU_MFC_CONF, "pd-mfc");
-EXYNOS_GPD(exynos4_pd_g3d, S5P_PMU_G3D_CONF, "pd-g3d");
-EXYNOS_GPD(exynos4_pd_lcd0, S5P_PMU_LCD0_CONF, "pd-lcd0");
-EXYNOS_GPD(exynos4_pd_lcd1, S5P_PMU_LCD1_CONF, "pd-lcd1");
-EXYNOS_GPD(exynos4_pd_tv, S5P_PMU_TV_CONF, "pd-tv");
-EXYNOS_GPD(exynos4_pd_cam, S5P_PMU_CAM_CONF, "pd-cam");
-EXYNOS_GPD(exynos4_pd_gps, S5P_PMU_GPS_CONF, "pd-gps");
-
-static struct exynos_pm_domain *exynos4_pm_domains[] = {
-	&exynos4_pd_mfc,
-	&exynos4_pd_g3d,
-	&exynos4_pd_lcd0,
-	&exynos4_pd_lcd1,
-	&exynos4_pd_tv,
-	&exynos4_pd_cam,
-	&exynos4_pd_gps,
-};
-
-static __init int exynos4_pm_init_power_domain(void)
-{
-	int idx;
-
-	if (of_have_populated_dt())
-		return exynos_pm_dt_parse_domains();
-
-	for (idx = 0; idx < ARRAY_SIZE(exynos4_pm_domains); idx++) {
-		struct exynos_pm_domain *pd = exynos4_pm_domains[idx];
-		int on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
-
-		pm_genpd_init(&pd->pd, NULL, !on);
-	}
-
-#ifdef CONFIG_S5P_DEV_FIMD0
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimd0, &exynos4_pd_lcd0);
-#endif
-#ifdef CONFIG_S5P_DEV_TV
-	exynos_pm_add_dev_to_genpd(&s5p_device_hdmi, &exynos4_pd_tv);
-	exynos_pm_add_dev_to_genpd(&s5p_device_mixer, &exynos4_pd_tv);
-#endif
-#ifdef CONFIG_S5P_DEV_MFC
-	exynos_pm_add_dev_to_genpd(&s5p_device_mfc, &exynos4_pd_mfc);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC0
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc0, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC1
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc1, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC2
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc2, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC3
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc3, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_CSIS0
-	exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis0, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_CSIS1
-	exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis1, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_G2D
-	exynos_pm_add_dev_to_genpd(&s5p_device_g2d, &exynos4_pd_lcd0);
-#endif
-#ifdef CONFIG_S5P_DEV_JPEG
-	exynos_pm_add_dev_to_genpd(&s5p_device_jpeg, &exynos4_pd_cam);
-#endif
-	return 0;
-}
 arch_initcall(exynos4_pm_init_power_domain);
 
 int __init exynos_pm_late_initcall(void)
-- 
1.8.2.1


WARNING: multiple messages have this Message-ID (diff)
From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 13/28] ARM: EXYNOS: pm_domains: Remove legacy power domain registration code
Date: Fri, 14 Jun 2013 21:32:49 +0200	[thread overview]
Message-ID: <1371238384-1504-14-git-send-email-t.figa@samsung.com> (raw)
In-Reply-To: <1371238384-1504-1-git-send-email-t.figa@samsung.com>

This patch removes static definitions of power domains and code
responsible for registering them and adding devices to them, since only
DT based boot is now supported on Exynos.

Cc: linux-pm at vger.kernel.org
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 arch/arm/mach-exynos/pm_domains.c | 94 +--------------------------------------
 1 file changed, 1 insertion(+), 93 deletions(-)

diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index beb946d..1703593 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -74,16 +74,6 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
 	return exynos_pd_power(domain, false);
 }
 
-#define EXYNOS_GPD(PD, BASE, NAME)			\
-static struct exynos_pm_domain PD = {			\
-	.base = (void __iomem *)BASE,			\
-	.name = NAME,					\
-	.pd = {						\
-		.power_off = exynos_pd_power_off,	\
-		.power_on = exynos_pd_power_on,	\
-	},						\
-}
-
 static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
 					 struct device *dev)
 {
@@ -156,7 +146,7 @@ static struct notifier_block platform_nb = {
 	.notifier_call = exynos_pm_notifier_call,
 };
 
-static __init int exynos_pm_dt_parse_domains(void)
+static __init int exynos4_pm_init_power_domain(void)
 {
 	struct platform_device *pdev;
 	struct device_node *np;
@@ -192,88 +182,6 @@ static __init int exynos_pm_dt_parse_domains(void)
 
 	return 0;
 }
-
-static __init __maybe_unused void exynos_pm_add_dev_to_genpd(struct platform_device *pdev,
-						struct exynos_pm_domain *pd)
-{
-	if (pdev->dev.bus) {
-		if (!pm_genpd_add_device(&pd->pd, &pdev->dev))
-			pm_genpd_dev_need_restore(&pdev->dev, true);
-		else
-			pr_info("%s: error in adding %s device to %s power"
-				"domain\n", __func__, dev_name(&pdev->dev),
-				pd->name);
-	}
-}
-
-EXYNOS_GPD(exynos4_pd_mfc, S5P_PMU_MFC_CONF, "pd-mfc");
-EXYNOS_GPD(exynos4_pd_g3d, S5P_PMU_G3D_CONF, "pd-g3d");
-EXYNOS_GPD(exynos4_pd_lcd0, S5P_PMU_LCD0_CONF, "pd-lcd0");
-EXYNOS_GPD(exynos4_pd_lcd1, S5P_PMU_LCD1_CONF, "pd-lcd1");
-EXYNOS_GPD(exynos4_pd_tv, S5P_PMU_TV_CONF, "pd-tv");
-EXYNOS_GPD(exynos4_pd_cam, S5P_PMU_CAM_CONF, "pd-cam");
-EXYNOS_GPD(exynos4_pd_gps, S5P_PMU_GPS_CONF, "pd-gps");
-
-static struct exynos_pm_domain *exynos4_pm_domains[] = {
-	&exynos4_pd_mfc,
-	&exynos4_pd_g3d,
-	&exynos4_pd_lcd0,
-	&exynos4_pd_lcd1,
-	&exynos4_pd_tv,
-	&exynos4_pd_cam,
-	&exynos4_pd_gps,
-};
-
-static __init int exynos4_pm_init_power_domain(void)
-{
-	int idx;
-
-	if (of_have_populated_dt())
-		return exynos_pm_dt_parse_domains();
-
-	for (idx = 0; idx < ARRAY_SIZE(exynos4_pm_domains); idx++) {
-		struct exynos_pm_domain *pd = exynos4_pm_domains[idx];
-		int on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
-
-		pm_genpd_init(&pd->pd, NULL, !on);
-	}
-
-#ifdef CONFIG_S5P_DEV_FIMD0
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimd0, &exynos4_pd_lcd0);
-#endif
-#ifdef CONFIG_S5P_DEV_TV
-	exynos_pm_add_dev_to_genpd(&s5p_device_hdmi, &exynos4_pd_tv);
-	exynos_pm_add_dev_to_genpd(&s5p_device_mixer, &exynos4_pd_tv);
-#endif
-#ifdef CONFIG_S5P_DEV_MFC
-	exynos_pm_add_dev_to_genpd(&s5p_device_mfc, &exynos4_pd_mfc);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC0
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc0, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC1
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc1, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC2
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc2, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_FIMC3
-	exynos_pm_add_dev_to_genpd(&s5p_device_fimc3, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_CSIS0
-	exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis0, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_CSIS1
-	exynos_pm_add_dev_to_genpd(&s5p_device_mipi_csis1, &exynos4_pd_cam);
-#endif
-#ifdef CONFIG_S5P_DEV_G2D
-	exynos_pm_add_dev_to_genpd(&s5p_device_g2d, &exynos4_pd_lcd0);
-#endif
-#ifdef CONFIG_S5P_DEV_JPEG
-	exynos_pm_add_dev_to_genpd(&s5p_device_jpeg, &exynos4_pd_cam);
-#endif
-	return 0;
-}
 arch_initcall(exynos4_pm_init_power_domain);
 
 int __init exynos_pm_late_initcall(void)
-- 
1.8.2.1

  parent reply	other threads:[~2013-06-14 19:33 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14 19:32 [PATCH 00/28] Twenty eight patches big Exynos cleanup Tomasz Figa
2013-06-14 19:32 ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 02/28] ARM: EXYNOS: Make ARCH_EXYNOS select USE_OF Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 03/28] ARM: SAMSUNG: Introduce SAMSUNG_ATAGS Kconfig entry Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 04/28] ARM: EXYNOS: common: Remove legacy PMU initialization code Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 05/28] ARM: EXYNOS: common: Remove legacy EINT " Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 06/28] ARM: EXYNOS: common: Remove legacy UART " Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 07/28] ARM: EXYNOS: Remove legacy dev- and setup- files Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 08/28] ARM: EXYNOS: common: Remove legacy interrupt initialization code Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 09/28] ARM: EXYNOS: common: Remove legacy timer " Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 10/28] ARM: EXYNOS: common: Remove platform device initialization Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 11/28] ARM: EXYNOS: common: Remove legacy mapping of chip ID block Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 12/28] ARM: EXYNOS: firmware: Remove check for device tree presence Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` Tomasz Figa [this message]
2013-06-14 19:32   ` [PATCH 13/28] ARM: EXYNOS: pm_domains: Remove legacy power domain registration code Tomasz Figa
2013-06-14 19:32 ` [PATCH 14/28] ARM: SAMSUNG: Introduce GPIO_SAMSUNG Kconfig entry Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-17  9:22   ` Linus Walleij
2013-06-17  9:22     ` Linus Walleij
2013-06-14 19:32 ` [PATCH 15/28] ARM: EXYNOS: Provide compatibility stubs for PM code in pm-core.h header Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 16/28] ARM: SAMSUNG: Compile s5p-irq-pm only with ATAGS support Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 17/28] ARM: EXYNOS: Decouple ARCH_EXYNOS from PLAT_S5P Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-15  1:52   ` Kukjin Kim
2013-06-15  1:52     ` Kukjin Kim
2013-06-15 12:02     ` Tomasz Figa
2013-06-15 12:02       ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 18/28] ARM: SAMSUNG: pm: Include most of mach/ headers conditionally Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 19/28] ARM: EXYNOS: Do not select legacy Kconfig symbols any more Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 20/28] ARM: EXYNOS: Remove setup-i2c0.c Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-15  1:54   ` Kukjin Kim
2013-06-15  1:54     ` Kukjin Kim
2013-06-15 12:03     ` Tomasz Figa
2013-06-15 12:03       ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 21/28] ARM: EXYNOS: Remove mach/gpio.h Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 22/28] ARM: EXYNOS: Remove mach/regs-gpio.h header Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:32 ` [PATCH 23/28] ARM: SAMSUNG: Make legacy MFC support code depend on SAMSUNG_ATAGS Tomasz Figa
2013-06-14 19:32   ` Tomasz Figa
2013-06-14 19:33 ` [PATCH 24/28] ARM: EXYNOS: Select SPARSE_IRQ for Exynos Tomasz Figa
2013-06-14 19:33   ` Tomasz Figa
2013-06-14 19:33 ` [PATCH 25/28] ARM: EXYNOS: Remove mach/irqs.h header Tomasz Figa
2013-06-14 19:33   ` Tomasz Figa
2013-06-14 19:33 ` [PATCH 26/28] ARM: EXYNOS: Remove unused base addresses from mach/map.h header Tomasz Figa
2013-06-14 19:33   ` Tomasz Figa
2013-06-14 19:33 ` [PATCH 27/28] ARM: EXYNOS: Remove CONFIG_SOC_EXYNOS4412 Tomasz Figa
2013-06-14 19:33   ` Tomasz Figa
2013-06-15  2:15   ` Kukjin Kim
2013-06-15  2:15     ` Kukjin Kim
2013-06-15 12:11     ` Tomasz Figa
2013-06-15 12:11       ` Tomasz Figa
2013-06-15 14:06   ` Eduardo Valentin
2013-06-15 14:06     ` Eduardo Valentin
2013-06-15 14:06     ` Eduardo Valentin
2013-06-15 14:39     ` Tomasz Figa
2013-06-15 14:39       ` Tomasz Figa
2013-06-14 19:33 ` [PATCH 28/28] ARM: EXYNOS: Remove mach/regs-usb-phy.h header Tomasz Figa
2013-06-14 19:33   ` Tomasz Figa
2013-06-14 21:26 ` [PATCH 00/28] Twenty eight patches big Exynos cleanup Arnd Bergmann
2013-06-14 21:26   ` Arnd Bergmann
2013-06-14 21:47   ` Tomasz Figa
2013-06-14 21:47     ` Tomasz Figa
2013-06-15  2:20   ` Kukjin Kim
2013-06-15  2:20     ` Kukjin Kim
2013-06-14 22:40 ` Arnd Bergmann
2013-06-14 22:40   ` Arnd Bergmann
2013-06-15  2:30 ` Kukjin Kim
2013-06-15  2:30   ` Kukjin Kim
2013-06-15 12:19   ` Tomasz Figa
2013-06-15 12:19     ` Tomasz Figa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371238384-1504-14-git-send-email-t.figa@samsung.com \
    --to=t.figa@samsung.com \
    --cc=arnd@arndb.de \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=olof@lixom.net \
    --cc=rjw@sisk.pl \
    --cc=s.nawrocki@samsung.com \
    --cc=thomas.abraham@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.