Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pcm.c File Reference
#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 <mach/dma.h>
#include "dma.h"
#include "pcm.h"

Go to the source code of this file.

Data Structures

struct  s3c_pcm_info
 

Macros

#define S3C_PCM_CTL   0x00
 
#define S3C_PCM_CLKCTL   0x04
 
#define S3C_PCM_TXFIFO   0x08
 
#define S3C_PCM_RXFIFO   0x0C
 
#define S3C_PCM_IRQCTL   0x10
 
#define S3C_PCM_IRQSTAT   0x14
 
#define S3C_PCM_FIFOSTAT   0x18
 
#define S3C_PCM_CLRINT   0x20
 
#define S3C_PCM_CTL_TXDIPSTICK_MASK   0x3f
 
#define S3C_PCM_CTL_TXDIPSTICK_SHIFT   13
 
#define S3C_PCM_CTL_RXDIPSTICK_MASK   0x3f
 
#define S3C_PCM_CTL_RXDIPSTICK_SHIFT   7
 
#define S3C_PCM_CTL_TXDMA_EN   (0x1 << 6)
 
#define S3C_PCM_CTL_RXDMA_EN   (0x1 << 5)
 
#define S3C_PCM_CTL_TXMSB_AFTER_FSYNC   (0x1 << 4)
 
#define S3C_PCM_CTL_RXMSB_AFTER_FSYNC   (0x1 << 3)
 
#define S3C_PCM_CTL_TXFIFO_EN   (0x1 << 2)
 
#define S3C_PCM_CTL_RXFIFO_EN   (0x1 << 1)
 
#define S3C_PCM_CTL_ENABLE   (0x1 << 0)
 
#define S3C_PCM_CLKCTL_SERCLK_EN   (0x1 << 19)
 
#define S3C_PCM_CLKCTL_SERCLKSEL_PCLK   (0x1 << 18)
 
#define S3C_PCM_CLKCTL_SCLKDIV_MASK   0x1ff
 
#define S3C_PCM_CLKCTL_SYNCDIV_MASK   0x1ff
 
#define S3C_PCM_CLKCTL_SCLKDIV_SHIFT   9
 
#define S3C_PCM_CLKCTL_SYNCDIV_SHIFT   0
 
#define S3C_PCM_TXFIFO_DVALID   (0x1 << 16)
 
#define S3C_PCM_TXFIFO_DATA_MSK   (0xffff << 0)
 
#define S3C_PCM_RXFIFO_DVALID   (0x1 << 16)
 
#define S3C_PCM_RXFIFO_DATA_MSK   (0xffff << 0)
 
#define S3C_PCM_IRQCTL_IRQEN   (0x1 << 14)
 
#define S3C_PCM_IRQCTL_WRDEN   (0x1 << 12)
 
#define S3C_PCM_IRQCTL_TXEMPTYEN   (0x1 << 11)
 
#define S3C_PCM_IRQCTL_TXALMSTEMPTYEN   (0x1 << 10)
 
#define S3C_PCM_IRQCTL_TXFULLEN   (0x1 << 9)
 
#define S3C_PCM_IRQCTL_TXALMSTFULLEN   (0x1 << 8)
 
#define S3C_PCM_IRQCTL_TXSTARVEN   (0x1 << 7)
 
#define S3C_PCM_IRQCTL_TXERROVRFLEN   (0x1 << 6)
 
#define S3C_PCM_IRQCTL_RXEMPTEN   (0x1 << 5)
 
#define S3C_PCM_IRQCTL_RXALMSTEMPTEN   (0x1 << 4)
 
#define S3C_PCM_IRQCTL_RXFULLEN   (0x1 << 3)
 
#define S3C_PCM_IRQCTL_RXALMSTFULLEN   (0x1 << 2)
 
#define S3C_PCM_IRQCTL_RXSTARVEN   (0x1 << 1)
 
#define S3C_PCM_IRQCTL_RXERROVRFLEN   (0x1 << 0)
 
#define S3C_PCM_IRQSTAT_IRQPND   (0x1 << 13)
 
#define S3C_PCM_IRQSTAT_WRD_XFER   (0x1 << 12)
 
