All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drivers: clk: make gpio-gated clock support optional
@ 2020-12-02 12:34 ` Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 8+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2020-12-02 12:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: mturquette, sboyd, matthias.bgg, linux-clk, linux-riscv

The gpio-gate-clock / gpio-mux-clock driver isn't used much,
just by a few ARM SoCs, so there's no need to always include
it unconditionally.

Thus make it optional, but keep it enabled by default.

changes v3: default to y when gpiolib enabled
            fix depends on gpiolib to uppercase

changes v2: added missing dependency on gpiolib

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/clk/Kconfig  | 8 ++++++++
 drivers/clk/Makefile | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index c715d4681a0b..e4fe406c4e7d 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -38,6 +38,14 @@ menuconfig COMMON_CLK
 
 if COMMON_CLK
 
+config COMMON_CLK_GPIO
+	tristate "GPIO gated clock support"
+	default y if GPIOLIB
+	depends on GPIOLIB
+	help
+	  Supports gpio gated clocks, which can be enabled/disabled via
+	  gpio output.
+
 config COMMON_CLK_WM831X
 	tristate "Clock driver for WM831x/2x PMICs"
 	depends on MFD_WM831X
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index da8fcf147eb1..0692ab5abc6d 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_COMMON_CLK)	+= clk-multiplier.o
 obj-$(CONFIG_COMMON_CLK)	+= clk-mux.o
 obj-$(CONFIG_COMMON_CLK)	+= clk-composite.o
 obj-$(CONFIG_COMMON_CLK)	+= clk-fractional-divider.o
-obj-$(CONFIG_COMMON_CLK)	+= clk-gpio.o
+obj-$(CONFIG_COMMON_CLK_GPIO)	+= clk-gpio.o
 ifeq ($(CONFIG_OF), y)
 obj-$(CONFIG_COMMON_CLK)	+= clk-conf.o
 endif
-- 
2.11.0


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

* [PATCH v3] drivers: clk: make gpio-gated clock support optional
@ 2020-12-02 12:34 ` Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 8+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2020-12-02 12:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: sboyd, matthias.bgg, mturquette, linux-clk, linux-riscv

The gpio-gate-clock / gpio-mux-clock driver isn't used much,
just by a few ARM SoCs, so there's no need to always include
it unconditionally.

Thus make it optional, but keep it enabled by default.

changes v3: default to y when gpiolib enabled
            fix depends on gpiolib to uppercase

changes v2: added missing dependency on gpiolib

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/clk/Kconfig  | 8 ++++++++
 drivers/clk/Makefile | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index c715d4681a0b..e4fe406c4e7d 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -38,6 +38,14 @@ menuconfig COMMON_CLK
 
 if COMMON_CLK
 
+config COMMON_CLK_GPIO
+	tristate "GPIO gated clock support"
+	default y if GPIOLIB
+	depends on GPIOLIB
+	help
+	  Supports gpio gated clocks, which can be enabled/disabled via
+	  gpio output.
+
 config COMMON_CLK_WM831X
 	tristate "Clock driver for WM831x/2x PMICs"
 	depends on MFD_WM831X
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index da8fcf147eb1..0692ab5abc6d 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_COMMON_CLK)	+= clk-multiplier.o
 obj-$(CONFIG_COMMON_CLK)	+= clk-mux.o
 obj-$(CONFIG_COMMON_CLK)	+= clk-composite.o
 obj-$(CONFIG_COMMON_CLK)	+= clk-fractional-divider.o
-obj-$(CONFIG_COMMON_CLK)	+= clk-gpio.o
+obj-$(CONFIG_COMMON_CLK_GPIO)	+= clk-gpio.o
 ifeq ($(CONFIG_OF), y)
 obj-$(CONFIG_COMMON_CLK)	+= clk-conf.o
 endif
-- 
2.11.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v3] drivers: clk: make gpio-gated clock support optional
  2020-12-02 12:34 ` Enrico Weigelt, metux IT consult
@ 2020-12-20  0:04   ` Stephen Boyd
  -1 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2020-12-20  0:04 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: mturquette, matthias.bgg, linux-clk, linux-riscv

Quoting Enrico Weigelt, metux IT consult (2020-12-02 04:34:46)
> The gpio-gate-clock / gpio-mux-clock driver isn't used much,
> just by a few ARM SoCs, so there's no need to always include
> it unconditionally.
> 
> Thus make it optional, but keep it enabled by default.
> 
> changes v3: default to y when gpiolib enabled
>             fix depends on gpiolib to uppercase
> 
> changes v2: added missing dependency on gpiolib
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---

