From patchwork Mon Aug 15 13:12:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 12943563 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 3A8FFC00140 for ; Mon, 15 Aug 2022 13:19:47 +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: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=wyjXpEvOutp8d5terSmcIKD4uXdheKiDz4WO5TKVVhY=; b=YwFXmf0HoeT80O 5b6uq0BkqL0yHvh4/j2QcX3TCm9x0JwzBbRFnmVNsstNDTSPRmDXxl5yUJZXxfoOgMXdoozKXr07O EKZ/SfXQnWxI1gTAsji3XaN5XBAJwPaewiLnPa6HKnPSqpxLYuBSiMV4Heb0msnUPsRN8UkLZuqSo yZLEIxunRaX5edgg1gBwCCGzgpWFcjrMKZbjUu2I5V7ekmn+Jvv9NhZibeN7VNH6AgQwE4uKLH3ES MR6QDd/sPy5fXq92xf+z1SvVbNQhqB/MyA1Gq1DOwU8EGQRnbUJi/m5Cw6xN+RmaXnyzOcJVWbIWL Q18aqkX0jwKjf8eAczVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNZzY-00GgQG-Hq; Mon, 15 Aug 2022 13:18:53 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNZuX-00GclZ-Bg for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2022 13:13:46 +0000 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id EB9C880FB; Mon, 15 Aug 2022 13:06:47 +0000 (UTC) From: Tony Lindgren To: Daniel Lezcano , Thomas Gleixner Subject: [PATCH 8/9] clocksource/drivers/timer-ti-dm: Add flag to detect omap1 Date: Mon, 15 Aug 2022 16:12:49 +0300 Message-Id: <20220815131250.34603-9-tony@atomide.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220815131250.34603-1-tony@atomide.com> References: <20220815131250.34603-1-tony@atomide.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220815_061341_550562_1522CD78 X-CRM114-Status: GOOD ( 15.22 ) 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: , Cc: Nishanth Menon , Grygorii Strashko , Vignesh Raghavendra , Aaro Koskinen , Keerthy , Janusz Krzysztofik , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, Ladislav Michl , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Let's make it clear that some features need to be tested currently on omap1. Only omap1 still uses platform_data. Signed-off-by: Tony Lindgren --- drivers/clocksource/timer-ti-dm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -133,6 +133,7 @@ struct dmtimer { unsigned long rate; unsigned reserved:1; unsigned posted:1; + unsigned omap1:1; struct timer_regs context; int revision; u32 capability; @@ -423,7 +424,7 @@ static int omap_dm_timer_set_source(struct omap_dm_timer *cookie, int source) * use the clock framework to set the parent clock. To be removed * once OMAP1 migrated to using clock framework for dmtimers */ - if (pdata && pdata->set_timer_src) + if (timer->omap1 && pdata && pdata->set_timer_src) return pdata->set_timer_src(timer->pdev, source); #if defined(CONFIG_COMMON_CLK) @@ -476,7 +477,7 @@ static int omap_dm_timer_prepare(struct dmtimer *timer) * FIXME: OMAP1 devices do not use the clock framework for dmtimers so * do not call clk_get() for these devices. */ - if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) { + if (!timer->omap1) { timer->fclk = clk_get(&timer->pdev->dev, "fck"); if (WARN_ON_ONCE(IS_ERR(timer->fclk))) { dev_err(&timer->pdev->dev, ": No fclk handle.\n"); @@ -763,7 +764,7 @@ static int omap_dm_timer_stop(struct omap_dm_timer *cookie) dev = &timer->pdev->dev; - if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) + if (!timer->omap1) rate = clk_get_rate(timer->fclk); __omap_dm_timer_stop(timer, rate); @@ -1119,6 +1120,8 @@ static int omap_dm_timer_probe(struct platform_device *pdev) timer->reserved = omap_dm_timer_reserved_systimer(timer->id); } + timer->omap1 = timer->capability & OMAP_TIMER_NEEDS_RESET; + if (!(timer->capability & OMAP_TIMER_ALWON)) { timer->nb.notifier_call = omap_timer_context_notifier; cpu_pm_register_notifier(&timer->nb);