linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF
@ 2013-05-01  0:58 Sebastian Hesselbarth
  2013-05-01  0:58 ` [PATCH 1/2] clk: add non CONFIG_OF routines for clk-provider Sebastian Hesselbarth
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sebastian Hesselbarth @ 2013-05-01  0:58 UTC (permalink / raw)
  To: linux-arm-kernel

Enabling drivers that provide clocks on DT on platforms that don't have
CONFIG_OF set fails due to compilation errors. This patch set first adds
some stubs for of_clk_provider functions if CONFIG_OF is not set. Second
it allows those platforms to build and use clk-si5351 i2c clock driver
by removing the dependency on CONFIG_OF.

The above approach has been suggested by Arnd Bergmann and replaces the
corresponding Kconfig patch for clk-si5351 posted earlier. It has been
compile tested with allmodconfig on x86_64 for post v3.9.

Sebastian Hesselbarth (2):
  clk: add non CONFIG_OF routines for clk-provider
  clk: si5351: Allow to build without CONFIG_OF

 drivers/clk/Kconfig          |    1 -
 include/linux/clk-provider.h |   47 +++++++++++++++++++++++++++++++++++-------
 2 files changed, 39 insertions(+), 9 deletions(-)
---
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Marek Belisko <marek.belisko@streamunlimited.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
-- 
1.7.10.4

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

* [PATCH 1/2] clk: add non CONFIG_OF routines for clk-provider
  2013-05-01  0:58 [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Sebastian Hesselbarth
@ 2013-05-01  0:58 ` Sebastian Hesselbarth
  2013-05-01  0:58 ` [PATCH 2/2] clk: si5351: Allow to build without CONFIG_OF Sebastian Hesselbarth
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sebastian Hesselbarth @ 2013-05-01  0:58 UTC (permalink / raw)
  To: linux-arm-kernel

Some drivers that are shared between architectures have HAVE_CLK selected
but don't have OF. To remove compilation errors for drivers that provide
clocks on DT with of_clk_add_provider we would have to enclose these calls
within #ifdef CONFIG_OF, #endif.

This patch adds some stubs for OF related clk-provider functions that
either do nothing or return appropriate values if CONFIG_OF is not set.
So, definition of these routines will always be available.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
---
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Marek Belisko <marek.belisko@streamunlimited.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
---
 include/linux/clk-provider.h |   47 +++++++++++++++++++++++++++++++++++-------
 1 file changed, 39 insertions(+), 8 deletions(-)

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 1186098..265f384 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -423,6 +423,17 @@ struct of_device_id;
 
 typedef void (*of_clk_init_cb_t)(struct device_node *);
 
+struct clk_onecell_data {
+	struct clk **clks;
+	unsigned int clk_num;
+};
+
+#define CLK_OF_DECLARE(name, compat, fn)			\
+	static const struct of_device_id __clk_of_table_##name	\
+		__used __section(__clk_of_table)		\
+		= { .compatible = compat, .data = fn };
+
+#ifdef CONFIG_OF
 int of_clk_add_provider(struct device_node *np,
 			struct clk *(*clk_src_get)(struct of_phandle_args *args,
 						   void *data),
@@ -430,19 +441,39 @@ int of_clk_add_provider(struct device_node *np,
 void of_clk_del_provider(struct device_node *np);
 struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
 				  void *data);
-struct clk_onecell_data {
-	struct clk **clks;
-	unsigned int clk_num;
-};
 struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
 const char *of_clk_get_parent_name(struct device_node *np, int index);
 
 void of_clk_init(const struct of_device_id *matches);
 
-#define CLK_OF_DECLARE(name, compat, fn)			\
-	static const struct of_device_id __clk_of_table_##name	\
-		__used __section(__clk_of_table)		\
-		= { .compatible = compat, .data = fn };
+#else /* !CONFIG_OF */
 
+static inline int of_clk_add_provider(struct device_node *np,
+			struct clk *(*clk_src_get)(struct of_phandle_args *args,
+						   void *data),
+			void *data)
+{
+	return 0;
+}
+#define of_clk_del_provider(np) \
+	{ while (0); }
+static inline struct clk *of_clk_src_simple_get(
+	struct of_phandle_args *clkspec, void *data)
+{
+	return ERR_PTR(-ENOENT);
+}
+static inline struct clk *of_clk_src_onecell_get(
+	struct of_phandle_args *clkspec, void *data)
+{
+	return ERR_PTR(-ENOENT);
+}
+static inline const char *of_clk_get_parent_name(struct device_node *np,
+						 int index)
+{
+	return NULL;
+}
+#define of_clk_init(matches) \
+	{ while (0); }
+#endif /* CONFIG_OF */
 #endif /* CONFIG_COMMON_CLK */
 #endif /* CLK_PROVIDER_H */
-- 
1.7.10.4

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

* [PATCH 2/2] clk: si5351: Allow to build without CONFIG_OF
  2013-05-01  0:58 [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Sebastian Hesselbarth
  2013-05-01  0:58 ` [PATCH 1/2] clk: add non CONFIG_OF routines for clk-provider Sebastian Hesselbarth