#define S3C_PCM_IRQSTAT_TXEMPTY   (0x1 << 11)
 
#define S3C_PCM_IRQSTAT_TXALMSTEMPTY   (0x1 << 10)
 
#define S3C_PCM_IRQSTAT_TXFULL   (0x1 << 9)
 
#define S3C_PCM_IRQSTAT_TXALMSTFULL   (0x1 << 8)
 
#define S3C_PCM_IRQSTAT_TXSTARV   (0x1 << 7)
 
#define S3C_PCM_IRQSTAT_TXERROVRFL   (0x1 << 6)
 
#define S3C_PCM_IRQSTAT_RXEMPT   (0x1 << 5)
 
#define S3C_PCM_IRQSTAT_RXALMSTEMPT   (0x1 << 4)
 
#define S3C_PCM_IRQSTAT_RXFULL   (0x1 << 3)
 
#define S3C_PCM_IRQSTAT_RXALMSTFULL   (0x1 << 2)
 
#define S3C_PCM_IRQSTAT_RXSTARV   (0x1 << 1)
 
#define S3C_PCM_IRQSTAT_RXERROVRFL   (0x1 << 0)
 
#define S3C_PCM_FIFOSTAT_TXCNT_MSK   (0x3f << 14)
 
#define S3C_PCM_FIFOSTAT_TXFIFOEMPTY   (0x1 << 13)
 
#define S3C_PCM_FIFOSTAT_TXFIFOALMSTEMPTY   (0x1 << 12)
 
#define S3C_PCM_FIFOSTAT_TXFIFOFULL   (0x1 << 11)
 
#define S3C_PCM_FIFOSTAT_TXFIFOALMSTFULL   (0x1 << 10)
 
#define S3C_PCM_FIFOSTAT_RXCNT_MSK   (0x3f << 4)
 
#define S3C_PCM_FIFOSTAT_RXFIFOEMPTY   (0x1 << 3)
 
#define S3C_PCM_FIFOSTAT_RXFIFOALMSTEMPTY   (0x1 << 2)
 
#define S3C_PCM_FIFOSTAT_RXFIFOFULL   (0x1 << 1)
 
#define S3C_PCM_FIFOSTAT_RXFIFOALMSTFULL   (0x1 << 0)
 
#define S3C_PCM_RATES   SNDRV_PCM_RATE_8000_96000
 
#define S3C_PCM_DAI_DECLARE
 

Functions

 module_platform_driver (s3c_pcm_driver)
 
 MODULE_AUTHOR ("Jaswinder Singh, <[email protected]>")
 
 MODULE_DESCRIPTION ("S3C PCM Controller Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:samsung-pcm")
 

Macro Definition Documentation

#define S3C_PCM_CLKCTL   0x04

Definition at line 30 of file pcm.c.

#define S3C_PCM_CLKCTL_SCLKDIV_MASK   0x1ff

Definition at line 54 of file pcm.c.

#define S3C_PCM_CLKCTL_SCLKDIV_SHIFT   9

Definition at line 56 of file pcm.c.

#define S3C_PCM_CLKCTL_SERCLK_EN   (0x1 << 19)

Definition at line 52 of file pcm.c.

#define S3C_PCM_CLKCTL_SERCLKSEL_PCLK   (0x1 << 18)

Definition at line 53 of file pcm.c.

#define S3C_PCM_CLKCTL_SYNCDIV_MASK   0x1ff

Definition at line 55 of file pcm.c.

#define S3C_PCM_CLKCTL_SYNCDIV_SHIFT   0

Definition at line 57 of file pcm.c.

#define S3C_PCM_CLRINT   0x20

Definition at line 36 of file pcm.c.

#define S3C_PCM_CTL   0x00

Definition at line 29 of file pcm.c.

#define S3C_PCM_CTL_ENABLE   (0x1 << 0)

Definition at line 49 of file pcm.c.

#define S3C_PCM_CTL_RXDIPSTICK_MASK   0x3f

Definition at line 41 of file pcm.c.

#define S3C_PCM_CTL_RXDIPSTICK_SHIFT   7

