From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB1B23B5854 for ; Mon, 29 Jun 2026 07:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782717115; cv=none; b=PUkrXo3z9gfetPrUSuEQ+eMw1JGq84envkIeAx+6YZj7zG7MZmOxtnXESrmGZG2+dOeSNS728Li0mpMDAqWUiwP0JRB1IRqp79qo9/g5tIrX1k6I3H0UmdKhHmuyncEDsyLfgQl1JZLwCaf7TNbt99thJrqmagsbk+mTfI0HfGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782717115; c=relaxed/simple; bh=4xPgIzs1Ct0nCYvo63JBCNqk45nAfIG3AogfSxV3MSY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b22hTIUnCm01SAjVTr9i4/a2Ac9if0nxcsXHBv35wl8aCnYyXD+AZKN/mQOve/CFLSfaveR1EVWQ55fod60gYYFuSRfp9+kKzrvrkVtNJYv6GbjyIxDAjj5ypacWiQ3POXFFvWcDWLi4xOPQ+cglOAJVflUvgjxSE1det7Lsf6U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=n1XRu3xJ; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n1XRu3xJ" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-c85a297d2d2so2047636a12.0 for ; Mon, 29 Jun 2026 00:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782717113; x=1783321913; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ocU4bbQQvRYUjNRGEheDIX/JjGUc9Z8ZjL6L4LmeVWQ=; b=n1XRu3xJ4TlskXVUEZx6N5nscC+IIi1wj6Ofgz0NJFHqkn9LJnyOJ60sj6Qamizzp3 6Zvl+KX39c3DHnubybUKFVhNqILclFYDYIpcfccaZFpofnHtuWIrI8C0AyQ1SJx+1egy 74e5+XDZ7cjpsn7xXy5re4x/kuppvl1IbYs624bZloiaU4YUtYMNu4o4zbbYxOhMRFhM DrVi20RBt+o72I1Uqc1kftRunzGSMegjLU+lqaQHKyzY+ZmJ1xyDfscCjM0fpIWjN6mc j+wr9jLiSX7MulWjqa7WgF1ijXCM7RdAY0TKsU2BM6f4Pei93MXbgwc7of2FtyIRh1aM u6Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782717113; x=1783321913; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ocU4bbQQvRYUjNRGEheDIX/JjGUc9Z8ZjL6L4LmeVWQ=; b=WlJXP5m51kBk8WGImEScjcZyUF5uF3JZSs0T3WFoGeHu5qkybfvqsfNTUPjs73WoUI eASoNAcv8+vcQBebh/i5z177QkSN3pTRRLqhAOz+fjDNz5Q1M31w5VemrxfkMwwslsCP jVNVbUlP8VqV59EhBiK+yPfe3pmflv7XPvWGjlnRuEqiCmkPmCXZ6YDku8Lh0uycPaOZ 54oTTMLuWoKEsFzcS1iB+X7ER5/MredPJ7uuBWyeIKWdzqTRbgiwePPozWoGbgY1Q3o/ lwpqD3/3nZtT3UdKSWFgoejUutGZ8RcUYG27jHWYuR1gKZ6fi6AmR96UOJOGMt9Kb9Pn 5cAw== X-Forwarded-Encrypted: i=1; AHgh+RpUZ7p7kn+zwuEfBU9QETciQY3ZlcrBnCUBp/3tH8vS4nyGC3urxu/OoSuaX3vcnSI+Qw3lGgUO7Fy6JHY=@vger.kernel.org X-Gm-Message-State: AOJu0YwVZKtaFMdiVcYriuJetWEwcgsWUC+9DZC9uYWNMU6ShByTf3Yd 3xbywT/cbOBWgG9Q/WQEv53SHnIwC28dbbOT/VXTzgcmex7lO5iaDt76 X-Gm-Gg: AfdE7cl0D6KHMB75Z2FbxGQIHiDHEvMO9PBYc27C0TV8WIsov0blV5yDkd4wv+okUzx xRU8VM8zMiWWcBvLxGMvlljQRidNKsLZ52wgnjpM0Xy5JXrEZVXv5vYEwSD2MF7m+uSmiputtRc DEvwk1Vnu8Ej2rJvV86K7SlWpSTbJBzZkGeAWglvAxVC2wWiibsDtvwhRmd4yJg6g8x1agBvilO 4Bmmign87nnyPUtZadS2RFcwd7bGAB2wEiZrM57FPRGtRFsV/G6MOU6+E4M0I2RxZJA0I7xpG4j ybpCFQTl47b+a5/9/ThZqulCdIRN3Vc/u5WJjI8roiQIDQX2pqgG/gp+pHliRbu2/njcfyJwh8n 1z9E05fBrDPk13MmVPa3z/xcx4RGdpWRPUNepUSDa3rnzsOvbwz8EY1Yd90PxAZCptARHaJy7yQ rlz8xYb9bKyBznKWLZ1qAclUKG1Sdp6xmxjBKkaCO1CZryvrd2rmPaHaTYqhzRUaTx X-Received: by 2002:a05:6a00:8005:b0:845:d284:9e14 with SMTP id d2e1a72fcca58-845d284a9e5mr8108752b3a.59.1782717113038; Mon, 29 Jun 2026 00:11:53 -0700 (PDT) Received: from [172.19.1.42] (60-250-196-139.hinet-ip.hinet.net. [60.250.196.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-845ebe987fcsm2596068b3a.39.2026.06.29.00.11.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jun 2026 00:11:52 -0700 (PDT) Message-ID: <7e96cc1a-eb60-4eeb-937d-64e83bc35279@gmail.com> Date: Mon, 29 Jun 2026 15:11:48 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] dt-bindings: iio: adc: Add Nuvoton MA35D1 EADC To: David Lechner , jic23@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: nuno.sa@analog.com, andy@kernel.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, cwweng@nuvoton.com References: <20260625110638.38438-1-cwweng.linux@gmail.com> <20260625110638.38438-2-cwweng.linux@gmail.com> <40485b4e-6585-42a1-9b84-3019328574c5@baylibre.com> Content-Language: en-US From: Chi-Wen Weng In-Reply-To: <40485b4e-6585-42a1-9b84-3019328574c5@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi David, Thanks for the review. > Datasheet says there are 4 interrupts. Yes, the controller has four EOC interrupt outputs, ADINT0 to ADINT3. The initial driver only uses ADINT0, but the hardware does provide four interrupt lines. I will update the binding to allow up to four interrupt entries and document the order as ADINT0, ADINT1, ADINT2 and ADINT3. The example will keep a single interrupt entry since that is the only one used by the initial driver. > Should there be an optional vref-supply for the V_REF pin? Yes, I agree. I will add an optional vref-supply property. I will also update the driver so that it does not force the external reference path unconditionally. If vref-supply is present, the driver will enable it and use it to report the ADC scale. Otherwise, the driver will use the internal reference path. > Should there be a dmas property? Datasheet says it supports PDMA transfer. The hardware does support PDMA, but DMA support is intentionally not included in this initial upstream version. The initial driver will only support interrupt-driven direct raw reads, and the MA35D1 PDMA provider is not upstream yet. I would prefer to leave dmas/dma-names out of the initial binding and add them later together with DMA support. Please let me know if you would prefer optional DMA properties to be described now. > I assume 8 is for the internal batter voltage channel? Often, we don't > include fixed internal channels like this in the devicetree since they > are always the same and don't depend on external wiring. Correct. Channels 0 to 7 are the external ADC input pins, while channel 8 is the internal VBAT input. I will limit the DT child channel nodes to external channels 0 to 7. If VBAT support is added later, it can be exposed by the driver as a fixed internal channel rather than being described by devicetree. > adc.yaml already specifies minItems and maxItems, so we don't need to > repeat it. Since I plan to simplify v2 and drop differential channel support from the initial submission, I will remove diff-channels from the initial binding. Differential input support can be added later once the fixed hardware pair constraints and signed output handling are implemented in the driver. > This (and reg) are uint32, so don't really need minimum: 0. > > Also, I assume that 8 is for the internal battery voltage channel, > which wouldn't make sense as part of a differential input. Will fix. The v2 binding will restrict child nodes to external channels 0 to 7 and drop the unnecessary minimum: 0. Thanks, Chi-Wen David Lechner 於 2026/6/28 上午 04:05 寫道: > On 6/25/26 6:06 AM, Chi-Wen Weng wrote: >> From: Chi-Wen Weng >> >> Add devicetree binding for the Enhanced ADC controller found on >> Nuvoton MA35D1 SoCs. >> >> The controller has one register region, one interrupt and one functional >> clock. ADC inputs are described using standard channel child nodes, >> including optional differential channel pairs. >> >> Signed-off-by: Chi-Wen Weng >> --- >> .../bindings/iio/adc/nuvoton,ma35d1-eadc.yaml | 100 ++++++++++++++++++ >> 1 file changed, 100 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/iio/adc/nuvoton,ma35d1-eadc.yaml >> >> diff --git a/Documentation/devicetree/bindings/iio/adc/nuvoton,ma35d1-eadc.yaml b/Documentation/devicetree/bindings/iio/adc/nuvoton,ma35d1-eadc.yaml >> new file mode 100644 >> index 000000000000..ae7ad0f7689a >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iio/adc/nuvoton,ma35d1-eadc.yaml >> @@ -0,0 +1,100 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/iio/adc/nuvoton,ma35d1-eadc.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Nuvoton MA35D1 Enhanced Analog to Digital Converter >> + >> +maintainers: >> + - Chi-Wen Weng >> + >> +description: | >> + The Nuvoton MA35D1 Enhanced Analog to Digital Converter (EADC) is a >> + 12-bit ADC controller integrated in the MA35D1 SoC. Each enabled ADC >> + input is described by a child channel node. >> + >> +properties: >> + compatible: >> + const: nuvoton,ma35d1-eadc >> + >> + reg: >> + maxItems: 1 >> + >> + interrupts: >> + maxItems: 1 > Datasheet says there are 4 interrupts. > >> + >> + clocks: >> + maxItems: 1 > Should there be an optional vref-supply for the V_REF pin? > > Should there be a dmas property? Datasheet says it supports > PDMA transfer. > >> + >> + '#address-cells': >> + const: 1 >> + >> + '#size-cells': >> + const: 0 >> + >> +patternProperties: >> + '^channel@[0-8]$': >> + type: object >> + $ref: adc.yaml >> + unevaluatedProperties: false >> + >> + properties: >> + reg: >> + minimum: 0 >> + maximum: 8 > I assume 8 is for the internal batter voltage channel? Often, we don't > include fixed internal channels like this in the devicetree since they > are always the same and don't depend on external wiring. > >> + >> + diff-channels: >> + minItems: 2 >> + maxItems: 2 > adc.yaml already specifies minItems and maxItems, so we don't need to repeat it. > >> + items: >> + minimum: 0 >> + maximum: 8 > This (and reg) are uint32, so don't really need minimum: 0. > > Also, I assume that 8 is for the internal battery voltage channel, which > wouldn't make sense as part of a differential input. > >> + >> + required: >> + - reg >> + >> +required: >> + - compatible >> + - reg >> + - interrupts >> + - clocks >> + - '#address-cells' >> + - '#size-cells' >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include >> + #include >> + #include >> + >> + soc { >> + #address-cells = <2>; >> + #size-cells = <2>; >> + >> + adc@40430000 { >> + compatible = "nuvoton,ma35d1-eadc"; >> + reg = <0x0 0x40430000 0x0 0x10000>; >> + interrupts = ; >> + clocks = <&clk EADC_GATE>; >> + >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + channel@0 { >> + reg = <0>; >> + }; >> + >> + channel@1 { >> + reg = <1>; >> + }; >> + >> + channel@2 { >> + reg = <2>; >> + diff-channels = <2 3>; >> + }; >> + }; >> + }; >> +...