2022-02-15 09:07:40

by Satya Priya

[permalink] [raw]
Subject: [PATCH V6 0/6] Add Qualcomm Technologies, Inc. PM8008 regulator driver

Satya Priya (6):
dt-bindings: regulator: Add pm8008 regulator bindings
dt-bindings: mfd: pm8008: Add regulators node
mfd: pm8008: Add mfd cell struct to register LDOs
regulator: Add a regulator driver for the PM8008 PMIC
arm64: dts: qcom: pm8008: Add base dts file
arm64: dts: qcom: sc7280: Add pm8008 support for sc7280-idp

.../devicetree/bindings/mfd/qcom,pm8008.yaml | 49 ++++-
.../bindings/regulator/qcom,pm8008-regulator.yaml | 28 +++
arch/arm64/boot/dts/qcom/pm8008.dtsi | 46 +++++
arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 66 +++++++
drivers/mfd/qcom-pm8008.c | 26 ++-
drivers/regulator/Kconfig | 9 +
drivers/regulator/Makefile | 1 +
drivers/regulator/qcom-pm8008-regulator.c | 213 +++++++++++++++++++++
8 files changed, 431 insertions(+), 7 deletions(-)
create mode 100644 Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml
create mode 100644 arch/arm64/boot/dts/qcom/pm8008.dtsi
create mode 100644 drivers/regulator/qcom-pm8008-regulator.c

--
2.7.4


2022-02-15 09:19:27

by Satya Priya

[permalink] [raw]
Subject: [PATCH V6 4/6] regulator: Add a regulator driver for the PM8008 PMIC

Qualcomm Technologies, Inc. PM8008 is an I2C controlled PMIC
containing 7 LDO regulators. Add a PM8008 regulator driver to
support PMIC regulator management via the regulator framework.

Signed-off-by: Satya Priya <[email protected]>
---
Changes in V2:
As per Mark's comments
- Using regmap helpers for regulator enable/disable and is_enabled APIs
- Changed pr_err to dev_err wherever possible.
- Removed init_voltage property as it is not used.
- Removed if check for registering LDOs
- Other minor changes.

Changes in V3:
As per Stephen's comments,
- Removed unused includes
- Removed PM8008_MAX_LDO macro.
- Removed pm8008_read/write APIs, using regmap_bulk_read/write APIs
- Using le16_to_cpu/cpu_to_le16 APIs in pm8008_regulator_get/set_voltage
- Consolidated all probe related functions into single probe function.
- Added of_parse_cb call back and removed regulator-name matching loop.
- Fixed other minor nits.

Changes in V4:
- Removed unused members like rdev and of_node from pm8008_regulator struct.
- Replaced set_voltage with set_voltage_sel
- Removed init_data configuration as it is not needed.
- Removed few other unused assignments from probe

Changes in V5:
- Removed Compatible string.
- Changed the probe function accordingly to probe LDOs using mfd driver.
- Added max headrooms for LDOs and removed the part reading min-dropout from DT.
- Added base reg values in the regulator_data struct instead of reading it from DT.

Changes in V6:
- Using loop to probe the regulators instead of creating separate platform device for
each regulator.
- Removed the of_parse_cb API as we are not parsing any DT properties. Moved slewrate
configuration to probe.
- Fixed other nits.

drivers/regulator/Kconfig | 9 ++
drivers/regulator/Makefile | 1 +
drivers/regulator/qcom-pm8008-regulator.c | 213 ++++++++++++++++++++++++++++++
3 files changed, 223 insertions(+)
create mode 100644 drivers/regulator/qcom-pm8008-regulator.c

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 00559c2..067013b 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -925,6 +925,15 @@ config REGULATOR_PWM
This driver supports PWM controlled voltage regulators. PWM
duty cycle can increase or decrease the voltage.

