devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v2 0/7]  Add STM32 DFSDM support
@ 2017-02-13 16:38 Arnaud Pouliquen
  2017-02-13 16:38 ` [RFC v2 1/7] iio: Add hardware consumer support Arnaud Pouliquen
                   ` (6 more replies)
  0 siblings, 7 replies; 37+ messages in thread
From: Arnaud Pouliquen @ 2017-02-13 16:38 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Jaroslav Kysela,
	Takashi Iwai, Liam Girdwood, Mark Brown
  Cc: devicetree, alsa-devel, olivier moysan, kernel, linux-iio,
	arnaud.pouliquen, Maxime Coquelin, linux-arm-kernel,
	Alexandre Torgue

Hello,

This RFC is following first patch-set sent for DFSDM driver
(https://www.spinics.net/lists/arm-kernel/msg557133.html).
AS MFD driver has been rejected, a new way to integrate DFSDM has to 
be defined.

Aim of this RFC is to provide a base to discuss this redesign.

1) DFSDM hardware overview:
-----------------------
The Digital Filter for Sigma Delta  is a module dedicated to interface external sigma 
delta modulators to STM32 micro-controllers. It is targeted for:
	- Audio mode signal with Pulse density modulation (PDM) microphone
	- motor and Sensing mode with sigma delta ADC modulator

Main Features:
 - Up to 8 multiplexed input digital serial channel (SIT)
	. SPI (PDM compatible) or Manchester interface
	.  Slave or master ( one main SPI CLK OUT for all interface) 
 - Alternative inputs for 8 internal digital parallel channels (PIT)
	. 16 bits resolution
	. internal sources: ADC or memory
 - Digital signal processing:
	. 4 instances
	. Sincx filter (x : order 1 to 5) oversampling ratio up to 1024
	. integrator: oversampling ratio up to 256
 - Channel multiplexer
	. allow to connect SIT or PIT to filter
	. channel n can be connected SIT n or SIT n+1
 - up to 24-bit output resolution
 	. signed
        . sampling rate  and resolution depend on filter parameters.
 - data offset correction
 - detector:
	. analog watchdog
	. short circuit detection
	. clock absence detection
	. extremes

For details on DFSDM IP, please refer to STM32F413 data-sheet chapter 15:
http://www.st.com/content/ccc/resource/technical/document/reference_manual/group0/81/ea/88/1f/97/9e/4a/d0/DM00305666/files/DM00305666.pdf/jcr:content/translations/en.DM00305666.pdf

2) SW design proposal:
---------------------
Patch-set associated to this RFC proposes an implementation of the
DFSDM features shared between ASoC and IIO frameworks.

Patch-set is only a Skeleton of the drivers, so a base to discuss and validate a design. 
It contains minimum code to allow probing (with DT) and to expose the ASoC and IIO ABI.
Hope that is sufficent in a first step to allow to focus on APIs.

In this patch-set there are two new APIs used:
	- IIO in-kern API: based on hw_customer API proposed by Lars
 	- ASOC <-> IIO API inspired by API defined for hdmi-codec for ASoC/DRM interconnect. 
   	  API is dedicated to DFSDM only.

Notice also that this design is based on following assumption:
	- Audio stream ABI interface is ASoC, no access to data through IIO ABI for PDM. 
	- ASoC DMA should be used for audio transfer as designed for real time stream.
	- Need some runtime parameters exchange between ASoC and IIO
	  due to the correlation between the sample frequency, the DFSDM decimation 
          factor and the associated scaling.

- "ASoC: dmaengine_pcm: add copy support" patch:
 I added a patch in ASoC that allows to implement a copy function to process data 
 after DMA transfer. Requested, as DFSDM samples captured contain channel ID 
 on 8-LSB bits and need also a potential rescale to present DAT on 24-bits.  	

- "IIO: ADC: add sigma delta modulator support" patch:
Simple dummy driver created to support external Sigma delta modulator. 
It is binded to DFSDM driver through hw_customer API.

Regards
Arnaud

Arnaud Pouliquen (6):
  iio: Add hardware consumer support
  IIO: Add bindings for simple sigma delta adc
  IIO: ADC: add sigma delta modulator support
  ASoC: stm32: add DFSDM DAI support
  IIO: add bindings for stm32 DFSDM filter
  IIO: ADC: add stm32 DFSDM support

