From patchwork Sat Mar 9 20:23:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2242541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 0AD75DF2F2 for ; Sat, 9 Mar 2013 20:31:42 +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 1UEQMs-0005oE-MO; Sat, 09 Mar 2013 20:27:49 +0000 Received: from mail-wg0-f45.google.com ([74.125.82.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UEQJB-0004Sv-MM for linux-arm-kernel@lists.infradead.org; Sat, 09 Mar 2013 20:24:09 +0000 Received: by mail-wg0-f45.google.com with SMTP id dq12so3784548wgb.12 for ; Sat, 09 Mar 2013 12:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Af7STB5Ujcju+eW7+5M1ga0JPI6ax8WydhBHAgFp1io=; b=lNnIACE4Q445BQ3n6VjB0wjkWspjX0952ybKQlEn1Q/a6WCICd46EiHwC31xA+0LuL tq/PeI5o4rhV49vAeXVRg6uX9cjALj3eRUOj+MD3XMcVLElzVgtihqcMJRrwpOc6UCZf FhhNru6Jxv42SD4StBe+0t9k9JnoroiDZGtTDY4KER5RckOSUwVNRLYsVVIdrXXBv68/ xf9crFnm/tKx/K2Wk2YEhxiPQ/uRw77jMNmVh7PuGrny7EQq0tt+JAmP1hJ/YI03hzaJ Lx6MvUYz5tKBuCnfrbASSvjKbPap3Jk8catDQWWF602m5saBof/vA54yO7QNRwmsR64y Mw6g== X-Received: by 10.180.81.164 with SMTP id b4mr4858225wiy.34.1362860636433; Sat, 09 Mar 2013 12:23:56 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPS id ed6sm6858911wib.9.2013.03.09.12.23.54 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Mar 2013 12:23:55 -0800 (PST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 09/12] clocksource: samsung-time: Do not use static IRQ definition Date: Sat, 9 Mar 2013 21:23:18 +0100 Message-Id: <1362860601-18464-10-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1362860601-18464-1-git-send-email-tomasz.figa@gmail.com> References: <1362860601-18464-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130309_152358_241935_E81BDF5D X-CRM114-Status: GOOD ( 14.09 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.45 listed in list.dnswl.org] 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: ghcstop@gmail.com, Mark Rutland , Kukjin Kim , linux@arm.linux.org.uk, =?UTF-8?q?Heiko=20St=C3=BCbner?= , kwangwoo.lee@gmail.com, broonie@opensource.wolfsonmicro.com, mcuelenaere@gmail.com, Tomasz Figa , christer@weinigel.se, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, buserror@gmail.com, augulis.darius@gmail.com, jacmet@sunsite.dk, Sylwester Nawrocki , linux@simtec.co.uk, jekhor@gmail.com 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 As another step towards multiplatform support, this patch modifies the samsung-time clocksource driver and its users to pass timer IRQ numbers through the samsung_timer_variant structure. Signed-off-by: Tomasz Figa --- arch/arm/mach-exynos/mach-universal_c210.c | 4 ++++ arch/arm/mach-s3c24xx/common.c | 3 +++ arch/arm/mach-s3c64xx/common.c | 4 ++++ arch/arm/mach-s5p64x0/common.c | 4 ++++ arch/arm/mach-s5pc100/common.c | 4 ++++ arch/arm/mach-s5pv210/common.c | 4 ++++ drivers/clocksource/samsung-time.c | 2 +- include/clocksource/samsung-time.h | 4 ++++ 8 files changed, 28 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index 3ece9e0..4cfc57b 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c @@ -1091,6 +1091,10 @@ static struct platform_device *universal_devices[] __initdata = { static const struct samsung_timer_variant universal_timer_variant = { .reg_base = EXYNOS4_PA_TIMER, + .irqs = { + IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, + IRQ_TIMER3, IRQ_TIMER4 + }, .bits = 32, .prescale = 2, .divisor = 1, diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index 5f142b2..82b5acf 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -219,6 +219,9 @@ static void s3c24xx_default_idle(void) static const struct samsung_timer_variant s3c24xx_timer_variant = { .reg_base = S3C24XX_PA_TIMER, + .irqs = { + IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, IRQ_TIMER3, IRQ_TIMER4 + }, .bits = 16, .prescale = 25, .divisor = 2, diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index a4a370e..c2cbe84 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -151,6 +151,10 @@ static struct device s3c64xx_dev = { static const struct samsung_timer_variant s3c64xx_timer_variant = { .reg_base = S3C_PA_TIMER, + .irqs = { + IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, + IRQ_TIMER3, IRQ_TIMER4 + }, .bits = 32, .prescale = 2, .divisor = 1, diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index 407c5a7..510b972 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c @@ -159,6 +159,10 @@ static void s5p64x0_idle(void) static const struct samsung_timer_variant s5p64x0_timer_variant = { .reg_base = S5P_PA_TIMER, + .irqs = { + IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, + IRQ_TIMER3, IRQ_TIMER4 + }, .bits = 32, .prescale = 2, .divisor = 1, diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index 0df734a..079c257 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c @@ -134,6 +134,10 @@ static struct map_desc s5pc100_iodesc[] __initdata = { static const struct samsung_timer_variant s5pc100_timer_variant = { .reg_base = S5P_PA_TIMER, + .irqs = { + IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, + IRQ_TIMER3, IRQ_TIMER4 + }, .bits = 32, .prescale = 2, .divisor = 1, diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 42108ca..9549bb5 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c @@ -151,6 +151,10 @@ void s5pv210_restart(char mode, const char *cmd) static const struct samsung_timer_variant s5pv210_timer_variant = { .reg_base = S5P_PA_TIMER, + .irqs = { + IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, + IRQ_TIMER3, IRQ_TIMER4 + }, .bits = 32, .prescale = 2, .divisor = 1, diff --git a/drivers/clocksource/samsung-time.c b/drivers/clocksource/samsung-time.c index 31ae97b..336b3aa5 100644 --- a/drivers/clocksource/samsung-time.c +++ b/drivers/clocksource/samsung-time.c @@ -320,7 +320,7 @@ static void __init samsung_clockevent_init(void) time_event_device.cpumask = cpumask_of(0); clockevents_config_and_register(&time_event_device, clock_rate, 1, -1); - irq_number = timer_source.event_id + IRQ_TIMER0; + irq_number = timer_variant.irqs[timer_source.event_id]; setup_irq(irq_number, &samsung_clock_event_irq); } diff --git a/include/clocksource/samsung-time.h b/include/clocksource/samsung-time.h index 535a334..66de2b5 100644 --- a/include/clocksource/samsung-time.h +++ b/include/clocksource/samsung-time.h @@ -20,6 +20,8 @@ enum samsung_timer_mode { SAMSUNG_PWM2, SAMSUNG_PWM3, SAMSUNG_PWM4, + + SAMSUNG_PWM_NUM }; struct samsung_timer_source { @@ -30,12 +32,14 @@ struct samsung_timer_source { /** * struct samsung_timer_variant - SoC-specific parameters of Samsung PWM timers * @reg_base: physical base address of timer registers + * @irqs: interrupt numbers of all timers * @bits: bit width of time counters * @prescale: prescaler divisor * @divisor: main divisor */ struct samsung_timer_variant { unsigned long reg_base; + unsigned int irqs[SAMSUNG_PWM_NUM]; int bits; u16 prescale; u16 divisor;