All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/11] Add STM32 DFSDM support
@ 2017-03-17 14:08 ` Arnaud Pouliquen
  0 siblings, 0 replies; 109+ messages in thread
From: Arnaud Pouliquen @ 2017-03-17 14:08 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,

I kept it as RFC as i reworked the global design (but also because not full validated...).
Regarding Mark and Jonathan's comments, I decided to  try an implementation 
with DMA support in IIO instead of handling it in ASOC.
Solution seems more straightforward but as DMA cyclic mode and associated buffer
block API is not part of IIO today, I still need some hacks...
To be honest, I tried to integrate DMA cyclic management and associated buffer block 
Consumer API. but no enough expertise on IIO to success... :(

Advantage vs V2:
	- No more data processing need in ASoC , done in IIO
        - ASoC uses IIO consumer interface ( except for buffer callback)
Drawback :
	- Need to create a "SPI bus" trigger to allo to use Buffer consumer API
        	=> Need to find a solution to set this trigger by default in IIO audio driver
        - No standard buffer management
        	- Implement DMA cyclic in DFSDM IIO driver.
                - Define specific API to handle  buffer callback per period instead of 
                  callback per samples generated by iio_push_to_buffers_with_timestamp.
 
V2-V3 delta:
	- New patches to support ASoC DMA codec in DT 
  		- ASoC: Add Bindins for DMIC codec driver.
  		- ASoC: codec: add DT support in dmic codec.
        - New patches to allow in-kernel set of IIO buffer size and watermark   
  		- IIO: consumer: allow to set buffer sizes.
	- IIO DFSDM drivers
        	- Split audio and ADC support in 2 drivers.
                - Implement DMA cyclic mode.
                - Add SPI bus Trigger for buffer management.
                
	- IIO sigma delta adc drivers
        	-  Suppress "simple and rename driver.
         
         - ASoC driver
         	- Suppress DMA engine.
                - Suppress copy ops.
                - Use IIO consmumer interface to enable/Disable DFSDM.        

Regards,

Arnaud

Arnaud Pouliquen (11):
  iio: Add hardware consumer support
  IIO: Add DT bindings for sigma delta adc modulator
  IIO: ADC: add sigma delta modulator support
  IIO: add DT bindings for stm32 DFSDM filter
  IIO: ADC: add stm32 DFSDM support for Sigma delta ADC
  IIO: ADC: add stm32 DFSDM support for PDM microphone
  IIO: consumer: allow to set buffer sizes
  ASoC: Add Bindins for DMIC codec driver
  ASoC: codec: add DT support in dmic codec
  ASoC: add bindings for stm32 DFSDM filter
  ASoC: stm32: add DFSDM DAI support

 .../bindings/iio/adc/sigma-delta-modulator.txt     |  13 +
 .../bindings/iio/adc/st,stm32-dfsdm-adc.txt        | 120 ++++
 Documentation/devicetree/bindings/sound/dmic.txt   |  11 +
 .../devicetree/bindings/sound/st,stm32-adfsdm.txt  |  41 ++
 drivers/iio/Kconfig                                |   6 +
 drivers/iio/Makefile                               |   1 +
 drivers/iio/adc/Kconfig                            |  50 ++
 drivers/iio/adc/Makefile                           |   4 +
 drivers/iio/adc/sd_adc_modulator.c                 |  98 +++
 drivers/iio/adc/stm32-dfsdm-adc.c                  | 419 ++++++++++++
 drivers/iio/adc/stm32-dfsdm-audio.c                | 720 +++++++++++++++++++++
 drivers/iio/adc/stm32-dfsdm-core.c                 | 658 +++++++++++++++++++
 drivers/iio/adc/stm32-dfsdm.h                      | 372 +++++++++++
 drivers/iio/buffer/industrialio-buffer-cb.c        |  12 +
 drivers/iio/hw_consumer.c                          | 156 +++++
 include/linux/iio/adc/stm32-dfsdm-audio.h          |  41 ++
 include/linux/iio/consumer.h                       |  13 +
 include/linux/iio/hw_consumer.h                    |  12 +
 sound/soc/Kconfig                                  |   1 +
 sound/soc/Makefile                                 |   1 +
 sound/soc/codecs/dmic.c                            |   8 +
 sound/soc/stm/Kconfig                              |  10 +
 sound/soc/stm/Makefile                             |   2 +
 sound/soc/stm/stm32_adfsdm.c                       | 362 +++++++++++
 24 files changed, 3131 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
 create mode 100644 Documentation/devicetree/bindings/sound/dmic.txt
 create mode 100644 Documentation/devicetree/bindings/sound/st,stm32-adfsdm.txt
 create mode 100644 drivers/iio/adc/sd_adc_modulator.c
 create mode 100644 drivers/iio/adc/stm32-dfsdm-adc.c
 create mode 100644 drivers/iio/adc/stm32-dfsdm-audio.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/adc/stm32-dfsdm-audio.h
 create mode 100644 include/linux/iio/hw_consumer.h
 create mode 100644 sound/soc/stm/Kconfig
 create mode 100644 sound/soc/stm/Makefile
 create mode 100644 sound/soc/stm/stm32_adfsdm.c

V2:

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.


- 
1.9.1

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

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

Thread overview: 109+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-17 14:08 [PATCH v3 00/11] Add STM32 DFSDM support Arnaud Pouliquen
2017-03-17 14:08 ` Arnaud Pouliquen
2017-03-17 14:08 ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 01/11] iio: Add hardware consumer support Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-20  7:48   ` Peter Meerwald-Stadler
2017-06-06 10:15   ` Arnaud Pouliquen
2017-06-06 10:15     ` Arnaud Pouliquen
2017-06-06 10:15     ` Arnaud Pouliquen
2017-09-11  9:01     ` Arnaud Pouliquen
2017-09-11  9:01       ` Arnaud Pouliquen
2017-09-11  9:01       ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 02/11] IIO: Add DT bindings for sigma delta adc modulator Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-3-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-24 14:21     ` Rob Herring
2017-03-24 14:21       ` Rob Herring
2017-03-24 14:21       ` Rob Herring
2017-03-17 14:08 ` [PATCH v3 03/11] IIO: ADC: add sigma delta modulator support Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-20  6:24   ` [alsa-devel] " kbuild test robot
2017-03-20  6:24     ` kbuild test robot
2017-03-20  6:24     ` kbuild test robot
2017-03-20  6:51   ` kbuild test robot
2017-03-20  6:51     ` kbuild test robot
2017-03-20  6:51     ` kbuild test robot
2017-03-17 14:08 ` [PATCH v3 04/11] IIO: add DT bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-24 14:37   ` Rob Herring
2017-03-24 14:37     ` Rob Herring
2017-03-24 14:37     ` Rob Herring
2017-03-17 14:08 ` [PATCH v3 05/11] IIO: ADC: add stm32 DFSDM support for Sigma delta ADC Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-6-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-19 22:25     ` Jonathan Cameron
2017-03-19 22:25       ` Jonathan Cameron
2017-03-19 22:25       ` Jonathan Cameron
2017-03-20 11:24       ` Arnaud Pouliquen
2017-03-20 11:24         ` Arnaud Pouliquen
2017-03-20 11:24         ` Arnaud Pouliquen
2017-03-25 15:53         ` Jonathan Cameron
2017-03-25 15:53           ` Jonathan Cameron
2017-03-25 15:53           ` Jonathan Cameron
2017-03-20  7:22     ` [alsa-devel] " kbuild test robot
2017-03-20  7:22       ` kbuild test robot
2017-03-20  8:04     ` kbuild test robot
2017-03-20  8:04       ` kbuild test robot
2017-03-20  8:04       ` kbuild test robot
2017-03-17 14:08 ` [PATCH v3 06/11] IIO: ADC: add stm32 DFSDM support for PDM microphone Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-7-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-19 22:38     ` Jonathan Cameron
2017-03-19 22:38       ` Jonathan Cameron
2017-03-19 22:38       ` Jonathan Cameron
2017-03-20 11:29       ` Arnaud Pouliquen
2017-03-20 11:29         ` Arnaud Pouliquen
2017-03-20 11:29         ` Arnaud Pouliquen
2017-03-25 15:59         ` Jonathan Cameron
2017-03-25 15:59           ` Jonathan Cameron
2017-03-25 15:59           ` Jonathan Cameron
2017-03-28  7:45           ` Arnaud Pouliquen
2017-03-28  7:45             ` Arnaud Pouliquen
2017-03-28  7:45             ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 07/11] IIO: consumer: allow to set buffer sizes Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-8-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-19 22:44     ` Jonathan Cameron
2017-03-19 22:44       ` Jonathan Cameron
2017-03-19 22:44       ` Jonathan Cameron
2017-03-20 11:30       ` Arnaud Pouliquen
2017-03-20 11:30         ` Arnaud Pouliquen
2017-03-20 11:30         ` Arnaud Pouliquen
2017-03-25 16:01         ` Jonathan Cameron
2017-03-25 16:01           ` Jonathan Cameron
2017-03-25 16:01           ` Jonathan Cameron
2017-03-20  6:22     ` [alsa-devel] " kbuild test robot
2017-03-20  6:22       ` kbuild test robot
2017-03-20  6:22       ` kbuild test robot
2017-03-20  8:08   ` Peter Meerwald-Stadler
2017-03-17 14:08 ` [PATCH v3 08/11] ASoC: Add bindings for DMIC codec driver Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-24 14:46   ` Rob Herring
2017-03-24 14:46     ` Rob Herring
2017-03-24 14:46     ` Rob Herring
2017-03-27 11:59     ` Mark Brown
2017-03-27 11:59       ` Mark Brown
2017-03-27 11:59       ` Mark Brown
2017-03-17 14:08 ` [PATCH v3 09/11] ASoC: codec: add DT support in dmic codec Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 10/11] ASoC: add bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-24 14:52   ` Rob Herring
2017-03-24 14:52     ` Rob Herring
2017-03-24 14:52     ` Rob Herring
2017-03-29 12:42     ` Arnaud Pouliquen
2017-03-29 12:42       ` Arnaud Pouliquen
2017-03-29 12:42       ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 11/11] ASoC: stm32: add DFSDM DAI support Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 16:36 ` [PATCH v3 00/11] Add STM32 DFSDM support Arnaud Pouliquen
2017-03-17 16:36   ` Arnaud Pouliquen
2017-03-17 16:36   ` Arnaud Pouliquen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.