Definition at line 42 of file pcm.c.

#define S3C_PCM_CTL_RXDMA_EN   (0x1 << 5)

Definition at line 44 of file pcm.c.

#define S3C_PCM_CTL_RXFIFO_EN   (0x1 << 1)

Definition at line 48 of file pcm.c.

#define S3C_PCM_CTL_RXMSB_AFTER_FSYNC   (0x1 << 3)

Definition at line 46 of file pcm.c.

#define S3C_PCM_CTL_TXDIPSTICK_MASK   0x3f

Definition at line 39 of file pcm.c.

#define S3C_PCM_CTL_TXDIPSTICK_SHIFT   13

Definition at line 40 of file pcm.c.

#define S3C_PCM_CTL_TXDMA_EN   (0x1 << 6)

Definition at line 43 of file pcm.c.

#define S3C_PCM_CTL_TXFIFO_EN   (0x1 << 2)

Definition at line 47 of file pcm.c.

#define S3C_PCM_CTL_TXMSB_AFTER_FSYNC   (0x1 << 4)

Definition at line 45 of file pcm.c.

#define S3C_PCM_DAI_DECLARE
Value:
.symmetric_rates = 1, \
.ops = &s3c_pcm_dai_ops, \
.playback = { \
.channels_min = 2, \
.channels_max = 2, \
.rates = S3C_PCM_RATES, \
}, \
.capture = { \
.channels_min = 2, \
.channels_max = 2, \
.rates = S3C_PCM_RATES, \
}

Definition at line 466 of file pcm.c.

#define S3C_PCM_FIFOSTAT   0x18

Definition at line 35 of file pcm.c.

#define S3C_PCM_FIFOSTAT_RXCNT_MSK   (0x3f << 4)

Definition at line 105 of file pcm.c.

#define S3C_PCM_FIFOSTAT_RXFIFOALMSTEMPTY   (0x1 << 2)

Definition at line 107 of file pcm.c.

#define S3C_PCM_FIFOSTAT_RXFIFOALMSTFULL   (0x1 << 0)

Definition at line 109 of file pcm.c.

#define S3C_PCM_FIFOSTAT_RXFIFOEMPTY   (0x1 << 3)

Definition at line 106 of file pcm.c.

#define S3C_PCM_FIFOSTAT_RXFIFOFULL   (0x1 << 1)

Definition at line 108 of file pcm.c.

#define S3C_PCM_FIFOSTAT_TXCNT_MSK   (0x3f << 14)

Definition at line 100 of file pcm.c.

#define S3C_PCM_FIFOSTAT_TXFIFOALMSTEMPTY   (0x1 << 12)

Definition at line 102 of file pcm.c.

#define S3C_PCM_FIFOSTAT_TXFIFOALMSTFULL   (0x1 << 10)

Definition at line 104 of file pcm.c.

#define S3C_PCM_FIFOSTAT_TXFIFOEMPTY   (0x1 << 13)

Definition at line 101 of file pcm.c.

#define S3C_PCM_FIFOSTAT_TXFIFOFULL   (0x1 << 11)

Definition at line 103 of file pcm.c.

#define S3C_PCM_IRQCTL   0x10

Definition at line 33 of file pcm.c.

#define S3C_PCM_IRQCTL_IRQEN   (0x1 << 14)

Definition at line 68 of file pcm.c.

#define S3C_PCM_IRQCTL_RXALMSTEMPTEN   (0x1 << 4)

Definition at line 77 of file pcm.c.

#define S3C_PCM_IRQCTL_RXALMSTFULLEN   (0x1 << 2)

Definition at line 79 of file pcm.c.

#define S3C_PCM_IRQCTL_RXEMPTEN   (0x1 << 5)

Definition at line 76 of file pcm.c.

#define S3C_PCM_IRQCTL_RXERROVRFLEN   (0x1 << 0)

Definition at line 81 of file pcm.c.

#define S3C_PCM_IRQCTL_RXFULLEN   (0x1 << 3)

Definition at line 78 of file pcm.c.

#define S3C_PCM_IRQCTL_RXSTARVEN   (0x1 << 1)

