* [PATCH v5 0/4] Add regulator support for mpq7920
@ 2020-01-08 13:12 Saravanan Sekar
2020-01-08 13:12 ` [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS Saravanan Sekar
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Saravanan Sekar @ 2020-01-08 13:12 UTC (permalink / raw)
To: sravanhome, lgirdwood, broonie, robh+dt, mark.rutland, mripard,
shawnguo, heiko, sam, icenowy, laurent.pinchart, gregkh,
Jonathan.Cameron, davem, mchehab+samsung
Cc: devicetree, linux-kernel
Changes in V5:
- removed timeslot related changes, the timeslot register holds the value of
time duration between each regulator of power on/off sequence. Although
timeslot register is accessed over I2C the changes reflects on next powercycle
of pmic, so cannot handled part of this driver.
- device tree bindings property are defined per regulator node
Changes in V4:
- fixed 0-DAY warnings
Changes in V3:
- fixed review comments in Documentation and dt_bindings_check passed
Changes in V2:
- fixed all the review comments in the driver, avoid ternery operator, inline & constant
- fixed/modifed review comments in Documentation
This patch series add support for PMIC regulator driver for Monolithic
Power System's MPQ7920 chipset. MPQ7920 provides support for 4-BUCK converter,
one fixed voltage RTCLDO and 4-LDO regualtor, accessed over I2C.
Saravanan Sekar (4):
dt-bindings: Add an entry for Monolithic Power System, MPS
dt-bindings: regulator: add document bindings for mpq7920
regulator: mpq7920: add mpq7920 regulator driver
MAINTAINERS: Add entry for mpq7920 PMIC driver
Saravanan Sekar (4):
dt-bindings: Add an entry for Monolithic Power System, MPS
dt-bindings: regulator: add document bindings for mpq7920
regulator: mpq7920: add mpq7920 regulator driver
MAINTAINERS: Add entry for mpq7920 PMIC driver
.../bindings/regulator/mps,mpq7920.yaml | 202 +++++++++++
.../devicetree/bindings/vendor-prefixes.yaml | 2 +
MAINTAINERS | 7 +
drivers/regulator/Kconfig | 10 +
drivers/regulator/Makefile | 1 +
drivers/regulator/mpq7920.c | 342 ++++++++++++++++++
drivers/regulator/mpq7920.h | 72 ++++
7 files changed, 636 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml
create mode 100644 drivers/regulator/mpq7920.c
create mode 100644 drivers/regulator/mpq7920.h
--
2.17.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS
2020-01-08 13:12 [PATCH v5 0/4] Add regulator support for mpq7920 Saravanan Sekar
@ 2020-01-08 13:12 ` Saravanan Sekar
2020-01-08 15:58 ` Mark Brown
2020-01-08 15:58 ` Applied "dt-bindings: Add an entry for Monolithic Power System, MPS" to the regulator tree Mark Brown
2020-01-08 13:12 ` [PATCH v5 2/4] dt-bindings: regulator: add document bindings for mpq7920 Saravanan Sekar
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Saravanan Sekar @ 2020-01-08 13:12 UTC (permalink / raw)
To: sravanhome, lgirdwood, broonie, robh+dt, mark.rutland, mripard,
shawnguo, heiko, sam, icenowy, laurent.pinchart, gregkh,
Jonathan.Cameron, davem, mchehab+samsung
Cc: devicetree, linux-kernel
Add an entry for Monolithic Power System, MPS
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
---
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 6046f4555852..5eac9d08bfa8 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -605,6 +605,8 @@ patternProperties:
description: MiraMEMS Sensing Technology Co., Ltd.
"^mitsubishi,.*":
description: Mitsubishi Electric Corporation
+ "^mps,.*":
+ description: Monolithic Power Systems, Inc.
"^mosaixtech,.*":
description: Mosaix Technologies, Inc.
"^motorola,.*":
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v5 2/4] dt-bindings: regulator: add document bindings for mpq7920
2020-01-08 13:12 [PATCH v5 0/4] Add regulator support for mpq7920 Saravanan Sekar
2020-01-08 13:12 ` [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS Saravanan Sekar
@ 2020-01-08 13:12 ` Saravanan Sekar
2020-01-08 15:58 ` Applied "regulator: bindings: add document bindings for mpq7920" to the regulator tree Mark Brown
2020-01-08 13:12 ` [PATCH v5 3/4] regulator: mpq7920: add mpq7920 regulator driver Saravanan Sekar
2020-01-08 13:12 ` [PATCH v5 4/4] MAINTAINERS: Add entry for mpq7920 PMIC driver Saravanan Sekar
3 siblings, 1 reply; 11+ messages in thread
From: Saravanan Sekar @ 2020-01-08 13:12 UTC (permalink / raw)
To: sravanhome, lgirdwood, broonie, robh+dt, mark.rutland, mripard,
shawnguo, heiko, sam, icenowy, laurent.pinchart, gregkh,
Jonathan.Cameron, davem, mchehab+samsung
Cc: devicetree, linux-kernel
Add device tree binding information for mpq7920 regulator driver.
Example bindings for mpq7920 are added.
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
---
.../bindings/regulator/mps,mpq7920.yaml | 202 ++++++++++++++++++
1 file changed, 202 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml
diff --git a/Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml b/Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml
new file mode 100644
index 000000000000..598f3ea070c9
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml
@@ -0,0 +1,202 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mps,mpq7920.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Monolithic Power System MPQ7920 PMIC
+
+maintainers:
+ - Saravanan Sekar <sravanhome@gmail.com>
+
+properties:
+ $nodename:
+ pattern: "pmic@[0-9a-f]{1,2}"
+ compatible:
+ enum:
+ - mps,mpq7920
+
+ reg:
+ maxItems: 1
+
+ regulators:
+ type: object
+ description: |
+ list of regulators provided by this controller, must be named
+ after their hardware counterparts BUCK[1-4], one LDORTC, and LDO[2-5]
+
+ mps,switch-freq:
+ description: |
+ switching frequency must be one of following corresponding value
+ 1.1MHz, 1.65MHz, 2.2MHz, 2.75MHz
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 2
+
+ buck1:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 4.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+
+ mps,buck-phase-delay:
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 0
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+
+ mps,buck-ovp-disable:
+ type: boolean
+ description: |
+ disables over voltage protection of this buck
+
+ buck2:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 2.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-phase-delay:
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 0
+
+ mps,buck-ovp-disable:
+ description: |
+ disables over voltage protection of this buck
+ type: boolean
+
+ buck3:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 4.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-phase-delay:
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-ovp-disable:
+ description: |
+ disables over voltage protection of this buck
+ type: boolean
+
+ buck4:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 2.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-phase-delay:
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-ovp-disable:
+ description: |
+ disables over voltage protection of this buck
+ type: boolean
+
+ ldortc:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V for RTC, always enabled
+
+ ldo2:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+ ldo3:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+ ldo4:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+ ldo5:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pmic@69 {
+ compatible = "mps,mpq7920";
+ reg = <0x69>;
+
+ regulators {
+ mps,switch-freq = <1>;
+
+ buck1 {
+ regulator-name = "buck1";
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <3587500>;
+ regulator-min-microamp = <460000>;
+ regulator-max-microamp = <7600000>;
+ regulator-boot-on;
+ mps,buck-ovp-disable;
+ mps,buck-phase-delay = <2>;
+ mps,buck-softstart = <1>;
+ };
+
+ ldo2 {
+ regulator-name = "ldo2";
+ regulator-min-microvolt = <650000>;
+ regulator-max-microvolt = <3587500>;
+ };
+ };
+ };
+ };
+...
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v5 3/4] regulator: mpq7920: add mpq7920 regulator driver
2020-01-08 13:12 [PATCH v5 0/4] Add regulator support for mpq7920 Saravanan Sekar
2020-01-08 13:12 ` [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS Saravanan Sekar
2020-01-08 13:12 ` [PATCH v5 2/4] dt-bindings: regulator: add document bindings for mpq7920 Saravanan Sekar
@ 2020-01-08 13:12 ` Saravanan Sekar
2020-01-08 15:50 ` Mark Brown
2020-01-08 13:12 ` [PATCH v5 4/4] MAINTAINERS: Add entry for mpq7920 PMIC driver Saravanan Sekar
3 siblings, 1 reply; 11+ messages in thread
From: Saravanan Sekar @ 2020-01-08 13:12 UTC (permalink / raw)
To: sravanhome, lgirdwood, broonie, robh+dt, mark.rutland, mripard,
shawnguo, heiko, sam, icenowy, laurent.pinchart, gregkh,
Jonathan.Cameron, davem, mchehab+samsung
Cc: devicetree, linux-kernel
Adding regulator driver for the device mpq7920.
The MPQ7920 PMIC device contains four DC-DC buck converters and
five regulators, is designed for automotive and accessed over I2C.
Fixed sparse warning reported on this patch
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
---
drivers/regulator/Kconfig | 10 ++
drivers/regulator/Makefile | 1 +
drivers/regulator/mpq7920.c | 345 ++++++++++++++++++++++++++++++++++++
drivers/regulator/mpq7920.h | 68 +++++++
4 files changed, 424 insertions(+)
create mode 100644 drivers/regulator/mpq7920.c
create mode 100644 drivers/regulator/mpq7920.h
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 74eb5af7295f..e10adc2e57da 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -600,6 +600,16 @@ config REGULATOR_MCP16502
through the regulator interface. In addition it enables
suspend-to-ram/standby transition.
+config REGULATOR_MPQ7920
+ tristate "Monolithic MPQ7920 PMIC"
+ depends on I2C && OF
+ select REGMAP_I2C
+ help
+ Say y here to support the MPQ7920 PMIC. This will enable supports
+ the software controllable 4 buck and 5 LDO regulators.
+ This driver supports the control of different power rails of device
+ through regulator interface.
+
config REGULATOR_MT6311
tristate "MediaTek MT6311 PMIC"
depends on I2C
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 2210ba56f9bd..fd11002507e4 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -77,6 +77,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_MPQ7920) += mpq7920.o
obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o
obj-$(CONFIG_REGULATOR_MT6358) += mt6358-regulator.o
diff --git a/drivers/regulator/mpq7920.c b/drivers/regulator/mpq7920.c
new file mode 100644
index 000000000000..d50c7dce4af6
--- /dev/null
+++ b/drivers/regulator/mpq7920.c
@@ -0,0 +1,345 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// mpq7920.c - regulator driver for mps mpq7920
+//
+// Copyright 2019 Monolithic Power Systems, Inc
+//
+// Author: Saravanan Sekar <sravanhome@gmail.com>
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/of_regulator.h>
+#include <linux/i2c.h>
+#include <linux/regmap.h>
+#include "mpq7920.h"
+
+#define MPQ7920_BUCK_VOLT_RANGE \
+ ((MPQ7920_VOLT_MAX - MPQ7920_BUCK_VOLT_MIN)/MPQ7920_VOLT_STEP + 1)
+#define MPQ7920_LDO_VOLT_RANGE \
+ ((MPQ7920_VOLT_MAX - MPQ7920_LDO_VOLT_MIN)/MPQ7920_VOLT_STEP + 1)
+
+#define MPQ7920BUCK(_name, _id, _ilim) \
+ [MPQ7920_BUCK ## _id] = { \
+ .id = MPQ7920_BUCK ## _id, \
+ .name = _name, \
+ .of_match = _name, \
+ .regulators_node = "regulators", \
+ .ops = &mpq7920_buck_ops, \
+ .min_uV = MPQ7920_BUCK_VOLT_MIN, \
+ .uV_step = MPQ7920_VOLT_STEP, \
+ .n_voltages = MPQ7920_BUCK_VOLT_RANGE, \
+ .curr_table = _ilim, \
+ .n_current_limits = ARRAY_SIZE(_ilim), \
+ .csel_reg = MPQ7920_BUCK ##_id## _REG_C, \
+ .csel_mask = MPQ7920_MASK_BUCK_ILIM, \
+ .enable_reg = MPQ7920_REG_REGULATOR_EN, \
+ .enable_mask = BIT(MPQ7920_REGULATOR_EN_OFFSET - \
+ MPQ7920_BUCK ## _id), \
+ .vsel_reg = MPQ7920_BUCK ##_id## _REG_A, \
+ .vsel_mask = MPQ7920_MASK_VREF, \
+ .active_discharge_on = MPQ7920_DISCHARGE_ON, \
+ .active_discharge_reg = MPQ7920_BUCK ##_id## _REG_B, \
+ .active_discharge_mask = MPQ7920_MASK_DISCHARGE, \
+ .soft_start_reg = MPQ7920_BUCK ##_id## _REG_C, \
+ .soft_start_mask = MPQ7920_MASK_SOFTSTART, \
+ .owner = THIS_MODULE, \
+ }
+
+#define MPQ7920LDO(_name, _id, _ops, _ilim, _ilim_sz, _creg, _cmask) \
+ [MPQ7920_LDO ## _id] = { \
+ .id = MPQ7920_LDO ## _id, \
+ .name = _name, \
+ .of_match = _name, \
+ .regulators_node = "regulators", \
+ .ops = _ops, \
+ .min_uV = MPQ7920_LDO_VOLT_MIN, \
+ .uV_step = MPQ7920_VOLT_STEP, \
+ .n_voltages = MPQ7920_LDO_VOLT_RANGE, \
+ .vsel_reg = MPQ7920_LDO ##_id## _REG_A, \
+ .vsel_mask = MPQ7920_MASK_VREF, \
+ .curr_table = _ilim, \
+ .n_current_limits = _ilim_sz, \
+ .csel_reg = _creg, \
+ .csel_mask = _cmask, \
+ .enable_reg = (_id == 1) ? 0 : MPQ7920_REG_REGULATOR_EN,\
+ .enable_mask = BIT(MPQ7920_REGULATOR_EN_OFFSET - \
+ MPQ7920_LDO ##_id + 1), \
+ .active_discharge_on = MPQ7920_DISCHARGE_ON, \
+ .active_discharge_mask = MPQ7920_MASK_DISCHARGE, \
+ .active_discharge_reg = MPQ7920_LDO ##_id## _REG_B, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ }
+
+enum mpq7920_regulators {
+ MPQ7920_BUCK1,
+ MPQ7920_BUCK2,
+ MPQ7920_BUCK3,
+ MPQ7920_BUCK4,
+ MPQ7920_LDO1, /* LDORTC */
+ MPQ7920_LDO2,
+ MPQ7920_LDO3,
+ MPQ7920_LDO4,
+ MPQ7920_LDO5,
+ MPQ7920_MAX_REGULATORS,
+};
+
+struct mpq7920_regulator_info {
+ struct device *dev;
+ struct regmap *regmap;
+ struct regulator_dev *rdev[MPQ7920_MAX_REGULATORS];
+ struct regulator_desc *rdesc;
+};
+
+static const struct regmap_config mpq7920_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = 0x25,
+};
+
+/* Current limits array (in uA)
+ * ILIM1 & ILIM3
+ */
+static const unsigned int mpq7920_I_limits1[] = {
+ 4600000, 6600000, 7600000, 9300000
+};
+
+/* ILIM2 & ILIM4 */
+static const unsigned int mpq7920_I_limits2[] = {
+ 2700000, 3900000, 5100000, 6100000
+};
+
+/* LDO4 & LDO5 */
+static const unsigned int mpq7920_I_limits3[] = {
+ 300000, 700000
+};
+
+static int mpq7920_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay);
+
+/* RTCLDO not controllable, always ON */
+static const struct regulator_ops mpq7920_ldortc_ops = {
+ .list_voltage = regulator_list_voltage_linear,
+ .map_voltage = regulator_map_voltage_linear,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+};
+
+static const struct regulator_ops mpq7920_ldo_wo_current_ops = {
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
+ .list_voltage = regulator_list_voltage_linear,
+ .map_voltage = regulator_map_voltage_linear,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .set_active_discharge = regulator_set_active_discharge_regmap,
+};
+
+static const struct regulator_ops mpq7920_ldo_ops = {
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
+ .list_voltage = regulator_list_voltage_linear,
+ .map_voltage = regulator_map_voltage_linear,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .set_active_discharge = regulator_set_active_discharge_regmap,
+ .get_current_limit = regulator_get_current_limit_regmap,
+ .set_current_limit = regulator_set_current_limit_regmap,
+};
+
+static const struct regulator_ops mpq7920_buck_ops = {
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
+ .list_voltage = regulator_list_voltage_linear,
+ .map_voltage = regulator_map_voltage_linear,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .set_active_discharge = regulator_set_active_discharge_regmap,
+ .set_soft_start = regulator_set_soft_start_regmap,
+ .set_ramp_delay = mpq7920_set_ramp_delay,
+};
+
+static struct regulator_desc mpq7920_regulators_desc[MPQ7920_MAX_REGULATORS] = {
+ MPQ7920BUCK("buck1", 1, mpq7920_I_limits1),
+ MPQ7920BUCK("buck2", 2, mpq7920_I_limits2),
+ MPQ7920BUCK("buck3", 3, mpq7920_I_limits1),
+ MPQ7920BUCK("buck4", 4, mpq7920_I_limits2),
+ MPQ7920LDO("ldortc", 1, &mpq7920_ldortc_ops, NULL, 0, 0, 0),
+ MPQ7920LDO("ldo2", 2, &mpq7920_ldo_wo_current_ops, NULL, 0, 0, 0),
+ MPQ7920LDO("ldo3", 3, &mpq7920_ldo_wo_current_ops, NULL, 0, 0, 0),
+ MPQ7920LDO("ldo4", 4, &mpq7920_ldo_ops, mpq7920_I_limits3,
+ ARRAY_SIZE(mpq7920_I_limits3), MPQ7920_LDO4_REG_B,
+ MPQ7920_MASK_LDO_ILIM),
+ MPQ7920LDO("ldo5", 5, &mpq7920_ldo_ops, mpq7920_I_limits3,
+ ARRAY_SIZE(mpq7920_I_limits3), MPQ7920_LDO5_REG_B,
+ MPQ7920_MASK_LDO_ILIM),
+};
+
+/*
+ * DVS ramp rate BUCK1 to BUCK4
+ * 00-01: Reserved
+ * 10: 8mV/us
+ * 11: 4mV/us
+ */
+static int mpq7920_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
+{
+ unsigned int ramp_val;
+
+ if (ramp_delay > 8000 || ramp_delay < 0)
+ return -EINVAL;
+
+ if (ramp_delay <= 4000)
+ ramp_val = 3;
+ else
+ ramp_val = 2;
+
+ return regmap_update_bits(rdev->regmap, MPQ7920_REG_CTL0,
+ MPQ7920_MASK_DVS_SLEWRATE, ramp_val << 6);
+}
+
+static void mpq7920_parse_dt(struct device *dev,
+ struct mpq7920_regulator_info *info)
+{
+ int ret, i;
+ struct device_node *np = dev->of_node;
+ struct device_node *child;
+ uint8_t freq;
+ uint8_t val;
+
+ np = of_get_child_by_name(np, "regulators");
+ if (!np) {
+ dev_err(dev, "missing 'regulators' subnode in DT\n");
+ return;
+ }
+
+ ret = of_property_read_u8(np, "mps,switch-freq", &freq);
+ if (!ret) {
+ regmap_update_bits(info->regmap, MPQ7920_REG_CTL0,
+ MPQ7920_MASK_SWITCH_FREQ,
+ (freq & 3) << 4);
+ }
+
+ for_each_child_of_node(np, child) {
+ for (i = 0; i <= MPQ7920_BUCK4; i++) {
+ struct regulator_desc *rdesc = &info->rdesc[i];
+
+ if (strcmp(rdesc->name, child->name))
+ continue;
+
+ if (of_property_read_bool(child,
+ "mps,buck-ovp-disable")) {
+ regmap_update_bits(info->regmap,
+ MPQ7920_BUCK1_REG_B + (i * 4),
+ BIT(6), ~BIT(6));
+ }
+
+ ret = of_property_read_u8(child, "mps,buck-softstart",
+ &val);
+ if (!ret)
+ rdesc->soft_start_val_on = (val & 3) << 2;
+
+ ret = of_property_read_u8(child, "mps,buck-phase-delay",
+ &val);
+ if (!ret) {
+ regmap_update_bits(info->regmap,
+ MPQ7920_BUCK1_REG_C + (i * 4),
+ MPQ7920_MASK_BUCK_PHASE_DEALY,
+ (val & 3) << 4);
+ }
+ break;
+ }
+ of_node_put(child);
+ }
+ of_node_put(np);
+}
+
+static inline int mpq7920_regulator_register(
+ struct mpq7920_regulator_info *info,
+ struct regulator_config *config)
+{
+ int i;
+ struct regulator_desc *rdesc;
+
+ for (i = 0; i < MPQ7920_MAX_REGULATORS; i++) {
+ rdesc = &info->rdesc[i];
+
+ info->rdev[i] = devm_regulator_register(info->dev, rdesc,
+ config);
+ if (IS_ERR(info->rdev))
+ return PTR_ERR(info->rdev);
+ }
+
+ return 0;
+}
+
+static int mpq7920_i2c_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct device *dev = &client->dev;
+ struct mpq7920_regulator_info *info;
+ struct regulator_config config = { NULL, };
+ struct regmap *regmap;
+ int ret;
+
+ info = devm_kzalloc(dev, sizeof(struct mpq7920_regulator_info),
+ GFP_KERNEL);
+ if (!info)
+ return -ENOMEM;
+
+ info->dev = dev;
+ info->rdesc = mpq7920_regulators_desc;
+ regmap = devm_regmap_init_i2c(client, &mpq7920_regmap_config);
+ if (IS_ERR(regmap)) {
+ dev_err(dev, "Failed to allocate regmap!\n");
+ return PTR_ERR(regmap);
+ }
+
+ i2c_set_clientdata(client, info);
+ info->regmap = regmap;
+ if (client->dev.of_node)
+ mpq7920_parse_dt(&client->dev, info);
+
+ config.dev = info->dev;
+ config.regmap = regmap;
+ config.driver_data = info;
+
+ ret = mpq7920_regulator_register(info, &config);
+ if (ret < 0)
+ dev_err(dev, "Failed to register regulator!\n");
+
+ return ret;
+}
+
+static const struct of_device_id mpq7920_of_match[] = {
+ { .compatible = "mps,mpq7920"},
+ {},
+};
+MODULE_DEVICE_TABLE(of, mpq7920_of_match);
+
+static const struct i2c_device_id mpq7920_id[] = {
+ { "mpq7920", },
+ { },
+};
+MODULE_DEVICE_TABLE(i2c, mpq7920_id);
+
+static struct i2c_driver mpq7920_regulator_driver = {
+ .driver = {
+ .name = "mpq7920",
+ .of_match_table = of_match_ptr(mpq7920_of_match),
+ },
+ .probe = mpq7920_i2c_probe,
+ .id_table = mpq7920_id,
+};
+module_i2c_driver(mpq7920_regulator_driver);
+
+MODULE_AUTHOR("Saravanan Sekar <sravanhome@gmail.com>");
+MODULE_DESCRIPTION("MPQ7920 PMIC regulator driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/regulator/mpq7920.h b/drivers/regulator/mpq7920.h
new file mode 100644
index 000000000000..6a93bfbc750c
--- /dev/null
+++ b/drivers/regulator/mpq7920.h
@@ -0,0 +1,68 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * mpq7920.h - Regulator definitions for mpq7920
+ *
+ * Copyright 2019 Monolithic Power Systems, Inc
+ *
+ */
+
+#ifndef __MPQ7920_H__
+#define __MPQ7920_H__
+
+#define MPQ7920_REG_CTL0 0x00
+#define MPQ7920_REG_CTL1 0x01
+#define MPQ7920_REG_CTL2 0x02
+#define MPQ7920_BUCK1_REG_A 0x03
+#define MPQ7920_BUCK1_REG_B 0x04
+#define MPQ7920_BUCK1_REG_C 0x05
+#define MPQ7920_BUCK1_REG_D 0x06
+#define MPQ7920_BUCK2_REG_A 0x07
+#define MPQ7920_BUCK2_REG_B 0x08
+#define MPQ7920_BUCK2_REG_C 0x09
+#define MPQ7920_BUCK2_REG_D 0x0a
+#define MPQ7920_BUCK3_REG_A 0x0b
+#define MPQ7920_BUCK3_REG_B 0x0c
+#define MPQ7920_BUCK3_REG_C 0x0d
+#define MPQ7920_BUCK3_REG_D 0x0e
+#define MPQ7920_BUCK4_REG_A 0x0f
+#define MPQ7920_BUCK4_REG_B 0x10
+#define MPQ7920_BUCK4_REG_C 0x11
+#define MPQ7920_BUCK4_REG_D 0x12
+#define MPQ7920_LDO1_REG_A 0x13
+#define MPQ7920_LDO1_REG_B 0x0
+#define MPQ7920_LDO2_REG_A 0x14
+#define MPQ7920_LDO2_REG_B 0x15
+#define MPQ7920_LDO2_REG_C 0x16
+#define MPQ7920_LDO3_REG_A 0x17
+#define MPQ7920_LDO3_REG_B 0x18
+#define MPQ7920_LDO3_REG_C 0x19
+#define MPQ7920_LDO4_REG_A 0x1a
+#define MPQ7920_LDO4_REG_B 0x1b
+#define MPQ7920_LDO4_REG_C 0x1c
+#define MPQ7920_LDO5_REG_A 0x1d
+#define MPQ7920_LDO5_REG_B 0x1e
+#define MPQ7920_LDO5_REG_C 0x1f
+#define MPQ7920_REG_MODE 0x20
+#define MPQ7920_REG_REGULATOR_EN1 0x22
+#define MPQ7920_REG_REGULATOR_EN 0x22
+
+#define MPQ7920_MASK_VREF 0x7f
+#define MPQ7920_MASK_BUCK_ILIM 0xd0
+#define MPQ7920_MASK_LDO_ILIM BIT(6)
+#define MPQ7920_MASK_DISCHARGE BIT(5)
+#define MPQ7920_MASK_MODE 0xc0
+#define MPQ7920_MASK_SOFTSTART 0x0c
+#define MPQ7920_MASK_SWITCH_FREQ 0x30
+#define MPQ7920_MASK_BUCK_PHASE_DEALY 0x30
+#define MPQ7920_MASK_DVS_SLEWRATE 0xc0
+#define MPQ7920_DISCHARGE_ON 0x1
+
+#define MPQ7920_REGULATOR_EN_OFFSET 7
+
+/* values in mV */
+#define MPQ7920_BUCK_VOLT_MIN 400000
+#define MPQ7920_LDO_VOLT_MIN 650000
+#define MPQ7920_VOLT_MAX 3587500
+#define MPQ7920_VOLT_STEP 12500
+
+#endif /* __MPQ7920_H__ */
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v5 4/4] MAINTAINERS: Add entry for mpq7920 PMIC driver
2020-01-08 13:12 [PATCH v5 0/4] Add regulator support for mpq7920 Saravanan Sekar
` (2 preceding siblings ...)
2020-01-08 13:12 ` [PATCH v5 3/4] regulator: mpq7920: add mpq7920 regulator driver Saravanan Sekar
@ 2020-01-08 13:12 ` Saravanan Sekar
2020-01-08 15:58 ` Applied "MAINTAINERS: Add entry for mpq7920 PMIC driver" to the regulator tree Mark Brown
3 siblings, 1 reply; 11+ messages in thread
From: Saravanan Sekar @ 2020-01-08 13:12 UTC (permalink / raw)
To: sravanhome, lgirdwood, broonie, robh+dt, mark.rutland, mripard,
shawnguo, heiko, sam, icenowy, laurent.pinchart, gregkh,
Jonathan.Cameron, davem, mchehab+samsung
Cc: devicetree, linux-kernel
Add MAINTAINERS entry for Monolithic Power Systems mpq7920 PMIC driver.
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
---
MAINTAINERS | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0fd82e674cf4..8a31285b59c6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11128,6 +11128,13 @@ S: Maintained
F: Documentation/driver-api/serial/moxa-smartio.rst
F: drivers/tty/mxser.*
+MONOLITHIC POWER SYSTEM PMIC DRIVER
+M: Saravanan Sekar <sravanhome@gmail.com>
+S: Maintained
+F: Documentation/devicetree/bindings/regulator/mpq7920.yaml
+F: drivers/regulator/mpq7920.c
+F: drivers/regulator/mpq7920.h
+
MR800 AVERMEDIA USB FM RADIO DRIVER
M: Alexey Klimov <klimov.linux@gmail.com>
L: linux-media@vger.kernel.org
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v5 3/4] regulator: mpq7920: add mpq7920 regulator driver
2020-01-08 13:12 ` [PATCH v5 3/4] regulator: mpq7920: add mpq7920 regulator driver Saravanan Sekar
@ 2020-01-08 15:50 ` Mark Brown
0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2020-01-08 15:50 UTC (permalink / raw)
To: Saravanan Sekar
Cc: lgirdwood, robh+dt, mark.rutland, mripard, shawnguo, heiko, sam,
icenowy, laurent.pinchart, gregkh, Jonathan.Cameron, davem,
mchehab+samsung, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]
On Wed, Jan 08, 2020 at 02:12:33PM +0100, Saravanan Sekar wrote:
> + for_each_child_of_node(np, child) {
> + for (i = 0; i <= MPQ7920_BUCK4; i++) {
> + struct regulator_desc *rdesc = &info->rdesc[i];
> +
> + if (strcmp(rdesc->name, child->name))
> + continue;
You can replace this loop with an of_parse_cb callback, please send an
incremental patch doing this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS
2020-01-08 13:12 ` [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS Saravanan Sekar
@ 2020-01-08 15:58 ` Mark Brown
2020-01-14 11:10 ` Geert Uytterhoeven
2020-01-08 15:58 ` Applied "dt-bindings: Add an entry for Monolithic Power System, MPS" to the regulator tree Mark Brown
1 sibling, 1 reply; 11+ messages in thread
From: Mark Brown @ 2020-01-08 15:58 UTC (permalink / raw)
To: Saravanan Sekar
Cc: lgirdwood, robh+dt, mark.rutland, mripard, shawnguo, heiko, sam,
icenowy, laurent.pinchart, gregkh, Jonathan.Cameron, davem,
mchehab+samsung, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 339 bytes --]
On Wed, Jan 08, 2020 at 02:12:31PM +0100, Saravanan Sekar wrote:
> "^mitsubishi,.*":
> description: Mitsubishi Electric Corporation
> + "^mps,.*":
> + description: Monolithic Power Systems, Inc.
> "^mosaixtech,.*":
This isn't sorted properly, since someone else already added MPS in the
correct place I'll just drop this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Applied "MAINTAINERS: Add entry for mpq7920 PMIC driver" to the regulator tree
2020-01-08 13:12 ` [PATCH v5 4/4] MAINTAINERS: Add entry for mpq7920 PMIC driver Saravanan Sekar
@ 2020-01-08 15:58 ` Mark Brown
0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2020-01-08 15:58 UTC (permalink / raw)
To: Saravanan Sekar
Cc: broonie, davem, devicetree, gregkh, heiko, icenowy,
Jonathan.Cameron, laurent.pinchart, lgirdwood, linux-kernel,
Mark Brown, mark.rutland, mchehab+samsung, mripard, robh+dt, sam,
shawnguo, sravanhome
The patch
MAINTAINERS: Add entry for mpq7920 PMIC driver
has been applied to the regulator tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.6
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
From c5bae95b4e60a07dd4f06452ccae5805ed16b40d Mon Sep 17 00:00:00 2001
From: Saravanan Sekar <sravanhome@gmail.com>
Date: Wed, 8 Jan 2020 14:12:34 +0100
Subject: [PATCH] MAINTAINERS: Add entry for mpq7920 PMIC driver
Add MAINTAINERS entry for Monolithic Power Systems mpq7920 PMIC driver.
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Link: https://lore.kernel.org/r/20200108131234.24128-5-sravanhome@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
MAINTAINERS | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index bd5847e802de..73780dbd60a6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11138,6 +11138,13 @@ S: Maintained
F: Documentation/driver-api/serial/moxa-smartio.rst
F: drivers/tty/mxser.*
+MONOLITHIC POWER SYSTEM PMIC DRIVER
+M: Saravanan Sekar <sravanhome@gmail.com>
+S: Maintained
+F: Documentation/devicetree/bindings/regulator/mpq7920.yaml
+F: drivers/regulator/mpq7920.c
+F: drivers/regulator/mpq7920.h
+
MR800 AVERMEDIA USB FM RADIO DRIVER
M: Alexey Klimov <klimov.linux@gmail.com>
L: linux-media@vger.kernel.org
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Applied "regulator: bindings: add document bindings for mpq7920" to the regulator tree
2020-01-08 13:12 ` [PATCH v5 2/4] dt-bindings: regulator: add document bindings for mpq7920 Saravanan Sekar
@ 2020-01-08 15:58 ` Mark Brown
0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2020-01-08 15:58 UTC (permalink / raw)
To: Saravanan Sekar
Cc: broonie, davem, devicetree, gregkh, heiko, icenowy,
Jonathan.Cameron, laurent.pinchart, lgirdwood, linux-kernel,
Mark Brown, mark.rutland, mchehab+samsung, mripard, robh+dt, sam,
shawnguo, sravanhome
The patch
regulator: bindings: add document bindings for mpq7920
has been applied to the regulator tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.6
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
From f5fa59a61ecac5efcb77b294a10134aab358bb5c Mon Sep 17 00:00:00 2001
From: Saravanan Sekar <sravanhome@gmail.com>
Date: Wed, 8 Jan 2020 14:12:32 +0100
Subject: [PATCH] regulator: bindings: add document bindings for mpq7920
Add device tree binding information for mpq7920 regulator driver.
Example bindings for mpq7920 are added.
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Link: https://lore.kernel.org/r/20200108131234.24128-3-sravanhome@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
.../bindings/regulator/mps,mpq7920.yaml | 202 ++++++++++++++++++
1 file changed, 202 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml
diff --git a/Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml b/Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml
new file mode 100644
index 000000000000..598f3ea070c9
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/mps,mpq7920.yaml
@@ -0,0 +1,202 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mps,mpq7920.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Monolithic Power System MPQ7920 PMIC
+
+maintainers:
+ - Saravanan Sekar <sravanhome@gmail.com>
+
+properties:
+ $nodename:
+ pattern: "pmic@[0-9a-f]{1,2}"
+ compatible:
+ enum:
+ - mps,mpq7920
+
+ reg:
+ maxItems: 1
+
+ regulators:
+ type: object
+ description: |
+ list of regulators provided by this controller, must be named
+ after their hardware counterparts BUCK[1-4], one LDORTC, and LDO[2-5]
+
+ mps,switch-freq:
+ description: |
+ switching frequency must be one of following corresponding value
+ 1.1MHz, 1.65MHz, 2.2MHz, 2.75MHz
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 2
+
+ buck1:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 4.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+
+ mps,buck-phase-delay:
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 0
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+
+ mps,buck-ovp-disable:
+ type: boolean
+ description: |
+ disables over voltage protection of this buck
+
+ buck2:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 2.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-phase-delay:
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 0
+
+ mps,buck-ovp-disable:
+ description: |
+ disables over voltage protection of this buck
+ type: boolean
+
+ buck3:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 4.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-phase-delay:
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-ovp-disable:
+ description: |
+ disables over voltage protection of this buck
+ type: boolean
+
+ buck4:
+ type: object
+ $ref: "regulator.yaml#"
+ description: |
+ 2.5A DC-DC step down converter
+
+ mps,buck-softstart:
+ description: |
+ defines the soft start time of this buck, must be one of the following
+ corresponding values 150us, 300us, 610us, 920us
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-phase-delay:
+ description: |
+ defines the phase delay of this buck, must be one of the following
+ corresponding values 0deg, 90deg, 180deg, 270deg
+ $ref: "/schemas/types.yaml#/definitions/uint8"
+ enum: [ 0, 1, 2, 3 ]
+ default: 1
+
+ mps,buck-ovp-disable:
+ description: |
+ disables over voltage protection of this buck
+ type: boolean
+
+ ldortc:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V for RTC, always enabled
+
+ ldo2:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+ ldo3:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+ ldo4:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+ ldo5:
+ $ref: "regulator.yaml#"
+ description: |
+ regulator with 0.65V-3.5875V
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pmic@69 {
+ compatible = "mps,mpq7920";
+ reg = <0x69>;
+
+ regulators {
+ mps,switch-freq = <1>;
+
+ buck1 {
+ regulator-name = "buck1";
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <3587500>;
+ regulator-min-microamp = <460000>;
+ regulator-max-microamp = <7600000>;
+ regulator-boot-on;
+ mps,buck-ovp-disable;
+ mps,buck-phase-delay = <2>;
+ mps,buck-softstart = <1>;
+ };
+
+ ldo2 {
+ regulator-name = "ldo2";
+ regulator-min-microvolt = <650000>;
+ regulator-max-microvolt = <3587500>;
+ };
+ };
+ };
+ };
+...
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Applied "dt-bindings: Add an entry for Monolithic Power System, MPS" to the regulator tree
2020-01-08 13:12 ` [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS Saravanan Sekar
2020-01-08 15:58 ` Mark Brown
@ 2020-01-08 15:58 ` Mark Brown
1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2020-01-08 15:58 UTC (permalink / raw)
To: Saravanan Sekar
Cc: broonie, davem, devicetree, gregkh, heiko, icenowy,
Jonathan.Cameron, laurent.pinchart, lgirdwood, linux-kernel,
Mark Brown, mark.rutland, mchehab+samsung, mripard, robh+dt,
Rob Herring, sam, shawnguo, sravanhome
The patch
dt-bindings: Add an entry for Monolithic Power System, MPS
has been applied to the regulator tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.6
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
From 9399e5dc6b679994872a6039849547c416bb6b05 Mon Sep 17 00:00:00 2001
From: Saravanan Sekar <sravanhome@gmail.com>
Date: Wed, 8 Jan 2020 14:12:31 +0100
Subject: [PATCH] dt-bindings: Add an entry for Monolithic Power System, MPS
Add an entry for Monolithic Power System, MPS
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200108131234.24128-2-sravanhome@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
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 6046f4555852..5eac9d08bfa8 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -605,6 +605,8 @@ patternProperties:
description: MiraMEMS Sensing Technology Co., Ltd.
"^mitsubishi,.*":
description: Mitsubishi Electric Corporation
+ "^mps,.*":
+ description: Monolithic Power Systems, Inc.
"^mosaixtech,.*":
description: Mosaix Technologies, Inc.
"^motorola,.*":
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS
2020-01-08 15:58 ` Mark Brown
@ 2020-01-14 11:10 ` Geert Uytterhoeven
0 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2020-01-14 11:10 UTC (permalink / raw)
To: Mark Brown
Cc: Saravanan Sekar, Liam Girdwood, Rob Herring, Mark Rutland,
Maxime Ripard, Shawn Guo, Heiko Stuebner, Sam Ravnborg, icenowy,
Laurent Pinchart, Greg KH, Jonathan.Cameron, David S. Miller,
Mauro Carvalho Chehab,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Linux Kernel Mailing List
Hi Mark,
On Wed, Jan 8, 2020 at 5:11 PM Mark Brown <broonie@kernel.org> wrote:
> On Wed, Jan 08, 2020 at 02:12:31PM +0100, Saravanan Sekar wrote:
> > "^mitsubishi,.*":
> > description: Mitsubishi Electric Corporation
> > + "^mps,.*":
> > + description: Monolithic Power Systems, Inc.
> > "^mosaixtech,.*":
>
> This isn't sorted properly, since someone else already added MPS in the
> correct place I'll just drop this.
Seems like you applied it a few minutes later regardless?
9399e5dc6b679994 ("dt-bindings: Add an entry for Monolithic Power System, MPS")
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] 11+ messages in thread
end of thread, other threads:[~2020-01-14 11:10 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 13:12 [PATCH v5 0/4] Add regulator support for mpq7920 Saravanan Sekar
2020-01-08 13:12 ` [PATCH v5 1/4] dt-bindings: Add an entry for Monolithic Power System, MPS Saravanan Sekar
2020-01-08 15:58 ` Mark Brown
2020-01-14 11:10 ` Geert Uytterhoeven
2020-01-08 15:58 ` Applied "dt-bindings: Add an entry for Monolithic Power System, MPS" to the regulator tree Mark Brown
2020-01-08 13:12 ` [PATCH v5 2/4] dt-bindings: regulator: add document bindings for mpq7920 Saravanan Sekar
2020-01-08 15:58 ` Applied "regulator: bindings: add document bindings for mpq7920" to the regulator tree Mark Brown
2020-01-08 13:12 ` [PATCH v5 3/4] regulator: mpq7920: add mpq7920 regulator driver Saravanan Sekar
2020-01-08 15:50 ` Mark Brown
2020-01-08 13:12 ` [PATCH v5 4/4] MAINTAINERS: Add entry for mpq7920 PMIC driver Saravanan Sekar
2020-01-08 15:58 ` Applied "MAINTAINERS: Add entry for mpq7920 PMIC driver" to the regulator tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).