All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] regulator: Add Maxim MAX20411 support
@ 2023-01-19 21:47 Bjorn Andersson
  2023-01-19 21:47 ` [PATCH 1/4] dt-bindings: regulator: Describe Maxim MAX20411 Bjorn Andersson
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Bjorn Andersson @ 2023-01-19 21:47 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-kernel,
	devicetree, linux-arm-msm

Introduce binding and driver for the Maxim MAX20411, and wire these up
on the Qualcomm SA8295P ADP.

Bjorn Andersson (4):
  dt-bindings: regulator: Describe Maxim MAX20411
  regulator: Introduce Maxim MAX20411 Step-Down converter
  arm64: dts: qcom: sc8280xp: Add qup1_i2c4
  arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4

 .../bindings/regulator/maxim,max20411.yaml    |  59 +++++++
 arch/arm64/boot/dts/qcom/sa8295p-adp.dts      |  41 +++++
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi        |  16 ++
 drivers/regulator/Kconfig                     |   8 +
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/max20411-regulator.c        | 163 ++++++++++++++++++
 6 files changed, 288 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max20411.yaml
 create mode 100644 drivers/regulator/max20411-regulator.c

-- 
2.37.3


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

* [PATCH 1/4] dt-bindings: regulator: Describe Maxim MAX20411
  2023-01-19 21:47 [PATCH 0/4] regulator: Add Maxim MAX20411 support Bjorn Andersson
@ 2023-01-19 21:47 ` Bjorn Andersson
  2023-01-20  8:21   ` Krzysztof Kozlowski
  2023-01-19 21:47 ` [PATCH 2/4] regulator: Introduce Maxim MAX20411 Step-Down converter Bjorn Andersson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Bjorn Andersson @ 2023-01-19 21:47 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-kernel,
	devicetree, linux-arm-msm

Add binding for the Maxim MAX20411 step-down DC-DC converter.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 .../bindings/regulator/maxim,max20411.yaml    | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max20411.yaml

diff --git a/Documentation/devicetree/bindings/regulator/maxim,max20411.yaml b/Documentation/devicetree/bindings/regulator/maxim,max20411.yaml
new file mode 100644
index 000000000000..3d1ba6139370
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/maxim,max20411.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/maxim,max20411.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim Integrated MAX20411 Step-Down DC-DC Converter
+
+maintainers:
+  - Bjorn Andersson <andersson@kernel.org>
+
+description:
+  The MAX20411 is a high-efficiency, DC-DC step-down converter. It provides
+  configurable output voltage in the range of 0.5V to 1.275V, configurable over
+  I2C.
+
+allOf:
+  - $ref: regulator.yaml#
+
+properties:
+  compatible:
+    const: maxim,max20411
+
+  reg:
+    maxItems: 1
+
+  enable-gpios:
+    maxItems: 1
+    description: GPIO connected to the EN pin, active high
+
+  vdd-supply:
+    description: Input supply for the device (VDD pin, 3.0V to 5.5V)
+
+required:
+  - compatible
+  - reg
+  - enable-gpios
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@39 {
+            compatible = "maxim,max20411";
+            reg = <0x39>;
+
+            enable-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
+
+            regulator-min-microvolt = <800000>;
+            regulator-max-microvolt = <1000000>;
+        };
+    };
+...
-- 
2.37.3


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

