All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clkdev: Add default clkdev.h
@ 2012-07-02 18:04 Mark Brown
  2012-07-03  2:00 ` Stephen Rothwell
  0 siblings, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-07-02 18:04 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arch, mturquette, Russell King, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h which
will be used if the arch does not have an include/asm/clkdev.h.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/asm-generic/Kbuild.asm |    4 ++++
 include/asm-generic/clkdev.h   |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..da121e0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 header-y += a.out.h
 endif
 
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
+generic-y += clkdev.h
+endif
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..c362a9d
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,26 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+#define __clk_get(clk)	({ 1; })
+#define __clk_put(clk)	do { } while (0)
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-02 18:04 [PATCH] clkdev: Add default clkdev.h Mark Brown
@ 2012-07-03  2:00 ` Stephen Rothwell
  2012-07-03 10:12   ` Mark Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Stephen Rothwell @ 2012-07-03  2:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Arnd Bergmann, linux-arch, mturquette, Russell King

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

Hi Mark,

On Mon,  2 Jul 2012 19:04:10 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
>
> diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
> new file mode 100644
> index 0000000..c362a9d
> --- /dev/null
> +++ b/include/asm-generic/clkdev.h
> @@ -0,0 +1,26 @@
> +/*
> + *  include/asm-generic/clkdev.h
> + *
> + * Based on the ARM clkdev.h:
> + *  Copyright (C) 2008 Russell King.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * Helper for the clk API to assist looking up a struct clk.
> + */
> +#ifndef __ASM_CLKDEV_H
> +#define __ASM_CLKDEV_H
> +
> +#include <linux/slab.h>
> +
> +#define __clk_get(clk)	({ 1; })
> +#define __clk_put(clk)	do { } while (0)

So why not:

struct clk;

static inline int __clk_get(struct clk *clk) { return 1; }
static inline void __clk_put(struct clk *clk) ( )

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03  2:00 ` Stephen Rothwell
@ 2012-07-03 10:12   ` Mark Brown
  2012-07-03 11:16     ` Arnd Bergmann
  0 siblings, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-07-03 10:12 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Arnd Bergmann, linux-arch, mturquette, Russell King

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

On Tue, Jul 03, 2012 at 12:00:59PM +1000, Stephen Rothwell wrote:
> On Mon,  2 Jul 2012 19:04:10 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> > +#define __clk_get(clk)	({ 1; })
> > +#define __clk_put(clk)	do { } while (0)

> So why not:

> struct clk;

> static inline int __clk_get(struct clk *clk) { return 1; }
> static inline void __clk_put(struct clk *clk) ( )

No idea, I'm just taking the existing default header and making it more
generally available.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 10:12   ` Mark Brown
@ 2012-07-03 11:16     ` Arnd Bergmann
  2012-07-03 11:48       ` Mark Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Arnd Bergmann @ 2012-07-03 11:16 UTC (permalink / raw)
  To: Mark Brown
  Cc: Stephen Rothwell, linux-arch, mturquette, Russell King,
	linux-kbuild, Michal Marek

On Tuesday 03 July 2012, Mark Brown wrote:
> On Tue, Jul 03, 2012 at 12:00:59PM +1000, Stephen Rothwell wrote:
> > On Mon,  2 Jul 2012 19:04:10 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> 
> > > +#define __clk_get(clk)     ({ 1; })
> > > +#define __clk_put(clk)     do { } while (0)
> 
> > So why not:
> 
> > struct clk;
> 
> > static inline int __clk_get(struct clk *clk) { return 1; }
> > static inline void __clk_put(struct clk *clk) ( )
> 
> No idea, I'm just taking the existing default header and making it more
> generally available.

I prefer Stephen's version because that maintains the type checking.
However, that is not a controversial point at all IMHO. The question
that we need to decide on is whether we want automatic "generic-y"
statements in Kbuild.asm.

I'm not opposed to the idea, but I can imagine some arch maintainers
fine it confusing. When you first posted the patch, I spent some
time trying to get the wildcard logic moved to scripts/Makefile.asm-generic
and scripts/Makefile.headersinst but couldn't figure it out in the end.

I would definitely prefer being able to just write 

generic-y += clkdev.h 

in include/asm-generic/Kbuild.asm, rather than 

ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
generic-y += clkdev.h
endif

Maybe Michal Marek or someone on the kbuild mailing list can help
out with a solution for that.

	Arnd

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 11:16     ` Arnd Bergmann
@ 2012-07-03 11:48       ` Mark Brown
  2012-07-03 12:05         ` Stephen Rothwell
  0 siblings, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-07-03 11:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Stephen Rothwell, linux-arch, mturquette, Russell King,
	linux-kbuild, Michal Marek

[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]

On Tue, Jul 03, 2012 at 11:16:05AM +0000, Arnd Bergmann wrote:
> On Tuesday 03 July 2012, Mark Brown wrote:

> > No idea, I'm just taking the existing default header and making it more
> > generally available.

> I prefer Stephen's version because that maintains the type checking.

I agree, I've already made the change locally.

> However, that is not a controversial point at all IMHO. The question
> that we need to decide on is whether we want automatic "generic-y"
> statements in Kbuild.asm.

Well, it does seem to defeat a large part of the point of having generic
headers if they're not there by default - it means that if you add a
header you need to go round every single architecture adding the header
explicitly which is cumbersome and annoying, especially with the less
actively maintained architectures.  On the other hand if you do things
without adding a generic header then people whine about not using the
generic header mechanism...

> I would definitely prefer being able to just write 

> generic-y += clkdev.h 

I agree but I don't see this as something that should block having the
facility.  Or if it does I guess I'll need to try to either fix clkdev
to use the arch include optionally or go round all the architectures
either of which is going to be needlessly painful.

> Maybe Michal Marek or someone on the kbuild mailing list can help
> out with a solution for that.

We could do that incrementally...

