From patchwork Thu Nov 22 21:40:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10694903 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 AAE7D5A4 for ; Thu, 22 Nov 2018 21:41:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B0ED2CBED for ; Thu, 22 Nov 2018 21:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F4AD2CC45; Thu, 22 Nov 2018 21:41:05 +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 3B8EA2CBED for ; Thu, 22 Nov 2018 21:41:05 +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=MyDM3FidliPoQO69fPNs17R6YW0Arhhekn38CqOzrLc=; b=HlDyMkpPENddDN OFItsDBR6VgFlKpF1wifZdTSOBTBqmjI5wLjY5dRgWrcC31gO4Z0wViIUb+jxR2cuZWx5YdonHJK1 eDZudyJnP5TuNg0BPNG5Js0Myv+x0ytGXH+YGZoS4XTt07yszdKxN+Bc8vea4HNfxRedG2Brar3Iz eatPxOTrDlwgqGww+iVpY5+ihSZH8HQJoKNm91zH1ytSfdNith49gORBQV5KOZ0C1nAHIesqtheVN RGE4TkHxfvqXNpX1DHs2mhrRwFgugHHFq73zlnFqw3lcUPMj++mXcNMPB0GAD++B8LCwhvWYw+V3e Td9LFgvR5kLp3pm59tDg==; 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 1gPwid-0006lQ-8I; Thu, 22 Nov 2018 21:41:03 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPwiF-00069H-Fk; Thu, 22 Nov 2018 21:40:40 +0000 Received: by mail-wm1-x341.google.com with SMTP id y185so6336931wmd.1; Thu, 22 Nov 2018 13:40:29 -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=b9M5DcWvweBjr9MSqSee+Ke/uuzQ3f30SLXtYeUgc+M=; b=UEXDe6QItdSuH3bNff1e1akAKk6mkD3tlHnQbqprXE8ssCVhJnqK+hHtK8fvWwWiwg IbH+5XXQpOyXfEKc5NJPJTIaMEWsg1yNonm+XSHQVaa8F/5Up8yPlG7w/L0t84gouf/p kF4xwl8ROBpFX7z9BzGo+QLuMYoxMQahf42kx196Y16L9qyBimTM5t1YCSGhJpvbAs7m dmAh3V8dGN+y4ae2JgqObZZ5ckn6U7zomWYSDlcoV8SFct+apl2QYwvO54DdbkWSzTua aBKi0ggHWbNPOqpqALq34JODwpPt616Dqq+EhyJMqR8s3dn+nOs4+dUnW4Ms0uN2kzPD Hv9w== 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=b9M5DcWvweBjr9MSqSee+Ke/uuzQ3f30SLXtYeUgc+M=; b=shP0Jy84czhHIZ8AZ//jENjBEa8o31S5YKaBlvM8FgQdbQT1sOAVeSOO3o0z74L0HV gFWsPirSYPQnJxtw3QL4ypPNgcnMkJlDua5icoB36vAK5ne+ZXD/mxusj5nIZ0PpLpMa ejb97Fvd+wPPrKKRayOSeQXdJEHGR08rlkDwW80eqP6VMToy/qfZu3Ro3VkWRp1KEk6H xkT6n1d2qWfgmlbFh9Q3vvx0yp0hUgkQKExxvkEzIIO8W15X6Q8+LsJoKjPpgaeaBXQk lqceRySglZ8m29mYlSLKqfq7oBy3WXOT5rRrjx5wh7xdCMAMPWRjkJYix+VUhBRIkT4W lp0w== X-Gm-Message-State: AA+aEWbMX8/QIZE3NA7oaJGajDXJhqKIlyUB409fcdnWTDLCk4spBAkT lj3QnhWCBEMtra1OC493LMBzEDCh X-Google-Smtp-Source: AJdET5fNiPpDlyTLDu6CgaP3zgmU4rBXdeViebX02cZkJNOM9Yl5k5LGiDklIL0DZ0gpnxw9RM9z0g== X-Received: by 2002:a1c:cb4c:: with SMTP id b73mr12010713wmg.69.1542922827423; Thu, 22 Nov 2018 13:40:27 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD732F5007DE18DA1F72FF8D9.dip0.t-ipconnect.de. [2003:dc:d732:f500:7de1:8da1:f72f:f8d9]) by smtp.googlemail.com with ESMTPSA id x14sm29755554wrm.65.2018.11.22.13.40.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 13:40:26 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, narmstrong@baylibre.com, jbrunet@baylibre.com Subject: [PATCH v2 2/4] clk: meson: clk-regmap: add read-only gate ops Date: Thu, 22 Nov 2018 22:40:15 +0100 Message-Id: <20181122214017.25643-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122214017.25643-1-martin.blumenstingl@googlemail.com> References: <20181122214017.25643-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-20181122_134039_522567_21FE7B43 X-CRM114-Status: GOOD ( 12.26 ) 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, mturquette@baylibre.com, linux-kernel@vger.kernel.org, Martin Blumenstingl , linux-clk@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 Some of the gate clocks are described as "just in case" bits in the datasheet. Examples are the ABP, PERIPH, AXI and L2 DRAM clocks on Meson8b. The datasheet suggests that these bits are not touched. The full explanation is: "Set to 1 to manually disable the [...] clock when changing the mux selection. Typically this bit is set to 0 since the clock muxes can switch without glitches.". This adds new read-only ops for gate clocks so we can describe these clocks in our clock controller drivers while ensuring that we can't accidentally modify the registers. Signed-off-by: Martin Blumenstingl Acked-by: Neil Armstrong --- drivers/clk/meson/clk-regmap.c | 5 +++++ drivers/clk/meson/clk-regmap.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/clk/meson/clk-regmap.c b/drivers/clk/meson/clk-regmap.c index 305ee307c003..c515f67322a3 100644 --- a/drivers/clk/meson/clk-regmap.c +++ b/drivers/clk/meson/clk-regmap.c @@ -50,6 +50,11 @@ const struct clk_ops clk_regmap_gate_ops = { }; EXPORT_SYMBOL_GPL(clk_regmap_gate_ops); +const struct clk_ops clk_regmap_gate_ro_ops = { + .is_enabled = clk_regmap_gate_is_enabled, +}; +EXPORT_SYMBOL_GPL(clk_regmap_gate_ro_ops); + static unsigned long clk_regmap_div_recalc_rate(struct clk_hw *hw, unsigned long prate) { diff --git a/drivers/clk/meson/clk-regmap.h b/drivers/clk/meson/clk-regmap.h index ed2d4348dbe2..e9c5728d40eb 100644 --- a/drivers/clk/meson/clk-regmap.h +++ b/drivers/clk/meson/clk-regmap.h @@ -51,6 +51,7 @@ clk_get_regmap_gate_data(struct clk_regmap *clk) } extern const struct clk_ops clk_regmap_gate_ops; +extern const struct clk_ops clk_regmap_gate_ro_ops; /** * struct clk_regmap_div_data - regmap backed adjustable divider specific data