From patchwork Mon Feb 28 11:19:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12763100 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2427C433EF for ; Mon, 28 Feb 2022 11:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vSihcKlS5xucC4DtS9Mgemyk0CLenZ789C/XMNdrogE=; b=tLDtZJaJCVfTej n7OujHTCTyWsQEU35xl6JcIUfstKxYUq97dmwXbmU9YLGwUsSwkFDpKhdlD7gZu0XbAPCPbdecyPL rplDSowv/5eZVUDoK7GKH3kFCEuhCTzCoZy/tAU41DvkGIplrULzfgAo225OD8lqZWIMwjWmPuHPd TiAn14s4NlaswrnwJ8LduQXgw38p6NctlFGPqlOrITuOYRjetOP0oJOWplpeQtpDzuLN0+U/dCL7i g45FVdATzsuYfOk6y2JncR+A+OEPet06sYs9d6qQuJQ1D1cEVFy9UxFw170yrbDcq3DBfWBWkEfQq jukkizrGdclkGaroOleg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOeXo-00BzTw-Pr; Mon, 28 Feb 2022 11:50:26 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOe2w-00BnVZ-Tq for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 11:18:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1646047110; x=1677583110; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lUQnn0zVy+bE/xhgO9ACVEqiKnempNvpK91uF2dQ9T0=; b=ohGkoTCuAaptfoD/td3gmWBXur9ctFcnShf+y5wH1m6hDd0BrLel5U4F 0+sCKGizN05EsYWgFos+5W+5cX2B0UTXUyaJFEGyG4H349T93rbhN5WtN gwCzTiYSWd7EpgaIbH3mzrj+VA0+o3IN+dEYalsafQNNIC2NFLu6JTR3a f0jo5//rJG8UYN43GEGjwb8VsHB7IWV4mbLMx40QLroPwKpg24IYht+Gl CK+OJonUmEeLUny91u+CFxWbTTELeS9fTl2Cyt4Lrg9YBm0BnRTqkwr+3 SIgPw9Rb30zFWokfEumZHp2r8ZVwLFo3u8SVTVxZmunUZ+Of3uYy+B5Xt g==; X-IronPort-AV: E=Sophos;i="5.90,142,1643698800"; d="scan'208";a="155099464" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Feb 2022 04:18:30 -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.2375.17; Mon, 28 Feb 2022 04:18:29 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Mon, 28 Feb 2022 04:18:28 -0700 From: Claudiu Beznea To: , CC: , , Claudiu Beznea Subject: [PATCH 5/7] clocksource/drivers/timer-microchip-pit64b: add delay timer Date: Mon, 28 Feb 2022 13:19:21 +0200 Message-ID: <20220228111923.1400049-6-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220228111923.1400049-1-claudiu.beznea@microchip.com> References: <20220228111923.1400049-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_031831_017428_A31AD31F X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add delay timer. Signed-off-by: Claudiu Beznea Reported-by: kernel test robot Reported-by: kernel test robot --- drivers/clocksource/timer-microchip-pit64b.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clocksource/timer-microchip-pit64b.c b/drivers/clocksource/timer-microchip-pit64b.c index abce83d2f00b..f1b211ee6312 100644 --- a/drivers/clocksource/timer-microchip-pit64b.c +++ b/drivers/clocksource/timer-microchip-pit64b.c @@ -9,6 +9,7 @@ #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; 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); } +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 = clkevt_to_mchp_pit64b_timer(cedev); @@ -371,6 +379,10 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_pit64b_timer *timer, sched_clock_register(mchp_pit64b_sched_read_clk, 64, clk_rate); + mchp_pit64b_dt.read_current_timer = mchp_pit64b_dt_read; + mchp_pit64b_dt.freq = clk_rate; + register_current_timer_delay(&mchp_pit64b_dt); + return 0; }