* [PATCH 2/4] regulator: Introduce Maxim MAX20411 Step-Down converter
  2023-01-19 21:47 [PATCH 0/4] regulator: Add Maxim MAX20411 support Bjorn Andersson
  2023-01-19 21:47 ` [PATCH 1/4] dt-bindings: regulator: Describe Maxim MAX20411 Bjorn Andersson
@ 2023-01-19 21:47 ` Bjorn Andersson
  2023-01-20 11:47   ` Mark Brown
  2023-01-19 21:47 ` [PATCH 3/4] arm64: dts: qcom: sc8280xp: Add qup1_i2c4 Bjorn Andersson
  2023-01-19 21:47 ` [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4 Bjorn Andersson
  3 siblings, 1 reply; 10+ messages in thread
From: Bjorn Andersson @ 2023-01-19 21:47 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-kernel,
	devicetree, linux-arm-msm

From: Bjorn Andersson <bjorn.andersson@linaro.org>

Introduce a driver to control the Maxim MAX20411 family of
high-efficiency, syncrhonous step-down converters.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 drivers/regulator/Kconfig              |   8 ++
 drivers/regulator/Makefile             |   1 +
 drivers/regulator/max20411-regulator.c | 163 +++++++++++++++++++++++++
 3 files changed, 172 insertions(+)
 create mode 100644 drivers/regulator/max20411-regulator.c

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 820c9a0788e5..aae28d0a489c 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -655,6 +655,14 @@ config REGULATOR_MAX20086
 	  protectorvia I2C bus. The regulator has 2 or 4 outputs depending on
 	  the device model. This driver is only capable to turn on/off them.
 
+config REGULATOR_MAX20411
+	tristate "Maxim MAX20411 High-Efficiency Single Step-Down Converter"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  This driver controls the Maxim MAX20411 family of high-efficiency,
+	  syncrhonous step-down converters.
+
 config REGULATOR_MAX77686
 	tristate "Maxim 77686 regulator"
 	depends on MFD_MAX77686 || COMPILE_TEST
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index b9f5eb35bf5f..ee383d8fc835 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -80,6 +80,7 @@ obj-$(CONFIG_REGULATOR_MAX8973) += max8973-regulator.o
 obj-$(CONFIG_REGULATOR_MAX8997) += max8997-regulator.o
 obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o
 obj-$(CONFIG_REGULATOR_MAX20086) += max20086-regulator.o
+obj-$(CONFIG_REGULATOR_MAX20411) += max20411-regulator.o
 obj-$(CONFIG_REGULATOR_MAX77686) += max77686-regulator.o
 obj-$(CONFIG_REGULATOR_MAX77693) += max77693-regulator.o
 obj-$(CONFIG_REGULATOR_MAX77802) += max77802-regulator.o
diff --git a/drivers/regulator/max20411-regulator.c b/drivers/regulator/max20411-regulator.c
new file mode 100644
index 000000000000..a5139ddc7a84
--- /dev/null
+++ b/drivers/regulator/max20411-regulator.c
@@ -0,0 +1,163 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Ltd.
+ */
+
+#include <linux/gpio/consumer.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/regmap.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/of_regulator.h>
+
+#define MAX20411_UV_STEP		6250
+#define MAX20411_BASE_UV		243750
+#define MAX20411_MIN_SEL		41 /* 0.5V */
+#define MAX20411_MAX_SEL		165 /* 1.275V */
+#define MAX20411_VID_OFFSET		0x7
+#define MAX20411_VID_MASK		0xff
+#define MAX20411_SLEW_OFFSET		0x6
+#define MAX20411_SLEW_DVS_MASK		0xc
+#define MAX20411_SLEW_SR_MASK		0x3
+
+struct max20411 {
+	struct device *dev;
+	struct device_node *of_node;
+	struct regulator_desc desc;
+	struct regulator_dev *rdev;
+	struct regmap *regmap;
+};
+
+static const unsigned int max20411_slew_rates[] = { 13100, 6600, 3300, 1600 };
+
+static int max20411_enable_time(struct regulator_dev *rdev)
+{
+	int voltage, rate, ret;
+	unsigned int val;
+
+	/* get voltage */
+	ret = regmap_read(rdev->regmap, rdev->desc->vsel_reg, &val);
+	if (ret)
+		return ret;
+
+	val &= rdev->desc->vsel_mask;
+	voltage = regulator_list_voltage_linear(rdev, val);
+
+	/* get rate */
+	ret = regmap_read(rdev->regmap, MAX20411_SLEW_OFFSET, &val);
+	if (ret)
+		return ret;
+
+	val = FIELD_GET(MAX20411_SLEW_SR_MASK, val);
+	rate = max20411_slew_rates[val];
+
+	return DIV_ROUND_UP(voltage, rate);
+}
+
+static const struct regmap_config max20411_regmap_config = {
+	.reg_bits		= 8,
+	.val_bits		= 8,
+	.max_register		= 0xe,
+};
+
+static const struct regulator_ops max20411_ops = {
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
+	.list_voltage		= regulator_list_voltage_linear,
+	.enable_time		= max20411_enable_time,
+};
+
+static int max20411_probe(struct i2c_client *client,
+			  const struct i2c_device_id *id)
+{
+	struct regulator_init_data *init_data;
+	struct device *dev = &client->dev;
+	struct regulator_config cfg = {};
+	struct regulator_desc *desc;
+	struct max20411 *max20411;
+
+	max20411 = devm_kzalloc(dev, sizeof(*max20411), GFP_KERNEL);
+	if (!max20411)
+		return -ENOMEM;
+
+	max20411->regmap = devm_regmap_init_i2c(client, &max20411_regmap_config);
+	if (IS_ERR(max20411->regmap)) {
+		dev_err(dev, "Failed to allocate regmap!\n");
+		return PTR_ERR(max20411->regmap);
+	}
+
+	max20411->dev = dev;
+	max20411->of_node = dev->of_node;
+
+	init_data = of_get_regulator_init_data(max20411->dev, max20411->of_node, &max20411->desc);
+	if (!init_data)
+		return -ENODATA;
+
+	desc = &max20411->desc;
+
+	desc->ops = &max20411_ops;
+	desc->owner = THIS_MODULE;
+	desc->type = REGULATOR_VOLTAGE;
+	desc->supply_name = "vin";
+	desc->name = "max20411";
+
+	/*
+	 * voltage = 0.24375V + selector * 6.25mV
+	 * with valid selector between 41 to 165 (0.5V to 1.275V)
+	 */
+	desc->min_uV = MAX20411_BASE_UV;
+	desc->uV_step = MAX20411_UV_STEP;
+	desc->linear_min_sel = MAX20411_MIN_SEL;
+	desc->n_voltages = MAX20411_MAX_SEL;
+
+	desc->vsel_reg = MAX20411_VID_OFFSET;
+	desc->vsel_mask = MAX20411_VID_MASK;
+
+	desc->ramp_reg = MAX20411_SLEW_OFFSET;
+	desc->ramp_mask = MAX20411_SLEW_DVS_MASK;
+	desc->ramp_delay_table = max20411_slew_rates;
+	desc->n_ramp_values = ARRAY_SIZE(max20411_slew_rates);
+
+	cfg.dev = max20411->dev;
+	cfg.init_data = init_data;
+	cfg.of_node = max20411->of_node;
+	cfg.driver_data = max20411;
+
+	cfg.ena_gpiod = gpiod_get(max20411->dev, "enable", GPIOD_ASIS);
+	if (IS_ERR(cfg.ena_gpiod))
+		return dev_err_probe(dev, PTR_ERR(cfg.ena_gpiod),
+				     "unable to acquire enable gpio\n");
+
+	max20411->rdev = devm_regulator_register(max20411->dev, desc, &cfg);
+	if (IS_ERR(max20411->rdev))
+		dev_err(max20411->dev, "Failed to register regulator\n");
+
+	return PTR_ERR_OR_ZERO(max20411->rdev);
+}
+
+static const struct of_device_id of_max20411_match_tbl[] = {
+	{ .compatible = "maxim,max20411", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, of_max20411_match_tbl);
+
+static const struct i2c_device_id max20411_id[] = {
+	{ "max20411", 0 },
+	{ },
+};
+MODULE_DEVICE_TABLE(i2c, max20411_id);
+
+static struct i2c_driver max20411_i2c_driver = {
+	.driver	= {
+		.name = "max20411",
+		.of_match_table	= of_max20411_match_tbl,
+	},
+	.probe = max20411_probe,
+	.id_table = max20411_id,
+};
+module_i2c_driver(max20411_i2c_driver);
+
+MODULE_LICENSE("GPL");
-- 
2.37.3


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

* [PATCH 3/4] arm64: dts: qcom: sc8280xp: Add qup1_i2c4
  2023-01-19 21:47 [PATCH 0/4] regulator: Add Maxim MAX20411 support Bjorn Andersson
  2023-01-19 21:47 ` [PATCH 1/4] dt-bindings: regulator: Describe Maxim MAX20411 Bjorn Andersson
  2023-01-19 21:47 ` [PATCH 2/4] regulator: Introduce Maxim MAX20411 Step-Down converter Bjorn Andersson
@ 2023-01-19 21:47 ` Bjorn Andersson
  2023-01-19 21:47 ` [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4 Bjorn Andersson
  3 siblings, 0 replies; 10+ messages in thread
From: Bjorn Andersson @ 2023-01-19 21:47 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	linux-kernel, devicetree, linux-arm-msm

From: Bjorn Andersson <bjorn.andersson@linaro.org>

Add description of i2c4 on qup1.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
index ea2c8ad37ccb..f971c4176686 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
@@ -901,6 +901,22 @@ qup1: geniqup@ac0000 {
 			ranges;
 
 			status = "disabled";
+
+			qup1_i2c4: i2c@a90000 {
+				compatible = "qcom,geni-i2c";
+				reg = <0 0x00a90000 0 0x4000>;
+				clock-names = "se";
+				clocks = <&gcc GCC_QUPV3_WRAP1_S4_CLK>;
+				interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				power-domains = <&rpmhpd SC8280XP_CX>;
+				interconnects = <&clk_virt MASTER_QUP_CORE_1 0 &clk_virt SLAVE_QUP_CORE_1 0>,
+						<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_QUP_1 0>,
+						<&aggre1_noc MASTER_QUP_1 0 &mc_virt SLAVE_EBI1 0>;
+				interconnect-names = "qup-core", "qup-config", "qup-memory";
+				status = "disabled";
+			};
 		};
 
 		pcie4: pcie@1c00000 {
-- 
2.37.3


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

* [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4
  2023-01-19 21:47 [PATCH 0/4] regulator: Add Maxim MAX20411 support Bjorn Andersson
                   ` (2 preceding siblings ...)
  2023-01-19 21:47 ` [PATCH 3/4] arm64: dts: qcom: sc8280xp: Add qup1_i2c4 Bjorn Andersson
@ 2023-01-19 21:47 ` Bjorn Andersson
  2023-01-20 20:30   ` kernel test robot
                     ` (2 more replies)
  3 siblings, 3 replies; 10+ messages in thread
