All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] regulator: da9210: support Device Tree initialisation
@ 2013-09-09 15:51 ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-09 15:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Magnus Damm, linux-sh, Mark Brown, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

The first patch just adds a vendor prefix for Dialog Semiconductor PLC, the
second one actually implements DT support in da9210.

Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>

Guennadi Liakhovetski (2):
  DT: add a vendor prefix for Dialog Semiconductor
  regulator: da9210: add Device Tree support

 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 drivers/regulator/da9210-regulator.c               |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

-- 
1.7.2.5

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

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

* [PATCH 0/2] regulator: da9210: support Device Tree initialisation
@ 2013-09-09 15:51 ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-09 15:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Magnus Damm, linux-sh, Mark Brown, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

The first patch just adds a vendor prefix for Dialog Semiconductor PLC, the
second one actually implements DT support in da9210.

Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>

Guennadi Liakhovetski (2):
  DT: add a vendor prefix for Dialog Semiconductor
  regulator: da9210: add Device Tree support

 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 drivers/regulator/da9210-regulator.c               |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

-- 
1.7.2.5

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

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

* [PATCH 1/2] DT: add a vendor prefix for Dialog Semiconductor
  2013-09-09 15:51 ` Guennadi Liakhovetski
@ 2013-09-09 15:51   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-09 15:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Magnus Damm, linux-sh, Mark Brown, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

Add a commonly used "diasemi" prefix for Dialog Semiconductor PLC.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 2956800..f8d5a75 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -22,6 +22,7 @@ cortina	Cortina Systems, Inc.
 dallas	Maxim Integrated Products (formerly Dallas Semiconductor)
 davicom	DAVICOM Semiconductor, Inc.
 denx	Denx Software Engineering
+diasemi	Dialog Semiconductor
 emmicro	EM Microelectronic
 epson	Seiko Epson Corp.
 est	ESTeem Wireless Modems
-- 
1.7.2.5


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

* [PATCH 1/2] DT: add a vendor prefix for Dialog Semiconductor
@ 2013-09-09 15:51   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-09 15:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Magnus Damm, linux-sh, Mark Brown, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

Add a commonly used "diasemi" prefix for Dialog Semiconductor PLC.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 2956800..f8d5a75 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -22,6 +22,7 @@ cortina	Cortina Systems, Inc.
 dallas	Maxim Integrated Products (formerly Dallas Semiconductor)
 davicom	DAVICOM Semiconductor, Inc.
 denx	Denx Software Engineering
+diasemi	Dialog Semiconductor
 emmicro	EM Microelectronic
 epson	Seiko Epson Corp.
 est	ESTeem Wireless Modems
-- 
1.7.2.5


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

* [PATCH 2/2] regulator: da9210: add Device Tree support
  2013-09-09 15:51 ` Guennadi Liakhovetski
@ 2013-09-09 15:52   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-09 15:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Magnus Damm, linux-sh, Mark Brown, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

This patch adds basic Device Tree support to the da9210 regulator driver -
with no special properties, since also driver's platform data only contains
standard regulator initialisation parameters.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---
 drivers/regulator/da9210-regulator.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c
index f0fe54b..f7ccff14 100644
--- a/drivers/regulator/da9210-regulator.c
+++ b/drivers/regulator/da9210-regulator.c
@@ -25,6 +25,7 @@
 #include <linux/slab.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/of_regulator.h>
 #include <linux/regmap.h>
 
 #include "da9210-regulator.h"
@@ -126,7 +127,8 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
 			    const struct i2c_device_id *id)
 {
 	struct da9210 *chip;
-	struct da9210_pdata *pdata = i2c->dev.platform_data;
+	struct device *dev = &i2c->dev;
+	struct da9210_pdata *pdata = dev_get_platdata(dev);
 	struct regulator_dev *rdev = NULL;
 	struct regulator_config config = { };
 	int error;
@@ -147,10 +149,11 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
 	}
 
 	config.dev = &i2c->dev;
-	if (pdata)
-		config.init_data = &pdata->da9210_constraints;
+	config.init_data = pdata ? &pdata->da9210_constraints :
+		of_get_regulator_init_data(dev, dev->of_node);
 	config.driver_data = chip;
 	config.regmap = chip->regmap;