@ 2013-05-01  0:58 ` Sebastian Hesselbarth
  2013-05-02 21:20 ` [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Arnd Bergmann
  2013-05-29  6:47 ` Mike Turquette
  3 siblings, 0 replies; 5+ messages in thread
From: Sebastian Hesselbarth @ 2013-05-01  0:58 UTC (permalink / raw)
  To: linux-arm-kernel

With of_clk_provider stubs for CONFIG_OF not set, we can now also enable
clk-si5351 on those architectures.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Marek Belisko <marek.belisko@streamunlimited.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
---
 drivers/clk/Kconfig |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 0357ac4..186dd0e 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -58,7 +58,6 @@ config COMMON_CLK_MAX77686
 config COMMON_CLK_SI5351
 	tristate "Clock driver for SiLabs 5351A/B/C"
 	depends on I2C
-	depends on OF
 	select REGMAP_I2C
 	select RATIONAL
 	---help---
-- 
1.7.10.4

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

* [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF
  2013-05-01  0:58 [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Sebastian Hesselbarth
  2013-05-01  0:58 ` [PATCH 1/2] clk: add non CONFIG_OF routines for clk-provider Sebastian Hesselbarth
  2013-05-01  0:58 ` [PATCH 2/2] clk: si5351: Allow to build without CONFIG_OF Sebastian Hesselbarth
@ 2013-05-02 21:20 ` Arnd Bergmann
  2013-05-29  6:47 ` Mike Turquette
  3 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2013-05-02 21:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 01 May 2013, Sebastian Hesselbarth wrote:
> 
> Yesterday 02:58:27
> Enabling drivers that provide clocks on DT on platforms that don't have
> CONFIG_OF set fails due to compilation errors. This patch set first adds
> some stubs for of_clk_provider functions if CONFIG_OF is not set. Second
> it allows those platforms to build and use clk-si5351 i2c clock driver
> by removing the dependency on CONFIG_OF.
> 
> The above approach has been suggested by Arnd Bergmann and replaces the
> corresponding Kconfig patch for clk-si5351 posted earlier. It has been
> compile tested with allmodconfig on x86_64 for post v3.9.
> 
> Sebastian Hesselbarth (2):
>   clk: add non CONFIG_OF routines for clk-provider
>   clk: si5351: Allow to build without CONFIG_OF
> 

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF
  2013-05-01  0:58 [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Sebastian Hesselbarth
                   ` (2 preceding siblings ...)
  2013-05-02 21:20 ` [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Arnd Bergmann
@ 2013-05-29  6:47 ` Mike Turquette
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Turquette @ 2013-05-29  6:47 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Sebastian Hesselbarth (2013-04-30 17:58:27)
> Enabling drivers that provide clocks on DT on platforms that don't have
> CONFIG_OF set fails due to compilation errors. This patch set first adds
> some stubs for of_clk_provider functions if CONFIG_OF is not set. Second
> it allows those platforms to build and use clk-si5351 i2c clock driver
> by removing the dependency on CONFIG_OF.
> 
> The above approach has been suggested by Arnd Bergmann and replaces the
> corresponding Kconfig patch for clk-si5351 posted earlier. It has been
> compile tested with allmodconfig on x86_64 for post v3.9.
> 
> Sebastian Hesselbarth (2):
>   clk: add non CONFIG_OF routines for clk-provider
>   clk: si5351: Allow to build without CONFIG_OF
> 

Both are taken into clk-next.

Thanks,
Mike

>  drivers/clk/Kconfig          |    1 -
>  include/linux/clk-provider.h |   47 +++++++++++++++++++++++++++++++++++-------
>  2 files changed, 39 insertions(+), 9 deletions(-)
> ---
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Daniel Mack <zonque@gmail.com>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Marek Belisko <marek.belisko@streamunlimited.com>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> -- 
> 1.7.10.4

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

end of thread, other threads:[~2013-05-29  6:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-01  0:58 [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Sebastian Hesselbarth
2013-05-01  0:58 ` [PATCH 1/2] clk: add non CONFIG_OF routines for clk-provider Sebastian Hesselbarth
2013-05-01  0:58 ` [PATCH 2/2] clk: si5351: Allow to build without CONFIG_OF Sebastian Hesselbarth
2013-05-02 21:20 ` [PATCH 0/2] clk: add of_clk_provider stubs to enable clk-si5351 on non OF Arnd Bergmann
2013-05-29  6:47 ` Mike Turquette

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).