From patchwork Mon Feb 13 16:38:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud POULIQUEN X-Patchwork-Id: 9570271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18D8460442 for ; Mon, 13 Feb 2017 16:55:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0521226212 for ; Mon, 13 Feb 2017 16:55:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA4DF26CFC; Mon, 13 Feb 2017 16:55:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DE5226212 for ; Mon, 13 Feb 2017 16:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wV5BidrvReiwha98piDW12Ccg5iPexgdyMqKcdxU2zE=; b=ginqOP0VtttsNh d4eCQxgQnYvn96GzTsVaV5vKQXmTz+ZKjoCY1D3UGYBZOJFly5oD2qFXwp/6lUjCS8zCLnZA8Y/zt TgNJravIPUCIOdp6j6wTf/l7UbA0OP1Mm/IR0sW+n2ZMuOjgfISpHXnniEu2LZtnJUDIhuDsZOuBY pmNn+uB6oRzgwEWg79AuRzJWbMo+yvtbC97kDqzXM6uHQoJMIHHn8w1F8s27JxSLdJAV2hP15v3ly v1aD3kIT3nE0OIy/tLP/U1rQTsg8nJvqQ+HzGWfg3nzsNcDATWo12P/fL53RAug3/dmo7m0r9KZNe uDFutNjWm9a+pX7/E8wQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cdJuI-0007Rk-9V; Mon, 13 Feb 2017 16:55:18 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cdJuF-000671-LQ for linux-arm-kernel@bombadil.infradead.org; Mon, 13 Feb 2017 16:55:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0t/jnhFuFszEeq0r5WxD5BJ5TpCJziKUKGq/y77rBU4=; b=cpxiLLq3iiROgMhXEUbxGcOsf kpE5ALmBkwwivZsEiIXM/ExObJnyBbxSZv1DYQonR6S7vcF66UZNmrPo+8tf7remS02Q8ZIhTn648 +9Geh1X+/bYbbV0d0dNSVCp/dJJmnXlQcLSh5L6M+uzYtI33NmtxUK4cXLABZbkbg9v/3eZkq9gNb x7XRoC1OA1J306aLtjAeo0p65o1qJ+/h7wd4xEFwuXZ02yFU7gSuCm6NwApbWZQdobrkNVAimgQ/Y 8sMqjImv73TrrAAPWuAql9mTCGRjIQvsDXQzBS3teZYqMHlicQbPiTMFtmpYTTN8BdNz+HZo9QEyH a+szbajLw==; Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cdJfD-0003xt-Ro for linux-arm-kernel@lists.infradead.org; Mon, 13 Feb 2017 16:39:47 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by m0046037.ppops.net (8.16.0.11/8.16.0.11) with SMTP id v1DGYXXn016257; Mon, 13 Feb 2017 17:39:13 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-.pphosted.com with ESMTP id 28hs8wbd5w-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 13 Feb 2017 17:39:13 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E125E31; Mon, 13 Feb 2017 16:39:12 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A1AF82836; Mon, 13 Feb 2017 16:39:12 +0000 (GMT) Received: from localhost (10.201.23.162) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 13 Feb 2017 17:39:12 +0100 From: Arnaud Pouliquen To: Rob Herring , Mark Rutland , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown Subject: [RFC v2 6/7] IIO: add bindings for stm32 DFSDM filter Date: Mon, 13 Feb 2017 17:38:28 +0100 Message-ID: <1487003909-11710-7-git-send-email-arnaud.pouliquen@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487003909-11710-1-git-send-email-arnaud.pouliquen@st.com> References: <1487003909-11710-1-git-send-email-arnaud.pouliquen@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.162] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-13_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170213_163943_970816_39040E0C X-CRM114-Status: GOOD ( 19.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, olivier moysan , kernel@stlinux.com, linux-iio@vger.kernel.org, arnaud.pouliquen@st.com, Maxime Coquelin , linux-arm-kernel@lists.infradead.org, Alexandre Torgue Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add bindings that describe Digital Filter for Sigma Delta Modulators. DFSDM allows to connect sigma delta modulators and/or PDM microphones. Signed-off-by: Arnaud Pouliquen --- .../bindings/iio/adc/st,stm32-dfsdm-adc.txt | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt new file mode 100644 index 0000000..83937cb --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt @@ -0,0 +1,125 @@ +STMicroelectronics STM32 DFSDM ADC device driver + + +STM32 DFSDM ADC is a sigma delta analog-to-digital converter dedicted to +interface external sigma delta modulators to stm32 micro controlers. +it is mainly targeted for: +- Sigma delta modulators ( motor control, metering...) +- PDM microphones ( audio digital microphone) + +It featured with up to 8 serial digital interface (SPI or Manchester) and +up to 4 filters. + +Each instance of the sub-drivers uses one filter instance. + +Contents of a stm32 dfsdmc root node: +------------------------------------- +Required properties: +- compatible: Should be "st,stm32-dfsdm-adc". +- reg: Offset and length of the DFSDM block register set. +- clocks: IP and serial interfaces clocking. Should be set according + to rcc clock ID and "clock-names". +- clock-names: Input clock name "dfsdm" must be defined, + "audio" is optional. If defined CLKOUT is based on the audio + clock, else "dfsdm" is used. +- clocks: Clock for the analog circuitry (common to all ADCs). +- clock-names: Must be "adc". + +Optional properties: +- st,clkout-freq: needed for SPI master mode + SPI clock OUT frequency (Hz).This clock must be set according + to "clock" property. Frequency must be a multiple of the rcc + clock frequency. If not, clkout frequency will not be + accurate. + +Contents of a stm32 DFSDM child nodes: +---------------------------------------- + +Required properties: +- compatible: Must be: + "st,stm32-dfsdm-adc" for sigma delta ADCs + "st,stm32-dfsdm-pdm" for audio digital microphone. +- reg: Specifies the DFSDM filter instance. +- interrupts: IRQ lines connected to each DFSDM filter instance. +- st,adc-channels: List of single-ended channels muxed for this ADC. +- st,adc-channel-names: List of single-ended channels Name. +- st,dai-filter-order: SinC filter order from 0 to 5. + 0: FastSinC + [1-5]: order 1 to 5. + For audio purpose it is recommended to use order 3 to 5. + +Required properties for "st,stm32-dfsdm-adc" compatibility: +- #io-channel-cells = <1>: See the IIO bindings section "IIO consumers". +- io-channels: from common iio binding. use to pipe external sigma delta + modulator or internal ADC output to dfsdm channel. + +Required properties for "st,stm32-dfsdm-pdm" compatibility: +- #sound-dai-cells: must be set to 0. +- dma: DMA controller phandle and DMA request line associated to the + filter instance ( specified by the field "reg") +- dma-names: must be "rx" + +Optional properties: +- st,adc-channel-types: Single-ended channel input type. Default value is 0. + - "SPI_R": SPI with data on rising edge (default) + - "SPI_F": SPI with data on falling edge + - "MANCH_R": manchester codec, rising edge = logic 0 + - "MANCH_F": manchester codec, falling edge = logic 1 +- st,adc-channel-clk-src: Conversion clock source. default value is 1. + - "CLKIN": External SPI clock (CLKIN x) + - "CLKOUT": internal SPI clock (CLKOUT) (default) + - "CLKOUT_F": internal SPI clock divided by 2 (falling edge). + - "CLKOUT_R": internal SPI clock divided by 2 (rising edge). + +- st,adc-alt-channel: Must be defined if Two sigma delta modulator are + connected on same SPI input. + If not set channel n is connected to SPI input n. + If set channel n is connected to SPI input n + 1. + +- st,filter0-sync: Set to 1 to synchronize with DFSDM filter instance 0. + to used for multi microphone synchronization. + +Example of a sigma delta adc purpose: + ads1202: simple_sd_adc@0 { + compatible = "sd-modulator"; + #io-channel-cells = <1>; + status = "okay"; + }; + dfsdm: dfsdm@40017000 { + compatible = "st,stm32h7-dfsdm"; + reg = <0x40017000 0x400>; + clocks = <&timer_clk>; + clock-names = "dfsdm"; + + dfsdm_adc0: dfsdm-adc0@0 { + compatible = "st,stm32-dfsdm-adc"; + #io-channel-cells = <1>; + reg = <0>; + interrupts = <110>; + st,adc-channels = <0>; + st,adc-channel-names = "in0"; + st,adc-channel-types = "SPI_R"; + st,adc-channel-clk-src = "CLKOUT"; + io-channels = <&ads1202 0>; + }; + +Example of a pdm microphone purpose: + dfsdm: dfsdm@40017000 { + compatible = "st,stm32h7-dfsdm"; + reg = <0x40017000 0x400>; + clocks = <&timer_clk>; + clock-names = "dfsdm"; + + dfsdm_pdm0: dfsdm-pdm@0 { + compatible = "st,stm32-dfsdm-pdm"; + #sound-dai-cells = <0>; + reg = <0>; + interrupts = <110>; + dmas = <&dmamux1 102 0x400 0x00>; + dma-names = "rx"; + st,adc-channels = <0>; + st,adc-channel-names = "pdm1"; + st,adc-channel-types = "SPI_R"; + st,adc-channel-clk-src = "CLKOUT"; + }; + }