The reason I'm doing this is that the lack of a widely available clock
API is a considerable pain point for a lot of the stuff I work on and
this is the major blocker to just enabling the default implementation on
architectures that don't support it already which would be a big step
forwards.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 11:48       ` Mark Brown
@ 2012-07-03 12:05         ` Stephen Rothwell
  2012-07-03 12:33           ` Mark Brown
  2012-07-03 13:39           ` Arnd Bergmann
  0 siblings, 2 replies; 32+ messages in thread
From: Stephen Rothwell @ 2012-07-03 12:05 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, linux-arch, mturquette, Russell King,
	linux-kbuild, Michal Marek

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

Hi Mark,

On Tue, 3 Jul 2012 12:48:44 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
>
> > I would definitely prefer being able to just write 
> 
> > generic-y += clkdev.h 
> 
> I agree but I don't see this as something that should block having the
> facility.  Or if it does I guess I'll need to try to either fix clkdev
> to use the arch include optionally or go round all the architectures
> either of which is going to be needlessly painful.

True.

> > Maybe Michal Marek or someone on the kbuild mailing list can help
> > out with a solution for that.
> 
> We could do that incrementally...

Yes, indeed it should be a separate change.

> The reason I'm doing this is that the lack of a widely available clock
> API is a considerable pain point for a lot of the stuff I work on and
> this is the major blocker to just enabling the default implementation on
> architectures that don't support it already which would be a big step
> forwards.

Agreed.  Please submit this patch and we can concentrate on this other
stuff later.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 12:05         ` Stephen Rothwell
@ 2012-07-03 12:33           ` Mark Brown
  2012-07-03 13:15             ` Stephen Rothwell
  2012-07-03 13:39           ` Arnd Bergmann
  1 sibling, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-07-03 12:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnd Bergmann, linux-arch, mturquette, Russell King,
	linux-kbuild, Michal Marek

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

On Tue, Jul 03, 2012 at 10:05:12PM +1000, Stephen Rothwell wrote:
> On Tue, 3 Jul 2012 12:48:44 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> > The reason I'm doing this is that the lack of a widely available clock
> > API is a considerable pain point for a lot of the stuff I work on and
> > this is the major blocker to just enabling the default implementation on
> > architectures that don't support it already which would be a big step
> > forwards.

> Agreed.  Please submit this patch and we can concentrate on this other
> stuff later.

Perhaps if you give me a couple of hours...

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 12:33           ` Mark Brown
@ 2012-07-03 13:15             ` Stephen Rothwell
  0 siblings, 0 replies; 32+ messages in thread
From: Stephen Rothwell @ 2012-07-03 13:15 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, linux-arch, mturquette, Russell King,
	linux-kbuild, Michal Marek

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]

Hi Mark,

On Tue, 3 Jul 2012 13:33:22 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
>
> On Tue, Jul 03, 2012 at 10:05:12PM +1000, Stephen Rothwell wrote:
> > On Tue, 3 Jul 2012 12:48:44 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> 
> > > The reason I'm doing this is that the lack of a widely available clock
> > > API is a considerable pain point for a lot of the stuff I work on and
> > > this is the major blocker to just enabling the default implementation on
> > > architectures that don't support it already which would be a big step
> > > forwards.
> 
> > Agreed.  Please submit this patch and we can concentrate on this other
> > stuff later.
> 
> Perhaps if you give me a couple of hours...

Sorry, I wasn't meaning to rush you, just agreeing that the two things
are separate.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 12:05         ` Stephen Rothwell
  2012-07-03 12:33           ` Mark Brown
@ 2012-07-03 13:39           ` Arnd Bergmann
  2012-07-03 13:47             ` Mark Brown
  1 sibling, 1 reply; 32+ messages in thread
From: Arnd Bergmann @ 2012-07-03 13:39 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Mark Brown, linux-arch, mturquette, Russell King, linux-kbuild,
	Michal Marek

On Tuesday 03 July 2012, Stephen Rothwell wrote:
> > > Maybe Michal Marek or someone on the kbuild mailing list can help
> > > out with a solution for that.
> > 
> > We could do that incrementally...
> 
> Yes, indeed it should be a separate change.

Ok, let's do that then. What tree should we use for merging it?

In theory I should take it to some asm-generic tree, but since
I get very little traffic there, I'm usually happy to just provide
an Ack and let anyone who needs the patch merge it through their
trees.

	Arnd

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 13:39           ` Arnd Bergmann
@ 2012-07-03 13:47             ` Mark Brown
  2012-07-09 22:23               ` Mike Turquette
  0 siblings, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-07-03 13:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Stephen Rothwell, linux-arch, mturquette, Russell King,
	linux-kbuild, Michal Marek

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

On Tue, Jul 03, 2012 at 01:39:34PM +0000, Arnd Bergmann wrote:

> Ok, let's do that then. What tree should we use for merging it?

> In theory I should take it to some asm-generic tree, but since
> I get very little traffic there, I'm usually happy to just provide
> an Ack and let anyone who needs the patch merge it through their
> trees.

I guess one of the clock trees which probably means Mike?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 13:47             ` Mark Brown
@ 2012-07-09 22:23               ` Mike Turquette
  2012-07-09 23:30                 ` Russell King - ARM Linux
  0 siblings, 1 reply; 32+ messages in thread
From: Mike Turquette @ 2012-07-09 22:23 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Stephen Rothwell, linux-arch, Russell King,
	linux-kbuild, Michal Marek

On 20120703-14:47, Mark Brown wrote:
> On Tue, Jul 03, 2012 at 01:39:34PM +0000, Arnd Bergmann wrote:
> 
> > Ok, let's do that then. What tree should we use for merging it?
> 
> > In theory I should take it to some asm-generic tree, but since
> > I get very little traffic there, I'm usually happy to just provide
> > an Ack and let anyone who needs the patch merge it through their
> > trees.
> 
> I guess one of the clock trees which probably means Mike?

Hi Mark,

Russell owns clkdev so I'd prefer he take this patch.

