From patchwork Wed Nov 14 22:57:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10683333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2327F14D6 for ; Wed, 14 Nov 2018 22:58:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 132512BC6C for ; Wed, 14 Nov 2018 22:58:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04CC52BC71; Wed, 14 Nov 2018 22:58:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 81E9F2BC6C for ; Wed, 14 Nov 2018 22:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=2qOgC2nh5JLEnzBfXCOvvW+bWUaqwEpUrbWn2Dikdfs=; b=ncAkDPhz9//XP4 XO1XBB70N5S7Il7iJ62EJoxqm5Nkqzlgxrheu7Oh9zOecCTPyfKH3+uNZ4xJO99xzMbnXrUYJ63rw 1tAsvOcZARlQupdg+tvNnkChNYuLBAeayX8Z2haf2M3ilfPhq0gBWz+nuI8WVLa34NAoJj/qe14Tv pNIjMjukVM9GGMvvVX5VdcLq8qmuZoFoRWlW6OP8mMG8MJ/VvqFa/JKxS5uzMG2Mt1FgeWDjG/v4Z /u5HjmbhnFibD5lUfaA7iOaaOMC/Q4bGHE/VwAcRVjNB/h9swoNwcmDgmuFM4HmA+xRZqvsFNlltt yjx8rd9rWnHUbJvrB4JA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN47C-0000BK-65; Wed, 14 Nov 2018 22:58:30 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN46l-000886-Nj; Wed, 14 Nov 2018 22:58:05 +0000 Received: by mail-wr1-x443.google.com with SMTP id k15-v6so19064380wre.12; Wed, 14 Nov 2018 14:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/fU3iJUznAqxv4GxLIhJ8UE2d70EiTCopB45m9DeqKk=; b=K0KMlUlgRJsOMGydt4Q3whagKmW8xgSzC3F0M66q0q168BUD0gxg6pDM5TeFdbEZ2A RI5rWFc7cHqOAtBVyj5mnHJpJrHIwiBIpeh/YRK9ZKmhmDLKkc1INvsT6KpOQZl15XZG 5JiiJh7IVGeyMog+cvBpcazKK2h1V7Gyrq3OFf/c33efZwsq5/g8oWsqsgIsKq12wBhx sj5rCmCviC8RYJzc3Z9FigMdZAHAKr7X8S2btZ+g3Bo8c2pbJc4Z/AyBwP7sQNzHPpPu VN0/E4Ig0z0jeaDCYTRboTLHkKqi7K3yGNPIDXZgOTAvChB7QrYkkPZLEIpqzvWi3xr9 48OQ== 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=/fU3iJUznAqxv4GxLIhJ8UE2d70EiTCopB45m9DeqKk=; b=lN67Aq5hdhkszyEpz5ersKkhmzGVT05Mam6LLRzHrr8HsMc2FxcpezrrpLocCF6XU9 lDb4sCE6EI5UfXBcpFLy2Hi1hRZS1lUQFheLKaA4JT+AGdzx1a2ZrOxUjfMflxqTXims Vh0D76wsAYamAhMgA7eJEUO9ZD0egAiCBb6ftV+pxgdN5PNEu9RwHS8zQaBUAfENE11P rc7nCE7thLJPCHrbvmqtXzpbw45L2Y2/6B7TxXe/mVxKk1VYZAhf3fXYyrwZX/eVyayT pQap2b5gN+kkpQ8m53pjMuJIztYzgYyUcuz/QsPmhWVxW8QT/YQrJha3NECDaRBvnH9O MYSA== X-Gm-Message-State: AGRZ1gK9om64Yzt0WpAosyMhAAyQ79xWYSW1OFiQPj+qPgaZMy3P0wj7 GC1NniZzxwtTwdzdKQplkBnWs1ac X-Google-Smtp-Source: AJdET5cCqavL2fJsvJqkY1EgPSxNlGBLCl/eV2taX4lLg5xIPFUyrTrmnsdtZEAhsvOEhuXGgHDCVA== X-Received: by 2002:a5d:40cc:: with SMTP id b12-v6mr3812260wrq.133.1542236275263; Wed, 14 Nov 2018 14:57:55 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD717A100301AB549B11D5ACB.dip0.t-ipconnect.de. [2003:dc:d717:a100:301a:b549:b11d:5acb]) by smtp.googlemail.com with ESMTPSA id n7-v6sm18987784wrt.60.2018.11.14.14.57.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 14:57:54 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, jbrunet@baylibre.com, narmstrong@baylibre.com Subject: [RFC v1 4/7] clk: meson: clk-pll: add the is_enabled function in the clk_ops Date: Wed, 14 Nov 2018 23:57:22 +0100 Message-Id: <20181114225725.2821-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181114225725.2821-1-martin.blumenstingl@googlemail.com> References: <20181114225725.2821-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_145803_772348_2126B6EB X-CRM114-Status: GOOD ( 12.29 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sboyd@kernel.org, Martin Blumenstingl , mturquette@baylibre.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have a utility function to check whether the PLL is enabled we can also pass that to our clk_ops to let the common clock framework know about the status of the hardware clock. For now this is of limited use since the only common clock framework's internal "disabled unused clocks" mechanism checks for this. Everything else still uses the ref-counting (internal to the common clock framework) when clk_enable is called. Signed-off-by: Martin Blumenstingl --- drivers/clk/meson/clk-pll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index b46cca953f4f..65eeae0989d9 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -309,10 +309,12 @@ const struct clk_ops meson_clk_pll_ops = { .recalc_rate = meson_clk_pll_recalc_rate, .round_rate = meson_clk_pll_round_rate, .set_rate = meson_clk_pll_set_rate, + .is_enabled = meson_clk_pll_is_enabled, .enable = meson_clk_pll_enable, .disable = meson_clk_pll_disable }; const struct clk_ops meson_clk_pll_ro_ops = { .recalc_rate = meson_clk_pll_recalc_rate, + .is_enabled = meson_clk_pll_is_enabled, };