+config REGULATOR_QCOM_PM8008
+ tristate "Qualcomm Technologies, Inc. PM8008 PMIC regulators"
+ depends on MFD_QCOM_PM8008
+ help
+ Select this option to get support for the voltage regulators
+ of Qualcomm Technologies, Inc. PM8008 PMIC chip. PM8008 has 7 LDO
+ regulators. This driver provides support for basic operations like
+ set/get voltage and enable/disable.
+
config REGULATOR_QCOM_RPM
tristate "Qualcomm RPM regulator driver"
depends on MFD_QCOM_RPM
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 4b8794a..6462fd4 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -101,6 +101,7 @@ obj-$(CONFIG_REGULATOR_MT6380) += mt6380-regulator.o
obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
obj-$(CONFIG_REGULATOR_MTK_DVFSRC) += mtk-dvfsrc-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_LABIBB) += qcom-labibb-regulator.o
+obj-$(CONFIG_REGULATOR_QCOM_PM8008) += qcom-pm8008-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_RPMH) += qcom-rpmh-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_SMD_RPM) += qcom_smd-regulator.o
diff --git a/drivers/regulator/qcom-pm8008-regulator.c b/drivers/regulator/qcom-pm8008-regulator.c
new file mode 100644
index 0000000..917632d
--- /dev/null
+++ b/drivers/regulator/qcom-pm8008-regulator.c
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright (c) 2022, The Linux Foundation. All rights reserved. */
+
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+
+#define STARTUP_DELAY_USEC 20
+#define VSET_STEP_MV 8
+#define VSET_STEP_UV (VSET_STEP_MV * 1000)
+
+#define LDO_ENABLE_REG(base) ((base) + 0x46)
+#define ENABLE_BIT BIT(7)
+
+#define LDO_STATUS1_REG(base) ((base) + 0x08)
+#define VREG_READY_BIT BIT(7)
+
+#define LDO_VSET_LB_REG(base) ((base) + 0x40)
+
+#define LDO_STEPPER_CTL_REG(base) ((base) + 0x3b)
+#define DEFAULT_VOLTAGE_STEPPER_RATE 38400
+#define STEP_RATE_MASK GENMASK(1, 0)
+
+#define PM8008_NUM_LDOS 7
+
+struct regulator_data {
+ const char *name;
+ const char *supply_name;
+ u16 base;
+ int min_uv;
+ int max_uv;
+ int min_dropout_uv;
+ const struct linear_range *voltage_range;
+};
+
+struct pm8008_regulator {
+ struct device *dev;
+ struct regmap *regmap;
+ struct regulator_desc rdesc;
+ u16 base;
+ int step_rate;
+};
+
+static const struct linear_range nldo_ranges[] = {
+ REGULATOR_LINEAR_RANGE(528000, 0, 122, 8000),
+};
+
+static const struct linear_range pldo_ranges[] = {
+ REGULATOR_LINEAR_RANGE(1504000, 0, 237, 8000),
+};
+
+static const struct regulator_data reg_data[] = {
+ /* name parent base min_uv max_uv headroom_uv voltage_range */
+ { "ldo1", "vdd_l1_l2", 0x4000, 528000, 1504000, 225000, nldo_ranges, },
+ { "ldo2", "vdd_l1_l2", 0x4100, 528000, 1504000, 225000, nldo_ranges, },
+ { "ldo3", "vdd_l3_l4", 0x4200, 1504000, 3400000, 300000, pldo_ranges, },
+ { "ldo4", "vdd_l3_l4", 0x4300, 1504000, 3400000, 300000, pldo_ranges, },
+ { "ldo5", "vdd_l5", 0x4400, 1504000, 3400000, 200000, pldo_ranges, },
+ { "ldo6", "vdd_l6", 0x4500, 1504000, 3400000, 200000, pldo_ranges, },
+ { "ldo7", "vdd_l7", 0x4600, 1504000, 3400000, 200000, pldo_ranges, },
+};
+
+static int pm8008_regulator_get_voltage(struct regulator_dev *rdev)
+{
+ struct pm8008_regulator *pm8008_reg = rdev_get_drvdata(rdev);
+ __le16 mV;
+ int rc;
+
+ rc = regmap_bulk_read(pm8008_reg->regmap,
+ LDO_VSET_LB_REG(pm8008_reg->base), (void *)&mV, 2);
+ if (rc < 0) {
+ dev_err(&rdev->dev, "failed to read regulator voltage rc=%d\n", rc);
+ return rc;
+ }
+
+ return le16_to_cpu(mV) * 1000;
+}
+
+static inline int pm8008_write_voltage(struct pm8008_regulator *pm8008_reg,
+ int mV)
+{
+ __le16 vset_raw;
+
+ vset_raw = cpu_to_le16(mV);
+
+ return regmap_bulk_write(pm8008_reg->regmap,
+ LDO_VSET_LB_REG(pm8008_reg->base),
+ (const void *)&vset_raw, sizeof(vset_raw));
+}
+
+static int pm8008_regulator_set_voltage_time(struct regulator_dev *rdev,
+ int old_uV, int new_uv)
+{
+ struct pm8008_regulator *pm8008_reg = rdev_get_drvdata(rdev);
+
+ return DIV_ROUND_UP(abs(new_uv - old_uV), pm8008_reg->step_rate);
+}
+
+static int pm8008_regulator_set_voltage(struct regulator_dev *rdev,
+ unsigned int selector)
+{
+ struct pm8008_regulator *pm8008_reg = rdev_get_drvdata(rdev);
+ int rc, mV;
+
+ /* voltage control register is set with voltage in millivolts */
+ mV = DIV_ROUND_UP(regulator_list_voltage_linear_range(rdev, selector),
+ 1000);
+ if (mV < 0)
+ return mV;
+
+ rc = pm8008_write_voltage(pm8008_reg, mV);
+ if (rc < 0)
+ return rc;
+
+ dev_dbg(&rdev->dev, "voltage set to %d\n", mV * 1000);
+ return 0;
+}
+
+static const struct regulator_ops pm8008_regulator_ops = {
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
+ .set_voltage_sel = pm8008_regulator_set_voltage,
+ .get_voltage = pm8008_regulator_get_voltage,
+ .list_voltage = regulator_list_voltage_linear,
+ .set_voltage_time = pm8008_regulator_set_voltage_time,
+};
+
+static int pm8008_regulator_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct regulator_dev *rdev;
+ struct pm8008_regulator *pm8008_reg;
+ struct regmap *regmap;
+ struct regulator_config reg_config = {};
+ int rc, i;
+ unsigned int reg;
+
+ regmap = dev_get_regmap(dev->parent, NULL);
+ if (!regmap) {
+ dev_err(dev, "parent regmap is missing\n");
+ return -EINVAL;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(reg_data); i++) {
+ pm8008_reg = devm_kzalloc(dev, sizeof(*pm8008_reg), GFP_KERNEL);
+ if (!pm8008_reg)
+ return -ENOMEM;
+
+ pm8008_reg->regmap = regmap;
+ pm8008_reg->dev = dev;
+ pm8008_reg->base = reg_data[i].base;
+
+ /* get slew rate */
+ rc = regmap_bulk_read(pm8008_reg->regmap,
+ LDO_STEPPER_CTL_REG(pm8008_reg->base), &reg, 1);
+ if (rc < 0) {
+ dev_err(dev, "failed to read step rate configuration rc=%d\n", rc);
+ return rc;
+ }
+ reg &= STEP_RATE_MASK;
+ pm8008_reg->step_rate = DEFAULT_VOLTAGE_STEPPER_RATE >> reg;
+
+ pm8008_reg->rdesc.type = REGULATOR_VOLTAGE;
+ pm8008_reg->rdesc.regulators_node = of_match_ptr("regulators");
+ pm8008_reg->rdesc.ops = &pm8008_regulator_ops;
+ pm8008_reg->rdesc.name = reg_data[i].name;
+ pm8008_reg->rdesc.supply_name = reg_data[i].supply_name;
+ pm8008_reg->rdesc.of_match = reg_data[i].name;
+ pm8008_reg->rdesc.uV_step = VSET_STEP_UV;
+ pm8008_reg->rdesc.min_uV = reg_data[i].min_uv;
+ pm8008_reg->rdesc.n_voltages
+ = ((reg_data[i].max_uv - reg_data[i].min_uv)
+ / pm8008_reg->rdesc.uV_step) + 1;
+ pm8008_reg->rdesc.linear_ranges = reg_data[i].voltage_range;
+ pm8008_reg->rdesc.n_linear_ranges = 1;
+ pm8008_reg->rdesc.enable_reg = LDO_ENABLE_REG(pm8008_reg->base);
+ pm8008_reg->rdesc.enable_mask = ENABLE_BIT;
+ pm8008_reg->rdesc.min_dropout_uV = reg_data[i].min_dropout_uv;
+
+ reg_config.dev = dev->parent;
+ reg_config.driver_data = pm8008_reg;
+
+ rdev = devm_regulator_register(dev, &pm8008_reg->rdesc, &reg_config);
+ if (IS_ERR(rdev)) {
+ rc = PTR_ERR(rdev);
+ dev_err(dev, "%s: failed to register regulator rc=%d\n",
+ reg_data[i].name, rc);
+ return rc;
+ }
+ }
+
+ return 0;
+}
+
+static struct platform_driver pm8008_regulator_driver = {
+ .driver = {
+ .name = "qcom,pm8008-regulators",
+ },
+ .probe = pm8008_regulator_probe,
+};
+
+module_platform_driver(pm8008_regulator_driver);
+
+MODULE_DESCRIPTION("Qualcomm PM8008 PMIC Regulator Driver");
+MODULE_LICENSE("GPL");
--
2.7.4

