All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board
@ 2020-01-04 15:32 ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip
  Cc: Markus Reichl, Angus Ainslie (Purism),
	devicetree, Heiko Stuebner, Jagan Teki, Laurent Pinchart,
	Linus Walleij, linux-arm-kernel, linux-kernel, Maxime Ripard,
	Rob Herring, Shawn Guo, Stephan Gerhold

On rk3399-roc-pc board a voltage regulator MP8859 from Monolithic Power Systems
is used to supply the 12V power line. This delivers 5V as a default value after
boot. The voltage is controllable via I2C.
Add a basic driver to set and get the voltage of the MP8859 and add a matching
node with fixed 12V in the DT of the board. 

Markus Reichl (5):
  regulator: mp8859: add driver
  regulator: mp8859: add config option and build entry
  dt-bindings: add vendor Monolithic Power Systems
  dt-bindings: regulator: add MPS mp8859 voltage regulator
  arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc

 .../devicetree/bindings/regulator/mp8859.txt  |  22 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      |  32 ++--
 drivers/regulator/Kconfig                     |  11 ++
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/mp8859.c                    | 156 ++++++++++++++++++
 6 files changed, 210 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt
 create mode 100644 drivers/regulator/mp8859.c

-- 
2.24.1


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

* [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board
@ 2020-01-04 15:32 ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, Heiko Stuebner, Stephan Gerhold, Rob Herring,
	Linus Walleij, Angus Ainslie (Purism),
	linux-kernel, Maxime Ripard, Markus Reichl, Laurent Pinchart,
	Shawn Guo, linux-arm-kernel, Jagan Teki

On rk3399-roc-pc board a voltage regulator MP8859 from Monolithic Power Systems
is used to supply the 12V power line. This delivers 5V as a default value after
boot. The voltage is controllable via I2C.
Add a basic driver to set and get the voltage of the MP8859 and add a matching
node with fixed 12V in the DT of the board. 

Markus Reichl (5):
  regulator: mp8859: add driver
  regulator: mp8859: add config option and build entry
  dt-bindings: add vendor Monolithic Power Systems
  dt-bindings: regulator: add MPS mp8859 voltage regulator
  arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc

 .../devicetree/bindings/regulator/mp8859.txt  |  22 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      |  32 ++--
 drivers/regulator/Kconfig                     |  11 ++
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/mp8859.c                    | 156 ++++++++++++++++++
 6 files changed, 210 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt
 create mode 100644 drivers/regulator/mp8859.c

-- 
2.24.1


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

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

* [PATCH 1/5] regulator: mp8859: add driver
  2020-01-04 15:32 ` Markus Reichl
  (?)
@ 2020-01-04 15:32 ` Markus Reichl
  2020-01-06 20:45   ` Mark Brown
  -1 siblings, 1 reply; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip, Liam Girdwood, Mark Brown; +Cc: Markus Reichl, linux-kernel

The MP8859 from Monolithic Power Systems is a single output DC/DC
converter. The voltage can be controlled via I2C.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 drivers/regulator/mp8859.c | 156 +++++++++++++++++++++++++++++++++++++
 1 file changed, 156 insertions(+)
 create mode 100644 drivers/regulator/mp8859.c

diff --git a/drivers/regulator/mp8859.c b/drivers/regulator/mp8859.c
new file mode 100644
index 000000000000..e804a5267301
--- /dev/null
+++ b/drivers/regulator/mp8859.c
@@ -0,0 +1,156 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (c) 2019 five technologies GmbH
+// Author: Markus Reichl <m.reichl@fivetechno.de>
+
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/of.h>
+#include <linux/regulator/driver.h>
+#include <linux/regmap.h>
+
+
+#define VOL_MIN_IDX			0x00
+#define VOL_MAX_IDX			0x7ff
+
+/* Register definitions */
+#define MP8859_VOUT_L_REG		0    //3 lo Bits
+#define MP8859_VOUT_H_REG		1    //8 hi Bits
+#define MP8859_VOUT_GO_REG		2
+#define MP8859_IOUT_LIM_REG		3
+#define MP8859_CTL1_REG			4
+#define MP8859_CTL2_REG			5
+#define MP8859_RESERVED1_REG		6
+#define MP8859_RESERVED2_REG		7
+#define MP8859_RESERVED3_REG		8
+#define MP8859_STATUS_REG		9
+#define MP8859_INTERRUPT_REG		0x0A
+#define MP8859_MASK_REG			0x0B
+#define MP8859_ID1_REG			0x0C
+#define MP8859_MFR_ID_REG		0x27
+#define MP8859_DEV_ID_REG		0x28
+#define MP8859_IC_REV_REG		0x29
+
+#define MP8859_MAX_REG			0x29
+
+#define MP8859_GO_BIT			0x01
+
+
+static int mp8859_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
+{
+	int ret;
+
+	ret = regmap_write(rdev->regmap, MP8859_VOUT_L_REG, sel & 0x7);
+
+	if (ret)
+		return ret;
+	ret = regmap_write(rdev->regmap, MP8859_VOUT_H_REG, sel >> 3);
+
+	if (ret)
+		return ret;
+	ret = regmap_update_bits(rdev->regmap, MP8859_VOUT_GO_REG,
+					MP8859_GO_BIT, 1);
+	return ret;
+}
+
+static int mp8859_get_voltage_sel(struct regulator_dev *rdev)
+{
+	unsigned int val_tmp;
+	unsigned int val;
+	int ret;
+
+	ret = regmap_read(rdev->regmap, MP8859_VOUT_H_REG, &val_tmp);
+
+	if (ret)
+		return ret;
+	val = val_tmp << 3;
+
+	ret = regmap_read(rdev->regmap, MP8859_VOUT_L_REG, &val_tmp);
+
+	if (ret)
+		return ret;
+	val |= val_tmp & 0x07;
+	return val;
+}
+
+static const struct regulator_linear_range mp8859_dcdc_ranges[] = {
+	REGULATOR_LINEAR_RANGE(0, VOL_MIN_IDX, VOL_MAX_IDX, 10000),
+};
+
+static const struct regmap_config mp8859_regmap = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.max_register = MP8859_MAX_REG,
+	.cache_type = REGCACHE_RBTREE,
+};
+
+static const struct regulator_ops mp8859_ops = {
+	.set_voltage_sel = mp8859_set_voltage_sel,
+	.get_voltage_sel = mp8859_get_voltage_sel,
+	.list_voltage = regulator_list_voltage_linear_range,
+};
+
+static const struct regulator_desc mp8859_regulators[] = {
+	{
+		.id = 0,
+		.type = REGULATOR_VOLTAGE,
+		.name = "mp8859_dcdc",
+		.of_match = of_match_ptr("mp8859_dcdc"),
+		.n_voltages = VOL_MAX_IDX + 1,
+		.linear_ranges = mp8859_dcdc_ranges,
+		.n_linear_ranges = 1,
+		.ops = &mp8859_ops,
+		.owner = THIS_MODULE,
+	},
+};
+
+static int mp8859_i2c_probe(struct i2c_client *i2c)
+{
+	int ret;
+	struct regulator_config config = {.dev = &i2c->dev};
+	struct regmap *regmap = devm_regmap_init_i2c(i2c, &mp8859_regmap);
+	struct regulator_dev *rdev;
+
+	if (IS_ERR(regmap)) {
+		ret = PTR_ERR(regmap);
+		dev_err(&i2c->dev, "regmap init failed: %d\n", ret);
+		return ret;
+	}
+	rdev = devm_regulator_register(&i2c->dev, &mp8859_regulators[0],
+					&config);
+
+	if (IS_ERR(rdev)) {
+		ret = PTR_ERR(rdev);
+		dev_err(&i2c->dev, "failed to register %s: %d\n",
+			mp8859_regulators[0].name, ret);
+			return ret;
+		}
+	return 0;
+}
+
+static const struct of_device_id mp8859_dt_id[] = {
+	{.compatible =  "mps,mp8859"},
+	{},
+};
+MODULE_DEVICE_TABLE(of, mp8859_dt_id);
+
+static const struct i2c_device_id mp8859_i2c_id[] = {
+	{ "mp8859", },
+	{  },
+};
+MODULE_DEVICE_TABLE(i2c, mp8859_i2c_id);
+
+static struct i2c_driver mp8859_regulator_driver = {
+	.driver = {
+		.name = "mp8859",
+		.of_match_table = of_match_ptr(mp8859_dt_id),
+	},
+	.probe_new = mp8859_i2c_probe,
+	.id_table = mp8859_i2c_id,
+};
+
+module_i2c_driver(mp8859_regulator_driver);
+
+MODULE_DESCRIPTION("Monolithic Power Systems MP8859 voltage regulator driver");
+MODULE_AUTHOR("Markus Reichl <m.reichl@fivetechno.de>");
+MODULE_LICENSE("GPL v2");
-- 
2.24.1


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

* [PATCH 2/5] regulator: mp8859: add config option and build entry
  2020-01-04 15:32 ` Markus Reichl
  (?)
  (?)
@ 2020-01-04 15:32 ` Markus Reichl
  -1 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip, Liam Girdwood, Mark Brown; +Cc: Markus Reichl, linux-kernel

Add entries for the mp8857 regulator driver
to the build system.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 drivers/regulator/Kconfig  | 11 +++++++++++
 drivers/regulator/Makefile |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 56512748a47d..593733a88a61 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -612,6 +612,17 @@ config REGULATOR_MCP16502
 	  through the regulator interface. In addition it enables
 	  suspend-to-ram/standby transition.
 
+config REGULATOR_MP8859
+	tristate "MPS MP8859 regulator driver"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  Say y here to support the MP8859 voltage regulator. This driver
+	  supports basic operations (get/set voltage) through the regulator
+	  interface.
+	  Say M here if you want to include support for the regulator as a
+	  module. The module will be named "mp8859".
+
 config REGULATOR_MT6311
 	tristate "MediaTek MT6311 PMIC"
 	depends on I2C
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 9eccf93bc3ab..8ba8e5deebbd 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -78,6 +78,7 @@ obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
 obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
 obj-$(CONFIG_REGULATOR_MC13XXX_CORE) +=  mc13xxx-regulator-core.o
 obj-$(CONFIG_REGULATOR_MCP16502) += mcp16502.o
+obj-$(CONFIG_REGULATOR_MP8859) += mp8859.o
 obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
 obj-$(CONFIG_REGULATOR_MT6323)	+= mt6323-regulator.o
 obj-$(CONFIG_REGULATOR_MT6358)	+= mt6358-regulator.o
-- 
2.24.1


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

* [PATCH 3/5] dt-bindings: add vendor Monolithic Power Systems
  2020-01-04 15:32 ` Markus Reichl
                   ` (2 preceding siblings ...)
  (?)
@ 2020-01-04 15:32 ` Markus Reichl
  -1 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip, Rob Herring, Mark Rutland
  Cc: Markus Reichl, Maxime Ripard, Linus Walleij, Stephan Gerhold,
	Heiko Stuebner, Icenowy Zheng, Laurent Pinchart, devicetree,
	linux-kernel

MPS produce power regulators like the MP8859.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index fa6aa3c5a500..4fa3bb494745 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -617,6 +617,8 @@ patternProperties:
     description: Moxa Inc.
   "^mpl,.*":
     description: MPL AG
+  "^mps,.*":
+    description: Monolithic Power Systems Inc.
   "^mqmaker,.*":
     description: mqmaker Inc.
   "^mscc,.*":
-- 
2.24.1


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

* [PATCH 4/5] dt-bindings: regulator: add MPS mp8859 voltage regulator
  2020-01-04 15:32 ` Markus Reichl
                   ` (3 preceding siblings ...)
  (?)
@ 2020-01-04 15:32 ` Markus Reichl
  -1 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip, Liam Girdwood, Mark Brown, Rob Herring, Mark Rutland
  Cc: Markus Reichl, linux-kernel, devicetree

The MP8859 from Monolithic Power Systems is a single output dc/dc converter
with voltage control over i2c.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 .../devicetree/bindings/regulator/mp8859.txt  | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt

diff --git a/Documentation/devicetree/bindings/regulator/mp8859.txt b/Documentation/devicetree/bindings/regulator/mp8859.txt
new file mode 100644
index 000000000000..74ad69730989
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/mp8859.txt
@@ -0,0 +1,22 @@
+Monolithic Power Systems MP8859 voltage regulator
+
+Required properties:
+- compatible: "mps,mp8859";
+- reg: I2C slave address.
+
+Optional subnode for regulator: "mp8859_dcdc", using common regulator
+bindings given in <Documentation/devicetree/bindings/regulator/regulator.txt>.
+
+Example:
+
+	mp8859: regulator@66 {
+		compatible = "mps,mp8859";
+		reg = <0x66>;
+		dc_12v: mp8859_dcdc {
+			regulator-name = "dc_12v";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+	};
-- 
2.24.1


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

* [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-04 15:32 ` Markus Reichl
@ 2020-01-04 15:32   ` Markus Reichl
  -1 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip, Rob Herring, Mark Rutland, Heiko Stuebner
  Cc: Markus Reichl, Jagan Teki, devicetree, linux-arm-kernel, linux-kernel

The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
This supplies 5V only in default state after booting.
Now we can control the output voltage via I2C interface.
Add a node for the driver to reach 12V.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index 8e01b04144b7..9f225e9c3d54 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
 		regulator-max-microvolt = <5000000>;
 	};
 
-	/*
-	 * should be placed inside mp8859, but not until mp8859 has
-	 * its own dt-binding.
-	 */
-	dc_12v: mp8859-dcdc1 {
-		compatible = "regulator-fixed";
-		regulator-name = "dc_12v";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
-		vin-supply = <&vcc_vbus_typec0>;
-	};
-
 	/* switched by pmic_sleep */
 	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
 		compatible = "regulator-fixed";
@@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
 		vbus-supply = <&vcc_vbus_typec0>;
 		status = "okay";
 	};
+
+	mp8859: regulator@66 {
+		compatible = "mps,mp8859";
+		reg = <0x66>;
+		dc_12v: mp8859_dcdc {
+			regulator-name = "dc_12v";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			vin-supply = <&vcc_vbus_typec0>;
+
+			regulator-state-mem {
+				regulator-on-in-suspend;
+				regulator-suspend-microvolt = <12000000>;
+			};
+		};
+	};
 };
 
 &i2s0 {
-- 
2.24.1


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

* [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
@ 2020-01-04 15:32   ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip, Rob Herring, Mark Rutland, Heiko Stuebner
  Cc: Markus Reichl, devicetree, Jagan Teki, linux-arm-kernel, linux-kernel

The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
This supplies 5V only in default state after booting.
Now we can control the output voltage via I2C interface.
Add a node for the driver to reach 12V.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index 8e01b04144b7..9f225e9c3d54 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
 		regulator-max-microvolt = <5000000>;
 	};
 
-	/*
-	 * should be placed inside mp8859, but not until mp8859 has
-	 * its own dt-binding.
-	 */
-	dc_12v: mp8859-dcdc1 {
-		compatible = "regulator-fixed";
-		regulator-name = "dc_12v";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
-		vin-supply = <&vcc_vbus_typec0>;
-	};
-
 	/* switched by pmic_sleep */
 	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
 		compatible = "regulator-fixed";
@@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
 		vbus-supply = <&vcc_vbus_typec0>;
 		status = "okay";
 	};
+
+	mp8859: regulator@66 {
+		compatible = "mps,mp8859";
+		reg = <0x66>;
+		dc_12v: mp8859_dcdc {
+			regulator-name = "dc_12v";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			vin-supply = <&vcc_vbus_typec0>;
+
+			regulator-state-mem {
+				regulator-on-in-suspend;
+				regulator-suspend-microvolt = <12000000>;
+			};
+		};
+	};
 };
 
 &i2s0 {
-- 
2.24.1


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

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

* Re: [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board
  2020-01-04 15:32 ` Markus Reichl
@ 2020-01-04 21:19   ` Heiko Stuebner
  -1 siblings, 0 replies; 22+ messages in thread
From: Heiko Stuebner @ 2020-01-04 21:19 UTC (permalink / raw)
  To: Markus Reichl
  Cc: linux-rockchip, Angus Ainslie (Purism),
	devicetree, Jagan Teki, Laurent Pinchart, Linus Walleij,
	linux-arm-kernel, linux-kernel, Maxime Ripard, Rob Herring,
	Shawn Guo, Stephan Gerhold

Hi Markus,

I've only gotten patches 3+5 of this series (vendor-prefix+dts patch), so
maybe you could teach your git-send-email to include all patches to all
recipients.

Am Samstag, 4. Januar 2020, 16:32:44 CET schrieb Markus Reichl:
> On rk3399-roc-pc board a voltage regulator MP8859 from Monolithic Power Systems
> is used to supply the 12V power line. This delivers 5V as a default value after
> boot. The voltage is controllable via I2C.
> Add a basic driver to set and get the voltage of the MP8859 and add a matching
> node with fixed 12V in the DT of the board. 
> 
> Markus Reichl (5):
>   regulator: mp8859: add driver
>   regulator: mp8859: add config option and build entry

I think these two should only need one patch together.

Heiko

>   dt-bindings: add vendor Monolithic Power Systems
>   dt-bindings: regulator: add MPS mp8859 voltage regulator
>   arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
> 
>  .../devicetree/bindings/regulator/mp8859.txt  |  22 +++
>  .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      |  32 ++--
>  drivers/regulator/Kconfig                     |  11 ++
>  drivers/regulator/Makefile                    |   1 +
>  drivers/regulator/mp8859.c                    | 156 ++++++++++++++++++
>  6 files changed, 210 insertions(+), 14 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt
>  create mode 100644 drivers/regulator/mp8859.c
> 
> 





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

* Re: [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board
@ 2020-01-04 21:19   ` Heiko Stuebner
  0 siblings, 0 replies; 22+ messages in thread
From: Heiko Stuebner @ 2020-01-04 21:19 UTC (permalink / raw)
  To: Markus Reichl
  Cc: devicetree, Stephan Gerhold, Rob Herring, Linus Walleij,
	Angus Ainslie (Purism),
	linux-kernel, Maxime Ripard, linux-rockchip, Laurent Pinchart,
	Shawn Guo, linux-arm-kernel, Jagan Teki

Hi Markus,

I've only gotten patches 3+5 of this series (vendor-prefix+dts patch), so
maybe you could teach your git-send-email to include all patches to all
recipients.

Am Samstag, 4. Januar 2020, 16:32:44 CET schrieb Markus Reichl:
> On rk3399-roc-pc board a voltage regulator MP8859 from Monolithic Power Systems
> is used to supply the 12V power line. This delivers 5V as a default value after
> boot. The voltage is controllable via I2C.
> Add a basic driver to set and get the voltage of the MP8859 and add a matching
> node with fixed 12V in the DT of the board. 
> 
> Markus Reichl (5):
>   regulator: mp8859: add driver
>   regulator: mp8859: add config option and build entry

I think these two should only need one patch together.

Heiko

>   dt-bindings: add vendor Monolithic Power Systems
>   dt-bindings: regulator: add MPS mp8859 voltage regulator
>   arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
> 
>  .../devicetree/bindings/regulator/mp8859.txt  |  22 +++
>  .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      |  32 ++--
>  drivers/regulator/Kconfig                     |  11 ++
>  drivers/regulator/Makefile                    |   1 +
>  drivers/regulator/mp8859.c                    | 156 ++++++++++++++++++
>  6 files changed, 210 insertions(+), 14 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt
>  create mode 100644 drivers/regulator/mp8859.c
> 
> 





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

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-04 15:32   ` Markus Reichl
@ 2020-01-04 21:23     ` Heiko Stuebner
  -1 siblings, 0 replies; 22+ messages in thread
From: Heiko Stuebner @ 2020-01-04 21:23 UTC (permalink / raw)
  To: Markus Reichl
  Cc: linux-rockchip, Rob Herring, Mark Rutland, Jagan Teki,
	devicetree, linux-arm-kernel, linux-kernel

Hi Markus,

Am Samstag, 4. Januar 2020, 16:32:49 CET schrieb Markus Reichl:
> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
> This supplies 5V only in default state after booting.

Just for my understanding ... both the old static regulator before as
well as the new i2c node said to supply 12V, but above you say that
the default is 5V ... so I'm wondering who configured the 12V before.

Or was it the case that the old regulator node was just wrong and we
had 5V running on the dc_12v line?

Thanks
Heiko

> Now we can control the output voltage via I2C interface.
> Add a node for the driver to reach 12V.
> 
> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
> ---
>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
>  1 file changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> index 8e01b04144b7..9f225e9c3d54 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> @@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
>  		regulator-max-microvolt = <5000000>;
>  	};
>  
> -	/*
> -	 * should be placed inside mp8859, but not until mp8859 has
> -	 * its own dt-binding.
> -	 */
> -	dc_12v: mp8859-dcdc1 {
> -		compatible = "regulator-fixed";
> -		regulator-name = "dc_12v";
> -		regulator-always-on;
> -		regulator-boot-on;
> -		regulator-min-microvolt = <12000000>;
> -		regulator-max-microvolt = <12000000>;
> -		vin-supply = <&vcc_vbus_typec0>;
> -	};
> -
>  	/* switched by pmic_sleep */
>  	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
>  		compatible = "regulator-fixed";
> @@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
>  		vbus-supply = <&vcc_vbus_typec0>;
>  		status = "okay";
>  	};
> +
> +	mp8859: regulator@66 {
> +		compatible = "mps,mp8859";
> +		reg = <0x66>;
> +		dc_12v: mp8859_dcdc {
> +			regulator-name = "dc_12v";
> +			regulator-min-microvolt = <12000000>;
> +			regulator-max-microvolt = <12000000>;
> +			regulator-always-on;
> +			regulator-boot-on;
> +			vin-supply = <&vcc_vbus_typec0>;
> +
> +			regulator-state-mem {
> +				regulator-on-in-suspend;
> +				regulator-suspend-microvolt = <12000000>;
> +			};
> +		};
> +	};
>  };
>  
>  &i2s0 {
> 





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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
@ 2020-01-04 21:23     ` Heiko Stuebner
  0 siblings, 0 replies; 22+ messages in thread
From: Heiko Stuebner @ 2020-01-04 21:23 UTC (permalink / raw)
  To: Markus Reichl
  Cc: Mark Rutland, devicetree, linux-kernel, linux-rockchip,
	Rob Herring, Jagan Teki, linux-arm-kernel

Hi Markus,

Am Samstag, 4. Januar 2020, 16:32:49 CET schrieb Markus Reichl:
> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
> This supplies 5V only in default state after booting.

Just for my understanding ... both the old static regulator before as
well as the new i2c node said to supply 12V, but above you say that
the default is 5V ... so I'm wondering who configured the 12V before.

Or was it the case that the old regulator node was just wrong and we
had 5V running on the dc_12v line?

Thanks
Heiko

> Now we can control the output voltage via I2C interface.
> Add a node for the driver to reach 12V.
> 
> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
> ---
>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
>  1 file changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> index 8e01b04144b7..9f225e9c3d54 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> @@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
>  		regulator-max-microvolt = <5000000>;
>  	};
>  
> -	/*
> -	 * should be placed inside mp8859, but not until mp8859 has
> -	 * its own dt-binding.
> -	 */
> -	dc_12v: mp8859-dcdc1 {
> -		compatible = "regulator-fixed";
> -		regulator-name = "dc_12v";
> -		regulator-always-on;
> -		regulator-boot-on;
> -		regulator-min-microvolt = <12000000>;
> -		regulator-max-microvolt = <12000000>;
> -		vin-supply = <&vcc_vbus_typec0>;
> -	};
> -
>  	/* switched by pmic_sleep */
>  	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
>  		compatible = "regulator-fixed";
> @@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
>  		vbus-supply = <&vcc_vbus_typec0>;
>  		status = "okay";
>  	};
> +
> +	mp8859: regulator@66 {
> +		compatible = "mps,mp8859";
> +		reg = <0x66>;
> +		dc_12v: mp8859_dcdc {
> +			regulator-name = "dc_12v";
> +			regulator-min-microvolt = <12000000>;
> +			regulator-max-microvolt = <12000000>;
> +			regulator-always-on;
> +			regulator-boot-on;
> +			vin-supply = <&vcc_vbus_typec0>;
> +
> +			regulator-state-mem {
> +				regulator-on-in-suspend;
> +				regulator-suspend-microvolt = <12000000>;
> +			};
> +		};
> +	};
>  };
>  
>  &i2s0 {
> 





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

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-04 21:23     ` Heiko Stuebner
@ 2020-01-05  9:16       ` Markus Reichl
  -1 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-05  9:16 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Mark Rutland, devicetree, linux-kernel, linux-rockchip,
	Rob Herring, Jagan Teki, linux-arm-kernel

Hi Heiko,

Am 04.01.20 um 22:23 schrieb Heiko Stuebner:
> Hi Markus,
> 
> Am Samstag, 4. Januar 2020, 16:32:49 CET schrieb Markus Reichl:
>> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
>> This supplies 5V only in default state after booting.
> 
> Just for my understanding ... both the old static regulator before as
> well as the new i2c node said to supply 12V, but above you say that
> the default is 5V ... so I'm wondering who configured the 12V before.
> 
> Or was it the case that the old regulator node was just wrong and we
> had 5V running on the dc_12v line?

Yes, the dc_12v line was running at 5V (measured 4,7V) as it is the
default power up value for the MP8859. This is as documented in the data
sheet [1].

[1] https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP8859/document_id/4033/

Gruß
--
Markus
> 
> Thanks
> Heiko
> 
>> Now we can control the output voltage via I2C interface.
>> Add a node for the driver to reach 12V.
>> 
>> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
>> ---
>>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
>>  1 file changed, 18 insertions(+), 14 deletions(-)
>> 
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> index 8e01b04144b7..9f225e9c3d54 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> @@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
>>  		regulator-max-microvolt = <5000000>;
>>  	};
>>  
>> -	/*
>> -	 * should be placed inside mp8859, but not until mp8859 has
>> -	 * its own dt-binding.
>> -	 */
>> -	dc_12v: mp8859-dcdc1 {
>> -		compatible = "regulator-fixed";
>> -		regulator-name = "dc_12v";
>> -		regulator-always-on;
>> -		regulator-boot-on;
>> -		regulator-min-microvolt = <12000000>;
>> -		regulator-max-microvolt = <12000000>;
>> -		vin-supply = <&vcc_vbus_typec0>;
>> -	};
>> -
>>  	/* switched by pmic_sleep */
>>  	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
>>  		compatible = "regulator-fixed";
>> @@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
>>  		vbus-supply = <&vcc_vbus_typec0>;
>>  		status = "okay";
>>  	};
>> +
>> +	mp8859: regulator@66 {
>> +		compatible = "mps,mp8859";
>> +		reg = <0x66>;
>> +		dc_12v: mp8859_dcdc {
>> +			regulator-name = "dc_12v";
>> +			regulator-min-microvolt = <12000000>;
>> +			regulator-max-microvolt = <12000000>;
>> +			regulator-always-on;
>> +			regulator-boot-on;
>> +			vin-supply = <&vcc_vbus_typec0>;
>> +
>> +			regulator-state-mem {
>> +				regulator-on-in-suspend;
>> +				regulator-suspend-microvolt = <12000000>;
>> +			};
>> +		};
>> +	};
>>  };
>>  
>>  &i2s0 {
>> 
> 
> 
> 
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
> 

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
@ 2020-01-05  9:16       ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-05  9:16 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Mark Rutland, devicetree, linux-kernel, linux-rockchip,
	Rob Herring, Jagan Teki, linux-arm-kernel

Hi Heiko,

Am 04.01.20 um 22:23 schrieb Heiko Stuebner:
> Hi Markus,
> 
> Am Samstag, 4. Januar 2020, 16:32:49 CET schrieb Markus Reichl:
>> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
>> This supplies 5V only in default state after booting.
> 
> Just for my understanding ... both the old static regulator before as
> well as the new i2c node said to supply 12V, but above you say that
> the default is 5V ... so I'm wondering who configured the 12V before.
> 
> Or was it the case that the old regulator node was just wrong and we
> had 5V running on the dc_12v line?

Yes, the dc_12v line was running at 5V (measured 4,7V) as it is the
default power up value for the MP8859. This is as documented in the data
sheet [1].

[1] https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP8859/document_id/4033/

Gruß
--
Markus
> 
> Thanks
> Heiko
> 
>> Now we can control the output voltage via I2C interface.
>> Add a node for the driver to reach 12V.
>> 
>> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
>> ---
>>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
>>  1 file changed, 18 insertions(+), 14 deletions(-)
>> 
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> index 8e01b04144b7..9f225e9c3d54 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> @@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
>>  		regulator-max-microvolt = <5000000>;
>>  	};
>>  
>> -	/*
>> -	 * should be placed inside mp8859, but not until mp8859 has
>> -	 * its own dt-binding.
>> -	 */
>> -	dc_12v: mp8859-dcdc1 {
>> -		compatible = "regulator-fixed";
>> -		regulator-name = "dc_12v";
>> -		regulator-always-on;
>> -		regulator-boot-on;
>> -		regulator-min-microvolt = <12000000>;
>> -		regulator-max-microvolt = <12000000>;
>> -		vin-supply = <&vcc_vbus_typec0>;
>> -	};
>> -
>>  	/* switched by pmic_sleep */
>>  	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
>>  		compatible = "regulator-fixed";
>> @@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
>>  		vbus-supply = <&vcc_vbus_typec0>;
>>  		status = "okay";
>>  	};
>> +
>> +	mp8859: regulator@66 {
>> +		compatible = "mps,mp8859";
>> +		reg = <0x66>;
>> +		dc_12v: mp8859_dcdc {
>> +			regulator-name = "dc_12v";
>> +			regulator-min-microvolt = <12000000>;
>> +			regulator-max-microvolt = <12000000>;
>> +			regulator-always-on;
>> +			regulator-boot-on;
>> +			vin-supply = <&vcc_vbus_typec0>;
>> +
>> +			regulator-state-mem {
>> +				regulator-on-in-suspend;
>> +				regulator-suspend-microvolt = <12000000>;
>> +			};
>> +		};
>> +	};
>>  };
>>  
>>  &i2s0 {
>> 
> 
> 
> 
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
> 

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

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

* Re: [PATCH 1/5] regulator: mp8859: add driver
  2020-01-04 15:32 ` [PATCH 1/5] regulator: mp8859: add driver Markus Reichl
@ 2020-01-06 20:45   ` Mark Brown
  2020-01-06 20:52       ` Markus Reichl
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2020-01-06 20:45 UTC (permalink / raw)
  To: Markus Reichl; +Cc: linux-rockchip, Liam Girdwood, linux-kernel

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

On Sat, Jan 04, 2020 at 04:32:45PM +0100, Markus Reichl wrote:
> The MP8859 from Monolithic Power Systems is a single output DC/DC
> converter. The voltage can be controlled via I2C.

I have patches 1, 2 and 4 with no cover letter or other information
about dependencies.  What's the story there?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 1/5] regulator: mp8859: add driver
@ 2020-01-06 20:52       ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-06 20:52 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-rockchip, Liam Girdwood, linux-kernel

Am 06.01.20 um 21:45 schrieb Mark Brown:
> On Sat, Jan 04, 2020 at 04:32:45PM +0100, Markus Reichl wrote:
>> The MP8859 from Monolithic Power Systems is a single output DC/DC
>> converter. The voltage can be controlled via I2C.
> 
> I have patches 1, 2 and 4 with no cover letter or other information
> about dependencies.  What's the story there?
> 
I used scripts/get_maintainer.pl on the single patches, will resend to 
a combined list.

> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
> 

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

* Re: [PATCH 1/5] regulator: mp8859: add driver
@ 2020-01-06 20:52       ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-06 20:52 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Liam Girdwood,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Am 06.01.20 um 21:45 schrieb Mark Brown:
> On Sat, Jan 04, 2020 at 04:32:45PM +0100, Markus Reichl wrote:
>> The MP8859 from Monolithic Power Systems is a single output DC/DC
>> converter. The voltage can be controlled via I2C.
> 
> I have patches 1, 2 and 4 with no cover letter or other information
> about dependencies.  What's the story there?
> 
I used scripts/get_maintainer.pl on the single patches, will resend to 
a combined list.

> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
> 

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
@ 2020-01-08 23:30     ` Heiko Stuebner
  0 siblings, 0 replies; 22+ messages in thread
From: Heiko Stuebner @ 2020-01-08 23:30 UTC (permalink / raw)
  To: Markus Reichl
  Cc: linux-rockchip, Liam Girdwood, Mark Brown, Rob Herring,
	Mark Rutland, linux-kernel, devicetree, linux-arm-kernel

Am Montag, 6. Januar 2020, 22:16:28 CET schrieb Markus Reichl:
> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
> This supplies 5V only in default state after booting.
> Now we can control the output voltage via I2C interface.
> Add a node for the driver to reach 12V.
> 
> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>

applied for 5.6 now that the driver-side got merged

Thanks
Heiko



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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
@ 2020-01-08 23:30     ` Heiko Stuebner
  0 siblings, 0 replies; 22+ messages in thread
From: Heiko Stuebner @ 2020-01-08 23:30 UTC (permalink / raw)
  To: Markus Reichl
  Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Liam Girdwood,
	Rob Herring, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Mark Brown,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Am Montag, 6. Januar 2020, 22:16:28 CET schrieb Markus Reichl:
> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
> This supplies 5V only in default state after booting.
> Now we can control the output voltage via I2C interface.
> Add a node for the driver to reach 12V.
> 
> Signed-off-by: Markus Reichl <m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>

applied for 5.6 now that the driver-side got merged

Thanks
Heiko

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
@ 2020-01-08 23:30     ` Heiko Stuebner
  0 siblings, 0 replies; 22+ messages in thread
From: Heiko Stuebner @ 2020-01-08 23:30 UTC (permalink / raw)
  To: Markus Reichl
  Cc: Mark Rutland, devicetree, Liam Girdwood, Rob Herring,
	linux-kernel, linux-rockchip, Mark Brown, linux-arm-kernel

Am Montag, 6. Januar 2020, 22:16:28 CET schrieb Markus Reichl:
> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
> This supplies 5V only in default state after booting.
> Now we can control the output voltage via I2C interface.
> Add a node for the driver to reach 12V.
> 
> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>

applied for 5.6 now that the driver-side got merged

Thanks
Heiko



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

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

* [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-06 21:16 Markus Reichl
@ 2020-01-06 21:16   ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-06 21:16 UTC (permalink / raw)
  To: linux-rockchip, Liam Girdwood, Mark Brown, Rob Herring,
	Mark Rutland, Heiko Stuebner
  Cc: Markus Reichl, linux-kernel, devicetree, linux-arm-kernel

The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
This supplies 5V only in default state after booting.
Now we can control the output voltage via I2C interface.
Add a node for the driver to reach 12V.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index 8e01b04144b7..9f225e9c3d54 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
 		regulator-max-microvolt = <5000000>;
 	};
 
-	/*
-	 * should be placed inside mp8859, but not until mp8859 has
-	 * its own dt-binding.
-	 */
-	dc_12v: mp8859-dcdc1 {
-		compatible = "regulator-fixed";
-		regulator-name = "dc_12v";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
-		vin-supply = <&vcc_vbus_typec0>;
-	};
-
 	/* switched by pmic_sleep */
 	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
 		compatible = "regulator-fixed";
@@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
 		vbus-supply = <&vcc_vbus_typec0>;
 		status = "okay";
 	};
+
+	mp8859: regulator@66 {
+		compatible = "mps,mp8859";
+		reg = <0x66>;
+		dc_12v: mp8859_dcdc {
+			regulator-name = "dc_12v";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			vin-supply = <&vcc_vbus_typec0>;
+
+			regulator-state-mem {
+				regulator-on-in-suspend;
+				regulator-suspend-microvolt = <12000000>;
+			};
+		};
+	};
 };
 
 &i2s0 {
-- 
2.24.1


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

* [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
@ 2020-01-06 21:16   ` Markus Reichl
  0 siblings, 0 replies; 22+ messages in thread
From: Markus Reichl @ 2020-01-06 21:16 UTC (permalink / raw)
  To: linux-rockchip, Liam Girdwood, Mark Brown, Rob Herring,
	Mark Rutland, Heiko Stuebner
  Cc: Markus Reichl, devicetree, linux-kernel, linux-arm-kernel

The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
This supplies 5V only in default state after booting.
Now we can control the output voltage via I2C interface.
Add a node for the driver to reach 12V.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index 8e01b04144b7..9f225e9c3d54 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
 		regulator-max-microvolt = <5000000>;
 	};
 
