Commit 92dfa619 authored by Bo Shen's avatar Bo Shen Committed by Mark Brown

ASoC: atmel-pcm: split into two file

This patch is split original atmel-pcm.c into new atmel-pcm.c and
atmel-pcm-pdc.c two files. The new atmel-pcm.c is the share routine
while will be used for pdc or dma transfer.

Using SND_ATMEL_SOC_PDC to select using PDC for audio transfer
Signed-off-by: default avatarBo Shen <voice.shen@atmel.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 31974361
...@@ -6,6 +6,10 @@ config SND_ATMEL_SOC ...@@ -6,6 +6,10 @@ config SND_ATMEL_SOC
the ATMEL SSC interface. You will also need the ATMEL SSC interface. You will also need
to select the audio interfaces to support below. to select the audio interfaces to support below.
config SND_ATMEL_SOC_PDC
tristate
depends on SND_ATMEL_SOC
config SND_ATMEL_SOC_SSC config SND_ATMEL_SOC_SSC
tristate tristate
depends on SND_ATMEL_SOC depends on SND_ATMEL_SOC
...@@ -17,6 +21,7 @@ config SND_ATMEL_SOC_SSC ...@@ -17,6 +21,7 @@ config SND_ATMEL_SOC_SSC
config SND_AT91_SOC_SAM9G20_WM8731 config SND_AT91_SOC_SAM9G20_WM8731
tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board" tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board"
depends on ATMEL_SSC && SND_ATMEL_SOC && AT91_PROGRAMMABLE_CLOCKS depends on ATMEL_SSC && SND_ATMEL_SOC && AT91_PROGRAMMABLE_CLOCKS
select SND_ATMEL_SOC_PDC
select SND_ATMEL_SOC_SSC select SND_ATMEL_SOC_SSC
select SND_SOC_WM8731 select SND_SOC_WM8731
help help
......
# AT91 Platform Support # AT91 Platform Support
snd-soc-atmel-pcm-objs := atmel-pcm.o snd-soc-atmel-pcm-objs := atmel-pcm.o
snd-soc-atmel-pcm-pdc-objs := atmel-pcm-pdc.o
snd-soc-atmel_ssc_dai-objs := atmel_ssc_dai.o snd-soc-atmel_ssc_dai-objs := atmel_ssc_dai.o
obj-$(CONFIG_SND_ATMEL_SOC) += snd-soc-atmel-pcm.o obj-$(CONFIG_SND_ATMEL_SOC) += snd-soc-atmel-pcm.o
obj-$(CONFIG_SND_ATMEL_SOC_PDC) += snd-soc-atmel-pcm-pdc.o
obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o
# AT91 Machine Support # AT91 Machine Support
......
This diff is collapsed.
This diff is collapsed.
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <linux/atmel-ssc.h> #include <linux/atmel-ssc.h>
#define ATMEL_SSC_DMABUF_SIZE (64 * 1024)
/* /*
* Registers and status bits that are required by the PCM driver. * Registers and status bits that are required by the PCM driver.
*/ */
...@@ -80,7 +82,22 @@ struct atmel_pcm_dma_params { ...@@ -80,7 +82,22 @@ struct atmel_pcm_dma_params {
#define ssc_readx(base, reg) (__raw_readl((base) + (reg))) #define ssc_readx(base, reg) (__raw_readl((base) + (reg)))
#define ssc_writex(base, reg, value) __raw_writel((value), (base) + (reg)) #define ssc_writex(base, reg, value) __raw_writel((value), (base) + (reg))
int atmel_pcm_platform_register(struct device *dev); int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd);
void atmel_pcm_platform_unregister(struct device *dev); void atmel_pcm_free(struct snd_pcm *pcm);
int atmel_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma);
#ifdef CONFIG_SND_ATMEL_SOC_PDC
int atmel_pcm_pdc_platform_register(struct device *dev);
void atmel_pcm_pdc_platform_unregister(struct device *dev);
#else
static inline int atmel_pcm_pdc_platform_register(struct device *dev)
{
return 0;
}
static inline void atmel_pcm_pdc_platform_unregister(struct device *dev)
{
}
#endif
#endif /* _ATMEL_PCM_H */ #endif /* _ATMEL_PCM_H */
...@@ -729,7 +729,7 @@ static int asoc_ssc_init(struct device *dev) ...@@ -729,7 +729,7 @@ static int asoc_ssc_init(struct device *dev)
goto err; goto err;
} }
ret = atmel_pcm_platform_register(dev); ret = atmel_pcm_pdc_platform_register(dev);
if (ret) { if (ret) {
dev_err(dev, "Could not register PCM: %d\n", ret); dev_err(dev, "Could not register PCM: %d\n", ret);
goto err_unregister_dai; goto err_unregister_dai;
...@@ -745,7 +745,7 @@ static int asoc_ssc_init(struct device *dev) ...@@ -745,7 +745,7 @@ static int asoc_ssc_init(struct device *dev)
static void asoc_ssc_exit(struct device *dev) static void asoc_ssc_exit(struct device *dev)
{ {
atmel_pcm_platform_unregister(dev); atmel_pcm_pdc_platform_unregister(dev);
snd_soc_unregister_dai(dev); snd_soc_unregister_dai(dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment