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: 9656313 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 C8DEC60352 for ; Fri, 31 Mar 2017 13:04:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9FE7285EF for ; Fri, 31 Mar 2017 13:04:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE9E228618; Fri, 31 Mar 2017 13:04: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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham 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 5F917285EF for ; Fri, 31 Mar 2017 13:04:59 +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=tX8j4ldO12yG4v2pYG//XdhaGNQfN1zu7DdtyN24YHc=; b=DROfsgJstmvz/VkwDD5/hsA6LI TJJRF4s8hgz4uBb/BQqWFKtkNdgANv9RnYwlef0FwoZOgbfLk35k+p/rrxutBBeyhqP++SmIsAw8p d8OTJdgGWA9f7j8L42jfKSjI9qijGm9DwR7OpkdGT1yEQOD++VoyX0OlwiPziIDMRBbYLn1ueV/SK pqaqiQFUXO5G/3egn3ZLY2/sQOlvzjWNLAeycYgBCfuR+FGmxlaTn3tNzJ+AogyYe1IbPN7FhdKXc 6GHDpJs3Y4aYqKliTUUmoyDnrV7e7SxGOGBY2vOiXp8wGzgbuDZBPhQZ9Fr73lnx5AhTgEIR0dMR1 me6zkXXg==; 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 1ctwEX-000333-81; Fri, 31 Mar 2017 13:04:53 +0000 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctwEN-0002t8-7g for linux-amlogic@lists.infradead.org; Fri, 31 Mar 2017 13:04:45 +0000 Received: by mail-wr0-x235.google.com with SMTP id l43so106970828wre.1 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=kN4e5tkg6TANqWDVzaEI5u3ugyhHw+zipgRisH+pqwB19BAjV28gpEEIEgS8nt8xF+ 2DDllsR6kePusbCqcsnTNyEvK0Uvkx4A6WoaxiUonNZOnzgQieJfgw8lItG+E22PLSoc I8dnEBmy2k3+zTHMyfr4JONX/NRxpenao2PBd/3gWB0tqs7gegPiCsla6rrx8ge9Dj2K k1bA35y82ztKB+cz5MKJWn8cW5hpud4eRpkO77b6NI4cwTs/OY73i+RYHDQirm9LAd7s 95DXZMvaWuP/3Z5eu+cwZlZ6PAiBperVqMPtT8uQElTLIhps8jnsTPfsCX4OkcpziMRk xG9Q== X-Gm-Message-State: AFeK/H0l0xokMaLhEza99N/l6CrCF6j4WVda3TyOAJYHdkl1daxABcWXjdwaQWID2HvFcA/2 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170331_060443_500883_10D3C549 X-CRM114-Status: GOOD ( 11.74 ) 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) 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