Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp515993img; Tue, 26 Feb 2019 04:11:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IaAVBIRDDYkrl+/jSDV6QWoenZVUTIaA3kQq8aEiycc1NT9OWTgJny/8RKNkD8zgSppvJKL X-Received: by 2002:a63:43:: with SMTP id 64mr23977628pga.64.1551183086583; Tue, 26 Feb 2019 04:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551183086; cv=none; d=google.com; s=arc-20160816; b=Ax+2tGseyJ0yZqD59uCY05BiGY7O7nnukotR7HVMrMHA/gaBgJ68e9BY+vEf8srOOg 9CGlf7/x2mz5JYeaYg+++u+0N87a86/ebB6Nlq1MHKIFmPA2ETT3itm/3IZFkea4DUYN 8MyWgA2bv/YNLdAMOcZjxJ5O64kSlCsmNsR8auIMdjR8I3hePMSiuNVck8CuMB+fCxYH 8iIEGpFc3tXu8Og2wt0igSWOntKgYP5yt/Q/LFijZedb3r+Qo9uWEx5gfNBuJEC85uvn +uFae/7vrXuRq104GnVcu9YxjXQbdi9SkCwW0AeeqMz92/VqlofiDJQ7dP+7brjR6FHP PMkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Mq3iJZVLpItIL4L4rsuKEvbRZu3sCHkA9qXDRFfgXBE=; b=wz19I3Rnf0AO8mOq+rDe5VL2ELDYxVtNB00FPzOlXxk6OW6UBv68RPP1W2wKpN6g7f eA5dgmgBW0+yhhWIZB94G+SiDCv4QjjQK+2as7yBihVEoLB0BfgmMOmakdXA/F2rjBao DFHOJZeMbmMt0TT05j3jcEAnyWpbc21k1sKc7Jm4pDW3JbVZZSklPX2JEw/vVmIBxw57 rb3jFGWhINRpOeGKgu2CPT1UCM75XlHhZIl0dFkzHiAzKoDXDhIjnd9ZfOIznKYl1nN1 pPs/fJXVLbdoH8zFAw/VuERw884Ggi42iKk0AKYOyy0i8y2O0nPjj9UvpTys5mMkkLe1 BntQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=Yg55H5xx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si12192933pfi.125.2019.02.26.04.11.11; Tue, 26 Feb 2019 04:11:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=Yg55H5xx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727505AbfBZMIy (ORCPT + 99 others); Tue, 26 Feb 2019 07:08:54 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55737 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727657AbfBZMHi (ORCPT ); Tue, 26 Feb 2019 07:07:38 -0500 Received: by mail-wm1-f67.google.com with SMTP id q187so2140882wme.5 for ; Tue, 26 Feb 2019 04:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mq3iJZVLpItIL4L4rsuKEvbRZu3sCHkA9qXDRFfgXBE=; b=Yg55H5xx5YhjgY3MfNPO+LrSNNTTZe9spRoCWEuDDgCXcmCYPjbT0h3VGDjtat+iUG 4A5Cvw/bHkYhRHtER3sjJpxQZBZGZrFgIjjRhxx+r8Os+mUHvI4iH9WZ/A9xjCJaCv9d 8RG5z75917QcFe46Dbq8tvLKck2y9tt55AyErLSt8bb37h20e7xlSgf2DT+8z7Fl2hHs 86TiFkZhWOIHtmjL8YKjU1YJK1W1AK4CoYiEpTuBFBYhLbGwXLr/QYf1uZutP+pbzOkc fQp2jaQEdM/c81XSixW/0KxOb64dsefGr41o7STJc88syVwtBPX1wLy5zSbRe1q64whr 0kUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mq3iJZVLpItIL4L4rsuKEvbRZu3sCHkA9qXDRFfgXBE=; b=elkapsuGBU+hLujZe+n5/BdfZ8cxj7riyPjPlPl0/ZAxzWuVOebJ9x256LlpPRbAZH Tp2ob5ahnC3H4FivT7zTGer0IVD9FFx/m5oh0IxuQwgJ9hR+/+p4fgbM8fA+11467afE +2ayIVKjNQGwoUqjjXeeZYrfuMFuTpb1zcMWQqY64Ric6ZG0syDsIV6T6vK0rf3Jf3gz Dl1XxWg1aqTgj2B2wJQR7lqviwftZBdNC+3U+G5LnR74edYJh0ZLQ+yKt9dNkCB1acT3 6TdM8MZ4sL97xhjChp3cLg/nZxqOKG5AcKSoV7mwA1c4ZDvN9E7TEb/M6qdA5PomFmCq eNuQ== X-Gm-Message-State: AHQUAub1MXy3uq8NJWO7GuDaoKLARlksciNqCYMQQ1I/0EQjkIJ+dTsC MbDC2uWBHb/DvlZrBIvxbi7xP2jYOKM= X-Received: by 2002:a1c:a98b:: with SMTP id s133mr2291528wme.129.1551182856266; Tue, 26 Feb 2019 04:07:36 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id a8sm12642158wmh.26.2019.02.26.04.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 04:07:35 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Daniel Lezcano , Thomas Gleixner , David Lechner Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v3 05/11] ARM: davinci: da830: switch to using the clocksource driver Date: Tue, 26 Feb 2019 13:06:27 +0100 Message-Id: <20190226120633.18200-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190226120633.18200-1-brgl@bgdev.pl> References: <20190226120633.18200-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski We now have a proper clocksource driver for davinci. Switch the da830 platform to using it. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/da830.c | 36 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index d242ce06f7e5..1dd4c7273bd7 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -20,7 +20,8 @@ #include #include #include -#include + +#include #include "irqs.h" #include "mux.h" @@ -675,32 +676,18 @@ int __init da830_register_gpio(void) return da8xx_register_gpio(&da830_gpio_platform_data); } -static struct davinci_timer_instance da830_timer_instance[2] = { - { - .base = DA8XX_TIMER64P0_BASE, - .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0), - .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_0), - .cmp_off = DA830_CMP12_0, - .cmp_irq = DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_0), - }, - { - .base = DA8XX_TIMER64P1_BASE, - .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_1), - .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_1), - .cmp_off = DA830_CMP12_0, - .cmp_irq = DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_1), - }, -}; - /* * T0_BOT: Timer 0, bottom : Used for clock_event & clocksource * T0_TOP: Timer 0, top : Used by DSP * T1_BOT, T1_TOP: Timer 1, bottom & top: Used for watchdog timer */ -static struct davinci_timer_info da830_timer_info = { - .timers = da830_timer_instance, - .clockevent_id = T0_BOT, - .clocksource_id = T0_BOT, +static const struct davinci_timer_cfg da830_timer_cfg = { + .reg = DEFINE_RES_IO(DA8XX_TIMER64P0_BASE, SZ_4K), + .irq = { + DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_0)), + DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0)), + }, + .cmp_off = DA830_CMP12_0, }; static const struct davinci_soc_info davinci_soc_info_da830 = { @@ -712,7 +699,6 @@ static const struct davinci_soc_info davinci_soc_info_da830 = { .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120, .pinmux_pins = da830_pins, .pinmux_pins_num = ARRAY_SIZE(da830_pins), - .timer_info = &da830_timer_info, .emac_pdata = &da8xx_emac_pdata, }; @@ -742,6 +728,7 @@ void __init da830_init_time(void) { void __iomem *pll; struct clk *clk; + int rv; clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA830_REF_FREQ); @@ -755,7 +742,8 @@ void __init da830_init_time(void) return; } - davinci_timer_init(clk); + rv = davinci_timer_register(clk, &da830_timer_cfg); + WARN(rv, "Unable to register the timer: %d\n", rv); } static struct resource da830_psc0_resources[] = { -- 2.20.1