From patchwork Wed Jun 5 21:18:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2674661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id AA145DF264 for ; Wed, 5 Jun 2013 21:21:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UkL7q-0005Lg-SC; Wed, 05 Jun 2013 21:20:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UkL7L-0007Ng-AF; Wed, 05 Jun 2013 21:19:39 +0000 Received: from mail-bk0-x235.google.com ([2a00:1450:4008:c01::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UkL6j-0007Fg-PF for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2013 21:19:07 +0000 Received: by mail-bk0-f53.google.com with SMTP id e11so598787bkh.26 for ; Wed, 05 Jun 2013 14:18:43 -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=ElIBaw9WeT2D45autWRbD7+4n4gcFVCQM1ln35zZV4I=; b=Gd0VvlqzIDRHYrEohLdV7Ag1GtNfaE6Z4vET6Jj7YRFGSr/i9qkcyRPOihcSciFsyo drmxZ4GXjAHyZLx3inVN4bAbuKvaaYiz75t/sg17tMNbXilcU6FH5xYTnrJ8CT9OwJdc ANTSWcJdK5yr0SXkhS+QA2cyhkov/0BCf4Y8xyw2VRTHtHyq4nHBuGSWAN9WJ6qLYToR 5U9jTaiwaQp85zEveNUrcKapN3xUkRAPQnmpHQD/Kzo1YLtQxF0IUEXnS0W59WoWFFYj 6P6NBRVd4doKvHOU3AafLnDKswK0++GXmtI+xpKw4FKMTLX0yvanD75QLQ3LoBJlhcip wWhg== X-Received: by 10.204.224.15 with SMTP id im15mr10322073bkb.120.1370467123102; Wed, 05 Jun 2013 14:18:43 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id iy11sm26540425bkb.11.2013.06.05.14.18.41 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Jun 2013 14:18:42 -0700 (PDT) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/15] ARM: SAMSUNG: Move all platforms to new clocksource driver Date: Wed, 5 Jun 2013 23:18:09 +0200 Message-Id: <1370467100-10820-5-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1370467100-10820-1-git-send-email-tomasz.figa@gmail.com> References: <1370467100-10820-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130605_171902_222175_FF160603 X-CRM114-Status: GOOD ( 15.34 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomasz.figa[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_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: linux-pwm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, =?UTF-8?q?Heiko=20St=C3=BCbner?= , Arnd Bergmann , Mark Brown , Tomasz Figa , thierry.reding@gmail.com, Thomas Abraham , Olof Johansson , Kukjin Kim , Sylwester Nawrocki 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 moves all Samsung platforms using PWM clocksource from legacy samsung-time to new samsung-pwm-timer driver. Signed-off-by: Tomasz Figa --- arch/arm/mach-s3c24xx/Kconfig | 12 ++++++------ arch/arm/mach-s3c24xx/common.c | 16 ++++++++++++++++ arch/arm/mach-s3c64xx/Kconfig | 4 ++-- arch/arm/mach-s3c64xx/common.c | 17 +++++++++++++++++ arch/arm/mach-s5p64x0/Kconfig | 4 ++-- arch/arm/mach-s5p64x0/common.c | 17 +++++++++++++++++ arch/arm/mach-s5pc100/Kconfig | 2 +- arch/arm/mach-s5pc100/common.c | 17 +++++++++++++++++ arch/arm/mach-s5pv210/Kconfig | 2 +- arch/arm/mach-s5pv210/common.c | 17 +++++++++++++++++ 10 files changed, 96 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig index 7ef7119..97a9b90 100644 --- a/arch/arm/mach-s3c24xx/Kconfig +++ b/arch/arm/mach-s3c24xx/Kconfig @@ -30,7 +30,7 @@ config CPU_S3C2410 select S3C2410_CLOCK select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ select S3C2410_PM if PM - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Support for S3C2410 and S3C2410A family from the S3C24XX line of Samsung Mobile CPUs. @@ -41,7 +41,7 @@ config CPU_S3C2412 select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line @@ -53,7 +53,7 @@ config CPU_S3C2416 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Support for the S3C2416 SoC from the S3C24XX line @@ -64,7 +64,7 @@ config CPU_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Support for S3C2440 Samsung Mobile CPU based systems. @@ -74,7 +74,7 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Support for S3C2442 Samsung Mobile CPU based systems. @@ -89,7 +89,7 @@ config CPU_S3C2443 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Support for the S3C2443 SoC from the S3C24XX line diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index e5e7d7d..457261c 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -245,6 +245,22 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) samsung_pwm_set_platdata(&s3c24xx_pwm_variant); } +void __init samsung_set_timer_source(unsigned int event, unsigned int source) +{ + s3c24xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; + s3c24xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); +} + +void __init samsung_timer_init(void) +{ + unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { + IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, IRQ_TIMER3, IRQ_TIMER4, + }; + + samsung_pwm_clocksource_init(S3C_VA_TIMER, + timer_irqs, &s3c24xx_pwm_variant); +} + /* Serial port registrations */ #define S3C2410_PA_UART0 (S3C24XX_PA_UART) diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 2057853..f78a6a0 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -17,13 +17,13 @@ config PLAT_S3C64XX # Configuration options for the S3C6410 CPU config CPU_S3C6400 - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM bool help Enable S3C6400 CPU support config CPU_S3C6410 - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM bool help Enable S3C6410 CPU support diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 5f3530e..add8451 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -157,6 +157,23 @@ static struct samsung_pwm_variant s3c64xx_pwm_variant = { .tclk_mask = (1 << 7) | (1 << 6) | (1 << 5), }; +void __init samsung_set_timer_source(unsigned int event, unsigned int source) +{ + s3c64xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; + s3c64xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); +} + +void __init samsung_timer_init(void) +{ + unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, + }; + + samsung_pwm_clocksource_init(S3C_VA_TIMER, + timer_irqs, &s3c64xx_pwm_variant); +} + /* read cpu identification code */ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig index 5a707bd..a39cd9e 100644 --- a/arch/arm/mach-s5p64x0/Kconfig +++ b/arch/arm/mach-s5p64x0/Kconfig @@ -11,14 +11,14 @@ config CPU_S5P6440 bool select S5P_SLEEP if PM select SAMSUNG_DMADEV - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM select SAMSUNG_WAKEMASK if PM help Enable S5P6440 CPU support config CPU_S5P6450 bool - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM select S5P_SLEEP if PM select SAMSUNG_DMADEV select SAMSUNG_WAKEMASK if PM diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index 50edd3c..5b1ce58 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c @@ -165,6 +165,23 @@ static struct samsung_pwm_variant s5p64x0_pwm_variant = { .tclk_mask = 0, }; +void __init samsung_set_timer_source(unsigned int event, unsigned int source) +{ + s5p64x0_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; + s5p64x0_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); +} + +void __init samsung_timer_init(void) +{ + unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, + }; + + samsung_pwm_clocksource_init(S3C_VA_TIMER, + timer_irqs, &s5p64x0_pwm_variant); +} + /* * s5p64x0_map_io * diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig index 2f456a4..2094a9b 100644 --- a/arch/arm/mach-s5pc100/Kconfig +++ b/arch/arm/mach-s5pc100/Kconfig @@ -11,7 +11,7 @@ config CPU_S5PC100 bool select S5P_EXT_INT select SAMSUNG_DMADEV - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Enable S5PC100 CPU support diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index e56a4d8..1db8356 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c @@ -140,6 +140,23 @@ static struct samsung_pwm_variant s5pc100_pwm_variant = { .tclk_mask = (1 << 5), }; +void __init samsung_set_timer_source(unsigned int event, unsigned int source) +{ + s5pc100_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; + s5pc100_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); +} + +void __init samsung_timer_init(void) +{ + unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, + }; + + samsung_pwm_clocksource_init(S3C_VA_TIMER, + timer_irqs, &s5pc100_pwm_variant); +} + /* * s5pc100_map_io * diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 0963283..07cdff7 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -15,7 +15,7 @@ config CPU_S5PV210 select S5P_PM if PM select S5P_SLEEP if PM select SAMSUNG_DMADEV - select SAMSUNG_HRT + select CLKSRC_SAMSUNG_PWM help Enable S5PV210 CPU support diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 4eba33d..d28affb 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c @@ -157,6 +157,23 @@ static struct samsung_pwm_variant s5pv210_pwm_variant = { .tclk_mask = (1 << 5), }; +void __init samsung_set_timer_source(unsigned int event, unsigned int source) +{ + s5pv210_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; + s5pv210_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); +} + +void __init samsung_timer_init(void) +{ + unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, + }; + + samsung_pwm_clocksource_init(S3C_VA_TIMER, + timer_irqs, &s5pv210_pwm_variant); +} + /* * s5pv210_map_io *