+	config.of_node = dev->of_node;
 
 	rdev = regulator_register(&da9210_reg, &config);
 	if (IS_ERR(rdev)) {
-- 
1.7.2.5


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

* [PATCH 2/2] regulator: da9210: add Device Tree support
@ 2013-09-09 15:52   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-09 15:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Magnus Damm, linux-sh, Mark Brown, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

This patch adds basic Device Tree support to the da9210 regulator driver -
with no special properties, since also driver's platform data only contains
standard regulator initialisation parameters.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---
 drivers/regulator/da9210-regulator.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c
index f0fe54b..f7ccff14 100644
--- a/drivers/regulator/da9210-regulator.c
+++ b/drivers/regulator/da9210-regulator.c
@@ -25,6 +25,7 @@
 #include <linux/slab.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/of_regulator.h>
 #include <linux/regmap.h>
 
 #include "da9210-regulator.h"
@@ -126,7 +127,8 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
 			    const struct i2c_device_id *id)
 {
 	struct da9210 *chip;
-	struct da9210_pdata *pdata = i2c->dev.platform_data;
+	struct device *dev = &i2c->dev;
+	struct da9210_pdata *pdata = dev_get_platdata(dev);
 	struct regulator_dev *rdev = NULL;
 	struct regulator_config config = { };
 	int error;
@@ -147,10 +149,11 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
 	}
 
 	config.dev = &i2c->dev;
-	if (pdata)
-		config.init_data = &pdata->da9210_constraints;
+	config.init_data = pdata ? &pdata->da9210_constraints :
+		of_get_regulator_init_data(dev, dev->of_node);
 	config.driver_data = chip;
 	config.regmap = chip->regmap;
