From nobody Mon Sep 15 12:57:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B8E2C54EBD for ; Thu, 12 Jan 2023 11:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236838AbjALLxg (ORCPT ); Thu, 12 Jan 2023 06:53:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbjALLwm (ORCPT ); Thu, 12 Jan 2023 06:52:42 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 366B71D0FF for ; Thu, 12 Jan 2023 03:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673523756; x=1705059756; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z5KTL4EaTIbo9QWWW/1WpQc0bvQTdKHy2Kuwm2BBH5Q=; b=2fC4DMGMEHNuG63/jfCL4zxEUFKC4RO54xWCmzwVin+vcSrnMU8NnFmG RglurIC+EEUC8qyJuT1b8ytFr4ZL6PcgQUHrf1xaNeydxgMTBOENNebSe SA0+gr/RUpM7i9pLUPGRjJlFOoR7AA3uyMtzWL91nQ5UI1WbOj+fOCZDr q9uwf8eIyOeEVhNU3vsX9Zd3Qb6SMyfKnpNUYZPQt6UEys/VRDlanQa1t BdHGU22K86g+NDGlOrwbMsNbFRD/CGUaI3PPw3hUnsrGoSreF8fB3Sasa 15IfWGV7Gf0VAdjIhRD7tZMsymcduHQyCpMC7TxximkpNCtWbd68v1pOo g==; X-IronPort-AV: E=Sophos;i="5.97,319,1669100400"; d="scan'208";a="191905716" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2023 04:42:34 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 12 Jan 2023 04:42:33 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 12 Jan 2023 04:42:31 -0700 From: Claudiu Beznea To: , CC: , Claudiu Beznea Subject: [PATCH 3/3] clocksource/drivers/timer-microchip-pit64b: add delay timer Date: Thu, 12 Jan 2023 13:42:12 +0200 Message-ID: <20230112114212.1161136-4-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112114212.1161136-1-claudiu.beznea@microchip.com> References: <20230112114212.1161136-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add delay timer. Signed-off-by: Claudiu Beznea --- drivers/clocksource/timer-microchip-pit64b.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clockso= urce/timer-microchip-pit64b.c index d5f1436f33d9..57209bb38c70 100644 --- a/drivers/clocksource/timer-microchip-pit64b.c +++ b/drivers/clocksource/timer-microchip-pit64b.c @@ -9,6 +9,7 @@ =20 #include #include +#include #include #include #include @@ -92,6 +93,8 @@ struct mchp_pit64b_clksrc { static void __iomem *mchp_pit64b_cs_base; /* Default cycles for clockevent timer. */ static u64 mchp_pit64b_ce_cycles; +/* Delay timer. */ +static struct delay_timer mchp_pit64b_dt; =20 static inline u64 mchp_pit64b_cnt_read(void __iomem *base) { @@ -169,6 +172,11 @@ static u64 notrace mchp_pit64b_sched_read_clk(void) return mchp_pit64b_cnt_read(mchp_pit64b_cs_base); } =20 +static unsigned long notrace mchp_pit64b_dt_read(void) +{ + return mchp_pit64b_cnt_read(mchp_pit64b_cs_base); +} + static int mchp_pit64b_clkevt_shutdown(struct clock_event_device *cedev) { struct mchp_pit64b_timer *timer =3D clkevt_to_mchp_pit64b_timer(cedev); @@ -376,6 +384,10 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_= pit64b_timer *timer, =20 sched_clock_register(mchp_pit64b_sched_read_clk, 64, clk_rate); =20 + mchp_pit64b_dt.read_current_timer =3D mchp_pit64b_dt_read; + mchp_pit64b_dt.freq =3D clk_rate; + register_current_timer_delay(&mchp_pit64b_dt); + return 0; } =20 --=20 2.34.1