2022-02-15 10:02:55

by Satya Priya

[permalink] [raw]
Subject: [PATCH V6 2/6] dt-bindings: mfd: pm8008: Add regulators node

Add regulators node and their supply nodes. Add separate compatible
"qcom,pm8008-regulators" to differentiate between pm8008 infra
and pm8008 regulators mfd devices.

Signed-off-by: Satya Priya <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Changes in V2:
- As per Rob's comments changed "pm8008[a-z]?-regulator" to
"^pm8008[a-z]?-regulators".

Changes in V3:
- Fixed bot errors.
- As per stephen's comments, changed "^pm8008[a-z]?-regulators$" to
"regulators".

Changes in V4:
- Changed compatible string to "qcom,pm8008-regulators"

Changes in V5:
- Remove compatible for regulators node.
- Move supply nodes of the regulators to chip level.

Changes in V6:
- No changes.

.../devicetree/bindings/mfd/qcom,pm8008.yaml | 49 +++++++++++++++++++---
1 file changed, 44 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
index ec3138c..1ec43f7 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
@@ -16,7 +16,9 @@ description: |

properties:
compatible:
- const: qcom,pm8008
+ enum:
+ - qcom,pm8008
+ - qcom,pm8008-regulators

reg:
description:
@@ -44,6 +46,25 @@ properties:
"#size-cells":
const: 0

+ vdd_l1_l2-supply:
+ description: Input supply phandle of ldo1 and ldo2 regulators.
+
+ vdd_l3_l4-supply:
+ description: Input supply phandle of ldo3 and ldo4 regulators.
+
+ vdd_l5-supply:
+ description: Input supply phandle of ldo5 regulator.
+
+ vdd_l6-supply:
+ description: Input supply phandle of ldo6 regulator.
+
+ vdd_l7-supply:
+ description: Input supply phandle of ldo7 regulator.
+
+ regulators:
+ type: object
+ $ref: "../regulator/qcom,pm8008-regulator.yaml#"
+
patternProperties:
"^gpio@[0-9a-f]+$":
type: object
@@ -88,10 +109,8 @@ patternProperties:
required:
- compatible
- reg
- - interrupts
- "#address-cells"
- "#size-cells"
- - "#interrupt-cells"

additionalProperties: false

@@ -102,7 +121,7 @@ examples:
qupv3_se13_i2c {
#address-cells = <1>;
#size-cells = <0>;
- pm8008i@8 {
+ pm8008_infra: pm8008@8 {
compatible = "qcom,pm8008";
reg = <0x8>;
#address-cells = <1>;
@@ -123,6 +142,26 @@ examples:
#interrupt-cells = <2>;
};
};
- };

+ pm8008_regulators: pm8008@9 {
+ compatible = "qcom,pm8008";
+ reg = <0x9>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ vdd_l1_l2-supply = <&vreg_s8b_1p2>;
+ vdd_l3_l4-supply = <&vreg_s1b_1p8>;
+ vdd_l5-supply = <&vreg_bob>;
+ vdd_l6-supply = <&vreg_bob>;
+ vdd_l7-supply = <&vreg_bob>;
+
+ regulators {
+ pm8008_l1: ldo1 {
+ regulator-name = "pm8008_l1";
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1300000>;
+ };
+ };
+ };
+ };
...
--
2.7.4

2022-02-15 11:01:40

by Satya Priya

[permalink] [raw]
Subject: [PATCH V6 3/6] mfd: pm8008: Add mfd cell struct to register LDOs

Register mfd cell ID and name for each of the 7 pm8008
LDOs to probe them through mfd driver without needing
a separate compatible for regulator driver.

Also, add a different compatible for the mfd node that
contains regulators to make sure that the LDOs are
registered with the correct mfd device.

Signed-off-by: Satya Priya <[email protected]>
---
Changes in V5:
- Changes newly added from V5.

Changes in V6:
- Changed the mfd_cell struct to have only name of the regulator driver.
- Using device_get_match_data() instead of of_match_node() to match data.
- Fixed few nits.

