From patchwork Fri Jun 10 00:32:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Turquette X-Patchwork-Id: 9168665 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 79759604DB for ; Fri, 10 Jun 2016 00:32:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CD0E28047 for ; Fri, 10 Jun 2016 00:32:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6176C28368; Fri, 10 Jun 2016 00:32:59 +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 DC28828047 for ; Fri, 10 Jun 2016 00:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751118AbcFJAc6 (ORCPT ); Thu, 9 Jun 2016 20:32:58 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:35702 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751056AbcFJAc6 (ORCPT ); Thu, 9 Jun 2016 20:32:58 -0400 Received: by mail-pf0-f169.google.com with SMTP id c2so17812993pfa.2 for ; Thu, 09 Jun 2016 17:32:57 -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=B4EPEEBVla/8Dh3CrfXP03jgtXR68kHTu3/f+GlScnU=; b=zkwfFctamcd7iYhWPsrIJk/f2BqNBKbLDHqB9Gb3WTWdjq+dc6uTZU1EWAp569dh4L hKnwmF24tIM/kmx6Hz4MNLUeeDm/lcAXRfWIvqPEmpR2vh+f7TBs8V4yAeIhuTI7rSJa 14PQYd/9t59al4SH1HkZc8h/+ppMfioOoKtJ9ZjVgyURFRj3b6vYYadxvUhM0hTqqe8b gtLg7KVfriza+P6garHvnyCftPQfEu9YeuVEbjBOnMcM9jWA5V6ZlRX1EmSTYbAzgFf5 3G7C4sSzNzhDY0uMTBX9VRZnyXZFwPaCzwSjIdRweGFpZxxe9R9MxqtAAMHEBofXoxox wHdQ== 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=B4EPEEBVla/8Dh3CrfXP03jgtXR68kHTu3/f+GlScnU=; b=LSN2/qV7QBhGYUi1RJ249tKHd5nhN8q9WL7GMbj1K8RP6Fqpc5ITCMQ3MV+T6JpPrt wRSJMuT8lJcfj4ekzHRpAxkfAhAKQXvf/zsBh6/jmajg3A6ej8NSRSLmMkSkW3hIdCte r3oftflq7OK0f2HCa75IYGpdGZca+QokhI7CI5RPT0likykwgJCAO/X1/IgBS3/mYzQs LKFlAL7tCiPrujfjKXvTGEHdZpkIOE+EMVqdeX3extHMQSAgOw7ZvjA9hKwh0/u4Ixhs jAj7xRF0H8wZuTLxR/rvZqZQEETrhGk/vViJdu2YhWOvGVoMEnpXALnj/uNyUweh7E3S vxTA== X-Gm-Message-State: ALyK8tIcEJCstk8+MezDN5MgGHCHfNyurVhikQCWy+Ikn9FGiDfyR51UQABAcG/D8ccq5NJy X-Received: by 10.98.34.15 with SMTP id i15mr7365264pfi.29.1465518777268; Thu, 09 Jun 2016 17:32:57 -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 78sm1573131pfm.43.2016.06.09.17.32.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jun 2016 17:32:56 -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 1/7] clk: meson: add peripheral gate macro Date: Thu, 9 Jun 2016 17:32:48 -0700 Message-Id: <1465518774-26924-2-git-send-email-mturquette@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465518774-26924-1-git-send-email-mturquette@baylibre.com> References: <1465518774-26924-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. Signed-off-by: Michael Turquette --- 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 f3f3961..9436932 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;