olivier moysan (1):
  ASoC: dmaengine_pcm: add copy support

 .../devicetree/bindings/iio/adc/simple_sd_adc.txt  |  13 +
 .../bindings/iio/adc/st,stm32-dfsdm-adc.txt        | 125 ++++++
 drivers/iio/Kconfig                                |   6 +
 drivers/iio/Makefile                               |   1 +
 drivers/iio/adc/Kconfig                            |  24 +
 drivers/iio/adc/Makefile                           |   2 +
 drivers/iio/adc/simple_sd_adc.c                    | 112 +++++
 drivers/iio/adc/stm32-dfsdm-adc.c                  | 483 +++++++++++++++++++++
 drivers/iio/adc/stm32-dfsdm-core.c                 | 273 ++++++++++++
 drivers/iio/adc/stm32-dfsdm.h                      | 141 ++++++
 drivers/iio/hw_consumer.c                          | 156 +++++++
 include/linux/iio/hw_consumer.h                    |  12 +
 include/sound/dmaengine_pcm.h                      |   3 +
 include/sound/stm32-adfsdm.h                       |  80 ++++
 sound/soc/Kconfig                                  |   1 +
 sound/soc/Makefile                                 |   1 +
 sound/soc/soc-generic-dmaengine-pcm.c              |  37 +-
 sound/soc/stm/Kconfig                              |  10 +
 sound/soc/stm/Makefile                             |   2 +
 sound/soc/stm/stm32_adfsdm.c                       | 365 ++++++++++++++++
 20 files changed, 1845 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/simple_sd_adc.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
 create mode 100644 drivers/iio/adc/simple_sd_adc.c
 create mode 100644 drivers/iio/adc/stm32-dfsdm-adc.c
 create mode 100644 drivers/iio/adc/stm32-dfsdm-core.c
 create mode 100644 drivers/iio/adc/stm32-dfsdm.h
 create mode 100644 drivers/iio/hw_consumer.c
 create mode 100644 include/linux/iio/hw_consumer.h
 create mode 100644 include/sound/stm32-adfsdm.h
 create mode 100644 sound/soc/stm/Kconfig
 create mode 100644 sound/soc/stm/Makefile
 create mode 100644 sound/soc/stm/stm32_adfsdm.c

-- 
1.9.1

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2017-03-05 11:04 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-13 16:38 [RFC v2 0/7] Add STM32 DFSDM support Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 1/7] iio: Add hardware consumer support Arnaud Pouliquen
     [not found]   ` <1487003909-11710-2-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-19 14:13     ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 2/7] IIO: Add bindings for simple sigma delta adc Arnaud Pouliquen
2017-02-22 15:17   ` Rob Herring
2017-02-27 11:15     ` Arnaud Pouliquen
2017-03-05 11:04       ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 3/7] IIO: ADC: add sigma delta modulator support Arnaud Pouliquen
     [not found]   ` <1487003909-11710-4-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-19 14:20     ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 4/7] ASoC: dmaengine_pcm: add copy support Arnaud Pouliquen
2017-02-14 17:16   ` Mark Brown
2017-02-15 13:59     ` Arnaud Pouliquen
     [not found]       ` <40633f7c-a2ac-1658-cc9d-b30eaff8a95a-qxv4g6HH51o@public.gmane.org>
2017-02-15 14:53         ` Mark Brown
2017-02-15 15:46           ` Arnaud Pouliquen
     [not found]             ` <338f8db7-2077-626f-986b-b4e3df40469c-qxv4g6HH51o@public.gmane.org>
2017-02-16 20:14               ` Mark Brown
2017-02-27  9:05                 ` Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 5/7] ASoC: stm32: add DFSDM DAI support Arnaud Pouliquen
     [not found]   ` <1487003909-11710-6-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-13 18:13     ` Peter Meerwald-Stadler
     [not found]       ` <alpine.DEB.2.02.1702131906350.25127-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2017-02-14 11:09         ` Arnaud Pouliquen
     [not found]           ` <c381a9a2-5dff-af9a-eeb0-8fd1a74f448e-qxv4g6HH51o@public.gmane.org>
2017-02-14 12:57             ` Peter Meerwald-Stadler
2017-02-14 17:45     ` Mark Brown
2017-02-15 16:39       ` Arnaud Pouliquen
     [not found]         ` <9b875a75-294a-2f59-5830-cc0f6b3b62c7-qxv4g6HH51o@public.gmane.org>
2017-02-15 16:53           ` Mark Brown
     [not found]       ` <20170214174534.35ytbpax75mxcayg-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-02-19 14:56         ` Jonathan Cameron
2017-02-27 10:31           ` Arnaud Pouliquen
     [not found]             ` <84f330ab-48a2-6e0b-ab95-6aab5b34c241-qxv4g6HH51o@public.gmane.org>
2017-03-05 10:55               ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 6/7] IIO: add bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-02-19 15:00   ` Jonathan Cameron
2017-02-27 10:47     ` Arnaud Pouliquen
     [not found]       ` <7fbfc694-3685-ec90-6292-5a5157a8a0d2-qxv4g6HH51o@public.gmane.org>
2017-03-05 11:00         ` Jonathan Cameron
     [not found]   ` <1487003909-11710-7-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-13 18:05     ` Peter Meerwald-Stadler
2017-02-22 16:42     ` Rob Herring
2017-02-27 14:07       ` Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 7/7] IIO: ADC: add stm32 DFSDM support Arnaud Pouliquen
2017-02-19 14:46   ` Jonathan Cameron
2017-02-27 10:09     ` Arnaud Pouliquen
     [not found]       ` <fe86eca5-5dca-efb3-45d2-46e193f60dc9-qxv4g6HH51o@public.gmane.org>
2017-03-05 10:55         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).