Applied to clk-next

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

* Re: [PATCH v3] drivers: clk: make gpio-gated clock support optional
@ 2020-12-20  0:04   ` Stephen Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2020-12-20  0:04 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: matthias.bgg, mturquette, linux-clk, linux-riscv

Quoting Enrico Weigelt, metux IT consult (2020-12-02 04:34:46)
> The gpio-gate-clock / gpio-mux-clock driver isn't used much,
> just by a few ARM SoCs, so there's no need to always include
> it unconditionally.
> 
> Thus make it optional, but keep it enabled by default.
> 
> changes v3: default to y when gpiolib enabled
>             fix depends on gpiolib to uppercase
> 
> changes v2: added missing dependency on gpiolib
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---

Applied to clk-next

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v3] drivers: clk: make gpio-gated clock support optional
  2020-12-20  0:04   ` Stephen Boyd
@ 2020-12-20  5:30     ` Stephen Boyd
  -1 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2020-12-20  5:30 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: mturquette, matthias.bgg, linux-clk, linux-riscv

Quoting Stephen Boyd (2020-12-19 16:04:21)
> Quoting Enrico Weigelt, metux IT consult (2020-12-02 04:34:46)
> > The gpio-gate-clock / gpio-mux-clock driver isn't used much,
> > just by a few ARM SoCs, so there's no need to always include
> > it unconditionally.
> > 
> > Thus make it optional, but keep it enabled by default.
> > 
> > changes v3: default to y when gpiolib enabled
> >             fix depends on gpiolib to uppercase
> > 
> > changes v2: added missing dependency on gpiolib
> > 
> > Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> > ---
> 
> Applied to clk-next

And now reverted

In file included from include/linux/device.h:32:0,
                 from drivers/clk/clk-gpio.c:17:
include/linux/device/driver.h:290:1: warning: data definition has no type or storage class
 device_initcall(__driver##_init);
 ^
include/linux/platform_device.h:258:2: note: in expansion of macro 'builtin_driver'
  builtin_driver(__platform_driver, platform_driver_register)
  ^~~~~~~~~~~~~~
drivers/clk/clk-gpio.c:249:1: note: in expansion of macro 'builtin_platform_driver'
 builtin_platform_driver(gpio_clk_driver);
 ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/device/driver.h:290:1: error: type defaults to 'int' in declaration of 'device_initcall' [-Werror=implicit-int]
 device_initcall(__driver##_init);
 ^
include/linux/platform_device.h:258:2: note: in expansion of macro 'builtin_driver'
  builtin_driver(__platform_driver, platform_driver_register)
  ^~~~~~~~~~~~~~
drivers/clk/clk-gpio.c:249:1: note: in expansion of macro 'builtin_platform_driver'
 builtin_platform_driver(gpio_clk_driver);
 ^~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-gpio.c:249:1: warning: parameter names (without types) in function declaration
In file included from include/linux/device.h:32:0,
                 from drivers/clk/clk-gpio.c:17:
drivers/clk/clk-gpio.c:249:25: warning: 'gpio_clk_driver_init' defined but not used [-Wunused-function]
 builtin_platform_driver(gpio_clk_driver);
                         ^
include/linux/device/driver.h:286:19: note: in definition of macro 'builtin_driver'
 static int __init __driver##_init(void) \
                   ^~~~~~~~
drivers/clk/clk-gpio.c:249:1: note: in expansion of macro 'builtin_platform_driver'
 builtin_platform_driver(gpio_clk_driver);
 ^~~~~~~~~~~~~~~~~~~~~~~

It looks like it needs to be a bool Kconfig to match how it used to be.
A module would be interesting, but would require more changes
presumably, like getting rid of builtin_platform_driver() and replacing
it with module_platform_driver().

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

* Re: [PATCH v3] drivers: clk: make gpio-gated clock support optional
@ 2020-12-20  5:30     ` Stephen Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2020-12-20  5:30 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: matthias.bgg, mturquette, linux-clk, linux-riscv

Quoting Stephen Boyd (2020-12-19 16:04:21)
> Quoting Enrico Weigelt, metux IT consult (2020-12-02 04:34:46)
> > The gpio-gate-clock / gpio-mux-clock driver isn't used much,
> > just by a few ARM SoCs, so there's no need to always include
> > it unconditionally.
> > 
> > Thus make it optional, but keep it enabled by default.
> > 
> > changes v3: default to y when gpiolib enabled
> >             fix depends on gpiolib to uppercase
> > 
> > changes v2: added missing dependency on gpiolib
> > 
> > Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> > ---
> 
> Applied to clk-next

