aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel/atmel-pcm-pdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/atmel/atmel-pcm-pdc.c')
-rw-r--r--sound/soc/atmel/atmel-pcm-pdc.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c
index 33ec592ecd75..a366b3503c28 100644
--- a/sound/soc/atmel/atmel-pcm-pdc.c
+++ b/sound/soc/atmel/atmel-pcm-pdc.c
@@ -76,12 +76,6 @@ struct atmel_runtime_data {
76 size_t period_size; 76 size_t period_size;
77 77
78 dma_addr_t period_ptr; /* physical address of next period */ 78 dma_addr_t period_ptr; /* physical address of next period */
79
80 /* PDC register save */
81 u32 pdc_xpr_save;
82 u32 pdc_xcr_save;
83 u32 pdc_xnpr_save;
84 u32 pdc_xncr_save;
85}; 79};
86 80
87/*--------------------------------------------------------------------------*\ 81/*--------------------------------------------------------------------------*\
@@ -320,67 +314,10 @@ static struct snd_pcm_ops atmel_pcm_ops = {
320 .mmap = atmel_pcm_mmap, 314 .mmap = atmel_pcm_mmap,
321}; 315};
322 316
323
324/*--------------------------------------------------------------------------*\
325 * ASoC platform driver
326\*--------------------------------------------------------------------------*/
327#ifdef CONFIG_PM
328static int atmel_pcm_suspend(struct snd_soc_dai *dai)
329{
330 struct snd_pcm_runtime *runtime = dai->runtime;
331 struct atmel_runtime_data *prtd;
332 struct atmel_pcm_dma_params *params;
333
334 if (!runtime)
335 return 0;
336
337 prtd = runtime->private_data;
338 params = prtd->params;
339
340 /* disable the PDC and save the PDC registers */
341
342 ssc_writel(params->ssc->regs, PDC_PTCR, params->mask->pdc_disable);
343
344 prtd->pdc_xpr_save = ssc_readx(params->ssc->regs, params->pdc->xpr);
345 prtd->pdc_xcr_save = ssc_readx(params->ssc->regs, params->pdc->xcr);
346 prtd->pdc_xnpr_save = ssc_readx(params->ssc->regs, params->pdc->xnpr);
347 prtd->pdc_xncr_save = ssc_readx(params->ssc->regs, params->pdc->xncr);
348
349 return 0;
350}
351
352static int atmel_pcm_resume(struct snd_soc_dai *dai)
353{
354 struct snd_pcm_runtime *runtime = dai->runtime;
355 struct atmel_runtime_data *prtd;
356 struct atmel_pcm_dma_params *params;
357
358 if (!runtime)
359 return 0;
360
361 prtd = runtime->private_data;
362 params = prtd->params;
363
364 /* restore the PDC registers and enable the PDC */
365 ssc_writex(params->ssc->regs, params->pdc->xpr, prtd->pdc_xpr_save);
366 ssc_writex(params->ssc->regs, params->pdc->xcr, prtd->pdc_xcr_save);
367 ssc_writex(params->ssc->regs, params->pdc->xnpr, prtd->pdc_xnpr_save);
368 ssc_writex(params->ssc->regs, params->pdc->xncr, prtd->pdc_xncr_save);
369
370 ssc_writel(params->ssc->regs, PDC_PTCR, params->mask->pdc_enable);
371 return 0;
372}
373#else
374#define atmel_pcm_suspend NULL
375#define atmel_pcm_resume NULL
376#endif
377
378static struct snd_soc_platform_driver atmel_soc_platform = { 317static struct snd_soc_platform_driver atmel_soc_platform = {
379 .ops = &atmel_pcm_ops, 318 .ops = &atmel_pcm_ops,
380 .pcm_new = atmel_pcm_new, 319 .pcm_new = atmel_pcm_new,
381 .pcm_free = atmel_pcm_free, 320 .pcm_free = atmel_pcm_free,
382 .suspend = atmel_pcm_suspend,
383 .resume = atmel_pcm_resume,
384}; 321};
385 322
386int atmel_pcm_pdc_platform_register(struct device *dev) 323int atmel_pcm_pdc_platform_register(struct device *dev)