blob: 0ebd7ea9706cc1ced01508562d866d520eb1dec6 [file] [log] [blame]
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +02001ASoC currently supports the three main Digital Audio Interfaces (DAI) found on
Mark Brown7c4dbbd2008-01-23 08:41:46 +01002SoC controllers and portable audio CODECs today, namely AC97, I2S and PCM.
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +02003
4
5AC97
6====
7
8 AC97 is a five wire interface commonly found on many PC sound cards. It is
9now also popular in many portable devices. This DAI has a reset line and time
10multiplexes its data on its SDATA_OUT (playback) and SDATA_IN (capture) lines.
11The bit clock (BCLK) is always driven by the CODEC (usually 12.288MHz) and the
12frame (FRAME) (usually 48kHz) is always driven by the controller. Each AC97
13frame is 21uS long and is divided into 13 time slots.
14
Liam Girdwooda71a4682006-10-19 20:35:56 +020015The AC97 specification can be found at :-
16http://www.intel.com/design/chipsets/audio/ac97_r23.pdf
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020017
18
19I2S
20===
21
22 I2S is a common 4 wire DAI used in HiFi, STB and portable devices. The Tx and
Matt LaPlante01dd2fb2007-10-20 01:34:40 +020023Rx lines are used for audio transmission, whilst the bit clock (BCLK) and
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020024left/right clock (LRC) synchronise the link. I2S is flexible in that either the
25controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock
26usually varies depending on the sample rate and the master system clock
27(SYSCLK). LRCLK is the same as the sample rate. A few devices support separate
Mark Brown7c4dbbd2008-01-23 08:41:46 +010028ADC and DAC LRCLKs, this allows for simultaneous capture and playback at
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020029different sample rates.
30
31I2S has several different operating modes:-
32
33 o I2S - MSB is transmitted on the falling edge of the first BCLK after LRC
34 transition.
35
36 o Left Justified - MSB is transmitted on transition of LRC.
37
Mark Brown7c4dbbd2008-01-23 08:41:46 +010038 o Right Justified - MSB is transmitted sample size BCLKs before LRC
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020039 transition.
40
41PCM
42===
43
Matt LaPlante01dd2fb2007-10-20 01:34:40 +020044PCM is another 4 wire interface, very similar to I2S, which can support a more
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020045flexible protocol. It has bit clock (BCLK) and sync (SYNC) lines that are used
46to synchronise the link whilst the Tx and Rx lines are used to transmit and
47receive the audio data. Bit clock usually varies depending on sample rate
48whilst sync runs at the sample rate. PCM also supports Time Division
Matt LaPlante01dd2fb2007-10-20 01:34:40 +020049Multiplexing (TDM) in that several devices can use the bus simultaneously (this
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020050is sometimes referred to as network mode).
51
52Common PCM operating modes:-
53
54 o Mode A - MSB is transmitted on falling edge of first BCLK after FRAME/SYNC.
55
56 o Mode B - MSB is transmitted on rising edge of FRAME/SYNC.