linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lubomir Rintel <lkundrak@v3.sk>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Lubomir Rintel <lkundrak@v3.sk>
Subject: [PATCH v3 02/13] clk: mmp: frac: Allow setting bits other than the numerator/denominator
Date: Wed, 20 May 2020 00:41:40 +0200	[thread overview]
Message-ID: <20200519224151.2074597-3-lkundrak@v3.sk> (raw)
In-Reply-To: <20200519224151.2074597-1-lkundrak@v3.sk>

For the I2S fractional clocks, there are more bits that need to be set
for the clock to run. Their actual meaning is unknown.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/clk/mmp/clk-frac.c | 3 +++
 drivers/clk/mmp/clk.h      | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c
index ed9928f5bdc7..48f592bd633d 100644
--- a/drivers/clk/mmp/clk-frac.c
+++ b/drivers/clk/mmp/clk-frac.c
@@ -148,7 +148,10 @@ static int clk_factor_init(struct clk_hw *hw)
 		val &= ~(masks->den_mask << masks->den_shift);
 		val |= (factor->ftbl[0].den & masks->den_mask) <<
 			masks->den_shift;
+	}
 
+	if (!(val & masks->enable_mask) || i >= factor->ftbl_cnt) {
+		val |= masks->enable_mask;
 		writel(val, factor->base);
 	}
 
diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h
index 20dc1e5dd756..369a09256e2f 100644
--- a/drivers/clk/mmp/clk.h
+++ b/drivers/clk/mmp/clk.h
@@ -16,6 +16,7 @@ struct mmp_clk_factor_masks {
 	unsigned int den_mask;
 	unsigned int num_shift;
 	unsigned int den_shift;
+	unsigned int enable_mask;
 };
 
 struct mmp_clk_factor_tbl {
-- 
2.26.2


  parent reply	other threads:[~2020-05-19 22:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 22:41 [PATCH v3 00/13] MMP2 Clock Updates (GPU, Audio, Power Islands) Lubomir Rintel
2020-05-19 22:41 ` [PATCH v3 01/13] clk: mmp: frac: Do not lose last 4 digits of precision Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` Lubomir Rintel [this message]
2020-05-28  1:01   ` [PATCH v3 02/13] clk: mmp: frac: Allow setting bits other than the numerator/denominator Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 03/13] dt-bindings: marvell,mmp2: Add clock id for the I2S clocks Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 04/13] dt-bindings: marvell,mmp2: Add clock id for the Audio clock Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 05/13] clk: mmp2: Move thermal register defines up a bit Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 06/13] clk: mmp2: Rename mmp2_pll_init() to mmp2_main_clk_init() Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 07/13] clk: mmp2: Add the I2S clocks Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 08/13] clk: mmp2: Add the audio clock Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 09/13] dt-bindings: clock: Make marvell,mmp2-clock a power controller Lubomir Rintel
2020-05-26 23:05   ` Rob Herring
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 10/13] dt-bindings: marvell,mmp2: Add ids for the power domains Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 11/13] clk: mmp2: Add support for power islands Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd
2020-05-19 22:41 ` [PATCH v3 12/13] dt-bindings: clock: Add Marvell MMP Audio Clock Controller binding Lubomir Rintel
2020-05-26 23:06   ` Rob Herring
2020-05-28  1:01   ` Stephen Boyd
2020-06-04 20:47   ` Rob Herring
2020-05-19 22:41 ` [PATCH v3 13/13] clk: mmp2: Add audio clock controller driver Lubomir Rintel
2020-05-28  1:01   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519224151.2074597-3-lkundrak@v3.sk \
    --to=lkundrak@v3.sk \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).