From patchwork Sat Jul 20 00:04:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2830732 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3F5549F3EB for ; Sat, 20 Jul 2013 00:05:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C017201C6 for ; Sat, 20 Jul 2013 00:05:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 242A7201DF for ; Sat, 20 Jul 2013 00:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642Ab3GTAFH (ORCPT ); Fri, 19 Jul 2013 20:05:07 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:37202 "EHLO mail-ee0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956Ab3GTAFG (ORCPT ); Fri, 19 Jul 2013 20:05:06 -0400 Received: by mail-ee0-f48.google.com with SMTP id b47so2624888eek.21 for ; Fri, 19 Jul 2013 17:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=kizIstdkImkZsBPsFUattgo77I8i53SBzmJ27zj4BKQ=; b=YVlXBiefxQsRSo4Zgxat7zjKXKxriTbSIk7o3COMS4pJxOdtQgXMXJTvbKkP9vir+T 7Cn/OF/j6aqZV6x/wM6hAr4uX9675Q5TOpBCvCUoyg7DjKhqlaP/cg2D6XL6xfmnNh9O NpRrjvtJqPwpj2nr0eV+NXl82f6eSM8lx606dzEuGusDjCXzaY0sbi+LF6YpcafIT42U vV+kqi7aMDVM+9lxSUzgfiJtZ2ZRWzF8ScwmIqGjXnRzbIl5BAvDZxNyAMN3/5wFUNWB NbpUHcuBez5ZKB5HUohOvuCVtm3wHsRmFVvVcLFTyEe1LCp4TG9YB0t2lvF2DvpxsVlw OqsQ== X-Received: by 10.14.87.4 with SMTP id x4mr17728493eee.121.1374278704796; Fri, 19 Jul 2013 17:05:04 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id bj46sm31186249eeb.13.2013.07.19.17.05.02 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Jul 2013 17:05:03 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, Kukjin Kim , Arnd Bergmann , Olof Johansson , Sylwester Nawrocki , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Mark Brown , Thierry Reding , Tomasz Figa , Kyungmin Park Subject: [PATCH v4 08/20] ARM: SAMSUNG: Set PWM platform data Date: Sat, 20 Jul 2013 02:04:21 +0200 Message-Id: <1374278673-25615-10-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1374278673-25615-1-git-send-email-tomasz.figa@gmail.com> References: <1374278673-25615-1-git-send-email-tomasz.figa@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Tomasz Figa 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-s3c24xx/common.c | 11 +++++++++++ arch/arm/mach-s3c64xx/common.c | 11 +++++++++++ arch/arm/mach-s5p64x0/common.c | 10 ++++++++++ arch/arm/mach-s5pc100/common.c | 11 +++++++++++ arch/arm/mach-s5pv210/common.c | 11 +++++++++++ 5 files changed, 54 insertions(+) diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index c157103..e5e7d7d 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 @@ -49,6 +50,7 @@ #include #include #include +#include #include "common.h" @@ -216,6 +218,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 +241,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_pwm_set_platdata(&s3c24xx_pwm_variant); } /* Serial port registrations */ diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 3f62e46..ca05e61 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -43,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -149,6 +151,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) @@ -161,6 +170,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_pwm_set_platdata(&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 dfdfdc3..49687f2 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 @@ -47,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -157,6 +159,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 * @@ -176,6 +185,7 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size) s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); samsung_wdt_reset_init(S3C_VA_WATCHDOG); + samsung_pwm_set_platdata(&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 4bdfecf..e0600af 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 #include @@ -46,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -132,6 +134,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 * @@ -149,6 +158,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_pwm_set_platdata(&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 023f1a7..306b29a 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 @@ -42,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -148,6 +150,13 @@ void s5pv210_restart(enum reboot_mode 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 +174,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_pwm_set_platdata(&s5pv210_pwm_variant); } void __init s5pv210_map_io(void)