Re: [PATCH 1/2] dt-bindings: iio: dac: add support for mcp47a1
David Lechner <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 7/25/26 3:12 AM, Joshua Crofts wrote: > On Sat, 25 Jul 2026 00:04:51 +0100 > Jonathan Cameron <[email protected]> wrote: > >> On Tue, 21 Jul 2026 20:24:38 +0200 >> Joshua Crofts <[email protected]> wrote: >> >>> The Microchip MCP47A1 is a 6-bit volatile Digital-to-Analog converted >>> which communicates via I2C. >>> >>> Signed-off-by: Joshua Crofts <[email protected]> >>> --- >>> .../bindings/iio/dac/microchip,mcp47a1.yaml | 56 ++++++++++++++++++++++ >>> MAINTAINERS | 6 +++ >>> 2 files changed, 62 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/iio/dac/microchip,mcp47a1.yaml b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47a1.yaml >>> new file mode 100644 >>> index 000000000000..3322fca03b3a >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/iio/dac/microchip,mcp47a1.yaml >> >>> + >>> +examples: >>> + - | >>> + i2c { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + >>> + dac@2e { >>> + compatible = "microchip,mcp47a1"; >>> + reg = <0x2e>; >>> + vref-supply = <&vref_regulator>; >>> + vdd-supply = <&vdd_regulator>; >>> + }; >>> + >>> + dac@3e { >>> + compatible = "microchip,mcp47a1"; >> Hi Joshua, >> >> What is the advantage of the second example? I'd drop it. >> > > Hi Jonathan, > > Per the datasheet, the MCP47A1 can have two different I2C slave > addresses (0x2e and 0x3e), which allows two DACs to share the > same bus, something I thought would be good to illustrate in the > example. > I know we haven't done this much historically, but we could make that more obvious with this instead: reg: items: - enum: [0x2e, 0x3e] Then the bindings validator would actually check for a valid address.