All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators
@ 2012-06-20  8:01 Guennadi Liakhovetski
  2012-06-20  9:48 ` Mark Brown
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2012-06-20  8:01 UTC (permalink / raw)
  To: linux-sh

Providing fixed voltage permanently "on" regulators with different voltages
shares a lot of identical code. It will be eliminated, once the
regulator_register_fixed_volt() function becomes available. Until then we
introduce a macro to define such regulators. This helps reduce the amount
of added code in each platform file and keeps copy-paste errors to the
minumum.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/mach-shmobile/include/mach/regulator.h |   34 +++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-shmobile/include/mach/regulator.h

diff --git a/arch/arm/mach-shmobile/include/mach/regulator.h b/arch/arm/mach-shmobile/include/mach/regulator.h
new file mode 100644
index 0000000..fe74995
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/regulator.h
@@ -0,0 +1,34 @@
+/*
+ * Temporary header until regulator_register_fixed_volt() is available.
+ * Licensed under GPLv2, see COPYING for details.
+ */
+
+#ifndef ASM_REGULATOR_H
+#define ASM_REGULATOR_H
+
+#include <linux/regulator/driver.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+
+#define REGULATOR_FIXED(s, rid, v)					\
+static struct regulator_init_data fixed_power_init_data_ ## rid = {	\
+	.num_consumer_supplies  = ARRAY_SIZE(s),			\
+	.consumer_supplies      = (s),					\
+	.constraints.always_on	= 1,					\
+};									\
+static struct fixed_voltage_config fixed_power_info_ ## rid = {		\
+	.supply_name = "Fixed #" # rid,					\
+	.microvolts = (v),						\
+	.gpio = -EINVAL,						\
+	.init_data = &fixed_power_init_data_ ## rid,			\
+	.enabled_at_boot = 1,						\
+};									\
+static struct platform_device fixed_power_ ## rid = {			\
+	.name = "reg-fixed-voltage",					\
+	.id   = (rid),							\
+	.dev  = {							\
+		.platform_data = &fixed_power_info_ ## rid,		\
+	},								\
+}
+
+#endif
-- 
1.7.2.5


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

* Re: [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators
  2012-06-20  8:01 [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators Guennadi Liakhovetski
@ 2012-06-20  9:48 ` Mark Brown
  2012-06-20 12:18 ` Guennadi Liakhovetski
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-06-20  9:48 UTC (permalink / raw)
  To: linux-sh

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

On Wed, Jun 20, 2012 at 10:01:30AM +0200, Guennadi Liakhovetski wrote:
> Providing fixed voltage permanently "on" regulators with different voltages
> shares a lot of identical code. It will be eliminated, once the
> regulator_register_fixed_volt() function becomes available. Until then we
> introduce a macro to define such regulators. This helps reduce the amount
> of added code in each platform file and keeps copy-paste errors to the
> minumum.

Or you could just pull in the topic branch I created for the purpose of
allowing other trees to pick this up:

  git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git tags/topic/fixed

which should save everyone work all round.  Just don't rebase.

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

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

* Re: [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators
  2012-06-20  8:01 [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators Guennadi Liakhovetski
  2012-06-20  9:48 ` Mark Brown
@ 2012-06-20 12:18 ` Guennadi Liakhovetski
  2012-06-21 11:42 ` Rafael J. Wysocki
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2012-06-20 12:18 UTC (permalink / raw)
  To: linux-sh

On Wed, 20 Jun 2012, Mark Brown wrote:

> On Wed, Jun 20, 2012 at 10:01:30AM +0200, Guennadi Liakhovetski wrote:
> > Providing fixed voltage permanently "on" regulators with different voltages
> > shares a lot of identical code. It will be eliminated, once the
> > regulator_register_fixed_volt() function becomes available. Until then we
> > introduce a macro to define such regulators. This helps reduce the amount
> > of added code in each platform file and keeps copy-paste errors to the
> > minumum.
> 
> Or you could just pull in the topic branch I created for the purpose of
> allowing other trees to pick this up:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git tags/topic/fixed
> 
> which should save everyone work all round.  Just don't rebase.

Thanks, Mark! Yes, maybe we'll do that. I'd submit a v2 shortly then. It 
should be relatively simple to switch to using that macro - I'd just have 
to replace these two lines:

+REGULATOR_FIXED(fixed3v3_power_consumers, 0, 3300000);
...
+	&fixed_power_0,

with something like this

+	regulator_register_always_on(0, "Fixed #0", fixed3v3_power_consumers, 
+				ARRAY_SIZE(fixed3v3_power_consumers), 3300000);

The idea behind that macro is to be able to merge these two series 
independently via their respective trees. I'll be shortly sending one more 
similar patch series for the sh arch, using an identical macro. If it is 
decided to pull in my regulator core patches, I'll rebase that one too.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