-	/*
-	 * should be placed inside mp8859, but not until mp8859 has
-	 * its own dt-binding.
-	 */
-	dc_12v: mp8859-dcdc1 {
-		compatible = "regulator-fixed";
-		regulator-name = "dc_12v";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
-		vin-supply = <&vcc_vbus_typec0>;
-	};
-
 	/* switched by pmic_sleep */
 	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
 		compatible = "regulator-fixed";
@@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
 		vbus-supply = <&vcc_vbus_typec0>;
 		status = "okay";
 	};
+
+	mp8859: regulator@66 {
+		compatible = "mps,mp8859";
+		reg = <0x66>;
+		dc_12v: mp8859_dcdc {
+			regulator-name = "dc_12v";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			vin-supply = <&vcc_vbus_typec0>;
+
+			regulator-state-mem {
+				regulator-on-in-suspend;
+				regulator-suspend-microvolt = <12000000>;
+			};
+		};
+	};
 };
 
 &i2s0 {
-- 
2.24.1


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

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

end of thread, other threads:[~2020-01-08 23:30 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04 15:32 [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Markus Reichl
2020-01-04 15:32 ` Markus Reichl
2020-01-04 15:32 ` [PATCH 1/5] regulator: mp8859: add driver Markus Reichl
2020-01-06 20:45   ` Mark Brown
2020-01-06 20:52     ` Markus Reichl
2020-01-06 20:52       ` Markus Reichl
2020-01-04 15:32 ` [PATCH 2/5] regulator: mp8859: add config option and build entry Markus Reichl
2020-01-04 15:32 ` [PATCH 3/5] dt-bindings: add vendor Monolithic Power Systems Markus Reichl
2020-01-04 15:32 ` [PATCH 4/5] dt-bindings: regulator: add MPS mp8859 voltage regulator Markus Reichl
2020-01-04 15:32 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
2020-01-04 15:32   ` Markus Reichl
2020-01-04 21:23   ` Heiko Stuebner
2020-01-04 21:23     ` Heiko Stuebner
2020-01-05  9:16     ` Markus Reichl
2020-01-05  9:16       ` Markus Reichl
2020-01-04 21:19 ` [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Heiko Stuebner
2020-01-04 21:19   ` Heiko Stuebner
2020-01-06 21:16 Markus Reichl
2020-01-06 21:16 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
2020-01-06 21:16   ` Markus Reichl
2020-01-08 23:30   ` Heiko Stuebner
2020-01-08 23:30     ` Heiko Stuebner
2020-01-08 23:30     ` Heiko Stuebner

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.