From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDD04C4332F for ; Sun, 27 Nov 2022 21:09:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbiK0VJF (ORCPT ); Sun, 27 Nov 2022 16:09:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbiK0VJD (ORCPT ); Sun, 27 Nov 2022 16:09:03 -0500 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E04D558C for ; Sun, 27 Nov 2022 13:09:02 -0800 (PST) Received: by mail-lj1-x232.google.com with SMTP id h5so6870365ljk.11 for ; Sun, 27 Nov 2022 13:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BFXO/ZdPtFpFLdCwGkdQebz3vpWArKXR7PrKFQW6Dxs=; b=zWQBXzeM0tiFaOXdakwLj7/dhxke40mbwENUulJGokGlmc19QrasgxKzAixXq5CZGX zpk385VoY0qdR22b8iPyDor96yjNqNAQ/WtXgmfHizDL9V6ghu7YRNyJ7mDiHmBYzZO1 YWtHoW/CcNUq30Kx/ItUblgaC+A8r2K1UEkEHdM7495ZGgDuSlKuxORlckAeRi0yxai1 A5lMtoIeuRWJs1zqDjxuWDetySWty7S3RJ/XKBqzwqer3ajK997waiYXhj/44Wvxj/Wl ugEYGDCsDMY/hro7WMDqtO4IVjA7yiDpr3lCLozMvbby7fOlJybEC6dt8GryzL94x6SW 3WKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BFXO/ZdPtFpFLdCwGkdQebz3vpWArKXR7PrKFQW6Dxs=; b=0eyac01//ugvL2ZTf27s6Z0+QH/f22d0c3No5hn6rKjVGfzoyZY4O1B5R+LkdXIv04 A2rIEghYi4ErU3Jeh7lGlcDOSKzt4jeShmtaD37Cm7m6yg75pVKERXAGCgb81/TWdTfO gHrI7PD/8LqTRKW1Z3MkT9MJA8GbqADPftcDkyHDAZnW488FDWROatsTZx2sxMYVkpeM TFkTNxTx71t8WnLcanNMxwAMxBIIbF4Af9o/kOvemRVmz80tkYAynuGKyMdLNgRgucws +6XJWZPs+BiFQqGu4fZLrLPstJFGRsEBl+TGRaf4KgUUeYELviVwqpYDNCdJpR1JVzLG L1fQ== X-Gm-Message-State: ANoB5plv6NwwtoICkTTA/q8c4CYigBdJa+RB/5hubzyII3ymnA4HLpHu C4DKa1A3gclWiziWX2OGHKD3uyA8qjn0OJBX X-Google-Smtp-Source: AA0mqf4QuObC2nLAN7sETiquwquoqdWx9FhIpw5ZC1oOtrp7tnJ6ywv7zRPd7Es/4lDNiHT8UPgn6A== X-Received: by 2002:a2e:9007:0:b0:279:84ce:5f71 with SMTP id h7-20020a2e9007000000b0027984ce5f71mr6062064ljg.207.1669583340496; Sun, 27 Nov 2022 13:09:00 -0800 (PST) Received: from [192.168.0.20] (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id o21-20020a056512231500b0049311968ca4sm1404143lfu.261.2022.11.27.13.08.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Nov 2022 13:09:00 -0800 (PST) Message-ID: Date: Sun, 27 Nov 2022 22:08:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] dt-bindings: iio: adc: ti,adc081c: Document the binding Content-Language: en-US To: Samuel Holland , Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221125220903.8632-1-samuel@sholland.org> <20221127174219.34d0406c@jic23-huawei> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 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 >>>> --- >>>> >>>> .../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 >>>> + - Lars-Peter Clausen >>>> + >>>> +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