From patchwork Fri Apr 12 19:17:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2437561 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 82221DF2A1 for ; Fri, 12 Apr 2013 19:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754878Ab3DLTSj (ORCPT ); Fri, 12 Apr 2013 15:18:39 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:37923 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752571Ab3DLTSh (ORCPT ); Fri, 12 Apr 2013 15:18:37 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ML500EWSPN073R0@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Sat, 13 Apr 2013 04:18:36 +0900 (KST) X-AuditID: cbfee61b-b7f076d0000034b6-dd-51685e0ce7d1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id DF.8C.13494.C0E58615; Sat, 13 Apr 2013 04:18:36 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0ML500CT6PL8T090@mmp2.samsung.com>; Sat, 13 Apr 2013 04:18:36 +0900 (KST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Cc: devicetree-discuss@lists.ozlabs.org, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, kyungmin.park@samsung.com, linux@simtec.co.uk, broonie@opensource.wolfsonmicro.com, kwangwoo.lee@gmail.com, jacmet@sunsite.dk, augulis.darius@gmail.com, mcuelenaere@gmail.com, linux@arm.linux.org.uk, sylvester.nawrocki@gmail.com, buserror@gmail.com, christer@weinigel.se, jekhor@gmail.com, ghcstop@gmail.com, mark.rutland@arm.com, tomasz.figa@gmail.com, heiko@sntech.de, robherring2@gmail.com, m.szyprowski@samsung.com, arnd@arndb.de, john.stultz@linaro.org, tglx@linutronix.de, Tomasz Figa Subject: [PATCH v5 06/14] ARM: SAMSUNG: Set PWM platform data Date: Fri, 12 Apr 2013 21:17:22 +0200 Message-id: <1365794250-14436-7-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1365794250-14436-1-git-send-email-t.figa@samsung.com> References: <1365794250-14436-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jQV2euIxAg7Pb5Sz+TjrGbrH37T9G i3+zT7FZ3Pr8iN1i48qPbBYHZj9ktTjaY2fx/9FrVovTl64xWhxct5TV4sxvXYveBVfZLFZs vcBicbbpDbvFpsfXWC1mnN/HZHH7Mq/F722NLBZrj9xlt1h6/SKTxaV5TSwW3799Y7OY93kn k8X6Ga9ZLDZvmspssWrXH0YHKY8189YwerQ097B5/P41idFj56y77B53ru1h83h37hy7x+Yl 9R7nZyxk9Hg58TebR9+WVYwe599MZfHYfm0es8e01+fZPD5vkvN4fWM2YwB/FJdNSmpOZllq kb5dAlfGg2mtzAW3TCrOr7rC2sC4S6eLkZNDQsBE4sbqCewQtpjEhXvr2boYuTiEBKYzStw5 eIQFwuliklj0sY8VpIpNQE3ic8MjNhBbREBDYkrXY3aQImaBTywSG/9NAUsIC9hKND9Yywxi swioSuy41MwCYvMKOEns6jrDCrFOXuLp/T6wek4BZ4nJd5+B2UJANf0b+xknMPIuYGRYxSia WpBcUJyUnmukV5yYW1yal66XnJ+7iREcc8+kdzCuarA4xCjAwajEw5shlREoxJpYVlyZe4hR goNZSYQ3Zm9aoBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeg63WgUIC6YklqdmpqQWpRTBZJg5O qQbG5W5CQc1BpjaPzk2dkHNzziopNiMf+Wv7X6aXNle+1Tr1KW6aV3H2xkTj2Hu9hy4oF3rY rZLJvfJQ5vbzq83p7ntWZIaU33U5ob2s3k318yvXlZE3+nRe+u/UuOblPpOLXzmuMfiv3NWl Ek2aAh/mz5lfIW2sYtGlajaJ7d6O7NKAXYnyPT+VWIozEg21mIuKEwG9lP9PtQIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch adds PWM platform data needed for legacy (non-DT) platforms to handle SoC-specific bits of the PWM/timer block. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park --- arch/arm/mach-exynos/common.c | 10 ++++++++++ arch/arm/mach-s3c24xx/common.c | 10 ++++++++++ arch/arm/mach-s3c64xx/common.c | 10 ++++++++++ arch/arm/mach-s5p64x0/common.c | 10 ++++++++++ arch/arm/mach-s5pc100/common.c | 10 ++++++++++ arch/arm/mach-s5pv210/common.c | 10 ++++++++++ 6 files changed, 60 insertions(+) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index a8570bf..b65229d 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -378,6 +379,13 @@ void __init exynos_init_io(struct map_desc *mach_desc, int size) s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); } +static struct samsung_pwm_variant exynos4_pwm_variant = { + .bits = 32, + .div_base = 0, + .has_tint_cstat = true, + .tclk_mask = (1 << 5), +}; + static void __init exynos4_map_io(void) { iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc)); @@ -419,6 +427,8 @@ static void __init exynos4_map_io(void) s5p_hdmi_setname("exynos4-hdmi"); s3c64xx_spi_setname("exynos4210-spi"); + + samsung_device_pwm.dev.platform_data = &exynos4_pwm_variant; } static void __init exynos5_map_io(void) diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index d97533d..a01cccb 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -216,6 +217,13 @@ static void s3c24xx_default_idle(void) S3C2410_CLKCON); } +static struct samsung_pwm_variant s3c24xx_pwm_variant = { + .bits = 16, + .div_base = 1, + .has_tint_cstat = false, + .tclk_mask = (1 << 4), +}; + void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) { arm_pm_idle = s3c24xx_default_idle; @@ -232,6 +240,8 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) s3c24xx_init_cpu(); s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); + + samsung_device_pwm.dev.platform_data = &s3c24xx_pwm_variant; } /* Serial port registrations */ diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 0b9c0ba..89d2823 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -148,6 +149,13 @@ static struct device s3c64xx_dev = { .bus = &s3c64xx_subsys, }; +static struct samsung_pwm_variant s3c64xx_pwm_variant = { + .bits = 32, + .div_base = 0, + .has_tint_cstat = true, + .tclk_mask = (1 << 7) | (1 << 6) | (1 << 5), +}; + /* read cpu identification code */ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) @@ -160,6 +168,8 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) s3c64xx_init_cpu(); s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); + + samsung_device_pwm.dev.platform_data = &s3c64xx_pwm_variant; } static __init int s3c64xx_dev_init(void) diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index 8ae5800..cef1d3a 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -156,6 +157,13 @@ static void s5p64x0_idle(void) cpu_do_idle(); } +static struct samsung_pwm_variant s5p64x0_pwm_variant = { + .bits = 32, + .div_base = 0, + .has_tint_cstat = true, + .tclk_mask = 0, +}; + /* * s5p64x0_map_io * @@ -173,6 +181,8 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size) s5p_init_cpu(S5P64X0_SYS_ID); s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); + + samsung_device_pwm.dev.platform_data = &s5p64x0_pwm_variant; } void __init s5p6440_map_io(void) diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index cc6e561..3ccbd43 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -131,6 +132,13 @@ static struct map_desc s5pc100_iodesc[] __initdata = { } }; +static struct samsung_pwm_variant s5pc100_pwm_variant = { + .bits = 32, + .div_base = 0, + .has_tint_cstat = true, + .tclk_mask = (1 << 5), +}; + /* * s5pc100_map_io * @@ -148,6 +156,8 @@ void __init s5pc100_init_io(struct map_desc *mach_desc, int size) s5p_init_cpu(S5P_VA_CHIPID); s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); + + samsung_device_pwm.dev.platform_data = &s5pc100_pwm_variant; } void __init s5pc100_map_io(void) diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 9dfe93e..bfd918f 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -148,6 +149,13 @@ void s5pv210_restart(char mode, const char *cmd) __raw_writel(0x1, S5P_SWRESET); } +static struct samsung_pwm_variant s5pv210_pwm_variant = { + .bits = 32, + .div_base = 0, + .has_tint_cstat = true, + .tclk_mask = (1 << 5), +}; + /* * s5pv210_map_io * @@ -165,6 +173,8 @@ void __init s5pv210_init_io(struct map_desc *mach_desc, int size) s5p_init_cpu(S5P_VA_CHIPID); s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); + + samsung_device_pwm.dev.platform_data = &s5pv210_pwm_variant; } void __init s5pv210_map_io(void)