Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp570860imm; Wed, 20 Jun 2018 03:07:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJUUU7rbfnWfeWEttTV9rqLhvNLRJBOpjEb2OKVdtJyS+8XbqAsHf8g/qXD6zMDiVNGZyh6 X-Received: by 2002:a17:902:ac97:: with SMTP id h23-v6mr23181554plr.140.1529489272968; Wed, 20 Jun 2018 03:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529489272; cv=none; d=google.com; s=arc-20160816; b=mpQr5Dhr3Z8XG/xTGUERTxN6F3mHDRseR7ip/20sCzjRaxMgkWu4UH6CTVgxoh5LDJ in7xwMZprCVLqyefV/a+L8mZdbGP+zWx0WDff44UvCvcj6Dv+BPW2Oa214PN+PetTTT/ o2qplUd+iXSlBt8kwq3ias54viY7gxbeuTxvXoBRym+MLodcVU/VZSZhZQmicI8hV+Ub v8XB3P5z8oOSvmXDAKFuGugz5mYpk7TUH2gUEZ/nWBSXZ+U6IK5i5SLuSkm366f09J7Q guiOJG0JmL8kP9Da/c5E6CN0kMiZHh9eybRrM/MHGaX0BEBtUpfIg2CUtoAgxmMBagqC hMlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/25jG1/AlkO1wnTVMssBMqhJnfLOsH7SOsbHveCnpzk=; b=TXsKcEQcDZ2BEcfwIzw4Ywy3PGmKLlXARuWfA1ITlK8gqyFaRkAjuky9axL7P72Soe FMdgpoCrAsLe7993E6oNx+e4Us9FRkCjqbD+kJXoC0ufe8Cb/6K0UKn7DKWpbZpMtgJB 35rWb2UAp7y2/c2ODh8NhqVGabFX9cFxmEHJ7m2zKedQg+W62vCfaKieZy0W3FIc3IcW g2KO0osGCcheJzw+ukAL36dRrOIjXVxuO0W8dzcQlKlGbcryjmZ6dGs4eGRFBjwxyfQ2 mFE+2uJ4WFLa1BwiPzodzZpnuUdyF+mkGmja5NUTeheUyQyZ0zj01w+BaSpc06x9QK6+ 0dHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=p0MyeK9B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si1756091pgf.222.2018.06.20.03.07.39; Wed, 20 Jun 2018 03:07:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=p0MyeK9B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754230AbeFTKGq (ORCPT + 99 others); Wed, 20 Jun 2018 06:06:46 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36298 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754104AbeFTKGV (ORCPT ); Wed, 20 Jun 2018 06:06:21 -0400 Received: by mail-wr0-f195.google.com with SMTP id f16-v6so2659199wrm.3 for ; Wed, 20 Jun 2018 03:06: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=/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=h7ndnThmNSScK1oYQL5nb3djDcjhZ0HNm56m3YK8MIqLOZ49wfPPfbWsJJTEIj9DjQ Dd+XYFo10Wf0/W+UpOvIVrNYmzppH/1hqqsMHntf2PUj/2HFvEpD9TQ0cl0Ms+USwyC8 wzF7kNNIbiyhQYNOqE1D2puaPPyYLOz44iLOEQfYc1M0pqYzloJ6gI3Hytl6UXrJHobn 3U4L84J2c3+s626oQCnJl36+eFJbhO+DsX7Icb/XbVy9ig+2+ESrE40iCn5qu3cQ7cV8 5RpbdUMW/5Qx+/dO0NAebGEHSMH9HCkeQRPHNLz0cBR/+8lPLXYMEuxnz9MWynW6j5He 6Mvw== X-Gm-Message-State: APt69E3DBR4qT7fIKr4xgEUtV1P46jWGzOgJlT5JVa4VAJnWbD+nSISH G3U5h9J+P21OsHFIkX37rJW2cQ== 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 Cc: Jerome Brunet , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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, }, }; -- 2.14.3