0ea6e61122
Below you will find an updated version from the original series bunching all patches into one big patch updating broken web addresses that are located in Documentation/* Some of the addresses date as far far back as 1995 etc... so searching became a bit difficult, the best way to deal with these is to use web.archive.org to locate these addresses that are outdated. Now there are also some addresses pointing to .spec files some are located, but some(after searching on the companies site)where still no where to be found. In this case I just changed the address to the company site this way the users can contact the company and they can locate them for the users. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Thomas Weber <weber@corscience.de> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Cc: Paulo Marques <pmarques@grupopie.com> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Michael Neuling <mikey@neuling.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
58 lines
1.7 KiB
Text
58 lines
1.7 KiB
Text
ASoC Platform Driver
|
|
====================
|
|
|
|
An ASoC platform driver can be divided into audio DMA and SoC DAI configuration
|
|
and control. The platform drivers only target the SoC CPU and must have no board
|
|
specific code.
|
|
|
|
Audio DMA
|
|
=========
|
|
|
|
The platform DMA driver optionally supports the following ALSA operations:-
|
|
|
|
/* SoC audio ops */
|
|
struct snd_soc_ops {
|
|
int (*startup)(struct snd_pcm_substream *);
|
|
void (*shutdown)(struct snd_pcm_substream *);
|
|
int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *);
|
|
int (*hw_free)(struct snd_pcm_substream *);
|
|
int (*prepare)(struct snd_pcm_substream *);
|
|
int (*trigger)(struct snd_pcm_substream *, int);
|
|
};
|
|
|
|
The platform driver exports its DMA functionality via struct snd_soc_platform:-
|
|
|
|
struct snd_soc_platform {
|
|
char *name;
|
|
|
|
int (*probe)(struct platform_device *pdev);
|
|
int (*remove)(struct platform_device *pdev);
|
|
int (*suspend)(struct platform_device *pdev, struct snd_soc_cpu_dai *cpu_dai);
|
|
int (*resume)(struct platform_device *pdev, struct snd_soc_cpu_dai *cpu_dai);
|
|
|
|
/* pcm creation and destruction */
|
|
int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *);
|
|
void (*pcm_free)(struct snd_pcm *);
|
|
|
|
/* platform stream ops */
|
|
struct snd_pcm_ops *pcm_ops;
|
|
};
|
|
|
|
Please refer to the ALSA driver documentation for details of audio DMA.
|
|
http://www.alsa-project.org/~iwai/writing-an-alsa-driver/
|
|
|
|
An example DMA driver is soc/pxa/pxa2xx-pcm.c
|
|
|
|
|
|
SoC DAI Drivers
|
|
===============
|
|
|
|
Each SoC DAI driver must provide the following features:-
|
|
|
|
1) Digital audio interface (DAI) description
|
|
2) Digital audio interface configuration
|
|
3) PCM's description
|
|
4) SYSCLK configuration
|
|
5) Suspend and resume (optional)
|
|
|
|
Please see codec.txt for a description of items 1 - 4.
|