From patchwork Thu Jul 23 15:26:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 11681229 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF218138C for ; Thu, 23 Jul 2020 15:30:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7BCE2067D for ; Thu, 23 Jul 2020 15:30:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3ZdbvSC1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qLNp4nQH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7BCE2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=hdJoyjsnuL95mnsgiHWBQEk5MSRaEdJ1ExowvIgP9g4=; b=3ZdbvSC19J7JgVOfS9c98O830 V0KK6qb6mTE68kv2M6SNWxaU2TuUmLNFGKHaJfbjEzqEQROi0eSOKuRafTuNWUytonF9kiGtVWsid WjpqNGa9Pp5VM4ucyjVIgxOCRvtIBjfAu6EucZxYjfWMjPMz90m9gyDTgy2KwrGV2ZaKWfdntRUsX v0kxS2LqTX6dXvLhjVbccN5Qh9Ot+P7n7UysdK0de4fsvY9HqvxlsWRETxpXmz5lPzLz0eGlqd+tH lYjcrcDWdYCSb1qBiYBQgW0VEX/JjstLg2M3APdkz88RSxg+zVlJUvCHgwLSymkrXWOhhJs7ORzfp HH/2hIMyw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd9D-00088L-Gl; Thu, 23 Jul 2020 15:28:39 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd7c-0007Us-Qh for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 15:27:02 +0000 Received: by mail-wm1-x344.google.com with SMTP id j18so5327724wmi.3 for ; Thu, 23 Jul 2020 08:27:00 -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 :mime-version:content-transfer-encoding; bh=gEfaBqT/0CoLB9mlKqYWw9OwFPm9et7GWv9HdjL+20Q=; b=qLNp4nQHmBcL9wwPcTVh1KdyojCC+Ng1h0PSBagRtQe/13DibONXpQ/OK1hYytNNyB oIN9Ptyndv/Mdo9ftVGZGb8jmZv9mBo2JX2mhV/GoJR0eJPnlepcmPCQrMS03klCj/Ls idzzWjFAhcItNP0G7hHezWVLTTLW7KvYCyQtdYFHjfPjitCHAQmeGMcVSldgCYpOTDJT C24PkFeoRuHRkm65GPydAWLnOnCU0v5MJKZssXF58zH/bkoRrGpMAEaYVjYBt2TmmOu9 QSfDL52VJVbM/N6YhjSl24VOEWL2ETfHOyHe0/Gn3himhdQox/4Q0OkYhWHIYcnUZlmx vs+A== 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=gEfaBqT/0CoLB9mlKqYWw9OwFPm9et7GWv9HdjL+20Q=; b=emwRbgJ5TrrtfKc+Y1aXfJR9D7mlWwU+dJVhUP8vs6Z53zi6+F/KJUt1K0PyRGptBk jvveB20f4X5ldlxY0w6sH2Abr1kLe5XKDsiJA/9VgwkG43CUwLV+VqYr8Y9avUfvVbp1 JilK0FmLxffhA2ht3izO2OwN2wu47DS7ugAnXfeW595FI4XCNIxdsGct2K8AJHIdwf8Z IbP8Ux6Mn7CUFfS1KBE2tlmb5FnNyHNa2zl1LJiPUh72RvbxsLc5mJZcJjHOZXxqY6wq hCTrZTlKnben5AFAV8I5R3Qv9Zf0Pp1M1nzJAbzWO+g05rq4yvDquSJ4f0+fwygjW995 u/Bw== X-Gm-Message-State: AOAM533Gkdt7Lj9TKqCQWOdphJU3wMz816brTGELNbqRLAy08DWO/Gee +DtiG4TkB7mP+GvSYRXK7Eh/qQ== X-Google-Smtp-Source: ABdhPJzKZTThxX/bozgKe2UbCkR0civZnFkJIRvbd/AnyAaR20RyQH92o7sYad6XySCakbUDgu3WMg== X-Received: by 2002:a7b:c3da:: with SMTP id t26mr2125925wmj.13.1595518019623; Thu, 23 Jul 2020 08:26:59 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:dca7:8d30:33fa:daac]) by smtp.gmail.com with ESMTPSA id g145sm5963491wmg.23.2020.07.23.08.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 08:26:58 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 05/16] clocksource/drivers/timer-atmel-tcb: Rework 32khz clock selection Date: Thu, 23 Jul 2020 17:26:25 +0200 Message-Id: <20200723152639.639771-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723152639.639771-1-daniel.lezcano@linaro.org> References: <1b1122f4-bce9-f349-e602-ed8e14cbb501@linaro.org> <20200723152639.639771-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_112701_118142_293DDE9D X-CRM114-Status: GOOD ( 13.89 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:344 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Ludovic Desroches , "moderated list:ARM/Microchip AT91 SoC support" , "open list:CLOCKSOURCE, CLOCKEVENT DRIVERS" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Alexandre Belloni On all the supported SoCs, the slow clock is always ATMEL_TC_TIMER_CLOCK5, avoid looking it up and pass it directly to setup_clkevents. Signed-off-by: Alexandre Belloni Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200710230813.1005150-6-alexandre.belloni@bootlin.com --- drivers/clocksource/timer-atmel-tcb.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c index 7427b07495a8..b255a4a1a36b 100644 --- a/drivers/clocksource/timer-atmel-tcb.c +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -346,7 +346,7 @@ static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_id writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR); } -static const u8 atmel_tcb_divisors[5] = { 2, 8, 32, 128, 0, }; +static const u8 atmel_tcb_divisors[] = { 2, 8, 32, 128 }; static const struct of_device_id atmel_tcb_of_match[] = { { .compatible = "atmel,at91rm9200-tcb", .data = (void *)16, }, @@ -362,7 +362,6 @@ static int __init tcb_clksrc_init(struct device_node *node) u64 (*tc_sched_clock)(void); u32 rate, divided_rate = 0; int best_divisor_idx = -1; - int clk32k_divisor_idx = -1; int bits; int i; int ret; @@ -416,12 +415,6 @@ static int __init tcb_clksrc_init(struct device_node *node) unsigned divisor = atmel_tcb_divisors[i]; unsigned tmp; - /* remember 32 KiHz clock for later */ - if (!divisor) { - clk32k_divisor_idx = i; - continue; - } - tmp = rate / divisor; pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); if (best_divisor_idx > 0) { @@ -467,7 +460,7 @@ static int __init tcb_clksrc_init(struct device_node *node) goto err_disable_t1; /* channel 2: periodic and oneshot timer support */ - ret = setup_clkevents(&tc, clk32k_divisor_idx); + ret = setup_clkevents(&tc, ATMEL_TC_TIMER_CLOCK5); if (ret) goto err_unregister_clksrc;