* Re: [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators
  2012-06-20  8:01 [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators Guennadi Liakhovetski
  2012-06-20  9:48 ` Mark Brown
  2012-06-20 12:18 ` Guennadi Liakhovetski
@ 2012-06-21 11:42 ` Rafael J. Wysocki
  2012-06-25 21:09 ` Rafael J. Wysocki
  2012-06-25 21:24 ` Guennadi Liakhovetski
  4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2012-06-21 11:42 UTC (permalink / raw)
  To: linux-sh

On Wednesday, June 20, 2012, Mark Brown wrote:
> On Wed, Jun 20, 2012 at 10:01:30AM +0200, Guennadi Liakhovetski wrote:
> > Providing fixed voltage permanently "on" regulators with different voltages
> > shares a lot of identical code. It will be eliminated, once the
> > regulator_register_fixed_volt() function becomes available. Until then we
> > introduce a macro to define such regulators. This helps reduce the amount
> > of added code in each platform file and keeps copy-paste errors to the
> > minumum.
> 
> Or you could just pull in the topic branch I created for the purpose of
> allowing other trees to pick this up:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git tags/topic/fixed
> 
> which should save everyone work all round.  Just don't rebase.

Arnd, Olof,

Would it be fine with you if we merged the topic branch above into
our soc branch?

Rafael

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

* Re: [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators
  2012-06-20  8:01 [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators Guennadi Liakhovetski
                   ` (2 preceding siblings ...)
  2012-06-21 11:42 ` Rafael J. Wysocki
@ 2012-06-25 21:09 ` Rafael J. Wysocki
  2012-06-25 21:24 ` Guennadi Liakhovetski
  4 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2012-06-25 21:09 UTC (permalink / raw)
  To: linux-sh

On Thursday, June 21, 2012, Rafael J. Wysocki wrote:
> On Wednesday, June 20, 2012, Mark Brown wrote:
> > On Wed, Jun 20, 2012 at 10:01:30AM +0200, Guennadi Liakhovetski wrote:
> > > Providing fixed voltage permanently "on" regulators with different voltages
> > > shares a lot of identical code. It will be eliminated, once the
> > > regulator_register_fixed_volt() function becomes available. Until then we
> > > introduce a macro to define such regulators. This helps reduce the amount
> > > of added code in each platform file and keeps copy-paste errors to the
> > > minumum.
> > 
> > Or you could just pull in the topic branch I created for the purpose of
> > allowing other trees to pick this up:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git tags/topic/fixed
> > 
> > which should save everyone work all round.  Just don't rebase.
> 
> Arnd, Olof,
> 
> Would it be fine with you if we merged the topic branch above into
> our soc branch?

Guennadi,

Since Olof says it's not a problem to pull the Mark's topic branch into
our soc tree, can you please rework the patchset on top of that branch?

Or do you need me to combine it with the commits already in the next
branch of the renesas.git tree for this purpose?

Rafael

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

* Re: [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators
  2012-06-20  8:01 [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators Guennadi Liakhovetski
                   ` (3 preceding siblings ...)
  2012-06-25 21:09 ` Rafael J. Wysocki
@ 2012-06-25 21:24 ` Guennadi Liakhovetski
  4 siblings, 0 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2012-06-25 21:24 UTC (permalink / raw)
  To: linux-sh

Hi Rafael

On Mon, 25 Jun 2012, Rafael J. Wysocki wrote:

> On Thursday, June 21, 2012, Rafael J. Wysocki wrote:
> > On Wednesday, June 20, 2012, Mark Brown wrote:
> > > On Wed, Jun 20, 2012 at 10:01:30AM +0200, Guennadi Liakhovetski wrote:
> > > > Providing fixed voltage permanently "on" regulators with different voltages
> > > > shares a lot of identical code. It will be eliminated, once the
> > > > regulator_register_fixed_volt() function becomes available. Until then we
> > > > introduce a macro to define such regulators. This helps reduce the amount
> > > > of added code in each platform file and keeps copy-paste errors to the
> > > > minumum.
> > > 
> > > Or you could just pull in the topic branch I created for the purpose of
> > > allowing other trees to pick this up:
> > > 
> > >   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git tags/topic/fixed
> > > 
> > > which should save everyone work all round.  Just don't rebase.
> > 
> > Arnd, Olof,
> > 
> > Would it be fine with you if we merged the topic branch above into
> > our soc branch?
> 
> Guennadi,
> 
> Since Olof says it's not a problem to pull the Mark's topic branch into
> our soc tree, can you please rework the patchset on top of that branch?

Sure, will do.

> Or do you need me to combine it with the commits already in the next
> branch of the renesas.git tree for this purpose?

No, don't think it should be necessary - patches in that branch only touch 
regulator internals, so, I don't think any merging with the sh-mobile 
branches would be required.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

end of thread, other threads:[~2012-06-25 21:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-20  8:01 [PATCH 01/11] ARM: mach-shmobile: add a temporary macro to define fixed voltage regulators Guennadi Liakhovetski
2012-06-20  9:48 ` Mark Brown
2012-06-20 12:18 ` Guennadi Liakhovetski
2012-06-21 11:42 ` Rafael J. Wysocki
2012-06-25 21:09 ` Rafael J. Wysocki
2012-06-25 21:24 ` Guennadi Liakhovetski

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.