The first patch just adds a vendor prefix for Dialog Semiconductor PLC, the
second one actually implements DT support in da9210.
Cc: Guennadi Liakhovetski <[email protected]>
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/
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 <[email protected]>
---
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
Add a commonly used "diasemi" prefix for Dialog Semiconductor PLC.
Signed-off-by: Guennadi Liakhovetski <[email protected]>
---
.../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
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 <[email protected]>
> ---
> 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.
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 <[email protected]>
---
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 <[email protected]>
> > ---
> > 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
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.