From patchwork Thu Sep 25 07:48:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 4973621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CBA9EBEEA6 for ; Thu, 25 Sep 2014 07:53:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8BA52027D for ; Thu, 25 Sep 2014 07:53:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 957DC20279 for ; Thu, 25 Sep 2014 07:53:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XX3qP-0005Ij-DX; Thu, 25 Sep 2014 07:52:05 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XX3q5-0004sA-UI; Thu, 25 Sep 2014 07:51:46 +0000 Received: by mail-pa0-f48.google.com with SMTP id bj1so3109278pad.35 for ; Thu, 25 Sep 2014 00:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lvaberZIcsPfL/aDo7kjmeeng5pILKq37+edFbUpusQ=; b=lwkSC3Q5xfLrhYNmglkXb3W6M5O7TTOcEgaQl+kWolyu2fHDFnJN1J0JGfDnNwIm4x PQQCJbbVYJHasnOkAo8aNtrml9EPuL64i8Hp1dO3Fejb7FbuUdX0k/sBK3S4wPBEFZZx mUfSVrSa1h7qdqQMT2lljLhhMMnoN+v1y0qcW/TOld2pfSN73XDO5/MoQ9G9Sj54e0bY J/PiOET8aMdvTcmXCgHNkM7qguTvurFAeJqc6jm+6Vc5XsJAOyz2wR1e3vUzfXREhgUs II3eabQTJ/nGe0Nj5AZAXgQgo8UkRViNtWqBchXR35o8wc+6soitbZAz2prwqeD+akB/ +Szw== X-Received: by 10.68.65.74 with SMTP id v10mr2581773pbs.72.1411631484625; Thu, 25 Sep 2014 00:51:24 -0700 (PDT) Received: from localhost.localdomain ([58.22.7.114]) by mx.google.com with ESMTPSA id yr3sm1368881pac.1.2014.09.25.00.51.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Sep 2014 00:51:24 -0700 (PDT) From: Kever Yang To: heiko@sntech.de, Mike Turquette Subject: [PATCH v3 3/3] clk: rockchip: add clock node in PD_VIDEO Date: Thu, 25 Sep 2014 15:48:47 +0800 Message-Id: <1411631328-14973-4-git-send-email-kever.yang@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411631328-14973-1-git-send-email-kever.yang@rock-chips.com> References: <1411631328-14973-1-git-send-email-kever.yang@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140925_005146_007188_64B25088 X-CRM114-Status: GOOD ( 10.35 ) X-Spam-Score: -0.7 (/) Cc: huangtao@rock-chips.com, addy.ke@rock-chips.com, linux-kernel@vger.kernel.org, dianders@chromium.org, Kever Yang , linux-rockchip@lists.infradead.org, xjq@rock-chips.com, cf@rock-chips.com, hj@rock-chips.com, sonnyrao@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch add the clock node in PD_VIDEO Signed-off-by: Kever Yang Reviewed-by: Heiko Stuebner Reviewed-by: Doug Anderson Tested-by: Doug Anderson --- Changes in v3: - add a fix factor - introduce a virtual node to implement the clock struct Changes in v2: - split out the patch drivers/clk/rockchip/clk-rk3288.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c index dd204cb..d466814 100644 --- a/drivers/clk/rockchip/clk-rk3288.c +++ b/drivers/clk/rockchip/clk-rk3288.c @@ -296,6 +296,20 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_usb480m_p, 0, RK3288_CLKSEL_CON(32), 14, 2, MFLAGS, 8, 5, DFLAGS, RK3288_CLKGATE_CON(3), 11, GFLAGS), + /* + * We use aclk_vdpu by default GRF_SOC_CON0[7] setting in system, + * so we ignore the mux and make clocks nodes as following, + */ + GATE(ACLK_VCODEC, "aclk_vcodec", "aclk_vdpu", 0, + RK3288_CLKGATE_CON(9), 0, GFLAGS), + /* + * We introduce a virtul node of hclk_vodec_pre_v to split one clock + * sturct with a gate and a fix divider into two node in software. + */ + GATE(0, "hclk_vcodec_pre_v", "aclk_vdpu", 0, + RK3288_CLKGATE_CON(3), 10, GFLAGS), + GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre", 0, + RK3288_CLKGATE_CON(9), 1, GFLAGS), COMPOSITE(0, "aclk_vio0", mux_pll_src_cpll_gpll_usb480m_p, 0, RK3288_CLKSEL_CON(31), 6, 2, MFLAGS, 0, 5, DFLAGS, @@ -711,6 +725,12 @@ static void __init rk3288_clk_init(struct device_node *np) pr_warn("%s: could not register clock usb480m: %ld\n", __func__, PTR_ERR(clk)); + clk = clk_register_fixed_factor(NULL, "hclk_vcodec_pre", + "hclk_vcodec_pre_v", 0, 1, 4); + if (IS_ERR(clk)) + pr_warn("%s: could not register clock hclk_vcodec_pre: %ld\n", + __func__, PTR_ERR(clk)); + rockchip_clk_register_plls(rk3288_pll_clks, ARRAY_SIZE(rk3288_pll_clks), RK3288_GRF_SOC_STATUS);