Thanks,
Mike

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-09 22:23               ` Mike Turquette
@ 2012-07-09 23:30                 ` Russell King - ARM Linux
  2012-07-10 17:22                   ` Mark Brown
  0 siblings, 1 reply; 32+ messages in thread
From: Russell King - ARM Linux @ 2012-07-09 23:30 UTC (permalink / raw)
  To: Mike Turquette
  Cc: Mark Brown, Arnd Bergmann, Stephen Rothwell, linux-arch,
	linux-kbuild, Michal Marek

On Mon, Jul 09, 2012 at 03:23:32PM -0700, Mike Turquette wrote:
> On 20120703-14:47, Mark Brown wrote:
> > On Tue, Jul 03, 2012 at 01:39:34PM +0000, Arnd Bergmann wrote:
> > 
> > > Ok, let's do that then. What tree should we use for merging it?
> > 
> > > In theory I should take it to some asm-generic tree, but since
> > > I get very little traffic there, I'm usually happy to just provide
> > > an Ack and let anyone who needs the patch merge it through their
> > > trees.
> > 
> > I guess one of the clock trees which probably means Mike?
> 
> Hi Mark,
> 
> Russell owns clkdev so I'd prefer he take this patch.

Note that I'm not going to be taking any further patches for at least
the next 16 days (as I'm away), and I'm not going to even guarantee
that I'll pick up on anything on the mailing lists during that period.

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-09 23:30                 ` Russell King - ARM Linux
@ 2012-07-10 17:22                   ` Mark Brown
  2012-07-10 18:07                     ` Arnd Bergmann
  0 siblings, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-07-10 17:22 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Mike Turquette, Arnd Bergmann, Stephen Rothwell, linux-arch,
	linux-kbuild, Michal Marek

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

On Tue, Jul 10, 2012 at 12:30:22AM +0100, Russell King - ARM Linux wrote:
> On Mon, Jul 09, 2012 at 03:23:32PM -0700, Mike Turquette wrote:

> > Russell owns clkdev so I'd prefer he take this patch.

