mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c
@ 2019-05-23 14:29 Ahmad Fatoum
  2019-05-23 14:29 ` [PATCH v2 2/2] clk: at91: delete dead i2s/audio code Ahmad Fatoum
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2019-05-23 14:29 UTC (permalink / raw)
  To: barebox; +Cc: sam

sama5d2.c was added alongside the update to the remaining clk drivers
to support the new upstream device tree bindings, but wasn't wired in
anywhere.

To prepare for usage in future sama5d2 support, fix compilation errors
related to absence of locks and unavailability of audio/i2s clock/pll
handling.

With this change, there are no users for the few definition-less at91
audio/i2s registration function declarations. So remove those as well.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---

	Changes since v2:
	 - removed unused function declarations
	 - added one more patch to remove dead audio/i2s code in the other files
	
	Both suggested by Sam Ravnborg.

 drivers/clk/at91/pmc.h     | 17 -------------
 drivers/clk/at91/sama5d2.c | 52 +++++---------------------------------
 2 files changed, 6 insertions(+), 63 deletions(-)

diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
index 529498308f51..b553ea259c65 100644
--- a/drivers/clk/at91/pmc.h
+++ b/drivers/clk/at91/pmc.h
@@ -88,18 +88,6 @@ int of_at91_get_clk_range(struct device_node *np, const char *propname,
 
 struct clk *of_clk_hw_pmc_get(struct of_phandle_args *clkspec, void *data);
 
-struct clk *
-at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name,
-				 const char *parent_name);
-
-struct clk *
-at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name,
-				const char *parent_name);
-
-struct clk *
-at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name,
-				const char *parent_name);
-
 struct clk *
 at91_clk_register_generated(struct regmap *regmap,
 			    const char *name, const char **parent_names,
@@ -110,11 +98,6 @@ struct clk *
 at91_clk_register_h32mx(struct regmap *regmap, const char *name,
 			const char *parent_name);
 
-struct clk *
-at91_clk_i2s_mux_register(struct regmap *regmap, const char *name,
-			  const char * const *parent_names,
-			  unsigned int num_parents, u8 bus_id);
-
 struct clk *
 at91_clk_register_main_rc_osc(struct regmap *regmap, const char *name,
 			      u32 frequency, u32 accuracy);
diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c
index dc15f7d9cbf3..7627c584ac08 100644
--- a/drivers/clk/at91/sama5d2.c
+++ b/drivers/clk/at91/sama5d2.c
@@ -84,8 +84,6 @@ static const struct {
 	{ .n = "trng_clk",    .id = 47, .r = { .min = 0, .max = 83000000 }, },
 	{ .n = "pdmic_clk",   .id = 48, .r = { .min = 0, .max = 83000000 }, },
 	{ .n = "securam_clk", .id = 51, },
-	{ .n = "i2s0_clk",    .id = 54, .r = { .min = 0, .max = 83000000 }, },
-	{ .n = "i2s1_clk",    .id = 55, .r = { .min = 0, .max = 83000000 }, },
 	{ .n = "can0_clk",    .id = 56, .r = { .min = 0, .max = 83000000 }, },
 	{ .n = "can1_clk",    .id = 57, .r = { .min = 0, .max = 83000000 }, },
 	{ .n = "classd_clk",  .id = 59, .r = { .min = 0, .max = 83000000 }, },
@@ -123,8 +121,6 @@ static const struct {
 	{ .n = "pwm_gclk",    .id = 38, .r = { .min = 0, .max = 83000000 }, },
 	{ .n = "isc_gclk",    .id = 46, },
 	{ .n = "pdmic_gclk",  .id = 48, },
-	{ .n = "i2s0_gclk",   .id = 54, .pll = true },
-	{ .n = "i2s1_gclk",   .id = 55, .pll = true },
 	{ .n = "can0_gclk",   .id = 56, .r = { .min = 0, .max = 80000000 }, },
 	{ .n = "can1_gclk",   .id = 57, .r = { .min = 0, .max = 80000000 }, },
 	{ .n = "classd_gclk", .id = 59, .r = { .min = 0, .max = 100000000 },
@@ -136,7 +132,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
 	struct clk_range range = CLK_RANGE(0, 0);
 	const char *slck_name, *mainxtal_name;
 	struct pmc_data *sama5d2_pmc;
-	const char *parent_names[6];
+	const char *parent_names[5];
 	struct regmap *regmap, *regmap_sfr;
 	struct clk *hw;
 	int i;
@@ -157,7 +153,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
 	if (IS_ERR(regmap))
 		return;
 
-	sama5d2_pmc = pmc_data_allocate(PMC_I2S1_MUX + 1,
+	sama5d2_pmc = pmc_data_allocate(PMC_MCK2 + 1,
 					nck(sama5d2_systemck),
 					nck(sama5d2_periph32ck),
 					nck(sama5d2_gck));
@@ -193,21 +189,6 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
 	if (IS_ERR(hw))
 		goto err_free;
 
-	hw = at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck",
-					      "mainck");
-	if (IS_ERR(hw))
-		goto err_free;
-
-	hw = at91_clk_register_audio_pll_pad(regmap, "audiopll_padck",
-					     "audiopll_fracck");
-	if (IS_ERR(hw))
-		goto err_free;
-
-	hw = at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck",
-					     "audiopll_fracck");
-	if (IS_ERR(hw))
-		goto err_free;
-
 	regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
 	if (IS_ERR(regmap_sfr))
 		regmap_sfr = NULL;
@@ -270,7 +251,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
 	}
 
 	for (i = 0; i < ARRAY_SIZE(sama5d2_periphck); i++) {
-		hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
+		hw = at91_clk_register_sam9x5_peripheral(regmap,
 							 sama5d2_periphck[i].n,
 							 "masterck",
 							 sama5d2_periphck[i].id,
@@ -282,7 +263,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
 	}
 
 	for (i = 0; i < ARRAY_SIZE(sama5d2_periph32ck); i++) {
-		hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
+		hw = at91_clk_register_sam9x5_peripheral(regmap,
 							 sama5d2_periph32ck[i].n,
 							 "h32mxck",
 							 sama5d2_periph32ck[i].id,
@@ -298,11 +279,10 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
 	parent_names[2] = "plladivck";
 	parent_names[3] = "utmick";
 	parent_names[4] = "mck";
-	parent_names[5] = "audiopll_pmcck";
 	for (i = 0; i < ARRAY_SIZE(sama5d2_gck); i++) {
-		hw = at91_clk_register_generated(regmap, &pmc_pcr_lock,
+		hw = at91_clk_register_generated(regmap,
 						 sama5d2_gck[i].n,
-						 parent_names, 6,
+						 parent_names, 5,
 						 sama5d2_gck[i].id,
 						 sama5d2_gck[i].pll,
 						 &sama5d2_gck[i].r);
@@ -312,26 +292,6 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
 		sama5d2_pmc->ghws[sama5d2_gck[i].id] = hw;
 	}
 
-	if (regmap_sfr) {
-		parent_names[0] = "i2s0_clk";
-		parent_names[1] = "i2s0_gclk";
-		hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s0_muxclk",
-					       parent_names, 2, 0);
-		if (IS_ERR(hw))
-			goto err_free;
-
-		sama5d2_pmc->chws[PMC_I2S0_MUX] = hw;
-
-		parent_names[0] = "i2s1_clk";
-		parent_names[1] = "i2s1_gclk";
-		hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s1_muxclk",
-					       parent_names, 2, 1);
-		if (IS_ERR(hw))
-			goto err_free;
-
-		sama5d2_pmc->chws[PMC_I2S1_MUX] = hw;
-	}
-
 	of_clk_add_provider(np, of_clk_hw_pmc_get, sama5d2_pmc);
 
 	return;
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] clk: at91: delete dead i2s/audio code
  2019-05-23 14:29 [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c Ahmad Fatoum
@ 2019-05-23 14:29 ` Ahmad Fatoum
  2019-05-23 16:35   ` Sam Ravnborg
  2019-05-23 16:34 ` [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c Sam Ravnborg
  2019-05-24  6:06 ` Sascha Hauer
  2 siblings, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2019-05-23 14:29 UTC (permalink / raw)
  To: barebox; +Cc: sam

They aren't used anywhere, thus drop them.

Suggested-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/clk/at91/dt-compat.c | 110 -----------------------------------
 drivers/clk/at91/pmc.c       |   2 -
 2 files changed, 112 deletions(-)

diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c
index bbd670641bba..beb86230f694 100644
--- a/drivers/clk/at91/dt-compat.c
+++ b/drivers/clk/at91/dt-compat.c
@@ -23,77 +23,6 @@
 
 #define SYSTEM_MAX_ID		31
 
-#ifdef CONFIG_HAVE_AT91_AUDIO_PLL
-static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np)
-{
-	struct clk *hw;
-	const char *name = np->name;
-	const char *parent_name;
-	struct regmap *regmap;
-
-	regmap = syscon_node_to_regmap(of_get_parent(np));
-	if (IS_ERR(regmap))
-		return;
-
-	parent_name = of_clk_get_parent_name(np, 0);
-
-	hw = at91_clk_register_audio_pll_frac(regmap, name, parent_name);
-	if (IS_ERR(hw))
-		return;
-
-	of_clk_add_provider(np, of_clk_src_simple_get, hw);
-}
-CLK_OF_DECLARE(of_sama5d2_clk_audio_pll_frac_setup,
-	       "atmel,sama5d2-clk-audio-pll-frac",
-	       of_sama5d2_clk_audio_pll_frac_setup);
-
-static void __init of_sama5d2_clk_audio_pll_pad_setup(struct device_node *np)
-{
-	struct clk *hw;
-	const char *name = np->name;
-	const char *parent_name;
-	struct regmap *regmap;
-
-	regmap = syscon_node_to_regmap(of_get_parent(np));
-	if (IS_ERR(regmap))
-		return;
-
-	parent_name = of_clk_get_parent_name(np, 0);
-
-	hw = at91_clk_register_audio_pll_pad(regmap, name, parent_name);
-	if (IS_ERR(hw))
-		return;
-
-	of_clk_add_provider(np, of_clk_src_simple_get, hw);
-}
-CLK_OF_DECLARE(of_sama5d2_clk_audio_pll_pad_setup,
-	       "atmel,sama5d2-clk-audio-pll-pad",
-	       of_sama5d2_clk_audio_pll_pad_setup);
-
-static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np)
-{
-	struct clk *hw;
-	const char *name = np->name;
-	const char *parent_name;
-	struct regmap *regmap;
-
-	regmap = syscon_node_to_regmap(of_get_parent(np));
-	if (IS_ERR(regmap))
-		return;
-
-	parent_name = of_clk_get_parent_name(np, 0);
-
-	hw = at91_clk_register_audio_pll_pmc(regmap, name, parent_name);
-	if (IS_ERR(hw))
-		return;
-
-	of_clk_add_provider(np, of_clk_src_simple_get, hw);
-}
-CLK_OF_DECLARE(of_sama5d2_clk_audio_pll_pmc_setup,
-	       "atmel,sama5d2-clk-audio-pll-pmc",
-	       of_sama5d2_clk_audio_pll_pmc_setup);
-#endif /* CONFIG_HAVE_AT91_AUDIO_PLL */
-
 #ifdef CONFIG_HAVE_AT91_GENERATED_CLK
 #define GENERATED_SOURCE_MAX	6
 
@@ -184,45 +113,6 @@ CLK_OF_DECLARE(of_sama5d4_clk_h32mx_setup, "atmel,sama5d4-clk-h32mx",
 	       of_sama5d4_clk_h32mx_setup);
 #endif /* CONFIG_HAVE_AT91_H32MX */
 
-#ifdef CONFIG_HAVE_AT91_I2S_MUX_CLK
-#define	I2S_BUS_NR	2
-
-static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np)
-{
-	struct regmap *regmap_sfr;
-	u8 bus_id;
-	const char *parent_names[2];
-	struct device_node *i2s_mux_np;
-	struct clk *hw;
-	int ret;
-
-	regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
-	if (IS_ERR(regmap_sfr))
-		return;
-
-	for_each_child_of_node(np, i2s_mux_np) {
-		if (of_property_read_u8(i2s_mux_np, "reg", &bus_id))
-			continue;
-
-		if (bus_id > I2S_BUS_NR)
-			continue;
-
-		ret = of_clk_parent_fill(i2s_mux_np, parent_names, 2);
-		if (ret != 2)
-			continue;
-
-		hw = at91_clk_i2s_mux_register(regmap_sfr, i2s_mux_np->name,
-					       parent_names, 2, bus_id);
-		if (IS_ERR(hw))
-			continue;
-
-		of_clk_add_provider(i2s_mux_np, of_clk_src_simple_get, hw);
-	}
-}
-CLK_OF_DECLARE(sama5d2_clk_i2s_mux, "atmel,sama5d2-clk-i2s-mux",
-	       of_sama5d2_clk_i2s_mux_setup);
-#endif /* CONFIG_HAVE_AT91_I2S_MUX_CLK */
-
 static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np)
 {
 	struct clk *hw;
diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index aa73d61c5e49..86a50b680b8d 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -140,8 +140,6 @@ static struct
 	u32 imr;
 	u32 pcsr1;
 	u32 pcr[PMC_MAX_IDS];
-	u32 audio_pll0;
-	u32 audio_pll1;
 	u32 pckr[PMC_MAX_PCKS];
 } pmc_cache;
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c
  2019-05-23 14:29 [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c Ahmad Fatoum
  2019-05-23 14:29 ` [PATCH v2 2/2] clk: at91: delete dead i2s/audio code Ahmad Fatoum
@ 2019-05-23 16:34 ` Sam Ravnborg
  2019-05-24  6:06 ` Sascha Hauer
  2 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2019-05-23 16:34 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi Ahmad.

On Thu, May 23, 2019 at 04:29:32PM +0200, Ahmad Fatoum wrote:
> sama5d2.c was added alongside the update to the remaining clk drivers
> to support the new upstream device tree bindings, but wasn't wired in
> anywhere.
> 
> To prepare for usage in future sama5d2 support, fix compilation errors
> related to absence of locks and unavailability of audio/i2s clock/pll
> handling.
> 
> With this change, there are no users for the few definition-less at91
> audio/i2s registration function declarations. So remove those as well.

Thanks for pciking this up.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] clk: at91: delete dead i2s/audio code
  2019-05-23 14:29 ` [PATCH v2 2/2] clk: at91: delete dead i2s/audio code Ahmad Fatoum
@ 2019-05-23 16:35   ` Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2019-05-23 16:35 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi again.

