From patchwork Thu Jun 23 02:01:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Turquette X-Patchwork-Id: 9194349 X-Patchwork-Delegate: mturquette@baylibre.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 91A036075C for ; Thu, 23 Jun 2016 02:11:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 809672841E for ; Thu, 23 Jun 2016 02:11:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74ACA28426; Thu, 23 Jun 2016 02:11:51 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11FC22841E for ; Thu, 23 Jun 2016 02:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbcFWCLu (ORCPT ); Wed, 22 Jun 2016 22:11:50 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34329 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbcFWCLu (ORCPT ); Wed, 22 Jun 2016 22:11:50 -0400 Received: by mail-pa0-f47.google.com with SMTP id bz2so22252132pad.1 for ; Wed, 22 Jun 2016 19:11:49 -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; bh=2x9HN5FkgZn5hYsNskRoIbFVaoFl0U5rzR39sPfGlmE=; b=eETook+sz2qHsvk9ZpiTat6/oBS6avLmg4whkKAzAu1/O9c03oNsOMHN9VKMRLC043 JYsuW/9sFvvkCaum6PU5DnzKR3XzJfbpwutuy3v1gWEqxN6YdL4UmNRltAB6VJSVuEUT O6WaQ2+LFQ1ZNDPfDwHEswgIhgobF9pD761h3yXynYogj/yKgk4cG75fWyElDvZcTdpm Gh1moXbsLYy1AjRL9jSWjnTwhebB0T2uQuYqfojed2Z9mZx/5kTtpKMSWXCP/bDsWxZl 0w0SYeuuLSl9e+82X9gb/8Y+aurZv3ucq+z8885GiInpUC/MS1VDv5AfU8ftTyFAiQt2 jpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2x9HN5FkgZn5hYsNskRoIbFVaoFl0U5rzR39sPfGlmE=; b=S+04/0wlvpxwZ7ydG9+0evGWn3I9EQvUKrnpOVgtM5nekocBG26fQFlsXXvumw45UB IZWsQKjh/ygYQ74MoOw+AaJmDkGslrddXEGo1rUPWIbR4eOzekj2YqYK27O/Ow9xZdfC 8DH4xgIxXowEMCNeCPQ87fhTYGcprncUlDrCO6E+gy7QZbxLBX6LW7I/taoP2Utk0PfI oKu8xwMhxWSddOgOziL2w2XGFkuCVj9IrhKNTgi0TegFvEDSC0NpFRdeh2BoGeyJEmhF Tf4CLFimAU7uHq99sSBdAI0wvpItOVuj6vqNCJ3tZjbuhELl3aqUv/W2y+uDHvs893RH uLMg== X-Gm-Message-State: ALyK8tKEZwivTvsI5hcGJgeU4isPJzrTKFPoVm9LoGql5KuUgb82VDlGVOBnR8rpqDG7oVEH X-Received: by 10.66.161.73 with SMTP id xq9mr38073246pab.6.1466647909480; Wed, 22 Jun 2016 19:11:49 -0700 (PDT) Received: from localhost (cpe-172-248-200-249.socal.res.rr.com. [172.248.200.249]) by smtp.gmail.com with ESMTPSA id h66sm2657001pfe.6.2016.06.22.19.11.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 19:11:48 -0700 (PDT) From: Michael Turquette To: linux-clk@vger.kernel.org Cc: linux-amlogic@lists.infradead.org, khilman@baylibre.com, carlo@endlessm.com, victor.wan@amlogic.com, jerry.cao@amlogic.com, xing.xu@amlogic.com Subject: [PATCH v2 2/6] clk: meson: add peripheral gate macro Date: Wed, 22 Jun 2016 19:01:16 -0700 Message-Id: <1466647280-17596-3-git-send-email-mturquette@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1466647280-17596-1-git-send-email-mturquette@baylibre.com> References: <1466647280-17596-1-git-send-email-mturquette@baylibre.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are a series of peripheral and system gate clocks that fan out from the clk81 signal. Add a helper macro to statically initialize these gate clocks. Tested-by: Kevin Hilman Signed-off-by: Michael Turquette --- No change in v2. drivers/clk/meson/clkc.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h index f3f396168ba4..9436932880c0 100644 --- a/drivers/clk/meson/clkc.h +++ b/drivers/clk/meson/clkc.h @@ -73,6 +73,20 @@ struct meson_clk_cpu { int meson_clk_cpu_notifier_cb(struct notifier_block *nb, unsigned long event, void *data); +#define MESON_GATE(_name, _reg, _bit) \ +struct clk_gate gxbb_##_name = { \ + .reg = (void __iomem *) _reg, \ + .bit_idx = (_bit), \ + .lock = &clk_lock, \ + .hw.init = &(struct clk_init_data) { \ + .name = #_name, \ + .ops = &clk_gate_ops, \ + .parent_names = (const char *[]){ "clk81" }, \ + .num_parents = 1, \ + .flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), \ + }, \ +}; + /* clk_ops */ extern const struct clk_ops meson_clk_pll_ro_ops; extern const struct clk_ops meson_clk_pll_ops;