drivers/mfd/qcom-pm8008.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
index c472d7f..a1cf8a9 100644
--- a/drivers/mfd/qcom-pm8008.c
+++ b/drivers/mfd/qcom-pm8008.c
@@ -8,6 +8,7 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
+#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
@@ -27,6 +28,10 @@
#define INT_EN_CLR_OFFSET 0x16
#define INT_LATCHED_STS_OFFSET 0x18

+static const struct mfd_cell pm8008_regulator_devs[] = {
+ MFD_CELL_NAME("qcom,pm8008-regulators"),
+};
+
enum {
PM8008_MISC,
PM8008_TEMP_ALARM,
@@ -35,6 +40,11 @@ enum {
PM8008_NUM_PERIPHS,
};

+enum pm8008_type {
+ PM8008_INFRA,
+ PM8008_REGULATORS,
+};
+
#define PM8008_PERIPH_0_BASE 0x900
#define PM8008_PERIPH_1_BASE 0x2400
#define PM8008_PERIPH_2_BASE 0xC000
@@ -221,6 +231,7 @@ static int pm8008_probe(struct i2c_client *client)
{
int rc;
struct pm8008_data *chip;
+ enum pm8008_type type;

chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
@@ -239,13 +250,24 @@ static int pm8008_probe(struct i2c_client *client)
dev_err(chip->dev, "Failed to probe irq periphs: %d\n", rc);
}

+ type = (uintptr_t) device_get_match_data(chip->dev);
+ if (type == PM8008_REGULATORS) {
+ rc = devm_mfd_add_devices(chip->dev, 0, pm8008_regulator_devs,
+ ARRAY_SIZE(pm8008_regulator_devs), NULL, 0, NULL);
+ if (rc) {
+ dev_err(chip->dev, "Failed to add children: %d\n", rc);
+ return rc;
+ }
+ }
+
return devm_of_platform_populate(chip->dev);
}

static const struct of_device_id pm8008_match[] = {
- { .compatible = "qcom,pm8008", },
- { },
+ { .compatible = "qcom,pm8008", .data = (void *)PM8008_INFRA},
+ { .compatible = "qcom,pm8008-regulators", .data = (void *)PM8008_REGULATORS},
};
+MODULE_DEVICE_TABLE(of, pm8008_match)

static struct i2c_driver pm8008_mfd_driver = {
.driver = {
--
2.7.4

2022-02-15 12:11:36

by Satya Priya

[permalink] [raw]
Subject: [PATCH V6 5/6] arm64: dts: qcom: pm8008: Add base dts file

Add base DTS file for pm8008 with infra and regulator nodes.

Signed-off-by: Satya Priya <[email protected]>
---
Changes in V4:
- This is newly added in V4, to add all the pm8008 common stuff.

Changes in V5:
- Changed the mfd node names from pm8008_chip to pm8008_infra and
pm8008_ldo to pm8008_regulators as they re more appropriate.
- Changed the compatible for pm8008@9 mfd node to differentiate from
pm8008@8 node in driver.
- Removed compatible for regulators node.
- Removed reg property for LDOs and added in driver.

Changes in V6:
- Changed node names to small letters.

arch/arm64/boot/dts/qcom/pm8008.dtsi | 46 ++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 arch/arm64/boot/dts/qcom/pm8008.dtsi

diff --git a/arch/arm64/boot/dts/qcom/pm8008.dtsi b/arch/arm64/boot/dts/qcom/pm8008.dtsi
new file mode 100644
index 0000000..8193d11
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/pm8008.dtsi
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: BSD-3-Clause
+// Copyright (c) 2021, The Linux Foundation. All rights reserved.
+
+pm8008_infra: pm8008@8 {
+ compatible = "qcom,pm8008";
+ reg = <0x8>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+};
+
+pm8008_regulators: pm8008@9 {
+ compatible = "qcom,pm8008-regulators";
+ reg = <0x9>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ regulators {
+ pm8008_l1: ldo1 {
+ regulator-name = "pm8008_l1";
+ };
+
+ pm8008_l2: ldo2 {
+ regulator-name = "pm8008_l2";
+ };
+
+ pm8008_l3: ldo3 {
+ regulator-name = "pm8008_l3";
+ };
+
+ pm8008_l4: ldo4 {
+ regulator-name = "pm8008_l4";
+ };
+
+ pm8008_l5: ldo5 {
+ regulator-name = "pm8008_l5";
+ };
+
+ pm8008_l6: ldo6 {
+ regulator-name = "pm8008_l6";
+ };
+
+ pm8008_l7: ldo7 {
+ regulator-name = "pm8008_l7";
+ };
+ };
+};
--
2.7.4

2022-02-15 14:43:57

by Satya Priya

[permalink] [raw]
Subject: [PATCH V6 1/6] dt-bindings: regulator: Add pm8008 regulator bindings

Add bindings for pm8008 pmic regulators.

Signed-off-by: Satya Priya <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Changes in V2:
- Moved this patch before "mfd: pm8008: Add pm8008 regulator node" to
resolve dtschema errors. Removed regulator-min-microvolt and
regulator-max-microvolt properties.

Changes in V3:
- As per Rob's comments added standard unit suffix for mindropout property,
added blank lines where required and added description for reg property.

Changes in V4:
- Changed compatible string to "com,pm8008-regulators"
- Moved "regulator-min-dropout-voltage-microvolt" to regulator.yaml as
separate patch.

Changes in V5:
- Removed the separate compatible for pm8008 regulator driver.
- Moved the supply nodes to chip level.
- Removed min-dropout property.

Changes in V6:
- Changed regulator node names to small letters.
- Changed regulator-name property to optional.

.../bindings/regulator/qcom,pm8008-regulator.yaml | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml

diff --git a/Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml
new file mode 100644
index 0000000..4ad3189
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/qcom,pm8008-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies, Inc. PM8008 Regulator bindings
+
+maintainers:
+ - Satya Priya <[email protected]>
+
+description:
+ Qualcomm Technologies, Inc. PM8008 is an I2C controlled PMIC
+ containing 7 LDO regulators.
+
+patternProperties:
+ "^ldo[1-7]$":
+ type: object
+ $ref: "regulator.yaml#"
+ description: PM8008 regulator peripherals of PM8008 regulator device
+
+ properties:
+ regulator-name: true
+
+ unevaluatedProperties: false
+
+additionalProperties: false
+...
--
2.7.4

2022-02-15 14:48:29

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH V6 3/6] mfd: pm8008: Add mfd cell struct to register LDOs

Hi Satya,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20220214]
[also build test ERROR on v5.17-rc4]
[cannot apply to robh/for-next broonie-regulator/for-next lee-mfd/for-mfd-next v5.17-rc4 v5.17-rc3 v5.17-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Satya-Priya/Add-Qualcomm-Technologies-Inc-PM8008-regulator-driver/20220215-165525
base: 259cbfc98c55ba3b6ef6e61fb7cfc3751dfded1e
config: i386-randconfig-a005-20220214 (https://download.01.org/0day-ci/archive/20220215/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 37f422f4ac31c8b8041c6b62065263314282dab6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/12b686033a10eae2956b1c8436bfaa8c411baa92
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Satya-Priya/Add-Qualcomm-Technologies-Inc-PM8008-regulator-driver/20220215-165525
git checkout 12b686033a10eae2956b1c8436bfaa8c411baa92
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> drivers/mfd/qcom-pm8008.c:270:38: error: expected ';' after top level declarator
MODULE_DEVICE_TABLE(of, pm8008_match)
^
;
1 error generated.


vim +270 drivers/mfd/qcom-pm8008.c

265
266 static const struct of_device_id pm8008_match[] = {
267 { .compatible = "qcom,pm8008", .data = (void *)PM8008_INFRA},
268 { .compatible = "qcom,pm8008-regulators", .data = (void *)PM8008_REGULATORS},
269 };
> 270 MODULE_DEVICE_TABLE(of, pm8008_match)
271

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

2022-02-15 15:48:43

by Satya Priya

[permalink] [raw]
Subject: [PATCH V6 6/6] arm64: dts: qcom: sc7280: Add pm8008 support for sc7280-idp

Add pm8008_infra and pm8008_regulators support for sc7280 idp.

Signed-off-by: Satya Priya <[email protected]>
---
Changes in V2:
- As per Stephen's comments, replaced '_' with '-' for node names.

Changes in V3:
- Changed the regulator node names as l1, l2 etc
- Changed "pm8008-regulators" to "regulators"
- Changed "qcom,min-dropout-voltage" to "regulator-min-dropout-voltage-microvolt"

Changes in V4:
- Moved all common stuff to pm8008.dtsi and added board specific configurations here.

Changes in V5:
- Changed the node names as per pm8008.dtsi
- Moved supply nodes to chip level (mfd node).
- Removed the regulator-mindropout property.

Changes in V6:
- No changes.

arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 66 ++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
index ecbf2b8..371ad19 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
@@ -263,6 +263,62 @@
};
};

