From patchwork Tue Mar 28 14:46:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 9649859 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 8888060349 for ; Tue, 28 Mar 2017 14:46:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AC5527F9F for ; Tue, 28 Mar 2017 14:46:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FA60283E2; Tue, 28 Mar 2017 14:46:55 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 27BED283A6 for ; Tue, 28 Mar 2017 14:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=g0XrSt3wLTt7HRtjEzQ+pLtx31TLxWoh4GM87OuCIs0=; b=Nn8AAlOBsTdkALtnerAEQCB1FZ 2BPRE1D/SxHYBNz5v0Vfh3MnwAY2RxLYAhqrLQj/pSiVLKcjJSLAmar9nCdDKDTCd/doVhfv3cNB1 8ceNxDUD6BOeDaVU73+8WOm+fAethqxoBNH0Nfx7gnVZ4gvzfkqR2PszYEj1jrJFZiOJJFkyAdbMg Xy5RLPeBU1ITDjNlltTyvA8OlrgascArzoodRsrJQackdXxI3xjaT2u+TtWWIIWCPomE0FFEX0at0 Fox2hm7LOuEg56UTDCaeDwkOw/NTtYKrZQnqlugCay4NPSp82DJbkCYHfELktH+qkkUZE+05sR0OD +TX2T6lg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cssOX-0000Ik-BK; Tue, 28 Mar 2017 14:46:49 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cssOP-0008TQ-AL for linux-amlogic@lists.infradead.org; Tue, 28 Mar 2017 14:46:43 +0000 Received: by mail-wm0-x230.google.com with SMTP id u132so41693436wmg.0 for ; Tue, 28 Mar 2017 07:46:20 -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=bgNywnCnr2MX1DZvRNpVftc3Qsif2ljGTVjoF6TFyIg=; b=YhaMgC/cwp3N/vDoMegcqMLnCThXr9Q0wfYihi0yjO6jlQWbvy8abYdCfem6AOKK0a nCcNKJ2MQ3evz+d5cJ6a0+FL7+aBxmeVKzoRcR1niQEssCDTYxyT7j+1zDe33RTExrtY msSiLsG+QvoR+sdWwcaX4PfhASnBJUMXbg/maZGQkjRsepOQ8ElBowyn0fovFEZmZOYX 7vRo2unnx1UjNXLSx6BtaobVK+PfZ/U8njpmeeltHJu/zNCgqKqU8+/dd8MF2IwgBsW2 G5EHVKYMyrAJ+WXy1KDhxK0WJ1zryfEGGx8yhncK7B89s1e+qECNWzaIvjziOKVGpli+ znEQ== 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=bgNywnCnr2MX1DZvRNpVftc3Qsif2ljGTVjoF6TFyIg=; b=d2tLMIwHSGWwXl10MkzKqZMLPhG9rOMV15n7XeeDRenAeFVDzbcvDFQXOB8ILSJhCa 1nXJ14ru3N3E5DzWqV/hzszIcXymOX49ceXLj5B2ZIErDzgKFRSn1eu7waJ3h03BuX6L fFMp5DgTGMmpoIARjuCYH8n94ANZHqvjiYck1+1cY9R24nlFUXV/wnjkVd5v+uOAsg1X SVmv0Rexe4ZSmVFhryh3SK2f+bbFoqhxeSUu2bPrC0pcDokf4HnOk9jLE57n1JMQS24e eaZgihkMxyCxsgX8yaTaxYSTwTp6nvue9lsKUvOlfsuvIPqyqze91jNMkRPS12wO4zVO LPlA== X-Gm-Message-State: AFeK/H1zGl/91IEOeXcea0hsMZsn7MiGeoQEFUMXvIeZRqY6ESic1JUZX+FpO1pOJkPPkbUS X-Received: by 10.28.13.69 with SMTP id 66mr4430693wmn.137.1490712379544; Tue, 28 Mar 2017 07:46:19 -0700 (PDT) Received: from localhost.localdomain (cag06-3-82-243-161-21.fbx.proxad.net. [82.243.161.21]) by smtp.googlemail.com with ESMTPSA id a18sm5159457wrc.58.2017.03.28.07.46.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 07:46:19 -0700 (PDT) From: Jerome Brunet To: Michael Turquette , Stephen Boyd , Kevin Hilman , Carlo Caione Subject: [PATCH v1 6/8] clk: meson: gxbb: add cts_i958 clock Date: Tue, 28 Mar 2017 16:46:03 +0200 Message-Id: <20170328144605.25278-7-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170328144605.25278-1-jbrunet@baylibre.com> References: <20170328144605.25278-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170328_074641_645504_9F90787A X-CRM114-Status: GOOD ( 11.98 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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) 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