And now reverted

In file included from include/linux/device.h:32:0,
                 from drivers/clk/clk-gpio.c:17:
include/linux/device/driver.h:290:1: warning: data definition has no type or storage class
 device_initcall(__driver##_init);
 ^
include/linux/platform_device.h:258:2: note: in expansion of macro 'builtin_driver'
  builtin_driver(__platform_driver, platform_driver_register)
  ^~~~~~~~~~~~~~
drivers/clk/clk-gpio.c:249:1: note: in expansion of macro 'builtin_platform_driver'
 builtin_platform_driver(gpio_clk_driver);
 ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/device/driver.h:290:1: error: type defaults to 'int' in declaration of 'device_initcall' [-Werror=implicit-int]
 device_initcall(__driver##_init);
 ^
include/linux/platform_device.h:258:2: note: in expansion of macro 'builtin_driver'
  builtin_driver(__platform_driver, platform_driver_register)
  ^~~~~~~~~~~~~~
drivers/clk/clk-gpio.c:249:1: note: in expansion of macro 'builtin_platform_driver'
 builtin_platform_driver(gpio_clk_driver);
 ^~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-gpio.c:249:1: warning: parameter names (without types) in function declaration
In file included from include/linux/device.h:32:0,
                 from drivers/clk/clk-gpio.c:17:
drivers/clk/clk-gpio.c:249:25: warning: 'gpio_clk_driver_init' defined but not used [-Wunused-function]
 builtin_platform_driver(gpio_clk_driver);
                         ^
include/linux/device/driver.h:286:19: note: in definition of macro 'builtin_driver'
 static int __init __driver##_init(void) \
                   ^~~~~~~~
drivers/clk/clk-gpio.c:249:1: note: in expansion of macro 'builtin_platform_driver'
 builtin_platform_driver(gpio_clk_driver);
 ^~~~~~~~~~~~~~~~~~~~~~~

It looks like it needs to be a bool Kconfig to match how it used to be.
A module would be interesting, but would require more changes
presumably, like getting rid of builtin_platform_driver() and replacing
it with module_platform_driver().

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v3] drivers: clk: make gpio-gated clock support optional
  2020-12-20  5:30     ` Stephen Boyd
@ 2020-12-22 19:51       ` Enrico Weigelt, metux IT consult
  -1 siblings, 0 replies; 8+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2020-12-22 19:51 UTC (permalink / raw)
  To: Stephen Boyd, Enrico Weigelt, metux IT consult, linux-kernel
  Cc: mturquette, matthias.bgg, linux-clk, linux-riscv

On 20.12.20 06:30, Stephen Boyd wrote:

> It looks like it needs to be a bool Kconfig to match how it used to be.
> A module would be interesting, but would require more changes
> presumably, like getting rid of builtin_platform_driver() and replacing
> it with module_platform_driver().

Okay, I'll rework it and post a v4.

thx.
--mtx


-- 
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH v3] drivers: clk: make gpio-gated clock support optional
@ 2020-12-22 19:51       ` Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 8+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2020-12-22 19:51 UTC (permalink / raw)
  To: Stephen Boyd, Enrico Weigelt, metux IT consult, linux-kernel
  Cc: matthias.bgg, mturquette, linux-clk, linux-riscv

On 20.12.20 06:30, Stephen Boyd wrote:

> It looks like it needs to be a bool Kconfig to match how it used to be.
> A module would be interesting, but would require more changes
> presumably, like getting rid of builtin_platform_driver() and replacing
> it with module_platform_driver().

Okay, I'll rework it and post a v4.

thx.
--mtx


-- 
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2020-12-22 19:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 12:34 [PATCH v3] drivers: clk: make gpio-gated clock support optional Enrico Weigelt, metux IT consult
2020-12-02 12:34 ` Enrico Weigelt, metux IT consult
2020-12-20  0:04 ` Stephen Boyd
2020-12-20  0:04   ` Stephen Boyd
2020-12-20  5:30   ` Stephen Boyd
2020-12-20  5:30     ` Stephen Boyd
2020-12-22 19:51     ` Enrico Weigelt, metux IT consult
2020-12-22 19:51       ` Enrico Weigelt, metux IT consult

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.