Skip to contentSkip to conversation

dt-bindings: iio: dac: add mcp4728.yaml

PATCH Superseded Andrea Collamati 2 participants 5 messages Jul 16, 2023 – Jul 20, 2023 1 message not in the archive

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/2 dt-bindings: iio: dac: add mcp4728.yaml

Add documentation for mcp4728

---
 .../bindings/iio/dac/microchip,mcp4728.yaml   | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml
Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml new file +42 -0
new file mode 100644
index 000000000000..c971d34794db
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4728.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip mcp4728 DAC
+
+maintainers:
+  - Andrea Collamati <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - microchip,mcp4728
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: |
+      Provides both power and acts as the reference supply on the mcp4728
+      when Internal Vref is not selected.
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mcp4728@60 {
+            compatible = "microchip,mcp4728";
+            reg = <0x60>;
+            vdd-supply = <&vdac_vdd>;
+        };
+    };
Signature · 1 line
2.34.1
#2 lore raw
Quoted 3 lines · Andrea Collamati

Add documentation for mcp4728

What changed? Where is the changelog?

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Quoted 16 lines
---
 .../bindings/iio/dac/microchip,mcp4728.yaml   | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml
Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml new file +5 -0
new file mode 100644
index 000000000000..c971d34794db
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4728.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml new file +10 -0
+
+title: Microchip mcp4728 DAC
+
+maintainers:
+  - Andrea Collamati <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - microchip,mcp4728

No improvements.

Quoted 12 lines
Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml new file +12 -0
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: |
+      Provides both power and acts as the reference supply on the mcp4728
+      when Internal Vref is not selected.
+
+required:
+  - compatible
+  - reg
+  - vdd-supply

Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml line 37

Quoted 10 lines
Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml new file +10 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mcp4728@60 {

This is a friendly reminder during the review process.

It seems my previous comments were not fully addressed. Maybe my feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.

All of the comments seem to be ignored. I don't understand why you decided not to respond to me.

To clarify: there is already binding for it - mcp4725.

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 iio: add mcp4728 I2C DAC driver

In reply to a message not in the archive

mcp4728 is a 12-bit quad channel DAC with I2C interface.

support for:
* per-channel gain
* per-channel power state
* per-channel power down mode control
* per-channel vref selection internal/vdd
* store current state to on-chip EEPROM

---
 drivers/iio/dac/Kconfig   |  12 +
 drivers/iio/dac/Makefile  |   1 +
 drivers/iio/dac/mcp4728.c | 635 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 648 insertions(+)
 create mode 100644 drivers/iio/dac/mcp4728.c
drivers/iio/dac/Kconfig +12 -0
index 3acd9c3f388e..fa1516f6a285 100644
@@ -389,6 +389,18 @@ config MCP4725
 	  To compile this driver as a module, choose M here: the module
 	  will be called mcp4725.
 
+config MCP4728
+	tristate "MCP4728 DAC driver"
+	depends on I2C
+	help
+	  Say Y here if you want to build a driver for the Microchip
+	  MCP4728 quad channel, 12-bit digital-to-analog converter (DAC)
+	  with I2C interface.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called mcp4728.
+
+
 config MCP4922
 	tristate "MCP4902, MCP4912, MCP4922 DAC driver"
 	depends on SPI
drivers/iio/dac/Makefile +1 -0
index addd97a78838..5b2bac900d5a 100644
@@ -41,6 +41,7 @@ obj-$(CONFIG_MAX517) += max517.o
 obj-$(CONFIG_MAX5522) += max5522.o
 obj-$(CONFIG_MAX5821) += max5821.o
 obj-$(CONFIG_MCP4725) += mcp4725.o
+obj-$(CONFIG_MCP4728) += mcp4728.o
 obj-$(CONFIG_MCP4922) += mcp4922.o
 obj-$(CONFIG_STM32_DAC_CORE) += stm32-dac-core.o
 obj-$(CONFIG_STM32_DAC) += stm32-dac.o
drivers/iio/dac/mcp4728.c new file +635 -0

635 lines not on this page · raw message

Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH v2 2/2] iio: add mcp4728 I2C DAC driver

Quoted 11 lines · Andrea Collamati

mcp4728 is a 12-bit quad channel DAC with I2C interface.

support for:
* per-channel gain
* per-channel power state
* per-channel power down mode control
* per-channel vref selection internal/vdd
* store current state to on-chip EEPROM

---

What changed? Are you saying you ignored entire review you got?

Quoted 16 lines
 drivers/iio/dac/Kconfig   |  12 +
 drivers/iio/dac/Makefile  |   1 +
 drivers/iio/dac/mcp4728.c | 635 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 648 insertions(+)
 create mode 100644 drivers/iio/dac/mcp4728.c
drivers/iio/dac/Kconfig +2 -0
index 3acd9c3f388e..fa1516f6a285 100644
@@ -389,6 +389,18 @@ config MCP4725
 	  To compile this driver as a module, choose M here: the module
 	  will be called mcp4725.
 
