From patchwork Thu Mar 26 11:13:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 46362 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5791421585 for ; Thu, 26 Mar 2015 11:14:34 +0000 (UTC) Received: by wizj7 with SMTP id j7sf4854015wiz.0 for ; Thu, 26 Mar 2015 04:14:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=uvwXDnZqRyQUj1gBWVSmcj63O3zNMH+tkcdYKU94pis=; b=VoK6uKdq/oeTR4pdOBqsMuoSlO3CFlgbfGJg7zD8EVrnIBJghYmu2MFzqq97nr9hsA tcWdM0n807XcEwX3gp9gePXLsGCvhgzS3cdHaT5CJ7ifvYYvX+QsPCbj9S61YAXzZ2UX UgogydL2WlvZmx4WXRFah+W1mG3NP1jDE1ZXAjYPR8iU8GSSKaoUnk8XqZp0Jv2wjQBx 3tlorRWJDCZmqB2FS7vZTVMT01s/Uaj1lfH9MtpfJHoM9uottgFKl5XyhfkEgAkfxdMQ RnjQ79DSslTXr2f/Qq1+eENKBlfx7dvhyoKgg7/MknR2gLnu+2mVP6E+3y+jluDlGTwN q+lw== X-Gm-Message-State: ALoCoQl0OoYiSisouFdqQ9ZFT8tDJPQ8YpB5agxrmH1Qxxjbz1xdKKikobWOxeAbLNDyLnd3Et4G X-Received: by 10.152.164.171 with SMTP id yr11mr3223453lab.4.1427368473633; Thu, 26 Mar 2015 04:14:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.243.37 with SMTP id wv5ls224503lac.60.gmail; Thu, 26 Mar 2015 04:14:33 -0700 (PDT) X-Received: by 10.112.181.231 with SMTP id dz7mr12340638lbc.47.1427368473352; Thu, 26 Mar 2015 04:14:33 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id ti8si4291015lbb.149.2015.03.26.04.14.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 04:14:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbbsy1 with SMTP id sy1so38198709lbb.1 for ; Thu, 26 Mar 2015 04:14:33 -0700 (PDT) X-Received: by 10.112.218.5 with SMTP id pc5mr13230770lbc.32.1427368473251; Thu, 26 Mar 2015 04:14:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp530461lbq; Thu, 26 Mar 2015 04:14:32 -0700 (PDT) X-Received: by 10.70.48.37 with SMTP id i5mr25502984pdn.111.1427368471548; Thu, 26 Mar 2015 04:14:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gm2si1507102pbc.22.2015.03.26.04.14.29; Thu, 26 Mar 2015 04:14:31 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751840AbbCZLO3 (ORCPT + 5 others); Thu, 26 Mar 2015 07:14:29 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:34227 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbbCZLO2 (ORCPT ); Thu, 26 Mar 2015 07:14:28 -0400 Received: by pdbni2 with SMTP id ni2so59742320pdb.1 for ; Thu, 26 Mar 2015 04:14:28 -0700 (PDT) X-Received: by 10.70.45.227 with SMTP id q3mr26334000pdm.22.1427368468535; Thu, 26 Mar 2015 04:14:28 -0700 (PDT) Received: from localhost.localdomain ([211.79.119.21]) by mx.google.com with ESMTPSA id wg9sm1875069pab.17.2015.03.26.04.14.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 04:14:28 -0700 (PDT) From: Leo Yan To: Wei Xu , Dan Zhao , zhenwei.wang@hisilicon.com, Haojian Zhuang , Bintian Wang , mturquette@linaro.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: Leo Yan Subject: [PATCH 4/4] clk: hisi: add stub clock register function Date: Thu, 26 Mar 2015 19:13:39 +0800 Message-Id: <1427368419-22222-5-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427368419-22222-1-git-send-email-leo.yan@linaro.org> References: <1427368419-22222-1-git-send-email-leo.yan@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leo.yan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add stub clock register function, so can easily enable stub clock for platforms. Signed-off-by: Leo Yan --- drivers/clk/hisilicon/clk.c | 29 +++++++++++++++++++++++++++++ drivers/clk/hisilicon/clk.h | 12 ++++++++++++ 2 files changed, 41 insertions(+) diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c index 1e4c5c6..74ce813 100644 --- a/drivers/clk/hisilicon/clk.c +++ b/drivers/clk/hisilicon/clk.c @@ -244,3 +244,32 @@ void __init hisi_clk_register_gate_sep(struct hisi_gate_clock *clks, data->clk_data.clks[clks[i].id] = clk; } } + +void __init hisi_clk_register_stub(struct hisi_stub_clock *clks, int nums, + struct hisi_clock_data *data, + struct device_node *np) +{ + struct clk *clk; + int i; + + for (i = 0; i < nums; i++) { + clk = hisi_register_stub_clk(np, + clks[i].id, + clks[i].name, + clks[i].parent_name, + clks[i].flags, + &hisi_clk_lock); + if (IS_ERR(clk)) { + pr_err("%s: failed to register clock %s\n", + __func__, clks[i].name); + continue; + } + + if (clks[i].alias) + clk_register_clkdev(clk, clks[i].name, NULL); + + data->clk_data.clks[clks[i].id] = clk; + } + + return; +} diff --git a/drivers/clk/hisilicon/clk.h b/drivers/clk/hisilicon/clk.h index e99184a..89ce9ad 100644 --- a/drivers/clk/hisilicon/clk.h +++ b/drivers/clk/hisilicon/clk.h @@ -90,6 +90,14 @@ struct hisi_gate_clock { const char *alias; }; +struct hisi_stub_clock { + unsigned int id; + char *name; + const char *parent_name; + unsigned long flags; + const char *alias; +}; + struct clk *hisi_register_clkgate_sep(struct device *, const char *, const char *, unsigned long, void __iomem *, u8, @@ -113,4 +121,8 @@ void __init hisi_clk_register_gate(struct hisi_gate_clock *, int, struct hisi_clock_data *); void __init hisi_clk_register_gate_sep(struct hisi_gate_clock *, int, struct hisi_clock_data *); +void __init hisi_clk_register_stub(struct hisi_stub_clock *clks, int nums, + struct hisi_clock_data *data, + struct device_node *np); + #endif /* __HISI_CLK_H */