From patchwork Thu May 9 11:10:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10936997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41E45924 for ; Thu, 9 May 2019 11:11:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2821E28B50 for ; Thu, 9 May 2019 11:11:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C16428A27; Thu, 9 May 2019 11:11:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DF22128A85 for ; Thu, 9 May 2019 11:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=w8ZHjPee7mRBkn4WXoDZk+Ya5o5tkRJ3BA55dQWr5VE=; b=ZDI4lRRUny82DTJdcGNv3TbsyW zPSy3G05FJM+QkC56yNyA+6PcEouJO9AcQFf76jnMJSThhkVJ3mQJSLLb65CarHVmWj5SRIn4kqKq LhI+Uz0xq8ryPKq3Y3RJNUc3tp45c99Z+IotsD9YXucqbO0NpBXrPpHv6gCbn/gCi9eybXdqqdwgL 1OcpPl82U3YT737c/borM+009Rh1d103YpIVfpjAVcBVA5NA8ZeZG/9QXZjq7CCDSELmUw72ucLT3 GQ+fLpW5hwb7MO8T7oVsvVXr9d+lVphhIrVl8SpQjX6oS1sOIFfly3x8bEUTS61p0Bs7+MuTHT/Gp K2ZYTGIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxd-0008EP-0N; Thu, 09 May 2019 11:11:37 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxY-0008Cz-V9 for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 11:11:34 +0000 Received: by mail-wr1-x444.google.com with SMTP id o4so2474065wra.3 for ; Thu, 09 May 2019 04:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=btyjrIBgvEiFaw+UeR2po3KmpV02gWF8Za6NMh5yZW4=; b=PWBiTlppp3qNKNSeeS/VbeyXHbeoNzIgZOkqg0QoiRFGQ/PoyWUhxKj3BLPDmz8W6Y JzXPTH5kOri0av4o3+l7pnSkszbh2LqCnIXf4oU7wWhWtha3iWEYL7mQP6CFGfFbTFGr KOuc7K4lgMulVZGUEawzuC5yZkFF4RwYXvm9sF2F08eXrBZgq9NOsUh0frqjNdNgmn9X OYWoNik+J4XJ2wimnmZN/CyFgZHo3ggmQHf9szz/AttkvE0AwkumSzIT5DMZ9lacacVu AGRDb0WGfRrkeIcK07euzHhF1/GjcTl/yHabhuTGJRx+PkjlxWuUAdoFN7KiZeFFph6z W3CQ== 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; bh=btyjrIBgvEiFaw+UeR2po3KmpV02gWF8Za6NMh5yZW4=; b=kqQM85R+SSmmDKQ0CSW2MXRANuK7+X0g/t1dpwHwD5+cX7YkQXVMWZdKNS5HkbG2Oz WVGUOryEepZwrCOqdPfIKB6jjnNs0XpzOKr0kdhHpC2oXsR+qpZFRcJm92aJ+XkzZrkf yQNtmlwVCjkICM5zXloh+6o4QiOcTmD3LTMOl8Sf8ntJyyg/MtTz/Rct71oKcUGCgHC7 8vKwjLvJkdZRU+mVF827wCE2jTiFkhYBNG2x3/Rb8VYYdQ5gJPxXDq8w/InxHH+LwcUm 7oBPDC2OZ2PkwbjyJMDtR4xtvr/iDVwOEvX4QiScoRFh/G2bBNGfT7HgO6NS4tI7mPY2 +dSw== X-Gm-Message-State: APjAAAXeSLoNqVmDf0Gw4qITiI40M0Slohhab3EimWaxcpzqQv8P/Zq/ PjivqqCtwZ6cGZCiDS4E8GKG1A== X-Google-Smtp-Source: APXvYqyRoSHdg558NkElF8rFinE7d1sCeJBjX1VLvJ9rN5APIFf6z35khSWZyITgkN0ZahCshSIy6g== X-Received: by 2002:a5d:4648:: with SMTP id j8mr2745726wrs.53.1557400287888; Thu, 09 May 2019 04:11:27 -0700 (PDT) Received: from mai.irit.fr ([141.115.39.235]) by smtp.gmail.com with ESMTPSA id z7sm2299778wme.26.2019.05.09.04.11.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 04:11:26 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 01/15] clocksource/drivers/sun4i: Add a compatible for suniv Date: Thu, 9 May 2019 13:10:34 +0200 Message-Id: <20190509111048.11151-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> References: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_041133_066933_8FA13EB0 X-CRM114-Status: GOOD ( 13.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mesih Kilinc , Maxime Ripard , Chen-Yu Tsai , linux-kernel@vger.kernel.org, "moderated list:ARM/Allwinner sunXi SoC support" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mesih Kilinc The suniv (new F-series) chip has a timer with less functionality than the A10 timer, e.g. it has only 3 channels. Add a new compatible for it. As we didn't use the extra channels on A10 either now, the code needn't to be changed. The suniv chip is based on ARM926EJ-S CPU, thus it has no architecture timer. Register sun4i_timer as sched_clock on it. Signed-off-by: Mesih Kilinc Acked-by: Maxime Ripard Acked-by: Daniel Lezcano Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-sun4i.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-sun4i.c b/drivers/clocksource/timer-sun4i.c index 6e0180aaf784..65f38f6ca714 100644 --- a/drivers/clocksource/timer-sun4i.c +++ b/drivers/clocksource/timer-sun4i.c @@ -186,7 +186,8 @@ static int __init sun4i_timer_init(struct device_node *node) */ if (of_machine_is_compatible("allwinner,sun4i-a10") || of_machine_is_compatible("allwinner,sun5i-a13") || - of_machine_is_compatible("allwinner,sun5i-a10s")) + of_machine_is_compatible("allwinner,sun5i-a10s") || + of_machine_is_compatible("allwinner,suniv-f1c100s")) sched_clock_register(sun4i_timer_sched_read, 32, timer_of_rate(&to)); @@ -218,3 +219,5 @@ static int __init sun4i_timer_init(struct device_node *node) } TIMER_OF_DECLARE(sun4i, "allwinner,sun4i-a10-timer", sun4i_timer_init); +TIMER_OF_DECLARE(suniv, "allwinner,suniv-f1c100s-timer", + sun4i_timer_init); From patchwork Thu May 9 11:10:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10937001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA49E13AD for ; Thu, 9 May 2019 11:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A43B228B55 for ; Thu, 9 May 2019 11:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A20DF28AF7; Thu, 9 May 2019 11:11:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F51728B53 for ; Thu, 9 May 2019 11:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dktn0bHVZo5wINSo7goYKkHZZ5hW2UzQ8w6rztC4RqE=; b=bWoOT8s0SEYHoW+NujKOumO/Xi w9L2HUFzFyKxTlMPNjyekCKTedhuYyKv3nGzE31317/kY2Pd462cTI/MayjmEiA9JFxhIJSA/GbUC eXwptbe/UvcK66X6yWEz8eR3YKdtpf9yIpv6SQBcoazk7H1Tb0QBTH3EyZTjgi3BvjjvpxWtc/fFT R0epWbcTi4j2zlb53isuDP6GdY68AFzFjlRGJDJ3x8x04PO8XKTF4bq0RVYGsKBn4qBWzLLBPVPn8 R8h1elEwZS0Lx/CfrTDFv5RKy9aT9fIRfG3g5RdrVD3WecVyvW0iuQUtJ39rLjQ6lDVl74n5wPUgu b20H2HCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxm-0008Pg-FR; Thu, 09 May 2019 11:11:46 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxd-0008EV-63 for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 11:11:40 +0000 Received: by mail-wr1-x444.google.com with SMTP id w8so39226wrl.6 for ; Thu, 09 May 2019 04:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OrI1DkG8hXh5qOzNYuZ9U1o4Js7uyFKM86UkARAQjFU=; b=dDaPI9k3tcMtll47Djpz/rdtUGEzwzvLyyL0l//cu8cVR2Rt99lGVVkca4bXCWy+bF 6cA0oko1TzN6KJydKoxqLaE6azX6lRuedbrSJPew3NWRjR7BLke3Fqi8giw2uDhne1qD qKVThZQ/j3dwNLYKXGIjM4SUk48jDT86z07FLXGIg3JuxV1uIUCtgXMDgPR09ZZMfZr+ TNHzhK3fyYN/vr3k/3/WP6pHTR+hO1AntaTqGiyZ0TU+Wlnzh8TPRxANcXf0ShFml+vx o70PgJlW2nxCNS2TKkr488HT9y5XauThy5EedX37kOz98RiqhvvRoUuaPW9l7sXT3Nbm Qhkg== 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; bh=OrI1DkG8hXh5qOzNYuZ9U1o4Js7uyFKM86UkARAQjFU=; b=WPdn5jVn2XXOkp1gaSK2OEEuS9VXQtgswyDBeKXjFIj3EPDPyh2H95twdRMwI2U32A /m8YEY86aG0sih9WtFnSVpLZTrn3Fxzk1wQhd4pEAUtY2mEn3LlP8jXvk/6idLJ3VlIp mTklM4CNNg+qmRBREy2gLUyiXbhZHPAZAChMI0eQhFbvhrWdqME6rQ1Dzv+RgN85I1+Q 1abUbKJrZdjaGD+dDId6Uyvf9kxM8Z2Y1FmopzsMiIvfckiohE0/TlghKEbxAqxskRlO pS3q6BrqFBmcdim5HieS+PZNk0hs/+5LxVPuof1UUtc9MJVmv68P/bmPSFpcnEUTny0c MY3Q== X-Gm-Message-State: APjAAAXDW5Mw5xngMiDON1sNS0C4jVxPSV08CILUpU54cKbIKQZfz4cV Yy4C+Qfxgw/KD29ukChGqKHjZQ== X-Google-Smtp-Source: APXvYqzkFCRg/4jV4ymjIhFIzAV05l1GgTMsLu+5AiktxlCAcReCeZs1b3mYSzdsAI2AeT9bdLmVAw== X-Received: by 2002:adf:9c87:: with SMTP id d7mr2643806wre.68.1557400295729; Thu, 09 May 2019 04:11:35 -0700 (PDT) Received: from mai.irit.fr ([141.115.39.235]) by smtp.gmail.com with ESMTPSA id z7sm2299778wme.26.2019.05.09.04.11.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 04:11:35 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 07/15] ARM: at91: move SoC specific definitions to SoC folder Date: Thu, 9 May 2019 13:10:40 +0200 Message-Id: <20190509111048.11151-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509111048.11151-1-daniel.lezcano@linaro.org> References: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> <20190509111048.11151-1-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_041137_346412_07A77D07 X-CRM114-Status: GOOD ( 14.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PWM SUBSYSTEM" , Alexandre Belloni , Arnd Bergmann , Greg Kroah-Hartman , "moderated list:ATM" , linux-kernel@vger.kernel.org, Ludovic Desroches , Thierry Reding , Chas Williams <3chas3@gmail.com>, "open list:ATM" , "moderated list:MICROCHIP TIMER COUNTER TC AND CLOCKSOURCE DR..." MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexandre Belloni Move linux/atmel_tc.h to the SoC specific folder include/soc/at91. Signed-off-by: Alexandre Belloni Acked-by: Thierry Reding Acked-by: Arnd Bergmann Signed-off-by: Daniel Lezcano --- drivers/clocksource/tcb_clksrc.c | 2 +- drivers/misc/atmel_tclib.c | 2 +- drivers/pwm/pwm-atmel-tcb.c | 2 +- include/{linux/atmel_tc.h => soc/at91/atmel_tcb.h} | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename include/{linux/atmel_tc.h => soc/at91/atmel_tcb.h} (99%) diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 43f4d5c4d6fa..138a12090149 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include /* diff --git a/drivers/misc/atmel_tclib.c b/drivers/misc/atmel_tclib.c index ac24a4bd63f7..194f774ab3a1 100644 --- a/drivers/misc/atmel_tclib.c +++ b/drivers/misc/atmel_tclib.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include /* * This is a thin library to solve the problem of how to portably allocate diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c index 0d0f8376bc35..7da1fdb4d269 100644 --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c @@ -17,10 +17,10 @@ #include #include #include -#include #include #include #include +#include #define NPWM 6 diff --git a/include/linux/atmel_tc.h b/include/soc/at91/atmel_tcb.h similarity index 99% rename from include/linux/atmel_tc.h rename to include/soc/at91/atmel_tcb.h index 468fdfa643f0..c3c7200ce151 100644 --- a/include/linux/atmel_tc.h +++ b/include/soc/at91/atmel_tcb.h @@ -7,8 +7,8 @@ * (at your option) any later version. */ -#ifndef ATMEL_TC_H -#define ATMEL_TC_H +#ifndef __SOC_ATMEL_TCB_H +#define __SOC_ATMEL_TCB_H #include #include From patchwork Thu May 9 11:10:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10937005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 411A713AD for ; Thu, 9 May 2019 11:12:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 297C1287E6 for ; Thu, 9 May 2019 11:12:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27716289BF; Thu, 9 May 2019 11:12:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C70D28A9C for ; Thu, 9 May 2019 11:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=PfWzmr39xQRCU8u3bffc9PfliIpcVLTQGyYZebwsNi8=; b=VKVPiqrqx0PTo8N96oA9g8d1c/ FeAyx5hqAaF2i1wngHWqFdt2/V10fcL4Suk6/IDsDx15cxhss5RAh3GFwjcNKth7jAzUkJ/m7V9KV 5OQJBXLalbdwAv2+6RtmsWYaTvjG9l8UqRTx4lBfa/paIg9z7wQ2FoCV+EiVyJdrcCBu5St75YyIS 16ZW9DehEBAXdwQir0P15+R+GH8Pzi2WhWCdEMa3OsOmhlKwSzt4exLV9KCH9fb8iMltsqeoY9Bte spEYSxx1zexD/SiPUHIjESwwhOGv6XhvynRlbwH/YkZxwaHjBYRQlfifySqKS29TmHNvXwe5j+qk4 /tv5CsrQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgy8-0000Uo-Ld; Thu, 09 May 2019 11:12:08 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxe-0008Ft-Vu for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 11:11:46 +0000 Received: by mail-wr1-x442.google.com with SMTP id c5so2427898wrs.11 for ; Thu, 09 May 2019 04:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bmjB3BHnekjxDNQPFJ4nw5UiA2KYqoVK/B7ROqlZgj4=; b=FIM0wqqC9vb6yllf2xV6CMWDAKauyBh4kfVZkhZh/5vsp4pY92k9c9dATliNsxMT31 +VR+Jx10oE1/jwJuV6UwW5HsHjxx4SN+2jE53jeGQIF4B3u2hSdbVVoiFejaew2vlYnH gt5MLztvIC1GOdmJ53wVLf3PPk0QVPcBHe6MuICKjnKSyDRc98GH3lRNPlKyyXWAFEOV zlcevWx2NXKT4F8L3NHKfrBVqk9rUDgzAWCN9iJKySopXXdyeXxTZfIfmiHfldk7MsCh f430QoUjCXEcbOi0SIZWEDXWsuD9vITW8Dv6w+zBemm0R29BWKeXwbG4aQjveJfquQk/ 5aeg== 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; bh=bmjB3BHnekjxDNQPFJ4nw5UiA2KYqoVK/B7ROqlZgj4=; b=m7kXiy8ofSJhvCSXNYZuCDgnvUyVzFX/j+3FAKOKFQYhHxnGU8PaLfgwO20bdFL2He 6cJ/Y4vgBxEhx3chrFBHfWKaY6Txm+tnLUZgR2dGkxtK89NAQBfGlXF783f74hw+skmZ 7TwQpUPGIOy/fRKsXCs7/fztZEDCyfE4N3INZWF/MNW6W5xcTuroJtLVNLswF0LpXnkx XhoSOVlbf8KibJKb05ah00stntb/b9cTX6Osa2ataVV31ywZpSq2sz+fk7CX3dpIECUL bp+myOTn949Y1bFYCh2M25GZlqoiMLN1gv5rsy7+gI2gyqtppFiUi+w+ChE3DGDw70fR VCMA== X-Gm-Message-State: APjAAAWQgHVFF2dZKTYmnGqbkPNqR4KYS2uaY2uxlQGo0QyCVrEQOnvj /Pb4OYNcWerf5msAWocCPsCeHQ== X-Google-Smtp-Source: APXvYqxLj5tt2/1wq0URNUB3A98KhTBLetp3g708tPUndgIYoMMlJ5Hlv5QnfU8b+GlSXAJ50rGxyw== X-Received: by 2002:adf:f487:: with SMTP id l7mr2700119wro.127.1557400297092; Thu, 09 May 2019 04:11:37 -0700 (PDT) Received: from mai.irit.fr ([141.115.39.235]) by smtp.gmail.com with ESMTPSA id z7sm2299778wme.26.2019.05.09.04.11.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 04:11:36 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 08/15] clocksource/drivers/tcb_clksrc: Stop depending on atmel_tclib Date: Thu, 9 May 2019 13:10:41 +0200 Message-Id: <20190509111048.11151-8-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509111048.11151-1-daniel.lezcano@linaro.org> References: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> <20190509111048.11151-1-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_041139_368672_B0F3AB63 X-CRM114-Status: GOOD ( 27.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, "moderated list:MICROCHIP TIMER COUNTER TC AND CLOCKSOURCE DR..." MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexandre Belloni atmel_tclib is probed too late in the boot process to be able to use the TCB as the boot clocksource. This is an issue for SoCs without the PIT (sams70, samv70 and samv71 families) as they simply currently can't boot. Get rid of the atmel_tclib dependency and probe everything on our own using the correct device tree binding. This also allows getting rid of ATMEL_TCB_CLKSRC_BLOCK and makes the driver a bit more flexible as the TCB is not hardcoded in the kernel anymore. Signed-off-by: Alexandre Belloni Signed-off-by: Daniel Lezcano --- drivers/clocksource/tcb_clksrc.c | 108 +++++++++++++++++++------------ drivers/misc/Kconfig | 14 +--- 2 files changed, 70 insertions(+), 52 deletions(-) diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 138a12090149..bf68504da94a 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include @@ -28,13 +29,6 @@ * source, used in either periodic or oneshot mode. This runs * at 32 KiHZ, and can handle delays of up to two seconds. * - * A boot clocksource and clockevent source are also currently needed, - * unless the relevant platforms (ARM/AT91, AVR32/AT32) are changed so - * this code can be used when init_timers() is called, well before most - * devices are set up. (Some low end AT91 parts, which can run uClinux, - * have only the timers in one TC block... they currently don't support - * the tclib code, because of that initialization issue.) - * * REVISIT behavior during system suspend states... we should disable * all clocks and save the power. Easily done for clockevent devices, * but clocksources won't necessarily get the needed notifications. @@ -112,7 +106,6 @@ void tc_clksrc_resume(struct clocksource *cs) } static struct clocksource clksrc = { - .name = "tcb_clksrc", .rating = 200, .read = tc_get_cycles, .mask = CLOCKSOURCE_MASK(32), @@ -214,7 +207,6 @@ static int tc_next_event(unsigned long delta, struct clock_event_device *d) static struct tc_clkevt_device clkevt = { .clkevt = { - .name = "tc_clkevt", .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, /* Should be lower than at91rm9200's system timer */ @@ -330,39 +322,73 @@ static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_id writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); } -static int __init tcb_clksrc_init(void) -{ - static char bootinfo[] __initdata - = KERN_DEBUG "%s: tc%d at %d.%03d MHz\n"; +static const u8 atmel_tcb_divisors[5] = { 2, 8, 32, 128, 0, }; + +static const struct of_device_id atmel_tcb_of_match[] = { + { .compatible = "atmel,at91rm9200-tcb", .data = (void *)16, }, + { .compatible = "atmel,at91sam9x5-tcb", .data = (void *)32, }, + { /* sentinel */ } +}; - struct platform_device *pdev; - struct atmel_tc *tc; +static int __init tcb_clksrc_init(struct device_node *node) +{ + struct atmel_tc tc; struct clk *t0_clk; + const struct of_device_id *match; u32 rate, divided_rate = 0; int best_divisor_idx = -1; int clk32k_divisor_idx = -1; + int bits; int i; int ret; - tc = atmel_tc_alloc(CONFIG_ATMEL_TCB_CLKSRC_BLOCK); - if (!tc) { - pr_debug("can't alloc TC for clocksource\n"); - return -ENODEV; + /* Protect against multiple calls */ + if (tcaddr) + return 0; + + tc.regs = of_iomap(node->parent, 0); + if (!tc.regs) + return -ENXIO; + + t0_clk = of_clk_get_by_name(node->parent, "t0_clk"); + if (IS_ERR(t0_clk)) + return PTR_ERR(t0_clk); + + tc.slow_clk = of_clk_get_by_name(node->parent, "slow_clk"); + if (IS_ERR(tc.slow_clk)) + return PTR_ERR(tc.slow_clk); + + tc.clk[0] = t0_clk; + tc.clk[1] = of_clk_get_by_name(node->parent, "t1_clk"); + if (IS_ERR(tc.clk[1])) + tc.clk[1] = t0_clk; + tc.clk[2] = of_clk_get_by_name(node->parent, "t2_clk"); + if (IS_ERR(tc.clk[2])) + tc.clk[2] = t0_clk; + + tc.irq[2] = of_irq_get(node->parent, 2); + if (tc.irq[2] <= 0) { + tc.irq[2] = of_irq_get(node->parent, 0); + if (tc.irq[2] <= 0) + return -EINVAL; } - tcaddr = tc->regs; - pdev = tc->pdev; - t0_clk = tc->clk[0]; + match = of_match_node(atmel_tcb_of_match, node->parent); + bits = (uintptr_t)match->data; + + for (i = 0; i < ARRAY_SIZE(tc.irq); i++) + writel(ATMEL_TC_ALL_IRQ, tc.regs + ATMEL_TC_REG(i, IDR)); + ret = clk_prepare_enable(t0_clk); if (ret) { pr_debug("can't enable T0 clk\n"); - goto err_free_tc; + return ret; } /* How fast will we be counting? Pick something over 5 MHz. */ rate = (u32) clk_get_rate(t0_clk); - for (i = 0; i < 5; i++) { - unsigned divisor = atmel_tc_divisors[i]; + for (i = 0; i < ARRAY_SIZE(atmel_tcb_divisors); i++) { + unsigned divisor = atmel_tcb_divisors[i]; unsigned tmp; /* remember 32 KiHz clock for later */ @@ -381,27 +407,29 @@ static int __init tcb_clksrc_init(void) best_divisor_idx = i; } - - printk(bootinfo, clksrc.name, CONFIG_ATMEL_TCB_CLKSRC_BLOCK, - divided_rate / 1000000, + clksrc.name = kbasename(node->parent->full_name); + clkevt.clkevt.name = kbasename(node->parent->full_name); + pr_debug("%s at %d.%03d MHz\n", clksrc.name, divided_rate / 1000000, ((divided_rate % 1000000) + 500) / 1000); - if (tc->tcb_config && tc->tcb_config->counter_width == 32) { + tcaddr = tc.regs; + + if (bits == 32) { /* use apropriate function to read 32 bit counter */ clksrc.read = tc_get_cycles32; /* setup ony channel 0 */ - tcb_setup_single_chan(tc, best_divisor_idx); + tcb_setup_single_chan(&tc, best_divisor_idx); } else { - /* tclib will give us three clocks no matter what the + /* we have three clocks no matter what the * underlying platform supports. */ - ret = clk_prepare_enable(tc->clk[1]); + ret = clk_prepare_enable(tc.clk[1]); if (ret) { pr_debug("can't enable T1 clk\n"); goto err_disable_t0; } /* setup both channel 0 & 1 */ - tcb_setup_dual_chan(tc, best_divisor_idx); + tcb_setup_dual_chan(&tc, best_divisor_idx); } /* and away we go! */ @@ -410,7 +438,7 @@ static int __init tcb_clksrc_init(void) goto err_disable_t1; /* channel 2: periodic and oneshot timer support */ - ret = setup_clkevents(tc, clk32k_divisor_idx); + ret = setup_clkevents(&tc, clk32k_divisor_idx); if (ret) goto err_unregister_clksrc; @@ -420,14 +448,14 @@ static int __init tcb_clksrc_init(void) clocksource_unregister(&clksrc); err_disable_t1: - if (!tc->tcb_config || tc->tcb_config->counter_width != 32) - clk_disable_unprepare(tc->clk[1]); + if (bits != 32) + clk_disable_unprepare(tc.clk[1]); err_disable_t0: clk_disable_unprepare(t0_clk); -err_free_tc: - atmel_tc_free(tc); + tcaddr = NULL; + return ret; } -arch_initcall(tcb_clksrc_init); +TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 42ab8ec92a04..268a01d3d6f3 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -61,7 +61,8 @@ config ATMEL_TCLIB config ATMEL_TCB_CLKSRC bool "TC Block Clocksource" - depends on ATMEL_TCLIB + depends on ARCH_AT91 + select TIMER_OF if OF default y help Select this to get a high precision clocksource based on a @@ -72,17 +73,6 @@ config ATMEL_TCB_CLKSRC may be used as a clock event device supporting oneshot mode (delays of up to two seconds) based on the 32 KiHz clock. -config ATMEL_TCB_CLKSRC_BLOCK - int - depends on ATMEL_TCB_CLKSRC - default 0 - range 0 1 - help - Some chips provide more than one TC block, so you have the - choice of which one to use for the clock framework. The other - TC can be used for other purposes, such as PWM generation and - interval timing. - config DUMMY_IRQ tristate "Dummy IRQ handler" default n From patchwork Thu May 9 11:10:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10937003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC782924 for ; Thu, 9 May 2019 11:12:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAA0528A9C for ; Thu, 9 May 2019 11:12:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8F2928ADD; Thu, 9 May 2019 11:12:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 704C928A9C for ; Thu, 9 May 2019 11:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TvarOjxQKctRaGrpuYXKFWe9dD+rv6RrzkkXFfGW210=; b=j4NM/YRzJDbITorWR3JkNL+7Bt TrhQQNAOxU268+6lSF/xZayJf5B5HJCrsTDqEK4xzESuLIq1g+eaeJbEpPbd6PHOT2VBQjUA0QkDu E7x67OP83hxS34rXQjWRnObxVRqpJGenvNdc9pOAbEd/vgjlbfoLUC/7LzUvMa0I74/5ULvlMm3R0 jUoiQP7o5gC/uI6SyjFZEfg/YygMzCKTr2LWR5cn/2uash+P51DXrDQd9O5CgVbWvQ4yhVfuSe+Aj 1siwym4d0W9lPUf1LmhfS/SKj80pzzOT3ICLO2Dc+tBI48iQCSb5AjKbjZozTLFHsSJea6hBgYElb wzD8YY4g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxz-0000Iu-Uq; Thu, 09 May 2019 11:11:59 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxg-0008HO-83 for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 11:11:46 +0000 Received: by mail-wr1-x441.google.com with SMTP id l2so2444873wrb.9 for ; Thu, 09 May 2019 04:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uXE39cHm/ePcze6cpMzENlQKnSZwc2KOJnys2n77A3I=; b=fBGeZQwyL/GXofUWkHPptZvFcDgg6iRQ++N6BG24UZql7XkRmLSIX4wGmFMKMv4h3k 4A2HvUQ0oG01QZkjGdkGZdsU8wVM0kW1i0xpcdINkL9OTkEysMjKwlfM2f2xjtVkJ5M1 vyIL7PeHONfja5TfFdesuMUyT5Gf9aeKARGKfnkaCoN040fl1ZhlP57jcMFhfjU1lU8A 8DOqB1GVLAYA02p2ACgceWtoWXflDkJ/sZTSCWrYUzESvuQDmtVOqvV5iH4SmGNIAhT2 zpUUUrjdvSIH3exFamyAB5SdEg0+58LvjhYcCwdzvOZ5jOglUzEGuFNYeKHgZtAecmBj t3ow== 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; bh=uXE39cHm/ePcze6cpMzENlQKnSZwc2KOJnys2n77A3I=; b=cppkU8VoHxx/xy2gEqz/RYnlaHXPeiHGFC3O3UrISLNnTzZi6evnqyNT3/FsVE679d 2TJNoHZAbOaMBuYomPKm1U5XGO7AwlFRWnfHIpYu4Y4j9IVZ3se/YQi2EwY/CMTCSEJc nBidN4ufx7hZDE3lBtOSh1J7/ke8mAxmq6AqBGS0n52XUNNvFdGrkvl4op/IAuCn7z1W P5X9qFv/adX9A4HW0sbDe2YkWhMbXLTKS3jS+3ga9xzBEnT8RZzqbBD5Rv0WUvITK0dF yXf/iXsDRsV0be4jAUrI4XLyz3AoffrOwUNkL9BPIvFv9Z1aNxt22CCjioU3Isd591mN wj7A== X-Gm-Message-State: APjAAAW6RRZAmQHhjuNzfc3+ZFlhCnPSOWX14voJR9JbQHA5xUO58S7u QeRD8kya26hvP1tZ/Jmv5FHyPQ== X-Google-Smtp-Source: APXvYqzUngphJjXPgwCdPMD+HnCjgeFAhWbgsnM6xO7Dgm9TJSdwV6DIRiqVuLArj7eqjF8ScYtSYw== X-Received: by 2002:a5d:518d:: with SMTP id k13mr889239wrv.285.1557400298313; Thu, 09 May 2019 04:11:38 -0700 (PDT) Received: from mai.irit.fr ([141.115.39.235]) by smtp.gmail.com with ESMTPSA id z7sm2299778wme.26.2019.05.09.04.11.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 04:11:37 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 09/15] clocksource/drivers/tcb_clksrc: Use tcb as sched_clock Date: Thu, 9 May 2019 13:10:42 +0200 Message-Id: <20190509111048.11151-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509111048.11151-1-daniel.lezcano@linaro.org> References: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> <20190509111048.11151-1-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_041140_589921_6926D327 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , linux-kernel@vger.kernel.org, "moderated list:MICROCHIP TIMER COUNTER TC AND CLOCKSOURCE DR..." MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexandre Belloni Now that the driver is registered early enough, use the TCB as the sched_clock which is much more accurate than the jiffies implementation. Signed-off-by: Alexandre Belloni Signed-off-by: Daniel Lezcano --- drivers/clocksource/tcb_clksrc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index bf68504da94a..9de8c10ab546 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -114,6 +115,16 @@ static struct clocksource clksrc = { .resume = tc_clksrc_resume, }; +static u64 notrace tc_sched_clock_read(void) +{ + return tc_get_cycles(&clksrc); +} + +static u64 notrace tc_sched_clock_read32(void) +{ + return tc_get_cycles32(&clksrc); +} + #ifdef CONFIG_GENERIC_CLOCKEVENTS struct tc_clkevt_device { @@ -335,6 +346,7 @@ static int __init tcb_clksrc_init(struct device_node *node) struct atmel_tc tc; struct clk *t0_clk; const struct of_device_id *match; + u64 (*tc_sched_clock)(void); u32 rate, divided_rate = 0; int best_divisor_idx = -1; int clk32k_divisor_idx = -1; @@ -419,6 +431,7 @@ static int __init tcb_clksrc_init(struct device_node *node) clksrc.read = tc_get_cycles32; /* setup ony channel 0 */ tcb_setup_single_chan(&tc, best_divisor_idx); + tc_sched_clock = tc_sched_clock_read32; } else { /* we have three clocks no matter what the * underlying platform supports. @@ -430,6 +443,7 @@ static int __init tcb_clksrc_init(struct device_node *node) } /* setup both channel 0 & 1 */ tcb_setup_dual_chan(&tc, best_divisor_idx); + tc_sched_clock = tc_sched_clock_read; } /* and away we go! */ @@ -442,6 +456,8 @@ static int __init tcb_clksrc_init(struct device_node *node) if (ret) goto err_unregister_clksrc; + sched_clock_register(tc_sched_clock, 32, divided_rate); + return 0; err_unregister_clksrc: From patchwork Thu May 9 11:10:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10937007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0F9313AD for ; Thu, 9 May 2019 11:12:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCF3A28ACD for ; Thu, 9 May 2019 11:12:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB04E28B01; Thu, 9 May 2019 11:12:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 597D528B22 for ; Thu, 9 May 2019 11:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2LEn8bT3jBm/pP+VTGaW1x5u7EOyIyNTkOK6J7ZCGtk=; b=VQrJ1m3OKi84cJofqx7ORlTX8e wMTTLU/W+RdvgOmktFkvp5jI85Gsuo8sb+DETzfOE+GltseVxunk9eBAsjpgkS5Urvsx6kvYeV7w+ bVnRRfLFR0RjaBMf59wP2FXFgHizWFSEDAYOTi60Qm1V4/NtIe6GbS5D+2ySuAQdvl3JL1/xQuKWq KkdKicM9T/kffETexdprwZHLOBN0wNQA4Iq/WBzZHEdayjaoT5QJ27Ubc2CFS00adbXkPWXtaRmR9 Q2TbLY/p/rPVFiSYekVu9mHq9IWEP3TOo/UTdkMOoczjRJZ6ru4WWj9yFouaXhIO0F9Y1IQHzJ/MO Jb0IfEQQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgyK-0000ke-WC; Thu, 09 May 2019 11:12:21 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxh-0008K6-PR for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 11:11:47 +0000 Received: by mail-wr1-x443.google.com with SMTP id h4so2458656wre.7 for ; Thu, 09 May 2019 04:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QCYNgLeacHF6Po+7GOvr1beHIPnLrcjXHBlwdHrGCU0=; b=xrKRJ01FjexwcW6Amk2UUkgupUslrHuPLDtpflcQVkX5Ui7ZAjWgKS3dqp58CehLKT m7U0HLJL81DLGNl6Nx8C/Ze2rWrVrZwAO8aM27Roy/Ir2eESs+RkNsf/uY6dyUXS6US2 e/efAcycx/5aKwBol9pNrIh/G34Q/aw2VxmiGEk2XrAfc/dMaUXXsVbit8T/LT8KlTzB SKj1qIdFVKRAKmp4X13yEt/cAu12cSOGL6sjJjgG3NeQqmd9HoVWW9ItPzkBRyBTx2FF +WQJjZK3DHfwhBM/4FxygB9SdEVA7e38iRLAhYmZSg67u5I1ZWtN994Oppt1+kZR4FlQ 4fgQ== 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; bh=QCYNgLeacHF6Po+7GOvr1beHIPnLrcjXHBlwdHrGCU0=; b=MzVxj4ol/m7py27XmfatDwO7SesYYWaCsy2iNnSa8Il0htnSqygequtWUvOwuf9+bF p/L0rIbZtSY9gF73QaXow7KyFr1Doh+p+W1ubCZfHihw0rK7M9061XnxztYzu9ytgutx 3HCsHD7l956OgkVjQ+nOFF1ziz2P5vtWBbWRxmou5306WiP8q+Plq/zhljbApY0oFJuB RGaBxHQggkE1Lbq06+ZQCVzyA7ssWs1PEpvz9NCkFVmSYJZzJ2fGfNZmLshSwQa4Q2Iv m5Ji7sb9TT1EvAVVctnz5rt7Ml4u0u2F5i6xCcek49u8zsPiLnEQEPsNLO2aQsDER709 ygsA== X-Gm-Message-State: APjAAAVxxucaQRNssMiNI7Uu6fFa2Uk/+DPpI8UvzmX876/5Snnbs392 wzPYjbvSEhouVWyhv0YY7TzV8Q== X-Google-Smtp-Source: APXvYqzMGoZEXQojTRjD72YL1yIFVm7J1W+VHiI9SvPm03np6VnCkUTzFJcvv1XUeh0PfNamyp1clg== X-Received: by 2002:a5d:6ad2:: with SMTP id u18mr2489123wrw.199.1557400299916; Thu, 09 May 2019 04:11:39 -0700 (PDT) Received: from mai.irit.fr ([141.115.39.235]) by smtp.gmail.com with ESMTPSA id z7sm2299778wme.26.2019.05.09.04.11.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 04:11:39 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 10/15] ARM: at91: Implement clocksource selection Date: Thu, 9 May 2019 13:10:43 +0200 Message-Id: <20190509111048.11151-10-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509111048.11151-1-daniel.lezcano@linaro.org> References: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> <20190509111048.11151-1-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_041142_282330_877AE81F X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Russell King , linux-kernel@vger.kernel.org, Ludovic Desroches , "moderated list:ARM SUB-ARCHITECTURES" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexandre Belloni Allow selecting and unselecting the PIT clocksource driver so it doesn't have to be compiled when unused. Signed-off-by: Alexandre Belloni Signed-off-by: Daniel Lezcano --- arch/arm/mach-at91/Kconfig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 903f23c309df..da1d97a06c53 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -107,6 +107,29 @@ config SOC_AT91SAM9 AT91SAM9X35 AT91SAM9XE +comment "Clocksource driver selection" + +config ATMEL_CLOCKSOURCE_PIT + bool "Periodic Interval Timer (PIT) support" + depends on SOC_AT91SAM9 || SOC_SAMA5 + default SOC_AT91SAM9 || SOC_SAMA5 + select ATMEL_PIT + help + Select this to get a clocksource based on the Atmel Periodic Interval + Timer. It has a relatively low resolution and the TC Block clocksource + should be preferred. + +config ATMEL_CLOCKSOURCE_TCB + bool "Timer Counter Blocks (TCB) support" + default SOC_AT91RM9200 || SOC_AT91SAM9 || SOC_SAMA5 + select ATMEL_TCB_CLKSRC + help + Select this to get a high precision clocksource based on a + TC block with a 5+ MHz base clock rate. + On platforms with 16-bit counters, two timer channels are combined + to make a single 32-bit timer. + It can also be used as a clock event device supporting oneshot mode. + config HAVE_AT91_UTMI bool From patchwork Thu May 9 11:10:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10937009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E533F924 for ; Thu, 9 May 2019 11:12:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEE5828A11 for ; Thu, 9 May 2019 11:12:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD1A628ACB; Thu, 9 May 2019 11:12:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 68B9628AFD for ; Thu, 9 May 2019 11:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tuVSbz3W42mr5n/TOOVCSgQDTS7Uq5TsJwsmB3n70uc=; b=tM+aTq4nIorjdUMFZim7cj2mzx 9BO72iseNcON4MXPZ18XkG6w/oA/qNbwloAzfqHP+1CDiznxYsALpcSDnj6c1EIZE7BC9CTA0sPDP fnbNVux1Nr//MhgWITx7V7Xt7IuD2Fn4wvYWYM8aX0yOgoRi2/X6OwDnujkyRnbPJP0ShIKjsO6tQ ihK/RShe+irD/YIASUAm5AELWi5DZrpioHSsk4IrFD3MP2Xk63dU0V3xKVHEwEhurPG0bBkNzpp91 NfsN4a9gc5vft7S1K3yn3k0cnLVQImJJ62mlPUiLXFJSt/Vt7qx/iLIf2nxoFpdnj9rmZfNOwxAc9 KBupuIkQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgyU-0000zI-TS; Thu, 09 May 2019 11:12:30 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxm-0008RR-AW for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 11:11:52 +0000 Received: by mail-wr1-x444.google.com with SMTP id w8so39812wrl.6 for ; Thu, 09 May 2019 04:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4vJDMe7+EQ4+NOcbJfE9TymlnXHgYOUGu64vsRLBkac=; b=N1bOovgDjxCRyHOozwBdr42aE3KEoSM4ABOm+YSUuvTxYz3N728+NYFaeNVTcHhB0w 3+Tx/HAv1FP50LvgicZ8laxj3XvtiordKj+YJLDEBoqokxdbTbzTAalpDNk/2vC+e58q WAdIzJT6dybx3AOR3ifdPuxguzLh13XNSoJOXnb/Kdl6QYsFH4ZD6GAfs9kPjkHmOPoK fZjoUPBluexqvw1CE0LavuhSczNnGnjhgFrwb6lq5V/tecgYmqreqn1pj2jgZsGOOcgV AVhkLr4yOErKM1I90wdvH2P6ZggUA8OUIohUGVPqOIar4GlqY1tqXNvAeDtfA68nre1g p3tA== 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; bh=4vJDMe7+EQ4+NOcbJfE9TymlnXHgYOUGu64vsRLBkac=; b=M+uSmFp+7TcvAqn9HmzRXkMTCQEQMa+F4mDROPb5pZEiuyng+KkRUZUMV2yiM+//Iv Qvkote/5jGwobCea20Ct91Y7Iy00mp0ilZwEntZx24QcE/ukK4HaEsedysb3Wp7y4eEb ooMhWI360jE6MeaUSaixQTpRd7bnWlpcaDY3g1A0x3fdaq8NPIrNqWKikf/JHzypw6LA 6yJHHEwddladTG484yF+xJxvgaLPYoC0gvLlGGEfFbHxjeJC+8imPeuI5Aq9K8FUUqhx LJ4qjX/ySkmfozin37XBMu7BwMtVwhMNO9uXn1AkU4Na7bjgUc0gyCi/jmrRPeEcFsPV gr8g== X-Gm-Message-State: APjAAAUMOBF8k1kM8+JJFCQ0yJ16FNdhs9kasAuPIsrjCONMc4+uC78P Anr9nSao+wbtaY7UJ758kPYyRA== X-Google-Smtp-Source: APXvYqyznM88ESRAs+LX3rzCPuecwtfM5D1R3IAEYLE5GOnO4E4PyptKT1HZIjfQ8cevLhVUeuZ26Q== X-Received: by 2002:a5d:4a44:: with SMTP id v4mr2574684wrs.84.1557400304781; Thu, 09 May 2019 04:11:44 -0700 (PDT) Received: from mai.irit.fr ([141.115.39.235]) by smtp.gmail.com with ESMTPSA id z7sm2299778wme.26.2019.05.09.04.11.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 04:11:44 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 14/15] clocksource/drivers/timer-atmel-tcb: Convert tc_clksrc_suspend|resume() to static Date: Thu, 9 May 2019 13:10:47 +0200 Message-Id: <20190509111048.11151-14-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509111048.11151-1-daniel.lezcano@linaro.org> References: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> <20190509111048.11151-1-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_041146_889613_C9391242 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , kbuild test robot , linux-kernel@vger.kernel.org, Ludovic Desroches , "moderated list:ARM/Microchip AT91 SoC support" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot Statisticize tc_clksrc_suspend and tc_clksrc_resume. Signed-off-by: kbuild test robot Signed-off-by: Alexandre Belloni Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-atmel-tcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c index 9de8c10ab546..6ed31f9def7e 100644 --- a/drivers/clocksource/timer-atmel-tcb.c +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -66,7 +66,7 @@ static u64 tc_get_cycles32(struct clocksource *cs) return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); } -void tc_clksrc_suspend(struct clocksource *cs) +static void tc_clksrc_suspend(struct clocksource *cs) { int i; @@ -81,7 +81,7 @@ void tc_clksrc_suspend(struct clocksource *cs) bmr_cache = readl(tcaddr + ATMEL_TC_BMR); } -void tc_clksrc_resume(struct clocksource *cs) +static void tc_clksrc_resume(struct clocksource *cs) { int i; From patchwork Thu May 9 11:10:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10937011 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7EE1924 for ; Thu, 9 May 2019 11:12:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D48F028518 for ; Thu, 9 May 2019 11:12:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8AB328AE7; Thu, 9 May 2019 11:12:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7521A28518 for ; Thu, 9 May 2019 11:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Q/GBu9+nvRO75NFkUqxjRNcooPO0OiLs3+tSUQh3aQc=; b=i9D6b60/SWWd7ab2Bwj7a5aMyf GKpMG619Tfbg/o57M6+dY0wMCeXLalB2DQZQzq20CQOaeq+2JqA+qDFsOjZBn2MJnJt09sLXxfijR 1XGiz9IV8ued871ZaGMw+wVmri5/ZTiT6TSHwLgpRuoE92M0Fwg7HUcK/3Q7DDR9prJdtzSI86VIU JoXbVn0UlPAMfiAOlTUWN5AfZS5ZMS19oCe0zgcBQm0uiOz+bPBHgFbc6AiS1AMUXEdFc4u63XmOd uLoyww76AMoq3PuQtV1KW+qj4qPwcUQApVaON7eQZEwXd7jJFYIpvJsDnasG0z0MGsR6MWqZVHCPK 3wUkdRYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgyh-0001EF-Gd; Thu, 09 May 2019 11:12:43 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOgxn-0008U2-PP for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 11:11:56 +0000 Received: by mail-wr1-x441.google.com with SMTP id s15so2424626wra.12 for ; Thu, 09 May 2019 04:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qVGkTtEbJGXMDq9yfYbvGEhm0nTx4/Q5KKy9E6G6Uls=; b=Q14zEwAVJ9z1gCyDh7Pvv/+JbG3ARRqKDiD3F+DXQx18zoM6hirJXgkqL3Rz14N6Pk jqPs9miT3a4rOXazdPQRMH/N9XjuF7ir7durm/GwimyvozKXr0rn5XtxS3FsxXcEJzdb o3UflAShf1SFKF3ROszcWoh+Jh5Y3rFcn6BW3Dyj9oHMBSi9ijUGtjKiWFaDrGpbVJcI cxMXl3DKWTIxRGNR7KdaoHTcUYor2syu8T+Kus0ipxh6r1XhGogSgQzSMGmdzzz3DvE2 zqlBQ8Rw518/FbDSB2migS9IDBFyJFzASEpS0LA24IulsYf3lWUN4lS2G8W6C9tUCdOs qxkA== 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; bh=qVGkTtEbJGXMDq9yfYbvGEhm0nTx4/Q5KKy9E6G6Uls=; b=tRKRQzvzKQjdqEy01AeTfMIK8th9aXo7zAe4LUaTsYXS8dP+dQhK3K8YYz1jXDvClc yCt+biV11nWAYiGNG6mHz+WgNm3zIFhMoXMwIRpLIHKCrPRgc4KytkuuTniKdm2llaUY WGsYpPSJ0E1LPwPyxQzOyNx5MVRIO+qdk3rKqESwg+dg9OIwbTrBHakWEiAm87Tqy3FA +n8EPklRRQxgaNPuZzZ3IZ6FdA2Vu2g1EDZS+91Bpz/5VDmca0D1GycSgvbQenspyBOW YfTBHPRvtqiwBPAdKIhOH+qj05QdTyOSjurb6Bwkd3FWWcMabfQl6q9MRQiMg4wAyMrG MT/w== X-Gm-Message-State: APjAAAWF/GaFyPNC7pKh/gtwO3ewEh8Z4GYtqu26cAGH43gpKYxM8RIL dqwSZLPiFdMyrcxPmeyWLCPkpQ== X-Google-Smtp-Source: APXvYqxmNseiHG6j6CHViU7MdKt23CuoxFMo6eV7NmQGqMcSLVJs7hdMitKEmQksaHnD5UVv3l6ckw== X-Received: by 2002:a5d:448e:: with SMTP id j14mr2738284wrq.158.1557400306306; Thu, 09 May 2019 04:11:46 -0700 (PDT) Received: from mai.irit.fr ([141.115.39.235]) by smtp.gmail.com with ESMTPSA id z7sm2299778wme.26.2019.05.09.04.11.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 04:11:45 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 15/15] misc: atmel_tclib: Do not probe already used TCBs Date: Thu, 9 May 2019 13:10:48 +0200 Message-Id: <20190509111048.11151-15-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190509111048.11151-1-daniel.lezcano@linaro.org> References: <7e786ba3-a664-8fd9-dd17-6a5be996a712@linaro.org> <20190509111048.11151-1-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_041148_758904_37A9EDAE X-CRM114-Status: GOOD ( 11.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Ludovic Desroches , "moderated list:MICROCHIP TIMER COUNTER TC AND CLOCKSOURCE DR..." MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alexandre Belloni The TCBs that have children are using the proper DT bindings and don't need to be handled by tclib. Acked-by: Greg Kroah-Hartman Signed-off-by: Alexandre Belloni Signed-off-by: Daniel Lezcano --- drivers/misc/atmel_tclib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/misc/atmel_tclib.c b/drivers/misc/atmel_tclib.c index 194f774ab3a1..2c6850ef0e9c 100644 --- a/drivers/misc/atmel_tclib.c +++ b/drivers/misc/atmel_tclib.c @@ -111,6 +111,9 @@ static int __init tc_probe(struct platform_device *pdev) struct resource *r; unsigned int i; + if (of_get_child_count(pdev->dev.of_node)) + return -EBUSY; + irq = platform_get_irq(pdev, 0); if (irq < 0) return -EINVAL;