+&i2c1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ #include "pm8008.dtsi"
+};
+
+&pm8008_infra {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pm8008_active>;
+};
+
+&pm8008_regulators {
+ vdd_l1_l2-supply = <&vreg_s8b_1p2>;
+ vdd_l3_l4-supply = <&vreg_s1b_1p8>;
+ vdd_l5-supply = <&vreg_bob>;
+ vdd_l6-supply = <&vreg_bob>;
+ vdd_l7-supply = <&vreg_bob>;
+};
+
+&pm8008_l1 {
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1300000>;
+};
+
+&pm8008_l2 {
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1250000>;
+};
+
+&pm8008_l3 {
+ regulator-min-microvolt = <1650000>;
+ regulator-max-microvolt = <3000000>;
+};
+
+&pm8008_l4 {
+ regulator-min-microvolt = <1504000>;
+ regulator-max-microvolt = <1600000>;
+};
+
+&pm8008_l5 {
+ regulator-min-microvolt = <2600000>;
+ regulator-max-microvolt = <3000000>;
+};
+
+&pm8008_l6 {
+ regulator-min-microvolt = <2600000>;
+ regulator-max-microvolt = <3000000>;
+};
+
+&pm8008_l7 {
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3544000>;
+};
+
&qfprom {
vcc-supply = <&vreg_l1c_1p8>;
};
@@ -375,6 +431,16 @@
drive-strength = <2>;
};

+&pm8350c_gpios {
+ pm8008_active: pm8008_active {
+ pins = "gpio4";
+ function = "normal";
+ bias-disable;
+ output-high;
+ power-source = <0>;
+ };
+};
+
&qspi_cs0 {
bias-disable;
};
--
2.7.4

2022-02-16 04:01:10

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH V6 2/6] dt-bindings: mfd: pm8008: Add regulators node

Quoting Satya Priya (2022-02-15 00:53:47)
> Add regulators node and their supply nodes. Add separate compatible
> "qcom,pm8008-regulators" to differentiate between pm8008 infra
> and pm8008 regulators mfd devices.
>
> Signed-off-by: Satya Priya <[email protected]>
> Reviewed-by: Stephen Boyd <[email protected]>

Please remove my tag.

