[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250930-overlord-scion-d60cff2ef1f5@spud>
Date: Tue, 30 Sep 2025 19:58:16 +0100
From: Conor Dooley <conor@...nel.org>
To: Phil Elwell <phil@...pberrypi.com>
Cc: Stanimir Varbanov <svarbanov@...e.de>,
Guenter Roeck <linux@...ck-us.net>, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rpi-kernel@...ts.infradead.org,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
linux-hwmon@...r.kernel.org, Jean Delvare <jdelvare@...e.com>,
Rob Herring <robh@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Stefan Wahren <wahrenst@....net>,
Saenz Julienne <nsaenz@...nel.org>,
Andrea della Porta <andrea.porta@...e.com>,
Jonathan Bell <jonathan@...pberrypi.com>,
Dave Stevenson <dave.stevenson@...pberrypi.com>
Subject: Re: [PATCH 1/4] dt-bindings: Add Raspberry Pi's RP1 ADC
On Tue, Sep 30, 2025 at 11:47:58AM +0100, Phil Elwell wrote:
> Hi Stanimir, Guenter,
>
> On Tue, 30 Sept 2025 at 11:21, Stanimir Varbanov <svarbanov@...e.de> wrote:
> >
> > Hi,
> >
> > On 9/25/25 11:37 PM, Guenter Roeck wrote:
> > > On Thu, Sep 25, 2025 at 08:40:54PM +0100, Conor Dooley wrote:
> > >> On Thu, Sep 25, 2025 at 03:04:13AM +0300, Stanimir Varbanov wrote:
> > >>> Document dt-bindings for Raspberry Pi's RP1 ADC.
> > >>>
> > >>> Signed-off-by: Stanimir Varbanov <svarbanov@...e.de>
> > >>> ---
> > >>> .../bindings/hwmon/raspberrypi,rp1-adc.yaml | 46 +++++++++++++++++++
> > >>> 1 file changed, 46 insertions(+)
> > >>> create mode 100644 Documentation/devicetree/bindings/hwmon/raspberrypi,rp1-adc.yaml
> > >>>
> > >>> diff --git a/Documentation/devicetree/bindings/hwmon/raspberrypi,rp1-adc.yaml b/Documentation/devicetree/bindings/hwmon/raspberrypi,rp1-adc.yaml
> > >>> new file mode 100644
> > >>> index 000000000000..5266b253fd2b
> > >>> --- /dev/null
> > >>> +++ b/Documentation/devicetree/bindings/hwmon/raspberrypi,rp1-adc.yaml
> > >>> @@ -0,0 +1,46 @@
> > >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > >>> +%YAML 1.2
> > >>> +---
> > >>> +$id: http://devicetree.org/schemas/hwmon/raspberrypi,rp1-adc.yaml#
> > >>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > >>> +
> > >>> +title: Rasberry Pi RP1 ADC device
> > >>> +
> > >>> +maintainers:
> > >>> + - Stanimir Varbanov <svarbanov@...e.de>
> > >>> +
> > >>> +description: |
> > >>> + The RP1 ADC is a five input successive-approximation ADC with 12-bit
> > >>> + resolution (ENOB 9.5-bit) at 500kSPS. It has four external inputs
> > >>> + and one internal temperature sensor.
> > >>> +
> > >>> +properties:
> > >>> + compatible:
> > >>> + const: raspberrypi,rp1-adc
> > >>> +
> > >>> + reg:
> > >>> + maxItems: 1
> > >>> +
> > >>> + clocks:
> > >>> + maxItems: 1
> > >>> +
> > >>> + vref-supply:
> > >>> + description:
> > >>> + Reference voltage regulator 3.3V.
> > >>
> > >> Looks like you're missing the io-channels-cells property that allows
> > >> this device to be a provider of adc channels to other devices.
> > >>
> > > Only makes sense if the driver is implemented as iio driver.
> > > Which would be fine with me, assuming this is a generic ADC.
> > > The iio -> hwmon bridge can then be used to instantiate a
> > > hwmon device if needed.
> > >
> >
> > According to the RP1 peripheral document the information about ADC is
> > limited and I cannot be 100% sure that this is generic ADC, but it looks
> > like it is. On RPi5 board the ADC inputs are not configurable, but that
> > could change on another board.
> >
> > I personally don't have objections to implement it as IIO driver.
> >
> > Phil, are you fine with implementing the driver as IIO?
>
> The problem with adding unused functionality, apart from the effort
> involved, is that testing it is harder. Will the IIO driver be
> inherently better/simpler because some of the hwmon support gets
> picked up by the generic IIO/HWMON bridge?
>
> Ultimately we'll make whatever changes are considered necessary in
> order to get this simple driver accepted, but it would be nice to feel
> there was some real world benefit now for the work, not on Pi 6/7/etc.
tbh, I don't care how the driver side of things is done, I would just
like for the binding documentation to be complete. If there's no usecase
at all where the device provides io channels, then omit the property.
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists