From patchwork Sat Oct 17 15:38:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11842845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E14C433DF for ; Sat, 17 Oct 2020 15:41:15 +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 5534B2074A for ; Sat, 17 Oct 2020 15:41:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sey6gZYZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="eetgpeWy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5534B2074A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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=p5RHP37zoHROYzp2SIAwWoNpTa0xf1g0l94lqua0l8Y=; b=sey6gZYZD/usjJPoAzoFJ1V+i 1bp1FerKAGVQMyEwc0DMIRkb0U1aErJkeJEYEOauBBSCqtQmde1pbvKdlU19F6nmt7cS9zweH1VUF CFTNLEpcjdRSXWvcE7RfQUFXI54JNSJEFBVHmcT+14WMUsinOg1e56xYdX5btzOQra2ZAwke0Wd6q tbCZ19P4U4VtA/KUhT43UCR6fqUCQoNcBWSJYOwEnHbDLqWUHr7ob0AK5DBrjOFoDZH1tvufw4Vop v+rcFNwcLVYmv7dpXN1bl3OWRfMtKs1TLunzpvtzQ+DWthkmTZaX3OPb+u9++LHv9mRO4lgpOW7gQ 3XNyGpjvg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kToIa-0003L7-4h; Sat, 17 Oct 2020 15:39:12 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kToIS-0003JA-44 for linux-arm-kernel@lists.infradead.org; Sat, 17 Oct 2020 15:39:09 +0000 Received: by mail-wr1-x442.google.com with SMTP id h5so6739579wrv.7 for ; Sat, 17 Oct 2020 08:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O8b3a8tEsPdmZGsHhmbkp77mMXjgy1OCPeTQ0OgsXhc=; b=eetgpeWy2duISOUDuLyFZjrkyYQTTQ4O/2P+CjAqB5m11MBRtpoRaAYVv15D9JlmyM a1Icr54M4EieBbiqaq0OIvB4Xk0nZC0ipg9IUPpxTKe+6mEY2xYS0zPWVSUYAEsjt6pf 1ArkVnfn0TV4zhdy1QuKC2MHufrU83Gk/bqq+qQUs/eI5ZLQ5uTvP9GGBXuYy9nOahfu 2ILaJWM6Z5l+lFIPMj4xpu46GomC3haPVwC72czZxJ4JvqcKXKYh47f/YHlcCLskXtCr AWbmMf5xk4jQweA7ccmj9VhgdxDJxcK1p/v0wdzZFwNLuCr321dvztWFBxc+5etmC4ti BYcQ== 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=O8b3a8tEsPdmZGsHhmbkp77mMXjgy1OCPeTQ0OgsXhc=; b=CuNP6Ycw1kEpeTv8jFajZBQ7sCKndSTVVqagR+yLbP0kBgu3TMhE4oQmY3nhDpJyh2 +cE7Yviv40DYrieQPDSmj1XBRkvCymL9iHbALIZ/GLSmp35GEEjy9qOKKs38aTnxYnSW 5iwXpa1j0RCp1UNJCnVaU9bOuSivxVYAhIWs9IVSlvldyZP53NXBVhDerTfvtFRk22uL KzTiVMsxE6oDdIJ9JfJ6o8j7G1nnBn/NHE6tAjHHGPRb5k7pgHhw097vTcKphHek07bh 9kVMg9KSqS5fzACJhumzl7NqOP2QTehUaQiaE3eeEut5zXwbYU6uIGiMvRL1eiYAQOaF KBSA== X-Gm-Message-State: AOAM533V0s5Y7jymq/otAJTaComoA7J5sHniRVFpQ2nqbGlRwLZE9/eL M4cehOhq4cBxuvZiFTa5mLrFZg== X-Google-Smtp-Source: ABdhPJzFnhShrjHXlRQr6YUYUiE55WTFRHSvzdlJc5N5ji8mSvo00iysRozA20esxUivjnKunTuapw== X-Received: by 2002:a05:6000:118c:: with SMTP id g12mr10942738wrx.246.1602949143310; Sat, 17 Oct 2020 08:39:03 -0700 (PDT) Received: from localhost.localdomain (159.171.185.81.rev.sfr.net. [81.185.171.159]) by smtp.gmail.com with ESMTPSA id n66sm7654953wmb.35.2020.10.17.08.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 08:39:02 -0700 (PDT) From: Fabien Parent To: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] clocksource: mediatek: add clk13m and bus clock support Date: Sat, 17 Oct 2020 17:38:57 +0200 Message-Id: <20201017153857.2494845-2-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201017153857.2494845-1-fparent@baylibre.com> References: <20201017153857.2494845-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201017_113904_185968_93871C44 X-CRM114-Status: GOOD ( 12.91 ) 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: matthias.bgg@gmail.com, Fabien Parent , tglx@linutronix.de, robh+dt@kernel.org, daniel.lezcano@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some MediaTek SoC like MT8516 need to enable additional clocks for the GPT timer. Enable them if present. Signed-off-by: Fabien Parent --- drivers/clocksource/timer-mediatek.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c index 9318edcd8963..42e2d2090484 100644 --- a/drivers/clocksource/timer-mediatek.c +++ b/drivers/clocksource/timer-mediatek.c @@ -9,6 +9,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -278,8 +279,19 @@ static int __init mtk_syst_init(struct device_node *node) static int __init mtk_gpt_init(struct device_node *node) { + struct clk *clk_13m, *clk_bus; int ret; + /* Optional clock*/ + clk_13m = of_clk_get_by_name(node, "clk13m"); + if (!IS_ERR(clk_13m)) + clk_prepare_enable(clk_13m); + + /* Optional clock*/ + clk_bus = of_clk_get_by_name(node, "bus"); + if (!IS_ERR(clk_bus)) + clk_prepare_enable(clk_bus); + to.clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; to.clkevt.set_state_shutdown = mtk_gpt_clkevt_shutdown; to.clkevt.set_state_periodic = mtk_gpt_clkevt_set_periodic;