On Thu, May 23, 2019 at 04:29:33PM +0200, Ahmad Fatoum wrote:
> They aren't used anywhere, thus drop them.
Thanks again.
> 
> Suggested-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c
  2019-05-23 14:29 [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c Ahmad Fatoum
  2019-05-23 14:29 ` [PATCH v2 2/2] clk: at91: delete dead i2s/audio code Ahmad Fatoum
  2019-05-23 16:34 ` [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c Sam Ravnborg
@ 2019-05-24  6:06 ` Sascha Hauer
  2 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2019-05-24  6:06 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, sam

On Thu, May 23, 2019 at 04:29:32PM +0200, Ahmad Fatoum wrote:
> sama5d2.c was added alongside the update to the remaining clk drivers
> to support the new upstream device tree bindings, but wasn't wired in
> anywhere.
> 
> To prepare for usage in future sama5d2 support, fix compilation errors
> related to absence of locks and unavailability of audio/i2s clock/pll
> handling.
> 
> With this change, there are no users for the few definition-less at91
> audio/i2s registration function declarations. So remove those as well.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-24  6:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 14:29 [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c Ahmad Fatoum
2019-05-23 14:29 ` [PATCH v2 2/2] clk: at91: delete dead i2s/audio code Ahmad Fatoum
2019-05-23 16:35   ` Sam Ravnborg
2019-05-23 16:34 ` [PATCH v2 1/2] clk: at91: fix compilation errors in sama5d2.c Sam Ravnborg
2019-05-24  6:06 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox