[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea76b70e-6060-7c23-48b5-b2e5b35fe85f@linaro.org>
Date: Sun, 27 Nov 2022 22:08:59 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Samuel Holland <samuel@...lland.org>,
Jonathan Cameron <jic23@...nel.org>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
devicetree@...r.kernel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dt-bindings: iio: adc: ti,adc081c: Document the binding
On 27/11/2022 19:01, Samuel Holland wrote:
> On 11/27/22 11:42, Jonathan Cameron wrote:
>> On Sun, 27 Nov 2022 13:51:19 +0100
>> Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:
>>
>>> On 25/11/2022 23:09, Samuel Holland wrote:
>>>> Linux has a driver for these ADCs at drivers/iio/adc/ti-adc081c.c, but
>>>> the compatible strings were undocumented. Add a binding for them. The
>>>> hardware has an alert interrupt output, but existing ti,adc081c users
>>>> do not provide the 'interrupts' property, so leave it as optional.
>>>>
>>>> Signed-off-by: Samuel Holland <samuel@...lland.org>
>>>> ---
>>>>
>>>> .../bindings/iio/adc/ti,adc081c.yaml | 55 +++++++++++++++++++
>>>> 1 file changed, 55 insertions(+)
>>>> create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,adc081c.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,adc081c.yaml b/Documentation/devicetree/bindings/iio/adc/ti,adc081c.yaml
>>>> new file mode 100644
>>>> index 000000000000..caaad777580c
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/iio/adc/ti,adc081c.yaml
>>>> @@ -0,0 +1,55 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/iio/adc/ti,adc081c.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: TI Single-channel I2C ADCs
>>>> +
>>>> +maintainers:
>>>> + - Jonathan Cameron <jic23@...nel.org>
>>>> + - Lars-Peter Clausen <lars@...afoo.de>
>>>> +
>>>> +description: |
>>>> + Single-channel ADC supporting 8, 10, or 12-bit samples and high/low alerts.
>>>> +
>>>> +properties:
>>>> + compatible:
>>>> + enum:
>>>> + - ti,adc081c
>>>> + - ti,adc101c
>>>> + - ti,adc121c
>>>> +
>>>> + reg:
>>>> + maxItems: 1
>>>> +
>>>> + interrupts:
>>>> + maxItems: 1
>>>> +
>>>> + vref-supply:
>>>> + description:
>>>> + Regulator for the combined power supply and voltage reference
>>>> +
>>>> + "#io-channel-cells":
>>>> + const: 1
>>>> +
>>>> +required:
>>>> + - compatible
>>>> + - reg
>>>
>>> Why not requiring io-channel-cells? If it is an IIO ADC provider, you
>>> need the cells, right?
>>
>> Only if anyone is using it as a provider. If it's purely being used via
>> IIO then there are no consumers registered.
>>
>> So historically I've left it up to those defining the binding to decide if
>> they think #io-channel-cells should be required or optional.
>>
>> It gets a bit non obvious with some of the more complex special ADCs on whether
>> they will ever be consumed. This one is generic, so quite likely it will be.
>
> I kept #io-channel-cells optional because there are already a handful of
> boards using ti,adc081c without it.
>
> On the board I am adding (Clockwork DevTerm), the ADC is used a
> temperature sensor for a thermal printer. So whether or not the ADC is
> used as an OF provider depends on how the printer driver gets implemented.
Thanks, it's fine.
Best regards,
Krzysztof
Powered by blists - more mailing lists