Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1655179 > unrolled thread

[PATCH v4 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER

Started byPhil Elwell <phil@raspberrypi.org>
First post2017-06-01 16:20 +0200
Last post2017-06-03 00:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v4 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER Phil Elwell <phil@raspberrypi.org> - 2017-06-01 16:20 +0200
    Re: [PATCH v4 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER Stephen Boyd <sboyd@codeaurora.org> - 2017-06-03 00:50 +0200

#1655179 — [PATCH v4 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER

FromPhil Elwell <phil@raspberrypi.org>
Date2017-06-01 16:20 +0200
Subject[PATCH v4 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER
Message-ID<tNz7c-3D6-43@gated-at.bofh.it>
Restrict clock sources for the PCM peripheral to the oscillator and
PLLD_PER because other source may have varying rates or be switched off.
Prevent other sources from being selected by replacing their names in
the list of potential parents with dummy entries (entry index is
significant).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/clk/bcm/clk-bcm2835.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index 0258538..49867d2 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -1516,6 +1516,31 @@ struct bcm2835_clk_desc {
 	.parents = bcm2835_clock_per_parents,				\
 	__VA_ARGS__)
 
+/*
+ * Restrict clock sources for the PCM peripheral to the oscillator and
+ * PLLD_PER because other source may have varying rates or be switched
+ * off.
+ *
+ * Prevent other sources from being selected by replacing their names in
+ * the list of potential parents with dummy entries (entry index is
+ * significant).
+ */
+static const char *const bcm2835_pcm_per_parents[] = {
+	"-",
+	"xosc",
+	"-",
+	"-",
+	"-",
+	"-",
+	"plld_per",
+	"-",
+};
+
+#define REGISTER_PCM_CLK(...)	REGISTER_CLK(				\
+	.num_mux_parents = ARRAY_SIZE(bcm2835_pcm_per_parents),		\
+	.parents = bcm2835_pcm_per_parents,				\
+	__VA_ARGS__)
+
 /* main vpu parent mux */
 static const char *const bcm2835_clock_vpu_parents[] = {
 	"gnd",
@@ -1993,7 +2018,7 @@ struct bcm2835_clk_desc {
 		.int_bits = 4,
 		.frac_bits = 8,
 		.tcnt_mux = 22),
-	[BCM2835_CLOCK_PCM]	= REGISTER_PER_CLK(
+	[BCM2835_CLOCK_PCM]	= REGISTER_PCM_CLK(
 		.name = "pcm",
 		.ctl_reg = CM_PCMCTL,
 		.div_reg = CM_PCMDIV,
-- 
1.9.1

[toc] | [next] | [standalone]


#1656615

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-06-03 00:50 +0200
Message-ID<tO3yi-7c0-3@gated-at.bofh.it>
In reply to#1655179
On 06/01, Phil Elwell wrote:
> Restrict clock sources for the PCM peripheral to the oscillator and
> PLLD_PER because other source may have varying rates or be switched off.
> Prevent other sources from being selected by replacing their names in
> the list of potential parents with dummy entries (entry index is
> significant).
> 
> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
> Reviewed-by: Eric Anholt <eric@anholt.net>
> Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web