Definition at line 80 of file pcm.c.

#define S3C_PCM_IRQCTL_TXALMSTEMPTYEN   (0x1 << 10)

Definition at line 71 of file pcm.c.

#define S3C_PCM_IRQCTL_TXALMSTFULLEN   (0x1 << 8)

Definition at line 73 of file pcm.c.

#define S3C_PCM_IRQCTL_TXEMPTYEN   (0x1 << 11)

Definition at line 70 of file pcm.c.

#define S3C_PCM_IRQCTL_TXERROVRFLEN   (0x1 << 6)

Definition at line 75 of file pcm.c.

#define S3C_PCM_IRQCTL_TXFULLEN   (0x1 << 9)

Definition at line 72 of file pcm.c.

#define S3C_PCM_IRQCTL_TXSTARVEN   (0x1 << 7)

Definition at line 74 of file pcm.c.

#define S3C_PCM_IRQCTL_WRDEN   (0x1 << 12)

Definition at line 69 of file pcm.c.

#define S3C_PCM_IRQSTAT   0x14

Definition at line 34 of file pcm.c.

#define S3C_PCM_IRQSTAT_IRQPND   (0x1 << 13)

Definition at line 84 of file pcm.c.

#define S3C_PCM_IRQSTAT_RXALMSTEMPT   (0x1 << 4)

Definition at line 93 of file pcm.c.

#define S3C_PCM_IRQSTAT_RXALMSTFULL   (0x1 << 2)

Definition at line 95 of file pcm.c.

#define S3C_PCM_IRQSTAT_RXEMPT   (0x1 << 5)

Definition at line 92 of file pcm.c.

#define S3C_PCM_IRQSTAT_RXERROVRFL   (0x1 << 0)

Definition at line 97 of file pcm.c.

#define S3C_PCM_IRQSTAT_RXFULL   (0x1 << 3)

Definition at line 94 of file pcm.c.

#define S3C_PCM_IRQSTAT_RXSTARV   (0x1 << 1)

Definition at line 96 of file pcm.c.

#define S3C_PCM_IRQSTAT_TXALMSTEMPTY   (0x1 << 10)

Definition at line 87 of file pcm.c.

#define S3C_PCM_IRQSTAT_TXALMSTFULL   (0x1 << 8)

Definition at line 89 of file pcm.c.

#define S3C_PCM_IRQSTAT_TXEMPTY   (0x1 << 11)

Definition at line 86 of file pcm.c.

#define S3C_PCM_IRQSTAT_TXERROVRFL   (0x1 << 6)

Definition at line 91 of file pcm.c.

#define S3C_PCM_IRQSTAT_TXFULL   (0x1 << 9)

Definition at line 88 of file pcm.c.

#define S3C_PCM_IRQSTAT_TXSTARV   (0x1 << 7)

Definition at line 90 of file pcm.c.

#define S3C_PCM_IRQSTAT_WRD_XFER   (0x1 << 12)

Definition at line 85 of file pcm.c.

#define S3C_PCM_RATES   SNDRV_PCM_RATE_8000_96000

Definition at line 464 of file pcm.c.

#define S3C_PCM_RXFIFO   0x0C

Definition at line 32 of file pcm.c.

#define S3C_PCM_RXFIFO_DATA_MSK   (0xffff << 0)

Definition at line 65 of file pcm.c.

#define S3C_PCM_RXFIFO_DVALID   (0x1 << 16)

Definition at line 64 of file pcm.c.

#define S3C_PCM_TXFIFO   0x08

Definition at line 31 of file pcm.c.

#define S3C_PCM_TXFIFO_DATA_MSK   (0xffff << 0)

Definition at line 61 of file pcm.c.

#define S3C_PCM_TXFIFO_DVALID   (0x1 << 16)

Definition at line 60 of file pcm.c.

Function Documentation

MODULE_ALIAS ( "platform:samsung-pcm )
MODULE_AUTHOR ( "Jaswinder  Singh,
< jassisinghbrar @gmail.com >"   
)
MODULE_DESCRIPTION ( "S3C PCM Controller Driver"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( s3c_pcm_driver  )