> Note that I'm not going to be taking any further patches for at least
> the next 16 days (as I'm away), and I'm not going to even guarantee
> that I'll pick up on anything on the mailing lists during that period.

Oh dear, that's a bit sad - given that the merge window may well open
it'll mean we'll end up with at least one additional release where we
can't get the clock API available as standard :(

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-10 17:22                   ` Mark Brown
@ 2012-07-10 18:07                     ` Arnd Bergmann
  2012-07-11  2:44                       ` Paul Mundt
  0 siblings, 1 reply; 32+ messages in thread
From: Arnd Bergmann @ 2012-07-10 18:07 UTC (permalink / raw)
  To: Mark Brown
  Cc: Russell King - ARM Linux, Mike Turquette, Stephen Rothwell,
	linux-arch, linux-kbuild, Michal Marek

On Tuesday 10 July 2012, Mark Brown wrote:
> On Tue, Jul 10, 2012 at 12:30:22AM +0100, Russell King - ARM Linux wrote:
> > On Mon, Jul 09, 2012 at 03:23:32PM -0700, Mike Turquette wrote:
> 
> > > Russell owns clkdev so I'd prefer he take this patch.
> 
> > Note that I'm not going to be taking any further patches for at least
> > the next 16 days (as I'm away), and I'm not going to even guarantee
> > that I'll pick up on anything on the mailing lists during that period.
> 
> Oh dear, that's a bit sad - given that the merge window may well open
> it'll mean we'll end up with at least one additional release where we
> can't get the clock API available as standard :(

I can start an asm-generic branch in the arm-soc tree then (or maybe
a new tree) and apply the patch there.

	Arnd

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-10 18:07                     ` Arnd Bergmann
@ 2012-07-11  2:44                       ` Paul Mundt
  2012-07-11  6:32                         ` Arnd Bergmann
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Mundt @ 2012-07-11  2:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Russell King - ARM Linux, Mike Turquette,
	Stephen Rothwell, linux-arch, linux-kbuild, Michal Marek

On Tue, Jul 10, 2012 at 06:07:28PM +0000, Arnd Bergmann wrote:
> On Tuesday 10 July 2012, Mark Brown wrote:
> > On Tue, Jul 10, 2012 at 12:30:22AM +0100, Russell King - ARM Linux wrote:
> > > On Mon, Jul 09, 2012 at 03:23:32PM -0700, Mike Turquette wrote:
> > 
> > > > Russell owns clkdev so I'd prefer he take this patch.
> > 
> > > Note that I'm not going to be taking any further patches for at least
> > > the next 16 days (as I'm away), and I'm not going to even guarantee
> > > that I'll pick up on anything on the mailing lists during that period.
> > 
> > Oh dear, that's a bit sad - given that the merge window may well open
> > it'll mean we'll end up with at least one additional release where we
> > can't get the clock API available as standard :(
> 
> I can start an asm-generic branch in the arm-soc tree then (or maybe
> a new tree) and apply the patch there.
> 
Given that this patch has nothing at all to do with ARM, why not just
take it through the asm-generic tree?

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-11  2:44                       ` Paul Mundt
@ 2012-07-11  6:32                         ` Arnd Bergmann
  0 siblings, 0 replies; 32+ messages in thread
From: Arnd Bergmann @ 2012-07-11  6:32 UTC (permalink / raw)
  To: Paul Mundt
  Cc: Mark Brown, Russell King - ARM Linux, Mike Turquette,
	Stephen Rothwell, linux-arch, linux-kbuild, Michal Marek

On Wednesday 11 July 2012, Paul Mundt wrote:
> > I can start an asm-generic branch in the arm-soc tree then (or maybe
> > a new tree) and apply the patch there.
> > 
> Given that this patch has nothing at all to do with ARM, why not just
> take it through the asm-generic tree?

Just my personal lazyness. I haven't had an asm-generic tree for a while,
and my main working tree is a mirror of the arm-soc tree.

On the other hand, I looked up the maintainers file and it points to
git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
so maybe I should restore that one after all or remove the reference
if I don't.

	Arnd

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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-09-05  4:04 Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-09-05  4:04 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arch, linux-kernel, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h for
use if the arch does not have an include/asm/clkdev.h.

Due to limitations in Kbuild we manually add clkdev.h to all
architectures that don't have one rather than having the header appear
by default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>
---

Resending as the addition of exec.h introduce a bunch of conflicts, plus
I spotted a typo.

 arch/alpha/include/asm/Kbuild      |    2 ++
 arch/avr32/include/asm/Kbuild      |    2 ++
 arch/cris/include/asm/Kbuild       |    1 +
 arch/frv/include/asm/Kbuild        |    1 +
 arch/h8300/include/asm/Kbuild      |    1 +
 arch/hexagon/include/asm/Kbuild    |    1 +
 arch/ia64/include/asm/Kbuild       |    1 +
 arch/m32r/include/asm/Kbuild       |    1 +
 arch/m68k/include/asm/Kbuild       |    1 +
 arch/microblaze/include/asm/Kbuild |    1 +
 arch/mn10300/include/asm/Kbuild    |    1 +
 arch/openrisc/include/asm/Kbuild   |    1 +
 arch/parisc/include/asm/Kbuild     |    1 +
 arch/powerpc/include/asm/Kbuild    |    1 +
 arch/s390/include/asm/Kbuild       |    2 ++
 arch/score/include/asm/Kbuild      |    2 ++
 arch/sparc/include/asm/Kbuild      |    1 +
 arch/tile/include/asm/Kbuild       |    1 +
 arch/um/include/asm/Kbuild         |    2 +-
 arch/unicore32/include/asm/Kbuild  |    1 +
 arch/x86/include/asm/Kbuild        |    2 ++
 arch/xtensa/include/asm/Kbuild     |    1 +
 include/asm-generic/clkdev.h       |   28 ++++++++++++++++++++++++++++
 23 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index 3bae7c9..64ffc9e 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -1,5 +1,7 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y += clkdev.h
+
 header-y += compiler.h
 header-y += console.h
 header-y += fpu.h
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild
index aa47fff..be0433e 100644
--- a/arch/avr32/include/asm/Kbuild
+++ b/arch/avr32/include/asm/Kbuild
@@ -1,4 +1,6 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y	+= clkdev.h
 generic-y	+= exec.h
+
 header-y	+= cachectl.h
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild
index f5ae9de..94c496a 100644
--- a/arch/cris/include/asm/Kbuild
+++ b/arch/cris/include/asm/Kbuild
@@ -8,5 +8,6 @@ header-y += etraxgpio.h
 header-y += rs485.h
 header-y += sync_serial.h
 
+generic-y += clkdev.h
 generic-y += module.h
 generic-y += exec.h
diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild
index 32c1646..251bd71 100644
--- a/arch/frv/include/asm/Kbuild
+++ b/arch/frv/include/asm/Kbuild
@@ -2,4 +2,5 @@ include include/asm-generic/Kbuild.asm
 
 header-y += registers.h
 header-y += termios.h
+generic-y += clkdev.h
 generic-y += exec.h
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild
index 883a0be..67c4b8f 100644
--- a/arch/h8300/include/asm/Kbuild
+++ b/arch/h8300/include/asm/Kbuild
@@ -1,4 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y	+= clkdev.h
 generic-y	+= module.h
 generic-y += exec.h
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index 0690642..3364b696 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -7,6 +7,7 @@ header-y += user.h
 generic-y += auxvec.h
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += current.h
 generic-y += device.h
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index 98efd48..562f593 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -13,4 +13,5 @@ header-y += ptrace_offsets.h
 header-y += rse.h
 header-y += ucontext.h
 header-y += ustack.h
+generic-y += clkdev.h
 generic-y += exec.h
diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild
index 883a0be..67c4b8f 100644
--- a/arch/m32r/include/asm/Kbuild
+++ b/arch/m32r/include/asm/Kbuild
@@ -1,4 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y	+= clkdev.h
 generic-y	+= module.h
 generic-y += exec.h
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild
index a9d1bf1..ecb5408 100644
--- a/arch/m68k/include/asm/Kbuild
+++ b/arch/m68k/include/asm/Kbuild
@@ -2,6 +2,7 @@ include include/asm-generic/Kbuild.asm
 header-y += cachectl.h
 
 generic-y += bitsperlong.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += device.h
 generic-y += emergency-restart.h
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index 5a0e72b..8653072 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -1,4 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
 header-y  += elf.h
+generic-y += clkdev.h
 generic-y += exec.h
diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild
index 7083403..fccd81e 100644
--- a/arch/mn10300/include/asm/Kbuild
+++ b/arch/mn10300/include/asm/Kbuild
@@ -1,3 +1,4 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y += clkdev.h
 generic-y += exec.h
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 0922959..7140b6b 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -11,6 +11,7 @@ generic-y += bug.h
 generic-y += bugs.h
 generic-y += cacheflush.h
 generic-y += checksum.h
+generic-y += clkdev.h
 generic-y += cmpxchg.h
 generic-y += cmpxchg-local.h
 generic-y += cputime.h
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index 818d651..458371a 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -1,5 +1,6 @@
 include include/asm-generic/Kbuild.asm
 
 header-y += pdc.h
+generic-y += clkdev.h
 generic-y += word-at-a-time.h
 generic-y += exec.h
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 13d6b7b..2767973 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -36,4 +36,5 @@ header-y += ucontext.h
 header-y += unistd.h
 header-y += epapr_hcalls.h
 
+generic-y += clkdev.h
 generic-y += rwsem.h
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index 287d7bb..f18fc79 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -13,3 +13,5 @@ header-y += tape390.h
 header-y += ucontext.h
 header-y += vtoc.h
 header-y += zcrypt.h
+
+generic-y += clkdev.h
diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild
index b367abd..ec697ae 100644
--- a/arch/score/include/asm/Kbuild
+++ b/arch/score/include/asm/Kbuild
@@ -1,3 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
 header-y +=
+
+generic-y += clkdev.h
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index c5833f4..164e6f2 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -17,6 +17,7 @@ header-y += uctx.h
 header-y += utrap.h
 header-y += watchdog.h
 
+generic-y += clkdev.h
 generic-y += div64.h
 generic-y += exec.h
 generic-y += local64.h
diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild
index 5a5e679..5cd98fa 100644
--- a/arch/tile/include/asm/Kbuild
+++ b/arch/tile/include/asm/Kbuild
@@ -8,6 +8,7 @@ header-y += hardwall.h
 
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += div64.h
 generic-y += emergency-restart.h
diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index fff2435..0f6e7b3 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@ -1,4 +1,4 @@
 generic-y += bug.h cputime.h device.h emergency-restart.h futex.h hardirq.h
 generic-y += hw_irq.h irq_regs.h kdebug.h percpu.h sections.h topology.h xor.h
 generic-y += ftrace.h pci.h io.h param.h delay.h mutex.h current.h exec.h
-generic-y += switch_to.h
+generic-y += switch_to.h clkdev.h
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
index 90a01c8..c910c98 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -4,6 +4,7 @@ generic-y += atomic.h
 generic-y += auxvec.h
 generic-y += bitsperlong.h
 generic-y += bugs.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += current.h
 generic-y += device.h
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index f9c0d3ba..66e5f0e 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -26,3 +26,5 @@ header-y += vsyscall.h
 genhdr-y += unistd_32.h
 genhdr-y += unistd_64.h
 genhdr-y += unistd_x32.h
+
+generic-y += clkdev.h
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
index 7083403..fccd81e 100644
--- a/arch/xtensa/include/asm/Kbuild
+++ b/arch/xtensa/include/asm/Kbuild
@@ -1,3 +1,4 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y += clkdev.h
 generic-y += exec.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..90a32a6
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,28 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+struct clk;
+
+static inline int __clk_get(struct clk *clk) { return 1; }
+static inline void __clk_put(struct clk *clk) { }
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10.4


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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-08-28 18:56 Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-08-28 18:56 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Stephen Rothwell, linux-arch, linux-kernel, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h for
use if the arch does not have an include/asm/clkdev.h.

Due to limitations in Kbuild we manually add clkdev.h to all
architectures that don't have one rather than having the header appear
by default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/alpha/include/asm/Kbuild      |    2 ++
 arch/avr32/include/asm/Kbuild      |    2 ++
 arch/cris/include/asm/Kbuild       |    1 +
 arch/frv/include/asm/Kbuild        |    2 ++
 arch/h8300/include/asm/Kbuild      |    1 +
 arch/hexagon/include/asm/Kbuild    |    1 +
 arch/ia64/include/asm/Kbuild       |    2 ++
 arch/m32r/include/asm/Kbuild       |    1 +
 arch/m68k/include/asm/Kbuild       |    1 +
 arch/microblaze/include/asm/Kbuild |    2 ++
 arch/mn10300/include/asm/Kbuild    |    2 ++
 arch/openrisc/include/asm/Kbuild   |    1 +
 arch/parisc/include/asm/Kbuild     |    1 +
 arch/powerpc/include/asm/Kbuild    |    1 +
 arch/s390/include/asm/Kbuild       |    2 ++
 arch/score/include/asm/Kbuild      |    2 ++
 arch/sparc/include/asm/Kbuild      |    1 +
 arch/tile/include/asm/Kbuild       |    1 +
 arch/um/include/asm/Kbuild         |    2 +-
 arch/unicore32/include/asm/Kbuild  |    1 +
 arch/x86/include/asm/Kbuild        |    2 ++
 arch/xtensa/include/asm/Kbuild     |    2 ++
 include/asm-generic/clkdev.h       |   28 ++++++++++++++++++++++++++++
 23 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index e423def..d97d663 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -1,5 +1,7 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y += clkdev.h
+
 header-y += compiler.h
 header-y += console.h
 header-y += fpu.h
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild
index 3136628..e3ba7bc 100644
--- a/arch/avr32/include/asm/Kbuild
+++ b/arch/avr32/include/asm/Kbuild
@@ -1,3 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y	+= clkdev.h
+
 header-y	+= cachectl.h
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild
index 28b690d..0d3854c 100644
--- a/arch/cris/include/asm/Kbuild
+++ b/arch/cris/include/asm/Kbuild
@@ -8,4 +8,5 @@ header-y += etraxgpio.h
 header-y += rs485.h
 header-y += sync_serial.h
 
+generic-y += clkdev.h
 generic-y += module.h
diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild
index 5be6663..0c8cf8a 100644
--- a/arch/frv/include/asm/Kbuild
+++ b/arch/frv/include/asm/Kbuild
@@ -2,3 +2,5 @@ include include/asm-generic/Kbuild.asm
 
 header-y += registers.h
 header-y += termios.h
+
+generic-y += clkdev.h
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild
index 871382d..65902a6 100644
--- a/arch/h8300/include/asm/Kbuild
+++ b/arch/h8300/include/asm/Kbuild
@@ -1,3 +1,4 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y	+= clkdev.h
 generic-y	+= module.h
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index 0690642..3364b696 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -7,6 +7,7 @@ header-y += user.h
 generic-y += auxvec.h
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += current.h
 generic-y += device.h
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index d4eb9383..47c545b 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -13,3 +13,5 @@ header-y += ptrace_offsets.h
 header-y += rse.h
 header-y += ucontext.h
 header-y += ustack.h
+
+generiy-y += clkdev.h
diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild
index 871382d..65902a6 100644
--- a/arch/m32r/include/asm/Kbuild
+++ b/arch/m32r/include/asm/Kbuild
@@ -1,3 +1,4 @@
 include include/asm-generic/Kbuild.asm
 
+generic-y	+= clkdev.h
 generic-y	+= module.h
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild
index a74e5d9..bfe675f 100644
--- a/arch/m68k/include/asm/Kbuild
+++ b/arch/m68k/include/asm/Kbuild
@@ -2,6 +2,7 @@ include include/asm-generic/Kbuild.asm
 header-y += cachectl.h
 
 generic-y += bitsperlong.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += device.h
 generic-y += emergency-restart.h
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index db5294c..153a2a1 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -1,3 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
 header-y  += elf.h
+
+generic-y += clkdev.h
diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild
index c68e168..0d20f55 100644
--- a/arch/mn10300/include/asm/Kbuild
+++ b/arch/mn10300/include/asm/Kbuild
@@ -1 +1,3 @@
 include include/asm-generic/Kbuild.asm
+
+generic-y += clkdev.h
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 0922959..7140b6b 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -11,6 +11,7 @@ generic-y += bug.h
 generic-y += bugs.h
 generic-y += cacheflush.h
 generic-y += checksum.h
+generic-y += clkdev.h
 generic-y += cmpxchg.h
 generic-y += cmpxchg-local.h
 generic-y += cputime.h
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index 4383707..0587f62 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -1,4 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
 header-y += pdc.h
+generic-y += clkdev.h
 generic-y += word-at-a-time.h
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 13d6b7b..2767973 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -36,4 +36,5 @@ header-y += ucontext.h
 header-y += unistd.h
 header-y += epapr_hcalls.h
 
+generic-y += clkdev.h
 generic-y += rwsem.h
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index 287d7bb..f18fc79 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -13,3 +13,5 @@ header-y += tape390.h
 header-y += ucontext.h
 header-y += vtoc.h
 header-y += zcrypt.h
+
+generic-y += clkdev.h
diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild
index b367abd..ec697ae 100644
--- a/arch/score/include/asm/Kbuild
+++ b/arch/score/include/asm/Kbuild
@@ -1,3 +1,5 @@
 include include/asm-generic/Kbuild.asm
 
 header-y +=
+
+generic-y += clkdev.h
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index fbe1cb5..100aa10 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -17,6 +17,7 @@ header-y += uctx.h
 header-y += utrap.h
 header-y += watchdog.h
 
+generic-y += clkdev.h
 generic-y += div64.h
 generic-y += local64.h
 generic-y += irq_regs.h
diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild
index 5bd7199..ea2e8ea 100644
--- a/arch/tile/include/asm/Kbuild
+++ b/arch/tile/include/asm/Kbuild
@@ -8,6 +8,7 @@ header-y += hardwall.h
 
 generic-y += bug.h
 generic-y += bugs.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += div64.h
 generic-y += emergency-restart.h
diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index fff2435..0f6e7b3 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@ -1,4 +1,4 @@
 generic-y += bug.h cputime.h device.h emergency-restart.h futex.h hardirq.h
 generic-y += hw_irq.h irq_regs.h kdebug.h percpu.h sections.h topology.h xor.h
 generic-y += ftrace.h pci.h io.h param.h delay.h mutex.h current.h exec.h
-generic-y += switch_to.h
+generic-y += switch_to.h clkdev.h
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
index 34b789b..123c59a 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -4,6 +4,7 @@ generic-y += atomic.h
 generic-y += auxvec.h
 generic-y += bitsperlong.h
 generic-y += bugs.h
+generic-y += clkdev.h
 generic-y += cputime.h
 generic-y += current.h
 generic-y += device.h
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index f9c0d3ba..66e5f0e 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -26,3 +26,5 @@ header-y += vsyscall.h
 genhdr-y += unistd_32.h
 genhdr-y += unistd_64.h
 genhdr-y += unistd_x32.h
+
+generic-y += clkdev.h
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
index c68e168..0d20f55 100644
--- a/arch/xtensa/include/asm/Kbuild
+++ b/arch/xtensa/include/asm/Kbuild
@@ -1 +1,3 @@
 include include/asm-generic/Kbuild.asm
+
+generic-y += clkdev.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..90a32a6
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,28 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+struct clk;
+
+static inline int __clk_get(struct clk *clk) { return 1; }
+static inline void __clk_put(struct clk *clk) { }
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10.4


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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-08-25 18:16 Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-08-25 18:16 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arch, linux-kernel, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h which
will be used if the arch does not have an include/asm/clkdev.h.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/asm-generic/Kbuild.asm |    4 ++++
 include/asm-generic/clkdev.h   |   28 ++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..da121e0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 header-y += a.out.h
 endif
 
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
+generic-y += clkdev.h
+endif
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..90a32a6
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,28 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+struct clk;
+
+static inline int __clk_get(struct clk *clk) { return 1; }
+static inline void __clk_put(struct clk *clk) { }
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10.4


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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-04  8:00 ` Geert Uytterhoeven
@ 2012-07-04  9:22   ` Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-07-04  9:22 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Stephen Rothwell, Russell King, mturquette, linux-arch,
	linux-kernel, Sam Ravnborg, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

On Wed, Jul 04, 2012 at 10:00:50AM +0200, Geert Uytterhoeven wrote:

> Quoting Sam:
> "Any use of wildcards in include/asm-generic/Kbuild.asm is bogus."

> http://lkml.indiana.edu/hypermail/linux/kernel/1206.2/01507.html

Without actually explaining why which isn't terribly helpful :/

As far as I can tell it looks like this is for headers which may
optionally be absent but clkdev.h is a header which should never be
absent, either the architecture defines it or it uses the generic one.

As I said further up the thread having to go round ever single
architecture and get them to actually apply patches for stuff like this
is needlessly painful.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 15:23 Mark Brown
  2012-07-03 15:29 ` Stephen Rothwell
@ 2012-07-04  8:00 ` Geert Uytterhoeven
  2012-07-04  9:22   ` Mark Brown
  1 sibling, 1 reply; 32+ messages in thread
From: Geert Uytterhoeven @ 2012-07-04  8:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: Stephen Rothwell, Russell King, mturquette, linux-arch,
	linux-kernel, Sam Ravnborg, linux-kbuild

On Tue, Jul 3, 2012 at 5:23 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> --- a/include/asm-generic/Kbuild.asm
> +++ b/include/asm-generic/Kbuild.asm
> @@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
>  header-y += a.out.h
>  endif
>
> +ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
> +generic-y += clkdev.h
> +endif

Quoting Sam:
"Any use of wildcards in include/asm-generic/Kbuild.asm is bogus."

http://lkml.indiana.edu/hypermail/linux/kernel/1206.2/01507.html

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 17:04 Mark Brown
@ 2012-07-03 22:07 ` Stephen Rothwell
  0 siblings, 0 replies; 32+ messages in thread
From: Stephen Rothwell @ 2012-07-03 22:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: Russell King, mturquette, linux-arch, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Hi Mark,

On Tue,  3 Jul 2012 18:04:37 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
>
> Ease the deployment of clkdev by providing a default asm/clkdev.h which
> will be used if the arch does not have an include/asm/clkdev.h.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Looks good to me.

Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-07-03 17:04 Mark Brown
  2012-07-03 22:07 ` Stephen Rothwell
  0 siblings, 1 reply; 32+ messages in thread
From: Mark Brown @ 2012-07-03 17:04 UTC (permalink / raw)
  To: Stephen Rothwell, Russell King, mturquette
  Cc: linux-arch, linux-kernel, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h which
will be used if the arch does not have an include/asm/clkdev.h.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/asm-generic/Kbuild.asm |    4 ++++
 include/asm-generic/clkdev.h   |   28 ++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..da121e0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 header-y += a.out.h
 endif
 
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
+generic-y += clkdev.h
+endif
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..90a32a6
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,28 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+struct clk;
+
+static inline int __clk_get(struct clk *clk) { return 1; }
+static inline void __clk_put(struct clk *clk) { }
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10


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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-07-03 15:23 Mark Brown
@ 2012-07-03 15:29 ` Stephen Rothwell
  2012-07-04  8:00 ` Geert Uytterhoeven
  1 sibling, 0 replies; 32+ messages in thread
From: Stephen Rothwell @ 2012-07-03 15:29 UTC (permalink / raw)
  To: Mark Brown; +Cc: Russell King, mturquette, linux-arch, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

Hi Mark,

On Tue,  3 Jul 2012 16:23:35 +0100 Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
>
> +static inline int __clk_get(clk) { return 1; }
> +static inline void __clk_put(clk) { }

struct clk;

static inline int __clk_get(struct clk *clk) { return 1; }
static inline void __clk_put(struct clk *clk) { }

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-07-03 15:23 Mark Brown
  2012-07-03 15:29 ` Stephen Rothwell
  2012-07-04  8:00 ` Geert Uytterhoeven
  0 siblings, 2 replies; 32+ messages in thread
From: Mark Brown @ 2012-07-03 15:23 UTC (permalink / raw)
  To: Stephen Rothwell, Russell King, mturquette
  Cc: linux-arch, linux-kernel, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h which
will be used if the arch does not have an include/asm/clkdev.h.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---

The discussion on the previous posting of this patch suggested we should
be merging this via clk (or possibly clkdev).

 include/asm-generic/Kbuild.asm |    4 ++++
 include/asm-generic/clkdev.h   |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..da121e0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 header-y += a.out.h
 endif
 
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
+generic-y += clkdev.h
+endif
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..7a15bd0
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,26 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+static inline int __clk_get(clk) { return 1; }
+static inline void __clk_put(clk) { }
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10


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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-06-14 11:22 Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-06-14 11:22 UTC (permalink / raw)
  To: Arnd Bergmann, Russell King
  Cc: linux-arch, linux-kernel, Sam Ravnborg, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h which
will be used if the arch does not have an include/asm/clkdev.h.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/asm-generic/Kbuild.asm |    4 ++++
 include/asm-generic/clkdev.h   |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..da121e0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 header-y += a.out.h
 endif
 
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
+generic-y += clkdev.h
+endif
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..c362a9d
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,26 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+#define __clk_get(clk)	({ 1; })
+#define __clk_put(clk)	do { } while (0)
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10


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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-05-14 19:03   ` Arnd Bergmann
@ 2012-05-14 19:09     ` Mark Brown
  -1 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-05-14 19:09 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Russell King, linux-arch, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

On Mon, May 14, 2012 at 07:03:03PM +0000, Arnd Bergmann wrote:

> I'm not completely sure about this part. It should work just fine, but
> we haven't done this for any of the other asm/* headers. If we decide
> to list generic header files  in Kconfig.asm that automatically get
> added to architectures, I would prefer doing it with a nicer syntax so
> we can do it for a lot of the other header files too. For now, I'd
> prefer to just add the file manually to the asm/Kbuild files in the
> architectures where it makes sense (e.g. all but s390).

The problem with that is the general pain that seems to come from trying
to get all the architecture maintainers to apply patches like this (lots
of them are OK but many do great /dev/null impressions) and it's pushing
the problem back onto the wrong people.  It seems less work to go put
something ugly in and then hopefully some Kbuild expert will get annoyed
and fix things rather than we get stuck with the status quo.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-05-14 19:09     ` Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-05-14 19:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 14, 2012 at 07:03:03PM +0000, Arnd Bergmann wrote:

> I'm not completely sure about this part. It should work just fine, but
> we haven't done this for any of the other asm/* headers. If we decide
> to list generic header files  in Kconfig.asm that automatically get
> added to architectures, I would prefer doing it with a nicer syntax so
> we can do it for a lot of the other header files too. For now, I'd
> prefer to just add the file manually to the asm/Kbuild files in the
> architectures where it makes sense (e.g. all but s390).

The problem with that is the general pain that seems to come from trying
to get all the architecture maintainers to apply patches like this (lots
of them are OK but many do great /dev/null impressions) and it's pushing
the problem back onto the wrong people.  It seems less work to go put
something ugly in and then hopefully some Kbuild expert will get annoyed
and fix things rather than we get stuck with the status quo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120514/8cd3ea98/attachment-0001.sig>

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

* Re: [PATCH] clkdev: Add default clkdev.h
  2012-05-14 14:19 ` Mark Brown
@ 2012-05-14 19:03   ` Arnd Bergmann
  -1 siblings, 0 replies; 32+ messages in thread
From: Arnd Bergmann @ 2012-05-14 19:03 UTC (permalink / raw)
  To: Mark Brown; +Cc: Russell King, linux-arch, linux-arm-kernel

On Monday 14 May 2012, Mark Brown wrote:
> Ease the deployment of clkdev by providing a default asm/clkdev.h which
> will be used if the arch does not have an include/asm/clkdev.h.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  include/asm-generic/Kbuild.asm |    4 ++++
>  include/asm-generic/clkdev.h   |   26 ++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
>  create mode 100644 include/asm-generic/clkdev.h
> 

Good idea!

>diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
>index c5d2e5d..da121e0 100644
>--- a/include/asm-generic/Kbuild.asm
>+++ b/include/asm-generic/Kbuild.asm
>@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
> header-y += a.out.h
> endif
> 
>+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
>+generic-y += clkdev.h
>+endif
>+
> header-y += auxvec.h
> header-y += bitsperlong.h
> header-y += byteorder.h

I'm not completely sure about this part. It should work just fine, but we haven't
done this for any of the other asm/* headers. If we decide to list generic header
files  in Kconfig.asm that automatically get added to architectures, I would prefer
doing it with a nicer syntax so we can do it for a lot of the other header files
too. For now, I'd prefer to just add the file manually to the asm/Kbuild files
in the architectures where it makes sense (e.g. all but s390).

	Arnd

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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-05-14 19:03   ` Arnd Bergmann
  0 siblings, 0 replies; 32+ messages in thread
From: Arnd Bergmann @ 2012-05-14 19:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 14 May 2012, Mark Brown wrote:
> Ease the deployment of clkdev by providing a default asm/clkdev.h which
> will be used if the arch does not have an include/asm/clkdev.h.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  include/asm-generic/Kbuild.asm |    4 ++++
>  include/asm-generic/clkdev.h   |   26 ++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
>  create mode 100644 include/asm-generic/clkdev.h
> 

Good idea!

>diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
>index c5d2e5d..da121e0 100644
>--- a/include/asm-generic/Kbuild.asm
>+++ b/include/asm-generic/Kbuild.asm
>@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
> header-y += a.out.h
> endif
> 
>+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
>+generic-y += clkdev.h
>+endif
>+
> header-y += auxvec.h
> header-y += bitsperlong.h
> header-y += byteorder.h

I'm not completely sure about this part. It should work just fine, but we haven't
done this for any of the other asm/* headers. If we decide to list generic header
files  in Kconfig.asm that automatically get added to architectures, I would prefer
doing it with a nicer syntax so we can do it for a lot of the other header files
too. For now, I'd prefer to just add the file manually to the asm/Kbuild files
in the architectures where it makes sense (e.g. all but s390).

	Arnd

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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-05-14 14:19 ` Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-05-14 14:19 UTC (permalink / raw)
  To: Arnd Bergmann, Russell King; +Cc: linux-arch, linux-arm-kernel, Mark Brown

Ease the deployment of clkdev by providing a default asm/clkdev.h which
will be used if the arch does not have an include/asm/clkdev.h.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/asm-generic/Kbuild.asm |    4 ++++
 include/asm-generic/clkdev.h   |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..da121e0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 header-y += a.out.h
 endif
 
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
+generic-y += clkdev.h
+endif
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..c362a9d
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,26 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+#define __clk_get(clk)	({ 1; })
+#define __clk_put(clk)	do { } while (0)
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10

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

* [PATCH] clkdev: Add default clkdev.h
@ 2012-05-14 14:19 ` Mark Brown
  0 siblings, 0 replies; 32+ messages in thread
From: Mark Brown @ 2012-05-14 14:19 UTC (permalink / raw)
  To: linux-arm-kernel

Ease the deployment of clkdev by providing a default asm/clkdev.h which
will be used if the arch does not have an include/asm/clkdev.h.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 include/asm-generic/Kbuild.asm |    4 ++++
 include/asm-generic/clkdev.h   |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 include/asm-generic/clkdev.h

diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index c5d2e5d..da121e0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -13,6 +13,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
 header-y += a.out.h
 endif
 
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/clkdev.h),)
+generic-y += clkdev.h
+endif
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
new file mode 100644
index 0000000..c362a9d
--- /dev/null
+++ b/include/asm-generic/clkdev.h
@@ -0,0 +1,26 @@
+/*
+ *  include/asm-generic/clkdev.h
+ *
+ * Based on the ARM clkdev.h:
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __ASM_CLKDEV_H
+#define __ASM_CLKDEV_H
+
+#include <linux/slab.h>
+
+#define __clk_get(clk)	({ 1; })
+#define __clk_put(clk)	do { } while (0)
+
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+	return kzalloc(size, GFP_KERNEL);
+}
+
+#endif
-- 
1.7.10

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

end of thread, other threads:[~2012-09-05  4:04 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-02 18:04 [PATCH] clkdev: Add default clkdev.h Mark Brown
2012-07-03  2:00 ` Stephen Rothwell
2012-07-03 10:12   ` Mark Brown
2012-07-03 11:16     ` Arnd Bergmann
2012-07-03 11:48       ` Mark Brown
2012-07-03 12:05         ` Stephen Rothwell
2012-07-03 12:33           ` Mark Brown
2012-07-03 13:15             ` Stephen Rothwell
2012-07-03 13:39           ` Arnd Bergmann
2012-07-03 13:47             ` Mark Brown
2012-07-09 22:23               ` Mike Turquette
2012-07-09 23:30                 ` Russell King - ARM Linux
2012-07-10 17:22                   ` Mark Brown
2012-07-10 18:07                     ` Arnd Bergmann
2012-07-11  2:44                       ` Paul Mundt
2012-07-11  6:32                         ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2012-09-05  4:04 Mark Brown
2012-08-28 18:56 Mark Brown
2012-08-25 18:16 Mark Brown
2012-07-03 17:04 Mark Brown
2012-07-03 22:07 ` Stephen Rothwell
2012-07-03 15:23 Mark Brown
2012-07-03 15:29 ` Stephen Rothwell
2012-07-04  8:00 ` Geert Uytterhoeven
2012-07-04  9:22   ` Mark Brown
2012-06-14 11:22 Mark Brown
2012-05-14 14:19 Mark Brown
2012-05-14 14:19 ` Mark Brown
2012-05-14 19:03 ` Arnd Bergmann
2012-05-14 19:03   ` Arnd Bergmann
2012-05-14 19:09   ` Mark Brown
2012-05-14 19:09     ` Mark Brown

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.