From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65695606A333 for ; Thu, 3 Dec 2026 17:07:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lEkk8Qav; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=W8tFTxyc DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=mLyHX/kw4g8vNYGzksR78+bvW64KYL+G1lvRe8SIjnE=; b=lEkk8QavZUuxcktNYo//G2Hitl io6cmVBis1ez4AQqXsDAQBc/KyxQC6KXhnV0RmUJDVcl+vyTXTn6N66N/HgpJIWV+otoWEeU3qyvW 89VPfE3aBR00RHoWS+P4W0f+g8Oyaxxrd8jw04CDGkr3ex4NcrBwNrl2Y7eyezrVT0fwvbYOgxL5f eLgSTwQ5F02N0OD+YSIJrmM9CimlwYatvg4GaQPnufrfIlNnUIytmaTRMz5z0Yj6i+QMQiZlAYagv x9dB4kWn48NXtnrRbNHg9VrhVuKC46GvWz1AaOmBh5m9MEbfFIu+HwOy4MtGy4I0HrOnr2Sr7/3Mb 3PfHvrtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZAHN-0000000FNTx-1Zll; Thu, 03 Dec 2026 17:07:33 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZAHL-0000000FNTQ-02bT for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2026 17:07:31 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 407C94467A; Thu, 3 Dec 2026 17:07:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FA681F00893; Thu, 3 Dec 2026 17:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796317649; bh=mLyHX/kw4g8vNYGzksR78+bvW64KYL+G1lvRe8SIjnE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=W8tFTxyc85PErzEkxsvPp0mJ2fxqNT1QeC+m0lFHqRwVfLafeqf7JSFfzBLLxCpcF scHMCpVxdoHTSaRFVkBcNPPaea8R/eJxm0snA7lZdpKE6cBizFMjijibTrRuDUJP0G fzzzSW9IAC3Tn5FIdCU8xIkS63/yXstyHO4l0OTqQpJN6Eh4Rx4ezVTkg3k1FlFQ3c +23VgejkhMeMRb3vZJPVrw1sqOXyV/ASdJnCfN5W/jXFkXgV7MehPYgEvKor7fDltD 5TjOa0O+W5vs9S1cCMDBaYaoMMc3plkAiRYw4rvyjMjZeaDm0+o1rz6OgJz/zTnKPF Eyr71O/4J3w2Q== Date: Thu, 3 Dec 2026 17:07:22 +0000 From: Conor Dooley To: Olivier MOYSAN Cc: Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Philipp Zabel , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , Philipp Stanner , Arnaud Pouliquen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Fabrice Gasnier , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-sound@vger.kernel.org Subject: Re: [PATCH v2 01/11] dt-bindings: iio: adc: add stm32mp2 mdf filter Message-ID: <20261203-acuteness-front-db9dccc3746e@spud> References: <20261118-upstream_mdf_v2-v2-0-7939d3c3720a@foss.st.com> <20261118-upstream_mdf_v2-v2-1-7939d3c3720a@foss.st.com> <20261123-barbecue-trickily-4ae8d9f01b3d@spud> X-Archived-By: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+knHKMEvnBm4oGcQ" Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 --+knHKMEvnBm4oGcQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 25, 2026 at 04:58:22PM +0100, Olivier MOYSAN wrote: > Hi Conor, >=20 > On 11/23/26 18:30, Conor Dooley wrote: > > With an eye to accepting something of this nature, rather than a rework, > > I have some initial questions before suggesting some remodeling of what > > is here. > >=20 > > On Wed, Nov 18, 2026 at 04:17:46PM +0100, Olivier Moysan wrote: > > > Add bindings that describes STM32 MDF settings to support > > > digital filtering for Pulse Density Modulation (PDM) microphones > > > and analog sigma delta modulators, on STM32MP2 SoCs. > > >=20 > > > Signed-off-by: Olivier Moysan > > > --- > > > .../bindings/iio/adc/st,stm32mp25-mdf.yaml | 341 ++++++++++= +++++++++++ > > > 1 file changed, 341 insertions(+) > > >=20 > > > diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32mp25-m= df.yaml b/Documentation/devicetree/bindings/iio/adc/st,stm32mp25-mdf.yaml > > > new file mode 100644 > > > index 000000000000..e4925a38012d > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32mp25-mdf.yaml > > > @@ -0,0 +1,341 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/iio/adc/st,stm32mp25-mdf.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: STMicroelectronics STM32 Multi-function Digital Filter (MDF) = ADC > > > + > > > +maintainers: > > > + - Olivier Moysan > > > + > > > +description: | > > > + STM32 MDF ADC is a sigma delta analog-to-digital converter dedicat= ed to > > > + interface external sigma delta modulators to STM32 micro controlle= rs. > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - st,stm32mp23-mdf > > > + - st,stm32mp25-mdf > > > + > > > + reg: > > > + minItems: 1 > > > + maxItems: 2 > > > + > > > + clocks: > > > + maxItems: 1 > > > + > > > + "#clock-cells": > > > + enum: [0, 1] > > > + > > > + clock-output-names: > > > + description: | > > > + CCK0 and CCK1 are optional output clocks, which share the same= clock frequency, > > > + but can be gated independently to save power. > > > + minItems: 1 > > > + items: > > > + - enum: [cck0, cck1] > > > + - const: cck1 > > > + > > > + "#address-cells": > > > + const: 1 > > > + > > > + "#size-cells": > > > + const: 1 > > > + > > > + ranges: true > > > + > > > + resets: > > > + maxItems: 1 > > > + > > > + access-controllers: > > > + maxItems: 1 > > > + > > > + power-domains: > > > + maxItems: 1 > > > + > > > + st,interleave: > > > + description: | > > > + Number of interleaved filters, starting from filter 0. For a v= alue N, > > > + filters 0 through N - 1 participate in interleaving. Their sam= ples are > > > + multiplexed into a single channel and retrieved through the de= vice > > > + associated with filter 0. Filters 1 through N - 1 must be enab= led and > > > + inherit their configuration from filter 0. If absent, interlea= ving is > > > + disabled. > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + minimum: 2 > > > + maximum: 8 > > > + > > > +required: > > > + - compatible > > > + - reg > > > + - ranges > > > + - clocks > > > + - "#address-cells" > > > + - "#size-cells" > > > + > > > +additionalProperties: false > > > + > > > +patternProperties: > > > + "^sitf@[0-9]+$": > > > + type: object > > > + description: | > > > + Serial interface configuration, managed by the MDF core. Pin c= ontrol > > > + states for the serial interface pins belong to the MDF parent = node. > > > + > > > + properties: > > > + reg: > > > + description: Specify the SITF serial interface instance > > > + maxItems: 1 > > > + > > > + clocks: > > > + description: | > > > + Serial interface clock (optional depending on interface mo= de) > > > + maxItems: 1 > > > + > > > + st,sitf-mode: > > > + description: | > > > + Select serial interface protocol > > > + - spi: SPI mode > > > + - lf_spi: low frequency SPI mode for low power applications > > > + $ref: /schemas/types.yaml#/definitions/string > > > + enum: > > > + - spi > > > + - lf_spi > > > + > > > + required: > > > + - reg > > > + - st,sitf-mode > > > + > > > + additionalProperties: false > > > + > > > + "^filter@[0-9]+$": > > > + type: object > > > + description: Digital filter path child node > > > + > > > + properties: > > > + compatible: > > > + enum: > > > + - st,stm32mp25-mdf-dmic > > > + - st,stm32mp25-mdf-adc > >=20 > > These two compatibles don't represent different hardware, just different > > roles from the same hardware, right? > >=20 >=20 > Yes, both compatibles refer to the same MDF filter hardware. They > distinguish two uses of that filter: IIO data acquisition and digital > microphone audio capture through ASoC framework. Different compatibles for the same hardware for different use cases like this is not something we permit. Seems like you should be able to differentiate use case based on whether you have dai or iio properties in the node. The main iio or w/e driver should be able to set the kernel up to deal with whether not the iio or asoc code paths should be taken without probing individual drivers from DT for each node. On top of that, compatibles for channels like this isn't something we want either. >=20 > > > + > > > + reg: > > > + description: Specify the MDF filter instance > > > + maxItems: 1 I also wonder if this reg property is implemented incorrectly. It feels like this should be size cells of 0, address cells of 1, to match the numbering in the documentation. Binning compatibles for these nodes, and therefore not actually probing a mmio driver based on them, means the driver could translate a 1 into whatever offset that actually represents. It's the same for the SITFs too. Numbers matching the docs are also much more natural for anyone actually implementing something using this binding, rather than having to look at the register map to figure out what the right reg entry is for the setup they have. > > > + > > > + interrupts: > > > + maxItems: 1 > > > + > > > + dmas: > > > + maxItems: 1 > > > + > > > + dma-names: > > > + items: > > > + - const: rx > > > + > > > + "#io-channel-cells": > > > + const: 1 > > > + > > > + '#address-cells': > > > + const: 1 > > > + > > > + '#size-cells': > > > + const: 0 > > > + > > > + st,cic-mode: > > > + description: | > > > + Cascaded-integrator-comb (CIC) filter configuration > > > + - 0: MCIC & ACIC filters in FastSinc mode > > > + - [1-3]: MCIC & ACIC filters in Sinc mode order 1 to 3 > > > + - [4-5]: Single CIC filter in Sinc mode order 4 to 5 > > > + For audio purpose it is recommended to use CIC Sinc4 or Si= nc5 > > > + This property is mandatory for filter 0 or filters not use= d in interleave mode. > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + minimum: 0 > > > + maximum: 5 > > > + > > > + st,delay: > > > + description: Filter delay in samples > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + maximum: 127 > > > + > > > + st,rs-filter-bypass: > > > + description: Bypass RSFLT reshaping filter. > > > + $ref: /schemas/types.yaml#/definitions/flag > > > + > > > + st,hpf-filter-cutoff-bp: > > > + description: | > > > + High Pass Filter (HPF) cut-off frequency expressed as a fr= action of the PCM sampling rate. > > > + Cut-off frequency =3D st,hpf-filter-cutoff-bp x Fpcm / 100= 00. > > > + If this property is not defined the HPF is disabled. > > > + enum: [625, 1250, 2500, 9500] > > > + > > > + st,sync: > > > + description: > > > + Synchronize to another filter. > > > + Must contain the phandle of the filter providing the synch= ronization. > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/phandle-array > > > + - maxItems: 1 > > > + > >=20 > > > + st,sitf: > > > + $ref: /schemas/types.yaml#/definitions/phandle-array > > > + items: > > > + - items: > > > + - description: Phandle of the serial interface connect= ed to the digital filter > > > + - description: | > > > + The phandle's argument selects the bitstream on th= e falling or rising edge > > > + of the serial interface clock: > > > + - 0: rising edge > > > + - 1: falling edge > > > + enum: [0, 1] > > > + default: 0 > > > + description: > > > + Should be phandle/bitstream pair. > >=20 > > Can this ever be more than a single phandle? > >=20 >=20 > Each MDF filter selects a single bitstream from one serial interface. The > property contains only one phandle plus one argument that selects the ris= ing > or falling clock edge. How does this differ from what the channels property is doing? I don't understand what the channel property actually represents, since this seems to be pointing at the mdf input that this filter uses. >=20 > > > + > > > + mdf-dai: > > > + type: object > > > + description: Audio interface for the MDF filter > > > + > > > + properties: > > > + compatible: > > > + const: st,stm32mp25-mdf-dai The "mdf-dai" node doesn't seem like it actually even represents a device and exists just as another convenience for probing a linux driver. > > > + > > > + "#sound-dai-cells": > > > + const: 0 > > > + > > > + io-channels: > > > + description: > > > + From common IIO binding. Used to pipe external sigma d= elta > > > + modulator or internal ADC output to MDF channel. Especially if the example is accurate and this just points to its own parent node... > > > + > > > + power-domains: > > > + maxItems: 1 > > > + > > > + port: > > > + $ref: /schemas/sound/audio-graph-port.yaml# > > > + unevaluatedProperties: false > > > + > > > + required: > > > + - compatible > > > + - "#sound-dai-cells" > > > + - io-channels > > > + > > > + additionalProperties: false > > > + > > > + required: > > > + - compatible > > > + - reg > > > + - interrupts > > > + - dmas > > > + - dma-names > > > + - "#io-channel-cells" > > > + - "#address-cells" > > > + - "#size-cells" > > > + - st,sitf > > > + > > > + patternProperties: > > > + "^channel@([0-7])$": > > > + type: object > > > + $ref: adc.yaml > > > + description: Represents the external channel which is connec= ted to the MDF. > > > + > > > + properties: > > > + reg: > > > + maximum: 7 > > > + > > > + io-backends: > > > + description: > > > + Used to pipe external sigma delta modulator or interna= l ADC backend to MDF > > > + channel. > > > + maxItems: 1 > > > + > > > + required: > > > + - reg > > > + > > > + unevaluatedProperties: false > > > + > > > + allOf: > > > + - if: > > > + properties: > > > + compatible: > > > + contains: > > > + const: st,stm32mp25-mdf-adc > > > + > > > + then: > > > + patternProperties: > > > + "^channel@[0-7]$": > > > + required: > > > + - io-backends > > > + properties: > > > + mdf-dai: false > > > + > > > + unevaluatedProperties: false > > > + > > > +examples: > > > + - | > > > + #include > > > + #include > > > + mdf1: filter@504d0000 { > > > + compatible =3D "st,stm32mp25-mdf"; > > > + ranges =3D <0 0x504d0000 0x1000>; > > > + reg =3D <0x504d0000 0x8>, <0x504d0ff0 0x10>; > > > + #address-cells =3D <1>; > > > + #size-cells =3D <1>; > > > + clocks =3D <&rcc CK_KER_MDF1>; > > > + #clock-cells =3D <1>; > > > + clock-output-names =3D "cck0", "cck1"; > > > + > > > + sitf5: sitf@300 { > > > + reg =3D <0x300 0x4>; > > > + st,sitf-mode =3D "spi"; > > > + clocks =3D <&mdf1 0>; > > > + assigned-clocks =3D <&mdf1 0>; > > > + assigned-clock-rates =3D <2048000>; > > > + }; > > > + > > > + filter0: filter@84 { > > > + compatible =3D "st,stm32mp25-mdf-dmic"; > > > + reg =3D <0x84 0x70>; > > > + #io-channel-cells =3D <1>; > > > + interrupts =3D ; > > > + dmas =3D <&hpdma 63 0x63 0x12 0>; > > > + dma-names =3D "rx"; > > > + st,cic-mode =3D <5>; > > > + st,sitf =3D <&sitf5 0>; > > > + #address-cells =3D <1>; > > > + #size-cells =3D <0>; > > > + > > > + channel@0 { > > > + reg =3D <0>; > > > + }; > > > + > > > + mdf-dai { > > > + compatible =3D "st,stm32mp25-mdf-dai"; > > > + #sound-dai-cells =3D <0>; > > > + io-channels =3D <&filter0 0>; > > > + }; > > > + }; > > > + > > > + filter@104 { > > > + compatible =3D "st,stm32mp25-mdf-adc"; > > > + reg =3D <0x104 0x70>; > > > + #io-channel-cells =3D <1>; > > > + interrupts =3D ; > > > + dmas =3D <&hpdma 64 0x63 0x12 0>; > > > + dma-names =3D "rx"; > > > + st,cic-mode =3D <2>; > > > + st,sitf =3D <&sitf5 1>; > >=20 > > Is this a realistic example, with multiple devices connected to the same > > sitf? I assume it is technically possible, given what I have seen in the > > docs but would anyone do this in reality? > >=20 >=20 > Yes, sharing the same SITF clock and data line for stereo audio capture i= s a > realistic use case. The microphones drive the data line on opposite clock > edges, so two MDF filters can capture the two channels independently. This > use case is documented here: > https://wiki.st.com/stm32mpu/wiki/MDF_device_tree_configuration#MDF_audio= _example >=20 > What is probably not realistic in the example, is to mix audio and analog > use cases (through st,stm32mp25-mdf-dmic and st,stm32mp25-mdf-adc). This = was > done to shorten the example. Maybe it would be worth splitting the audio = and > analog use cases. Perhaps it would, wouldn't be a big change either so no harm in doing it. Thanks, Conor. > > > + #address-cells =3D <1>; > > > + #size-cells =3D <0>; > > > + > > > + channel@1 { > > > + reg =3D <1>; > > > + settling-time-us =3D <1000>; > > > + io-backends =3D <&sd_adc1>; > > > + }; > > > + }; > > > + }; > > > + > > > +... > > >=20 > > > --=20 > > > 2.43.0 > > >=20 >=20 --+knHKMEvnBm4oGcQ Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCaxGhygAKCRB4tDGHoIJi 0q1lAQDPMUU0xp/0aiaCh8hAFD6isqsi2QdriijirNwLcQBQjwEAgVUkoYcEbTv5 dp3fEButwMu0SYyssuWnAG4DbZuvzgQ= =Mlnj -----END PGP SIGNATURE----- --+knHKMEvnBm4oGcQ--