+	config.of_node = dev->of_node;
 
 	rdev = regulator_register(&da9210_reg, &config);
 	if (IS_ERR(rdev)) {
-- 
1.7.2.5


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

* Re: [PATCH 2/2] regulator: da9210: add Device Tree support
  2013-09-09 15:52   ` Guennadi Liakhovetski
@ 2013-09-09 16:04     ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2013-09-09 16:04 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-kernel, Magnus Damm, linux-sh, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

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

On Mon, Sep 09, 2013 at 05:52:00PM +0200, Guennadi Liakhovetski wrote:
> This patch adds basic Device Tree support to the da9210 regulator driver -
> with no special properties, since also driver's platform data only contains
> standard regulator initialisation parameters.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> ---
>  drivers/regulator/da9210-regulator.c |    9 ++++++---

I'd expect to see a binding document, even if it is just a very brief
one documenting the prefix and pointing to the standard regulator
properties.

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

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

* Re: [PATCH 2/2] regulator: da9210: add Device Tree support
@ 2013-09-09 16:04     ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2013-09-09 16:04 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-kernel, Magnus Damm, linux-sh, devicetree, Grant Likely,
	Rob Herring, Guennadi Liakhovetski

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

On Mon, Sep 09, 2013 at 05:52:00PM +0200, Guennadi Liakhovetski wrote:
> This patch adds basic Device Tree support to the da9210 regulator driver -
> with no special properties, since also driver's platform data only contains
> standard regulator initialisation parameters.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> ---
>  drivers/regulator/da9210-regulator.c |    9 ++++++---

I'd expect to see a binding document, even if it is just a very brief
one documenting the prefix and pointing to the standard regulator
properties.

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

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

* [PATCH] regulator: da9210: add Device Tree binding documentation
  2013-09-09 16:04     ` Mark Brown
@ 2013-09-12 10:57       ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-12 10:57 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Magnus Damm, linux-sh, devicetree, Grant Likely,
	Rob Herring

DA9210 Device Tree support currently only handles standard regulator DT
bindings. This patch adds compulsory minimal documentation to describe
this.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---

On Mon, 9 Sep 2013, Mark Brown wrote:

> On Mon, Sep 09, 2013 at 05:52:00PM +0200, Guennadi Liakhovetski wrote:
> > This patch adds basic Device Tree support to the da9210 regulator driver -
> > with no special properties, since also driver's platform data only contains
> > standard regulator initialisation parameters.
> > 
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> > ---
> >  drivers/regulator/da9210-regulator.c |    9 ++++++---
> 
> I'd expect to see a binding document, even if it is just a very brief
> one documenting the prefix and pointing to the standard regulator
> properties.

Hi Mark,
Is a separate patch like this one ok or you'd prefer me to re-post the 
original series and merge this with the DT implementation?

 .../devicetree/bindings/regulator/da9210.txt       |   21 ++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/da9210.txt

diff --git a/Documentation/devicetree/bindings/regulator/da9210.txt b/Documentation/devicetree/bindings/regulator/da9210.txt
new file mode 100644
index 0000000..f120f22
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/da9210.txt
@@ -0,0 +1,21 @@
+* Dialog Semiconductor DA9210 Voltage Regulator
+
+Required properties:
+
+- compatible:	must be "diasemi,da9210"
+- reg:		the i2c slave address of the regulator. It should be 0x68.
+
+Any standard regulator properties can be used to configure the single da9210
+DCDC.
+
+Example:
+
+	da9210@68 {
+		compatible = "diasemi,da9210";
+		reg = <0x68>;
+
+		regulator-min-microvolt = <900000>;
+		regulator-max-microvolt = <1000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
-- 
1.7.2.5


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

* [PATCH] regulator: da9210: add Device Tree binding documentation
@ 2013-09-12 10:57       ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-12 10:57 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Magnus Damm, linux-sh, devicetree, Grant Likely,
	Rob Herring

DA9210 Device Tree support currently only handles standard regulator DT
bindings. This patch adds compulsory minimal documentation to describe
this.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---

On Mon, 9 Sep 2013, Mark Brown wrote:

> On Mon, Sep 09, 2013 at 05:52:00PM +0200, Guennadi Liakhovetski wrote:
> > This patch adds basic Device Tree support to the da9210 regulator driver -
> > with no special properties, since also driver's platform data only contains
> > standard regulator initialisation parameters.
> > 
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> > ---
> >  drivers/regulator/da9210-regulator.c |    9 ++++++---
> 
> I'd expect to see a binding document, even if it is just a very brief
> one documenting the prefix and pointing to the standard regulator
> properties.

Hi Mark,
Is a separate patch like this one ok or you'd prefer me to re-post the 
original series and merge this with the DT implementation?

 .../devicetree/bindings/regulator/da9210.txt       |   21 ++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/da9210.txt

diff --git a/Documentation/devicetree/bindings/regulator/da9210.txt b/Documentation/devicetree/bindings/regulator/da9210.txt
new file mode 100644
index 0000000..f120f22
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/da9210.txt
@@ -0,0 +1,21 @@
+* Dialog Semiconductor DA9210 Voltage Regulator
+
+Required properties:
+
+- compatible:	must be "diasemi,da9210"
+- reg:		the i2c slave address of the regulator. It should be 0x68.
+
+Any standard regulator properties can be used to configure the single da9210
+DCDC.
+
+Example:
+
+	da9210@68 {
+		compatible = "diasemi,da9210";
+		reg = <0x68>;
+
+		regulator-min-microvolt = <900000>;
+		regulator-max-microvolt = <1000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
-- 
1.7.2.5


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

* Re: [PATCH] regulator: da9210: add Device Tree binding documentation
  2013-09-12 10:57       ` Guennadi Liakhovetski
@ 2013-09-12 11:17         ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2013-09-12 11:17 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-kernel, Magnus Damm, linux-sh, devicetree, Grant Likely,
	Rob Herring

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

On Thu, Sep 12, 2013 at 12:57:20PM +0200, Guennadi Liakhovetski wrote:

> Is a separate patch like this one ok or you'd prefer me to re-post the 
> original series and merge this with the DT implementation?

Please repost, the bindings and the code really ought to be reviewed
together.

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

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

* Re: [PATCH] regulator: da9210: add Device Tree binding documentation
@ 2013-09-12 11:17         ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2013-09-12 11:17 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-kernel, Magnus Damm, linux-sh, devicetree, Grant Likely,
	Rob Herring

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

On Thu, Sep 12, 2013 at 12:57:20PM +0200, Guennadi Liakhovetski wrote:

> Is a separate patch like this one ok or you'd prefer me to re-post the 
> original series and merge this with the DT implementation?

Please repost, the bindings and the code really ought to be reviewed
together.

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

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

end of thread, other threads:[~2013-09-12 11:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-09 15:51 [PATCH 0/2] regulator: da9210: support Device Tree initialisation Guennadi Liakhovetski
2013-09-09 15:51 ` Guennadi Liakhovetski
2013-09-09 15:51 ` [PATCH 1/2] DT: add a vendor prefix for Dialog Semiconductor Guennadi Liakhovetski
2013-09-09 15:51   ` Guennadi Liakhovetski
2013-09-09 15:52 ` [PATCH 2/2] regulator: da9210: add Device Tree support Guennadi Liakhovetski
2013-09-09 15:52   ` Guennadi Liakhovetski
2013-09-09 16:04   ` Mark Brown
2013-09-09 16:04     ` Mark Brown
2013-09-12 10:57     ` [PATCH] regulator: da9210: add Device Tree binding documentation Guennadi Liakhovetski
2013-09-12 10:57       ` Guennadi Liakhovetski
2013-09-12 11:17       ` Mark Brown
2013-09-12 11:17         ` 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.