From patchwork Fri Mar 31 13:04:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 9656347 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 3AC1F60352 for ; Fri, 31 Mar 2017 13:07:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 298082863A for ; Fri, 31 Mar 2017 13:07:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B14A28669; Fri, 31 Mar 2017 13:07:30 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable 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 AE99128643 for ; Fri, 31 Mar 2017 13:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933259AbdCaNF3 (ORCPT ); Fri, 31 Mar 2017 09:05:29 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:36474 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933242AbdCaNEX (ORCPT ); Fri, 31 Mar 2017 09:04:23 -0400 Received: by mail-wr0-f176.google.com with SMTP id w11so104285933wrc.3 for ; Fri, 31 Mar 2017 06:04:22 -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=XJf4mgAXlb7zOPVZy8jbDw7NFzjrDMcwe/C8QbV30Jo=; b=TL9adcM2ZKUK4jl7YUUYCKNCyc24md7j9wM6QTDqX32C+6zxcEybHMTgArPSFmrL20 Nef0Iy1eyq9GTasLHFFMgcSj14bCp+S+a+ePNRCRPgGStHXFSDE1iI+VZ2bq9RnUGu4M 0OFTiXFgrmBDqRGA2i6/t7E+vb2ZyhfkPGZ+9gBj1Yr2dwo4kh1Gyj5ItBwLyd/uq4Sz UcVI+ewFLvtKJ68JHBBscWpFPf604KQxdLeeHWxAfQxRkaD6l4FnUWddeICpYghKK52I zbTutHUp3IqZ3rRv0CZSG7lM/32L6vne+MEeWNrivC9EnWymNtUHUDbC3kNO3RkffGLa uzdA== 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; bh=XJf4mgAXlb7zOPVZy8jbDw7NFzjrDMcwe/C8QbV30Jo=; b=MSZlYaIt0bhjSxcOqTId1FwzGEtcj/8Xd+u3g5xFmOADsNMiSmKr7N/7Awb7Q3boWt 4HkopnNyeZNX1DyeZk/do6Pp7cTjVVfHAv0lCFRfmA8LwcYpGYmHqM39wovKUH8Vdpor agU8pktI9zgB9VitcaYYOuFfUjn9/R9omdKHs1aXmgNUbFSW6AzvU8sq8X4CBqHbt8mU wtuVxi44nM4vOgMQ8myKQc19NDyR+jyWM1zJ6fv/cY36Rn9LEwvy2/xhozptbf6JxrGE WA8CXpbBabEEwKes4+OU1Z9/wOPjM7X2jJKVn1047xbgUVkneeU0NeQJSx72EclKW192 248w== X-Gm-Message-State: AFeK/H0CBdLC5U9wqLeb1klVVMlZSo/6iTiN3gBN4PvmhI7bF7TtQenELdhJM1viJHKbRdHK X-Received: by 10.28.198.134 with SMTP id w128mr3163573wmf.80.1490965461318; Fri, 31 Mar 2017 06:04:21 -0700 (PDT) Received: from localhost.localdomain (uluru.liltaz.com. [163.172.81.188]) by smtp.googlemail.com with ESMTPSA id 189sm2844439wmm.31.2017.03.31.06.04.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 06:04:20 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong , Michael Turquette , Stephen Boyd , Kevin Hilman , Carlo Caione Cc: Jerome Brunet , linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/8] clk: meson: gxbb: add cts_i958 clock Date: Fri, 31 Mar 2017 15:04:09 +0200 Message-Id: <20170331130411.4781-7-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170331130411.4781-1-jbrunet@baylibre.com> References: <20170331130411.4781-1-jbrunet@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 This adds the cts_i958 clock to control the clock source of the spdif output block. This mux is not explicitly mentionned in the documentation but it is critical to the spdif dai. It is used to select whether the clock source of the spdif output is cts_amclk (when data are taken from i2s buffer) or the cts_mclk_i958 (when data are taken from the spdif buffer) Acked-by: Michael Turquette Signed-off-by: Jerome Brunet --- drivers/clk/meson/gxbb.c | 21 +++++++++++++++++++++ drivers/clk/meson/gxbb.h | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 72492cc63915..ad5f027af1a2 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -933,6 +933,24 @@ static struct clk_gate gxbb_cts_mclk_i958 = { }, }; +static struct clk_mux gxbb_cts_i958 = { + .reg = (void *)HHI_AUD_CLK_CNTL2, + .mask = 0x1, + .shift = 27, + .lock = &clk_lock, + .hw.init = &(struct clk_init_data){ + .name = "cts_i958", + .ops = &clk_mux_ops, + .parent_names = (const char *[]){ "cts_amclk", "cts_mclk_i958" }, + .num_parents = 2, + /* + *The parent is specific to origin of the audio data. Let the + * consumer choose the appropriate parent + */ + .flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, + }, +}; + /* Everything Else (EE) domain gates */ static MESON_GATE(gxbb_ddr, HHI_GCLK_MPEG0, 0); static MESON_GATE(gxbb_dos, HHI_GCLK_MPEG0, 1); @@ -1139,6 +1157,7 @@ static struct clk_hw_onecell_data gxbb_hw_onecell_data = { [CLKID_CTS_MCLK_I958] = &gxbb_cts_mclk_i958.hw, [CLKID_CTS_MCLK_I958_SEL] = &gxbb_cts_mclk_i958_sel.hw, [CLKID_CTS_MCLK_I958_DIV] = &gxbb_cts_mclk_i958_div.hw, + [CLKID_CTS_I958] = &gxbb_cts_i958.hw, }, .num = NR_CLKS, }; @@ -1258,6 +1277,7 @@ static struct clk_hw_onecell_data gxl_hw_onecell_data = { [CLKID_CTS_MCLK_I958] = &gxbb_cts_mclk_i958.hw, [CLKID_CTS_MCLK_I958_SEL] = &gxbb_cts_mclk_i958_sel.hw, [CLKID_CTS_MCLK_I958_DIV] = &gxbb_cts_mclk_i958_div.hw, + [CLKID_CTS_I958] = &gxbb_cts_i958.hw, }, .num = NR_CLKS, }; @@ -1382,6 +1402,7 @@ static struct clk_mux *const gxbb_clk_muxes[] = { &gxbb_mali, &gxbb_cts_amclk_sel, &gxbb_cts_mclk_i958_sel, + &gxbb_cts_i958, }; static struct clk_divider *const gxbb_clk_dividers[] = { diff --git a/drivers/clk/meson/gxbb.h b/drivers/clk/meson/gxbb.h index efa90dad3478..3b0665099a1e 100644 --- a/drivers/clk/meson/gxbb.h +++ b/drivers/clk/meson/gxbb.h @@ -283,8 +283,9 @@ #define CLKID_CTS_MCLK_I958 110 #define CLKID_CTS_MCLK_I958_SEL 111 #define CLKID_CTS_MCLK_I958_DIV 112 +#define CLKID_CTS_I958 113 -#define NR_CLKS 113 +#define NR_CLKS 114 /* include the CLKIDs that have been made part of the stable DT binding */ #include