From patchwork Thu Mar 14 06:02:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2267831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E17C93FCF6 for ; Thu, 14 Mar 2013 06:09:14 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UG1JC-0002JJ-Cx; Thu, 14 Mar 2013 06:06:34 +0000 Received: from mail-ia0-x22d.google.com ([2607:f8b0:4001:c02::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UG1G8-0000Es-J7 for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2013 06:03:25 +0000 Received: by mail-ia0-f173.google.com with SMTP id h37so1749788iak.18 for ; Wed, 13 Mar 2013 23:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=g7Toclt1/5K/oiUy7JI3crnP5EDc1usgg13hufwvxRI=; b=eGeBfeBNLZklJJ8z0qT9dqQjC22xwhiLAGfq6+7rLt1Mwv79LJY7MjRZaVldrE4hew N3EQ9vaR2F3cTb3AcLa3Cj6uATn/NQsP7PDBspeChVdw8n/EZDmPBPS5Qf0QAAmfFxiG hxZo/gKzvAoxA2sIXdyhXXVFXsfnOH6XhnN534VZ+yyTXIJGLHKVDr0NyDrKnhXy8oJT 5K+aykiBKkW6fx6Wg4lZi6fGUs3kBg5TZBDov+ntgQZSVStX47T81Jy6vB3OZcGlaJbQ 18rN3zExfgqk+bwD8kn0pB1NXW5wfGFfm+SmEru8EHZ3iladz2BSR2cnzK+XKDuBXmcP QP0g== X-Received: by 10.50.46.133 with SMTP id v5mr18728591igm.94.1363241002792; Wed, 13 Mar 2013 23:03:22 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qn10sm6685977igc.6.2013.03.13.23.03.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 13 Mar 2013 23:03:21 -0700 (PDT) From: Amit Daniel Kachhap To: linux-samsung-soc@vger.kernel.org, Kukjin Kim Subject: [PATCH 2/3] ARM: SAMSUNG: Add SAMSUNG_PM config option to select pm Date: Thu, 14 Mar 2013 11:32:58 +0530 Message-Id: <1363240979-1939-3-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1363240979-1939-1-git-send-email-amit.daniel@samsung.com> References: <1363240979-1939-1-git-send-email-amit.daniel@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130314_020324_722368_89C3C01C X-CRM114-Status: GOOD ( 20.08 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (amitdanielk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Abhilash Kesavan , Thomas Abraham , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch enables the selection of samsung pm related stuffs when SAMSUNG_PM config is enabled and not just when generic PM config is enabled. Power management for s3c64XX and s3c24XX is enabled by default and for other platform depends on S5P_PM. This patch also fixes the following compilation error's when compiling a platform like exynos5440 which does not select pm stuffs. arch/arm/mach-exynos/built-in.o: In function `__virt_to_phys': linux/arch/arm/include/asm/memory.h:175: undefined reference to `s3c_cpu_resume' linux/arch/arm/include/asm/memory.h:175: undefined reference to `s3c_cpu_resume' linux/arch/arm/include/asm/memory.h:175: undefined reference to `s3c_cpu_resume' linux/arch/arm/include/asm/memory.h:175: undefined reference to `s3c_cpu_resume' arch/arm/mach-exynos/built-in.o: In function `exynos5_init_irq': linux/arch/arm/mach-exynos/common.c:492: undefined reference to `s3c_irq_wake' linux/arch/arm/mach-exynos/common.c:492: undefined reference to `s3c_irq_wake' arch/arm/mach-exynos/built-in.o: In function `exynos4_init_irq': linux/arch/arm/mach-exynos/common.c:476: undefined reference to `s3c_irq_wake' linux/arch/arm/mach-exynos/common.c:476: undefined reference to `s3c_irq_wake' arch/arm/plat-samsung/built-in.o: In function `s3c_irqext_wake': linux/arch/arm/plat-samsung/pm.c:144: undefined reference to `s3c_irqwake_eintallow' linux/arch/arm/plat-samsung/pm.c:144: undefined reference to `s3c_irqwake_eintallow' arch/arm/plat-samsung/built-in.o: In function `s3c_pm_enter': linux/arch/arm/plat-samsung/pm.c:263: undefined reference to `s3c_irqwake_intallow' linux/arch/arm/plat-samsung/pm.c:263: undefined reference to `s3c_irqwake_intallow' linux/arch/arm/plat-samsung/pm.c:264: undefined reference to `s3c_irqwake_eintallow' linux/arch/arm/plat-samsung/pm.c:264: undefined reference to `s3c_irqwake_eintallow' linux/arch/arm/plat-samsung/pm.c:275: undefined reference to `s3c_pm_save_core' linux/arch/arm/plat-samsung/pm.c:279: undefined reference to `s3c_pm_configure_extint' linux/arch/arm/plat-samsung/pm.c:310: undefined reference to `s3c_pm_restore_core' make: *** [vmlinux] Error 1 Signed-off-by: Amit Daniel Kachhap --- arch/arm/mach-exynos/Makefile | 2 +- arch/arm/mach-exynos/common.c | 2 +- arch/arm/mach-exynos/common.h | 1 - arch/arm/mach-exynos/cpuidle.c | 1 + arch/arm/plat-samsung/Kconfig | 7 +++++++ arch/arm/plat-samsung/Makefile | 3 +-- arch/arm/plat-samsung/include/plat/pm.h | 8 ++++---- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index b09b027..2a431fc 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile @@ -14,7 +14,7 @@ obj- := obj-$(CONFIG_ARCH_EXYNOS) += common.o -obj-$(CONFIG_PM) += pm.o +obj-$(CONFIG_S5P_PM) += pm.o obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 5b3c2b2..5e3ccda 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -764,7 +764,7 @@ static struct irq_chip exynos_irq_eint = { .irq_mask_ack = exynos_irq_eint_maskack, .irq_ack = exynos_irq_eint_ack, .irq_set_type = exynos_irq_eint_set_type, -#ifdef CONFIG_PM +#ifdef CONFIG_S5P_PM .irq_set_wake = s3c_irqext_wake, #endif }; diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index fcfc64c..c6062dd 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -95,6 +95,5 @@ struct exynos_pmu_conf { }; extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); -extern void s3c_cpu_resume(void); #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 6929c77..4fc1f4f 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -25,6 +25,7 @@ #include #include +#include #include "common.h" diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 6cb19c6..66427af 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -31,6 +31,13 @@ config PLAT_S5P help Base platform code for Samsung's S5P series SoC. +config SAMSUNG_PM + bool + depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || S5P_PM) + default y + help + Base platform power management code for samsung code + if PLAT_SAMSUNG # boot configurations diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index a23c460..1c406b3 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -51,8 +51,7 @@ obj-$(CONFIG_SAMSUNG_DMADEV) += dma-ops.o # PM support -obj-$(CONFIG_PM) += pm.o -obj-$(CONFIG_PM) += pm-gpio.o +obj-$(CONFIG_SAMSUNG_PM) += pm.o pm-gpio.o obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h index f6fcade..46e2c82 100644 --- a/arch/arm/plat-samsung/include/plat/pm.h +++ b/arch/arm/plat-samsung/include/plat/pm.h @@ -19,7 +19,7 @@ struct device; -#ifdef CONFIG_PM +#ifdef CONFIG_SAMSUNG_PM extern __init int s3c_pm_init(void); extern __init int s3c64xx_pm_init(void); @@ -58,8 +58,6 @@ extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */ /* from sleep.S */ -extern void s3c_cpu_resume(void); - extern int s3c2410_cpu_suspend(unsigned long); /* sleep save info */ @@ -106,12 +104,14 @@ extern void s3c_pm_do_save(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); -#ifdef CONFIG_PM +#ifdef CONFIG_SAMSUNG_PM extern int s3c_irq_wake(struct irq_data *data, unsigned int state); extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); +extern void s3c_cpu_resume(void); #else #define s3c_irq_wake NULL #define s3c_irqext_wake NULL +#define s3c_cpu_resume NULL #endif /* PM debug functions */