From: Bjorn Andersson @ 2023-01-19 21:47 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	linux-kernel, devicetree, linux-arm-msm

From: Bjorn Andersson <bjorn.andersson@linaro.org>

The SA8295P ADP has a Maxim max20411 step-down converter on i2c4.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
index 80cb18d9e481..cdb296569d46 100644
--- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
@@ -476,6 +476,31 @@ &pcie4_phy {
 	status = "okay";
 };
 
+&qup1 {
+	status = "okay";
+};
+
+&qup1_i2c4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&qup1_i2c4_state>;
+
+	status = "okay";
+
+	vdd_gfx: regulator@39 {
+		compatible = "maxim,max20411";
+		reg = <0x39>;
+
+		regulator-name = "vdd_gfx";
+		regulator-min-microvolt = <800000>;
+		regulator-max-microvolt = <968750>;
+
+		enable-gpios = <&pmm8540a_gpios 2 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&vdd_gfx_enable_state>;
+	};
+};
+
 &qup2 {
 	status = "okay";
 };
@@ -636,6 +661,14 @@ &xo_board_clk {
 
 /* PINCTRL */
 
+&pmm8540a_gpios {
+	vdd_gfx_enable_state: vdd-gfx-enable-state {
+		pins = "gpio2";
+		function = "normal";
+		output-enable;
+	};
+};
+
 &tlmm {
 	pcie2a_default: pcie2a-default-state {
 		clkreq-n-pins {
@@ -728,4 +761,12 @@ wake-n-pins {
 			bias-pull-up;
 		};
 	};
+
+	qup1_i2c4_state: qup1-i2c4-state {
+		pins = "gpio0", "gpio1";
+		function = "qup12";
+
+		drive-strength = <2>;
+		bias-pull-up;
+	};
 };
-- 
2.37.3


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

* Re: [PATCH 1/4] dt-bindings: regulator: Describe Maxim MAX20411
  2023-01-19 21:47 ` [PATCH 1/4] dt-bindings: regulator: Describe Maxim MAX20411 Bjorn Andersson
@ 2023-01-20  8:21   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-20  8:21 UTC (permalink / raw)
  To: Bjorn Andersson, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-kernel,
	devicetree, linux-arm-msm

On 19/01/2023 22:47, Bjorn Andersson wrote:
> Add binding for the Maxim MAX20411 step-down DC-DC converter.
> 

Subject prefix should probably be "regulator: dt-bindings: ", as per
Mark's requests.

> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---
>  .../bindings/regulator/maxim,max20411.yaml    | 59 +++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max20411.yaml
> 
> diff --git a/Documentation/devicetree/bindings/regulator/maxim,max20411.yaml b/Documentation/devicetree/bindings/regulator/maxim,max20411.yaml
> new file mode 100644
> index 000000000000..3d1ba6139370
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/maxim,max20411.yaml
> @@ -0,0 +1,59 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/maxim,max20411.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Maxim Integrated MAX20411 Step-Down DC-DC Converter
> +
> +maintainers:
> +  - Bjorn Andersson <andersson@kernel.org>
> +
> +description:
> +  The MAX20411 is a high-efficiency, DC-DC step-down converter. It provides
> +  configurable output voltage in the range of 0.5V to 1.275V, configurable over
> +  I2C.
> +
> +allOf:
> +  - $ref: regulator.yaml#
> +
> +properties:
> +  compatible:
> +    const: maxim,max20411
> +
> +  reg:
> +    maxItems: 1
> +
> +  enable-gpios:
> +    maxItems: 1

Drop maxItems, provided by gpio-consumer-common.

> +    description: GPIO connected to the EN pin, active high
> +

With two above:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 2/4] regulator: Introduce Maxim MAX20411 Step-Down converter
  2023-01-19 21:47 ` [PATCH 2/4] regulator: Introduce Maxim MAX20411 Step-Down converter Bjorn Andersson
@ 2023-01-20 11:47   ` Mark Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2023-01-20 11:47 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Liam Girdwood, Rob Herring, Krzysztof Kozlowski, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, linux-kernel, devicetree,
	linux-arm-msm

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

On Thu, Jan 19, 2023 at 01:47:47PM -0800, Bjorn Andersson wrote:

> +	desc->ops = &max20411_ops;
> +	desc->owner = THIS_MODULE;
> +	desc->type = REGULATOR_VOLTAGE;
> +	desc->supply_name = "vin";
> +	desc->name = "max20411";
> +
> +	/*
> +	 * voltage = 0.24375V + selector * 6.25mV
> +	 * with valid selector between 41 to 165 (0.5V to 1.275V)
> +	 */
> +	desc->min_uV = MAX20411_BASE_UV;
> +	desc->uV_step = MAX20411_UV_STEP;
> +	desc->linear_min_sel = MAX20411_MIN_SEL;
> +	desc->n_voltages = MAX20411_MAX_SEL;

Doesn't really matter either way but the more normal way to write
this is to have a static struct with all the fixed values in it
rather than dynamically initialising one at runtime.  Otherwise
this looks good.

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

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

* Re: [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4
  2023-01-19 21:47 ` [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4 Bjorn Andersson
@ 2023-01-20 20:30   ` kernel test robot
  2023-01-21  2:38   ` kernel test robot
  2023-01-21  3:39   ` kernel test robot
  2 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2023-01-20 20:30 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: llvm, oe-kbuild-all, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, linux-kernel, devicetree, linux-arm-msm

Hi Bjorn,

I love your patch! Yet something to improve:

[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on robh/for-next broonie-sound/for-next linus/master v6.2-rc4]
[cannot apply to next-20230120]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bjorn-Andersson/dt-bindings-regulator-Describe-Maxim-MAX20411/20230120-061409
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20230119214749.4048933-5-quic_bjorande%40quicinc.com
patch subject: [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4
config: arm64-randconfig-r012-20230119 (https://download.01.org/0day-ci/archive/20230121/202301210451.KgHMjz0A-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 4196ca3278f78c6e19246e54ab0ecb364e37d66a)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/75c5fbc70a2e2cbd360675e2dc0fb001b3ad6fdf
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Bjorn-Andersson/dt-bindings-regulator-Describe-Maxim-MAX20411/20230120-061409
        git checkout 75c5fbc70a2e2cbd360675e2dc0fb001b3ad6fdf
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> Error: arch/arm64/boot/dts/qcom/sa8295p-adp.dts:502.1-16 Label or path pmm8540a_gpios not found
>> FATAL ERROR: Syntax error parsing input tree

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

* Re: [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4
  2023-01-19 21:47 ` [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4 Bjorn Andersson
  2023-01-20 20:30   ` kernel test robot
@ 2023-01-21  2:38   ` kernel test robot
  2023-01-21  3:39   ` kernel test robot
  2 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2023-01-21  2:38 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: oe-kbuild-all, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, linux-kernel, devicetree, linux-arm-msm

Hi Bjorn,

I love your patch! Yet something to improve:

[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on robh/for-next broonie-sound/for-next linus/master v6.2-rc4]
[cannot apply to next-20230120]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bjorn-Andersson/dt-bindings-regulator-Describe-Maxim-MAX20411/20230120-061409
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20230119214749.4048933-5-quic_bjorande%40quicinc.com
patch subject: [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20230121/202301211057.EQa4jBtA-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/75c5fbc70a2e2cbd360675e2dc0fb001b3ad6fdf
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Bjorn-Andersson/dt-bindings-regulator-Describe-Maxim-MAX20411/20230120-061409
        git checkout 75c5fbc70a2e2cbd360675e2dc0fb001b3ad6fdf
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> Error: arch/arm64/boot/dts/qcom/sa8295p-adp.dts:502.1-16 Label or path pmm8540a_gpios not found
   FATAL ERROR: Syntax error parsing input tree

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

* Re: [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4
  2023-01-19 21:47 ` [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4 Bjorn Andersson
  2023-01-20 20:30   ` kernel test robot
  2023-01-21  2:38   ` kernel test robot
@ 2023-01-21  3:39   ` kernel test robot
  2 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2023-01-21  3:39 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: oe-kbuild-all, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, linux-kernel, devicetree, linux-arm-msm

Hi Bjorn,

I love your patch! Yet something to improve:

[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on robh/for-next broonie-sound/for-next linus/master v6.2-rc4]
[cannot apply to next-20230120]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bjorn-Andersson/dt-bindings-regulator-Describe-Maxim-MAX20411/20230120-061409
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20230119214749.4048933-5-quic_bjorande%40quicinc.com
patch subject: [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20230121/202301211130.XOrJCPF2-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/75c5fbc70a2e2cbd360675e2dc0fb001b3ad6fdf
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Bjorn-Andersson/dt-bindings-regulator-Describe-Maxim-MAX20411/20230120-061409
        git checkout 75c5fbc70a2e2cbd360675e2dc0fb001b3ad6fdf
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   Error: arch/arm64/boot/dts/qcom/sa8295p-adp.dts:502.1-16 Label or path pmm8540a_gpios not found
>> FATAL ERROR: Syntax error parsing input tree

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

end of thread, other threads:[~2023-01-21  3:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 21:47 [PATCH 0/4] regulator: Add Maxim MAX20411 support Bjorn Andersson
2023-01-19 21:47 ` [PATCH 1/4] dt-bindings: regulator: Describe Maxim MAX20411 Bjorn Andersson
2023-01-20  8:21   ` Krzysztof Kozlowski
2023-01-19 21:47 ` [PATCH 2/4] regulator: Introduce Maxim MAX20411 Step-Down converter Bjorn Andersson
2023-01-20 11:47   ` Mark Brown
2023-01-19 21:47 ` [PATCH 3/4] arm64: dts: qcom: sc8280xp: Add qup1_i2c4 Bjorn Andersson
2023-01-19 21:47 ` [PATCH 4/4] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c4 Bjorn Andersson
2023-01-20 20:30   ` kernel test robot
2023-01-21  2:38   ` kernel test robot
2023-01-21  3:39   ` kernel test robot

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.