#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <sound/soc.h>
#include <sound/pcm_params.h>
#include <linux/platform_data/asoc-s3c.h>
#include "dma.h"
#include "pcm.h"
#define S3C_PCM_CTL …
#define S3C_PCM_CLKCTL …
#define S3C_PCM_TXFIFO …
#define S3C_PCM_RXFIFO …
#define S3C_PCM_IRQCTL …
#define S3C_PCM_IRQSTAT …
#define S3C_PCM_FIFOSTAT …
#define S3C_PCM_CLRINT …
#define S3C_PCM_CTL_TXDIPSTICK_MASK …
#define S3C_PCM_CTL_TXDIPSTICK_SHIFT …
#define S3C_PCM_CTL_RXDIPSTICK_MASK …
#define S3C_PCM_CTL_RXDIPSTICK_SHIFT …
#define S3C_PCM_CTL_TXDMA_EN …
#define S3C_PCM_CTL_RXDMA_EN …
#define S3C_PCM_CTL_TXMSB_AFTER_FSYNC …
#define S3C_PCM_CTL_RXMSB_AFTER_FSYNC …
#define S3C_PCM_CTL_TXFIFO_EN …
#define S3C_PCM_CTL_RXFIFO_EN …
#define S3C_PCM_CTL_ENABLE …
#define S3C_PCM_CLKCTL_SERCLK_EN …
#define S3C_PCM_CLKCTL_SERCLKSEL_PCLK …
#define S3C_PCM_CLKCTL_SCLKDIV_MASK …
#define S3C_PCM_CLKCTL_SYNCDIV_MASK …
#define S3C_PCM_CLKCTL_SCLKDIV_SHIFT …
#define S3C_PCM_CLKCTL_SYNCDIV_SHIFT …
#define S3C_PCM_TXFIFO_DVALID …
#define S3C_PCM_TXFIFO_DATA_MSK …
#define S3C_PCM_RXFIFO_DVALID …
#define S3C_PCM_RXFIFO_DATA_MSK …
#define S3C_PCM_IRQCTL_IRQEN …
#define S3C_PCM_IRQCTL_WRDEN …
#define S3C_PCM_IRQCTL_TXEMPTYEN …
#define S3C_PCM_IRQCTL_TXALMSTEMPTYEN …
#define S3C_PCM_IRQCTL_TXFULLEN …
#define S3C_PCM_IRQCTL_TXALMSTFULLEN …
#define S3C_PCM_IRQCTL_TXSTARVEN …
#define S3C_PCM_IRQCTL_TXERROVRFLEN …
#define S3C_PCM_IRQCTL_RXEMPTEN …
#define S3C_PCM_IRQCTL_RXALMSTEMPTEN …
#define S3C_PCM_IRQCTL_RXFULLEN …
#define S3C_PCM_IRQCTL_RXALMSTFULLEN …
#define S3C_PCM_IRQCTL_RXSTARVEN …
#define S3C_PCM_IRQCTL_RXERROVRFLEN …
#define S3C_PCM_IRQSTAT_IRQPND …
#define S3C_PCM_IRQSTAT_WRD_XFER …
#define S3C_PCM_IRQSTAT_TXEMPTY …
#define S3C_PCM_IRQSTAT_TXALMSTEMPTY …
#define S3C_PCM_IRQSTAT_TXFULL …
#define S3C_PCM_IRQSTAT_TXALMSTFULL …
#define S3C_PCM_IRQSTAT_TXSTARV …
#define S3C_PCM_IRQSTAT_TXERROVRFL …
#define S3C_PCM_IRQSTAT_RXEMPT …
#define S3C_PCM_IRQSTAT_RXALMSTEMPT …
#define S3C_PCM_IRQSTAT_RXFULL …
#define S3C_PCM_IRQSTAT_RXALMSTFULL …
#define S3C_PCM_IRQSTAT_RXSTARV …
#define S3C_PCM_IRQSTAT_RXERROVRFL …
#define S3C_PCM_FIFOSTAT_TXCNT_MSK …
#define S3C_PCM_FIFOSTAT_TXFIFOEMPTY …
#define S3C_PCM_FIFOSTAT_TXFIFOALMSTEMPTY …
#define S3C_PCM_FIFOSTAT_TXFIFOFULL …
#define S3C_PCM_FIFOSTAT_TXFIFOALMSTFULL …
#define S3C_PCM_FIFOSTAT_RXCNT_MSK …
#define S3C_PCM_FIFOSTAT_RXFIFOEMPTY …
#define S3C_PCM_FIFOSTAT_RXFIFOALMSTEMPTY …
#define S3C_PCM_FIFOSTAT_RXFIFOFULL …
#define S3C_PCM_FIFOSTAT_RXFIFOALMSTFULL …
struct s3c_pcm_info { … };
static struct snd_dmaengine_dai_dma_data s3c_pcm_stereo_out[] = …;
static struct snd_dmaengine_dai_dma_data s3c_pcm_stereo_in[] = …;
static struct s3c_pcm_info s3c_pcm[2];
static void s3c_pcm_snd_txctrl(struct s3c_pcm_info *pcm, int on)
{ … }
static void s3c_pcm_snd_rxctrl(struct s3c_pcm_info *pcm, int on)
{ … }
static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *socdai)
{ … }
static int s3c_pcm_set_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{ … }
static int s3c_pcm_set_clkdiv(struct snd_soc_dai *cpu_dai,
int div_id, int div)
{ … }
static int s3c_pcm_set_sysclk(struct snd_soc_dai *cpu_dai,
int clk_id, unsigned int freq, int dir)
{ … }
static int s3c_pcm_dai_probe(struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops s3c_pcm_dai_ops = …;
#define S3C_PCM_RATES …
#define S3C_PCM_DAI_DECLARE …
static struct snd_soc_dai_driver s3c_pcm_dai[] = …;
static const struct snd_soc_component_driver s3c_pcm_component = …;
static int s3c_pcm_dev_probe(struct platform_device *pdev)
{ … }
static void s3c_pcm_dev_remove(struct platform_device *pdev)
{ … }
static struct platform_driver s3c_pcm_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;