+config MCP4728
+	tristate "MCP4728 DAC driver"

drivers/iio/dac/Kconfig config MCP4725 · line 403

Quoted 10 lines
drivers/iio/dac/Kconfig +10 -0
+	depends on I2C
+	help
+	  Say Y here if you want to build a driver for the Microchip
+	  MCP4728 quad channel, 12-bit digital-to-analog converter (DAC)
+	  with I2C interface.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called mcp4728.
+
+

Why two blank lines?

Quoted 5 lines
drivers/iio/dac/Kconfig +0 -0
 config MCP4922
 	tristate "MCP4902, MCP4912, MCP4922 DAC driver"
 	depends on SPI
drivers/iio/dac/Makefile +0 -0
index addd97a78838..5b2bac900d5a 100644

...

drivers/iio/dac/Makefile

Quoted 12 lines
drivers/iio/dac/Makefile +12 -0
+
+static void mcp4728_remove(struct i2c_client *client)
+{
+	struct iio_dev *indio_dev = i2c_get_clientdata(client);
+	struct mcp4728_data *data = iio_priv(indio_dev);
+
+	iio_device_unregister(indio_dev);
+	regulator_disable(data->vdd_reg);
+}
+
+static const struct i2c_device_id mcp4728_id[] = { { "mcp4728", MCP4728 }, {} };
+MODULE_DEVICE_TABLE(i2c, mcp4728_id);

Yeah, my feedback was ignored.

That's not how it works. Anyway, I doubt that it should be a new driver.

If Jonathan agrees to have new/duplicated drivers, then fine with me, but then don't ignore the comments. Instead:

It seems my previous comments were not fully addressed. Maybe my feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH v2 2/2] iio: add mcp4728 I2C DAC driver

Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · Andrea Collamati

mcp4728 is a 12-bit quad channel DAC with I2C interface.

support for:
* per-channel gain
* per-channel power state
* per-channel power down mode control
* per-channel vref selection internal/vdd
* store current state to on-chip EEPROM

Quoted 3 lines
Quoted 2 lines

---

What changed? Are you saying you ignored entire review you got?

I didn't ignored, but I didn't list the changes. I will look at other emails to understand how to write v2 v3 ... changes..Sorry.

Quoted 34 lines
Quoted 15 lines

drivers/iio/dac/Kconfig | 12 +
drivers/iio/dac/Makefile | 1 +
drivers/iio/dac/mcp4728.c | 635 ++++++++++++++++++++++++++++++++++++++

3 files changed, 648 insertions(+)

create mode 100644 drivers/iio/dac/mcp4728.c

drivers/iio/dac/Kconfig +0 -0
index 3acd9c3f388e..fa1516f6a285 100644
@@ -389,6 +389,18 @@ config MCP4725

To compile this driver as a module, choose M here: the module will be called mcp4725.

drivers/iio/dac/Kconfig +2 -0
+config MCP4728
+ tristate "MCP4728 DAC driver"

drivers/iio/dac/Kconfig config MCP4725 · line 403

Quoted 10 lines
drivers/iio/dac/Kconfig +10 -0
+ depends on I2C
+ help
+ Say Y here if you want to build a driver for the Microchip
+ MCP4728 quad channel, 12-bit digital-to-analog converter (DAC)
+ with I2C interface.
+
+ To compile this driver as a module, choose M here: the module
+ will be called mcp4728.
+
+

Why two blank lines?

Quoted 5 lines

config MCP4922
tristate "MCP4902, MCP4912, MCP4922 DAC driver"
depends on SPI

drivers/iio/dac/Makefile +0 -0
index addd97a78838..5b2bac900d5a 100644

...

Quoted 12 lines

drivers/iio/dac/Makefile

Quoted 12 lines
drivers/iio/dac/Makefile +12 -0
+
+static void mcp4728_remove(struct i2c_client *client)
+{
+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
+ struct mcp4728_data *data = iio_priv(indio_dev);
+
+ iio_device_unregister(indio_dev);
+ regulator_disable(data->vdd_reg);
+}
+
+static const struct i2c_device_id mcp4728_id[] = { { "mcp4728", MCP4728 }, {} };
+MODULE_DEVICE_TABLE(i2c, mcp4728_id);

Sorry.. I fixed but then I code formatter replace the old one. I will pay more attention..

besides clang-format and checkpatch are there any other tools to avoid these formatting errors?

Thank you

Quoted 11 lines

Yeah, my feedback was ignored.

That's not how it works. Anyway, I doubt that it should be a new driver.

If Jonathan agrees to have new/duplicated drivers, then fine with me, but then don't ignore the comments. Instead:

It seems my previous comments were not fully addressed. Maybe my feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.

Ok.

Quoted 3 lines

Best regards,
Krzysztof