> Reviewed-by: Rob Herring <[email protected]>
> ---
> Changes in V2:
> - As per Rob's comments changed "pm8008[a-z]?-regulator" to
> "^pm8008[a-z]?-regulators".
>
> Changes in V3:
> - Fixed bot errors.
> - As per stephen's comments, changed "^pm8008[a-z]?-regulators$" to
> "regulators".
>
> Changes in V4:
> - Changed compatible string to "qcom,pm8008-regulators"
>
> Changes in V5:
> - Remove compatible for regulators node.
> - Move supply nodes of the regulators to chip level.
>
> Changes in V6:
> - No changes.
>
> .../devicetree/bindings/mfd/qcom,pm8008.yaml | 49 +++++++++++++++++++---
> 1 file changed, 44 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
> index ec3138c..1ec43f7 100644
> --- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
> +++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
> @@ -44,6 +46,25 @@ properties:
> "#size-cells":
> const: 0
>
> + vdd_l1_l2-supply:
> + description: Input supply phandle of ldo1 and ldo2 regulators.
> +
> + vdd_l3_l4-supply:
> + description: Input supply phandle of ldo3 and ldo4 regulators.
> +
> + vdd_l5-supply:
> + description: Input supply phandle of ldo5 regulator.
> +
> + vdd_l6-supply:
> + description: Input supply phandle of ldo6 regulator.
> +
> + vdd_l7-supply:
> + description: Input supply phandle of ldo7 regulator.
> +
> + regulators:
> + type: object
> + $ref: "../regulator/qcom,pm8008-regulator.yaml#"
> +
> patternProperties:
> "^gpio@[0-9a-f]+$":
> type: object
> @@ -88,10 +109,8 @@ patternProperties:
> required:
> - compatible
> - reg
> - - interrupts
> - "#address-cells"
> - "#size-cells"
> - - "#interrupt-cells"

Shouldn't interrupts and interrupt-cells still be required for
qcom,pm8008? This binding seems like it is for two different nodes.

>
> additionalProperties: false
>
> @@ -102,7 +121,7 @@ examples:
> qupv3_se13_i2c {
> #address-cells = <1>;
> #size-cells = <0>;
> - pm8008i@8 {
> + pm8008_infra: pm8008@8 {
> compatible = "qcom,pm8008";
> reg = <0x8>;
> #address-cells = <1>;
> @@ -123,6 +142,26 @@ examples:
> #interrupt-cells = <2>;
> };
> };
> - };
>
> + pm8008_regulators: pm8008@9 {
> + compatible = "qcom,pm8008";

Isn't this supposed to be "qcom,pm8008-regulators"?

> + reg = <0x9>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + vdd_l1_l2-supply = <&vreg_s8b_1p2>;
> + vdd_l3_l4-supply = <&vreg_s1b_1p8>;
> + vdd_l5-supply = <&vreg_bob>;
> + vdd_l6-supply = <&vreg_bob>;
> + vdd_l7-supply = <&vreg_bob>;
> +
> + regulators {

I still don't get the need for this extra container. Please remove it.

> + pm8008_l1: ldo1 {
> + regulator-name = "pm8008_l1";
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1300000>;
> + };
> + };
> + };
> + };

2022-02-16 06:31:26

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH V6 3/6] mfd: pm8008: Add mfd cell struct to register LDOs

