From patchwork Wed Jun 20 10:06:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10476829 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 2FBFD604D3 for ; Wed, 20 Jun 2018 10:06:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EA3728E00 for ; Wed, 20 Jun 2018 10:06:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1309128E04; Wed, 20 Jun 2018 10:06:48 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 A4E8D28E00 for ; Wed, 20 Jun 2018 10:06:47 +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=QDGhOVoszQ3Tzo6HajOVkUAbvNU9bFQaF3lRV3+sGU8=; b=aW57HjfYCXPbIQOAZDGEOkQtCc 6ewc0A/R2pZRmQQQ8Bui8Wc3i7cQyFTuk69/+Q4OJSJqArl+gTltJT/DRZNCeXjIWKGUkd7a0uXAm s5S8Jx55+usKO0gWmYPQG7uykQVuaUja3wmGFmaasO4IA5jd1CT7MOTa0Jl1YWeqQWV/ZuAv9j/CN mZmQEIC/nE8qXJYlcl7P3B4IJSOXUSbaXIKg3dNxqqcrQqGVhT89g5M5tSMqjIu5+VoOmwrM8bOwS NeJzoEuUsI9n8vXWRoM4we5HTiq53vynls0tN4uP2m61is43IZ1brUPhkEIquCn2Z56kDnTUOScTP pk0Rka4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVa0i-0007Qb-VH; Wed, 20 Jun 2018 10:06:45 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVa0W-0007Mf-0b for linux-amlogic@lists.infradead.org; Wed, 20 Jun 2018 10:06:41 +0000 Received: by mail-wr0-x243.google.com with SMTP id x4-v6so2636963wro.11 for ; Wed, 20 Jun 2018 03:06:21 -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=/25jG1/AlkO1wnTVMssBMqhJnfLOsH7SOsbHveCnpzk=; b=p0MyeK9BLHvvnWDQHsfTZyz8ssDNbZRfvSRbmC8HWf851HgVH5HDIfjpYD7bjA5QkH OIFUvJCbjFlLaAqrYTl4/ROb6P58scr5Q0CiVZlCT8ie/UEuc/d6kQoN5Gswf9C6nmSQ /+aBoCggPd5kbKnaOaK3miIdBSwNJNPfMxBu9iXz7tUZ8PtOLJ5cLOFIbGjeZO66UplE Ksq2RxUcDqWdTGtkizznOquCHYW2ACm7Si5QE0oXd1WoAVPM/yCiaeK6s+XeTavyUqXF DCMfchHx9l/forEzqIxigS9lmiFEBjmkK9+5xW/6vygNpSxQ/2G93p7mFtempy67Uwo3 mvmA== 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=/25jG1/AlkO1wnTVMssBMqhJnfLOsH7SOsbHveCnpzk=; b=sTB8U1D+B90aZQIWjB7wsof0Xzfi2QIflzvy2cgX8Jk1s8hXxIm/0DjHmzZpmFUXya sAyGE4C0PV6UNUlJUH2bfLdbqNGnQmv8bJEksilDmNcsmqy33Z9XRO/ZK2nXc3Egqemr dUdXTm0YasBbyTKM+5EyTFbzmnLcXbD9SAT0PEfeHpkqOWuaJgyY0xZH20AjBS3iy2Ak r3tdMkmJLi5BKTWdWhwzNSWidj8dr3vQb2wUxEliF3G59WFQc9MXFWaaSutpwa4dcf8f fxeTuuyvaotZ9aGIzKYCGjSCV7qHP9nIs0S6OXl9nxjs2Bo9nJ6NUFZB2SrK2UipnjK5 hGeg== X-Gm-Message-State: APt69E3XppY3w0i8hISHJCpSe5A37/S93Lf4zNXdGqsIIklbT20BFBl4 7VX96LX9qwL9/2ejqKgNYNZGJQ== X-Google-Smtp-Source: ADUXVKJDKLmXf2EFvJFOpPITr/B1GTMFfpgPFsAUeBBpVLHNNGS1MmWImkI3xQXwUMCEs4+XS3R0UQ== X-Received: by 2002:adf:ba8f:: with SMTP id p15-v6mr18332730wrg.139.1529489180202; Wed, 20 Jun 2018 03:06:20 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id m10-v6sm2685852wrq.56.2018.06.20.03.06.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 03:06:19 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong , Kevin Hilman , Carlo Caione Subject: [PATCH 1/2] clk: meson: stop rate propagation for audio clocks Date: Wed, 20 Jun 2018 12:06:09 +0200 Message-Id: <20180620100610.29010-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180620100610.29010-1-jbrunet@baylibre.com> References: <20180620100610.29010-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180620_030632_066532_C0029424 X-CRM114-Status: GOOD ( 12.86 ) 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 It is actually a lot easier to setup the PLL with carefully chosen rates than relying on CCF clock propagation for this audio use case. This way, we can make sure we will always be able to provide the common audio clock rates, while having the PLL in the optimal operating range. For this, we stop the rate propagation at the mux picking the PLL and let it round to the closest matching PLL. Doing so, we can use the generic divider for the i2s clock. clk-audio-divider is no longer required. It was a (poor) attempt to use CCF rate propagation while making sure the PLL rate would be high enough to work with audio use cases. Signed-off-by: Jerome Brunet Acked-by: Neil Armstrong --- drivers/clk/meson/gxbb.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 297ebc391475..894a6adaa17a 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -970,28 +970,26 @@ static struct clk_regmap gxbb_cts_amclk_sel = { .mask = 0x3, .shift = 9, .table = (u32[]){ 1, 2, 3 }, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cts_amclk_sel", .ops = &clk_regmap_mux_ops, .parent_names = (const char *[]){ "mpll0", "mpll1", "mpll2" }, .num_parents = 3, - .flags = CLK_SET_RATE_PARENT, }, }; static struct clk_regmap gxbb_cts_amclk_div = { - .data = &(struct meson_clk_audio_div_data){ - .div = { - .reg_off = HHI_AUD_CLK_CNTL, - .shift = 0, - .width = 8, - }, + .data = &(struct clk_regmap_div_data) { + .offset = HHI_AUD_CLK_CNTL, + .shift = 0, + .width = 8, .flags = CLK_DIVIDER_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data){ .name = "cts_amclk_div", - .ops = &meson_clk_audio_divider_ops, + .ops = &clk_regmap_divider_ops, .parent_names = (const char *[]){ "cts_amclk_sel" }, .num_parents = 1, .flags = CLK_SET_RATE_PARENT, @@ -1018,13 +1016,13 @@ static struct clk_regmap gxbb_cts_mclk_i958_sel = { .mask = 0x3, .shift = 25, .table = (u32[]){ 1, 2, 3 }, + .flags = CLK_MUX_ROUND_CLOSEST, }, .hw.init = &(struct clk_init_data) { .name = "cts_mclk_i958_sel", .ops = &clk_regmap_mux_ops, .parent_names = (const char *[]){ "mpll0", "mpll1", "mpll2" }, .num_parents = 3, - .flags = CLK_SET_RATE_PARENT, }, };