Hi Satya,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20220214]
[also build test ERROR on v5.17-rc4]
[cannot apply to robh/for-next broonie-regulator/for-next lee-mfd/for-mfd-next v5.17-rc4 v5.17-rc3 v5.17-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Satya-Priya/Add-Qualcomm-Technologies-Inc-PM8008-regulator-driver/20220215-165525
base: 259cbfc98c55ba3b6ef6e61fb7cfc3751dfded1e
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220215/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/12b686033a10eae2956b1c8436bfaa8c411baa92
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Satya-Priya/Add-Qualcomm-Technologies-Inc-PM8008-regulator-driver/20220215-165525
git checkout 12b686033a10eae2956b1c8436bfaa8c411baa92
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash drivers/mfd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> drivers/mfd/qcom-pm8008.c:272:1: error: expected ',' or ';' before 'static'
272 | static struct i2c_driver pm8008_mfd_driver = {
| ^~~~~~
In file included from drivers/mfd/qcom-pm8008.c:7:
drivers/mfd/qcom-pm8008.c: In function 'pm8008_mfd_driver_init':
>> drivers/mfd/qcom-pm8008.c:279:19: error: 'pm8008_mfd_driver' undeclared (first use in this function); did you mean 'pm8008_mfd_driver_init'?
279 | module_i2c_driver(pm8008_mfd_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/i2c.h:886:42: note: in definition of macro 'i2c_add_driver'
886 | i2c_register_driver(THIS_MODULE, driver)
| ^~~~~~
include/linux/i2c.h:954:9: note: in expansion of macro 'module_driver'
954 | module_driver(__i2c_driver, i2c_add_driver, \
| ^~~~~~~~~~~~~
drivers/mfd/qcom-pm8008.c:279:1: note: in expansion of macro 'module_i2c_driver'
279 | module_i2c_driver(pm8008_mfd_driver);
| ^~~~~~~~~~~~~~~~~
drivers/mfd/qcom-pm8008.c:279:19: note: each undeclared identifier is reported only once for each function it appears in
279 | module_i2c_driver(pm8008_mfd_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/i2c.h:886:42: note: in definition of macro 'i2c_add_driver'
886 | i2c_register_driver(THIS_MODULE, driver)
| ^~~~~~
include/linux/i2c.h:954:9: note: in expansion of macro 'module_driver'
954 | module_driver(__i2c_driver, i2c_add_driver, \
| ^~~~~~~~~~~~~
drivers/mfd/qcom-pm8008.c:279:1: note: in expansion of macro 'module_i2c_driver'
279 | module_i2c_driver(pm8008_mfd_driver);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:32,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/mfd/qcom-pm8008.c:7:
drivers/mfd/qcom-pm8008.c: In function 'pm8008_mfd_driver_exit':
drivers/mfd/qcom-pm8008.c:279:19: error: 'pm8008_mfd_driver' undeclared (first use in this function); did you mean 'pm8008_mfd_driver_exit'?
279 | module_i2c_driver(pm8008_mfd_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/device/driver.h:267:24: note: in definition of macro 'module_driver'
267 | __unregister(&(__driver) , ##__VA_ARGS__); \
| ^~~~~~~~
drivers/mfd/qcom-pm8008.c:279:1: note: in expansion of macro 'module_i2c_driver'
279 | module_i2c_driver(pm8008_mfd_driver);
| ^~~~~~~~~~~~~~~~~
drivers/mfd/qcom-pm8008.c: In function 'pm8008_mfd_driver_init':
include/linux/device/driver.h:263:1: error: control reaches end of non-void function [-Werror=return-type]
263 | } \
| ^
include/linux/i2c.h:954:9: note: in expansion of macro 'module_driver'
954 | module_driver(__i2c_driver, i2c_add_driver, \
| ^~~~~~~~~~~~~
drivers/mfd/qcom-pm8008.c:279:1: note: in expansion of macro 'module_i2c_driver'
279 | module_i2c_driver(pm8008_mfd_driver);
| ^~~~~~~~~~~~~~~~~
At top level:
drivers/mfd/qcom-pm8008.c:230:12: warning: 'pm8008_probe' defined but not used [-Wunused-function]
230 | static int pm8008_probe(struct i2c_client *client)
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_SOC_LPASS_RX_MACRO
Depends on SOUND && !UML && SND && SND_SOC && COMMON_CLK
Selected by
- SND_SOC_SC7280 && SOUND && !UML && SND && SND_SOC && SND_SOC_QCOM && (I2C && SOUNDWIRE || COMPILE_TEST
WARNING: unmet direct dependencies detected for SND_SOC_LPASS_TX_MACRO
Depends on SOUND && !UML && SND && SND_SOC && COMMON_CLK
Selected by
- SND_SOC_SC7280 && SOUND && !UML && SND && SND_SOC && SND_SOC_QCOM && (I2C && SOUNDWIRE || COMPILE_TEST


vim +272 drivers/mfd/qcom-pm8008.c

6b149f3310a466 Guru Das Srinagesh 2021-05-25 271
6b149f3310a466 Guru Das Srinagesh 2021-05-25 @272 static struct i2c_driver pm8008_mfd_driver = {
6b149f3310a466 Guru Das Srinagesh 2021-05-25 273 .driver = {
6b149f3310a466 Guru Das Srinagesh 2021-05-25 274 .name = "pm8008",
6b149f3310a466 Guru Das Srinagesh 2021-05-25 275 .of_match_table = pm8008_match,
6b149f3310a466 Guru Das Srinagesh 2021-05-25 276 },
6b149f3310a466 Guru Das Srinagesh 2021-05-25 277 .probe_new = pm8008_probe,
6b149f3310a466 Guru Das Srinagesh 2021-05-25 278 };
6b149f3310a466 Guru Das Srinagesh 2021-05-25 @279 module_i2c_driver(pm8008_mfd_driver);
6b149f3310a466 Guru Das Srinagesh 2021-05-25 280

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Subject: Re: [PATCH V6 2/6] dt-bindings: mfd: pm8008: Add regulators node

On 2/15/22 12:53 AM, Satya Priya wrote:
> @@ -102,7 +121,7 @@ examples:
> qupv3_se13_i2c {
> #address-cells = <1>;
> #size-cells = <0>;
> - pm8008i@8 {
> + pm8008_infra: pm8008@8 {
> compatible = "qcom,pm8008";
> reg = <0x8>;
> #address-cells = <1>;
> @@ -123,6 +142,26 @@ examples:
> #interrupt-cells = <2>;
> };
> };
> - };
>
> + pm8008_regulators: pm8008@9 {
> + compatible = "qcom,pm8008";

Should this be "qcom,pm8008-regulators" ?

> + reg = <0x9>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + vdd_l1_l2-supply = <&vreg_s8b_1p2>;
> + vdd_l3_l4-supply = <&vreg_s1b_1p8>;
> + vdd_l5-supply = <&vreg_bob>;
> + vdd_l6-supply = <&vreg_bob>;
> + vdd_l7-supply = <&vreg_bob>;
> +
> + regulators {
> + pm8008_l1: ldo1 {
> + regulator-name = "pm8008_l1";
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1300000>;
> + };
> + };
> + };
> + };
> ...

-Subbaraman

2022-02-16 07:28:52

by Guru Das Srinagesh

[permalink] [raw]
Subject: Re: [PATCH V6 3/6] mfd: pm8008: Add mfd cell struct to register LDOs

On Tue, Feb 15, 2022 at 02:23:48PM +0530, Satya Priya wrote:
> static const struct of_device_id pm8008_match[] = {
> - { .compatible = "qcom,pm8008", },
> - { },
> + { .compatible = "qcom,pm8008", .data = (void *)PM8008_INFRA},
> + { .compatible = "qcom,pm8008-regulators", .data = (void *)PM8008_REGULATORS},

Typo perhaps: Please set the last element of this array to the sentinel value NULL.
{},

> };
> +MODULE_DEVICE_TABLE(of, pm8008_match)

Missing a semicolon at the end.

>
> static struct i2c_driver pm8008_mfd_driver = {
> .driver = {

2022-02-16 09:50:40

by Satya Priya

[permalink] [raw]
Subject: Re: [PATCH V6 3/6] mfd: pm8008: Add mfd cell struct to register LDOs


On 2/16/2022 8:28 AM, Guru Das Srinagesh wrote:
> On Tue, Feb 15, 2022 at 02:23:48PM +0530, Satya Priya wrote:
>> static const struct of_device_id pm8008_match[] = {
>> - { .compatible = "qcom,pm8008", },
>> - { },
>> + { .compatible = "qcom,pm8008", .data = (void *)PM8008_INFRA},
>> + { .compatible = "qcom,pm8008-regulators", .data = (void *)PM8008_REGULATORS},
> Typo perhaps: Please set the last element of this array to the sentinel value NULL.
> {},


Yes, I'll correct this.


>> };
>> +MODULE_DEVICE_TABLE(of, pm8008_match)
> Missing a semicolon at the end.


Yes, will add it.


Thanks.

2022-02-16 09:50:42

by Satya Priya

[permalink] [raw]
Subject: Re: [PATCH V6 2/6] dt-bindings: mfd: pm8008: Add regulators node


On 2/16/2022 7:34 AM, Stephen Boyd wrote:
> Quoting Satya Priya (2022-02-15 00:53:47)
>> Add regulators node and their supply nodes. Add separate compatible
>> "qcom,pm8008-regulators" to differentiate between pm8008 infra
>> and pm8008 regulators mfd devices.
>>
>> Signed-off-by: Satya Priya <[email protected]>
>> Reviewed-by: Stephen Boyd <[email protected]>
> Please remove my tag.


Okay


>> Reviewed-by: Rob Herring <[email protected]>
>> ---
>> Changes in V2:
>> - As per Rob's comments changed "pm8008[a-z]?-regulator" to
>> "^pm8008[a-z]?-regulators".
>>
>> Changes in V3:
>> - Fixed bot errors.
>> - As per stephen's comments, changed "^pm8008[a-z]?-regulators$" to
>> "regulators".
>>
>> Changes in V4:
>> - Changed compatible string to "qcom,pm8008-regulators"
>>
>> Changes in V5:
>> - Remove compatible for regulators node.
>> - Move supply nodes of the regulators to chip level.
>>
>> Changes in V6:
>> - No changes.
>>
>> .../devicetree/bindings/mfd/qcom,pm8008.yaml | 49 +++++++++++++++++++---
>> 1 file changed, 44 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
>> index ec3138c..1ec43f7 100644
>> --- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
>> +++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
>> @@ -44,6 +46,25 @@ properties:
>> "#size-cells":
>> const: 0
>>
>> + vdd_l1_l2-supply:
>> + description: Input supply phandle of ldo1 and ldo2 regulators.
>> +
>> + vdd_l3_l4-supply:
>> + description: Input supply phandle of ldo3 and ldo4 regulators.
>> +
>> + vdd_l5-supply:
>> + description: Input supply phandle of ldo5 regulator.
>> +
>> + vdd_l6-supply:
>> + description: Input supply phandle of ldo6 regulator.
>> +
>> + vdd_l7-supply:
>> + description: Input supply phandle of ldo7 regulator.
>> +
>> + regulators:
>> + type: object
>> + $ref: "../regulator/qcom,pm8008-regulator.yaml#"
>> +
>> patternProperties:
>> "^gpio@[0-9a-f]+$":
>> type: object
>> @@ -88,10 +109,8 @@ patternProperties:
>> required:
>> - compatible
>> - reg
>> - - interrupts
>> - "#address-cells"
>> - "#size-cells"
>> - - "#interrupt-cells"
> Shouldn't interrupts and interrupt-cells still be required for
> qcom,pm8008?


No, these are not strictly required.


> This binding seems like it is for two different nodes.


This binding is for the same node with different SIDs 8 and 9, having
different set of peripherals.


>> additionalProperties: false
>>
>> @@ -102,7 +121,7 @@ examples:
>> qupv3_se13_i2c {
>> #address-cells = <1>;
>> #size-cells = <0>;
>> - pm8008i@8 {
>> + pm8008_infra: pm8008@8 {
>> compatible = "qcom,pm8008";
>> reg = <0x8>;
>> #address-cells = <1>;
>> @@ -123,6 +142,26 @@ examples:
>> #interrupt-cells = <2>;
>> };
>> };
>> - };
>>
>> + pm8008_regulators: pm8008@9 {
>> + compatible = "qcom,pm8008";
> Isn't this supposed to be "qcom,pm8008-regulators"?


Yes, I'll correct this.


>> + reg = <0x9>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + vdd_l1_l2-supply = <&vreg_s8b_1p2>;
>> + vdd_l3_l4-supply = <&vreg_s1b_1p8>;
>> + vdd_l5-supply = <&vreg_bob>;
>> + vdd_l6-supply = <&vreg_bob>;
>> + vdd_l7-supply = <&vreg_bob>;
>> +
>> + regulators {
> I still don't get the need for this extra container. Please remove it.


Okay.


>> + pm8008_l1: ldo1 {
>> + regulator-name = "pm8008_l1";
>> + regulator-min-microvolt = <950000>;
>> + regulator-max-microvolt = <1300000>;
>> + };
>> + };
>> + };
>> + };

2022-02-16 09:51:17

by Satya Priya

[permalink] [raw]
Subject: Re: [PATCH V6 2/6] dt-bindings: mfd: pm8008: Add regulators node


On 2/16/2022 10:01 AM, Subbaraman Narayanamurthy wrote:
> On 2/15/22 12:53 AM, Satya Priya wrote:
>> @@ -102,7 +121,7 @@ examples:
>> qupv3_se13_i2c {
>> #address-cells = <1>;
>> #size-cells = <0>;
>> - pm8008i@8 {
>> + pm8008_infra: pm8008@8 {
>> compatible = "qcom,pm8008";
>> reg = <0x8>;
>> #address-cells = <1>;
>> @@ -123,6 +142,26 @@ examples:
>> #interrupt-cells = <2>;
>> };
>> };
>> - };
>>
>> + pm8008_regulators: pm8008@9 {
>> + compatible = "qcom,pm8008";
> Should this be "qcom,pm8008-regulators" ?


Yes, I'll correct it.


Thanks.


>> + reg = <0x9>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + vdd_l1_l2-supply = <&vreg_s8b_1p2>;
>> + vdd_l3_l4-supply = <&vreg_s1b_1p8>;
>> + vdd_l5-supply = <&vreg_bob>;
>> + vdd_l6-supply = <&vreg_bob>;
>> + vdd_l7-supply = <&vreg_bob>;
>> +
>> + regulators {
>> + pm8008_l1: ldo1 {
>> + regulator-name = "pm8008_l1";
>> + regulator-min-microvolt = <950000>;
>> + regulator-max-microvolt = <1300000>;
>> + };
>> + };
>> + };
>> + };
>> ...
> -Subbaraman