diff options
author | Liam Girdwood <lg@opensource.wolfsonmicro.com> | 2006-10-19 14:35:56 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:01:07 -0500 |
commit | a71a468a50f1385855e28864e26251b02df829bb (patch) | |
tree | 243daee96ea5c55c88a186aa03b7917f7ad533f6 /include/sound/soc.h | |
parent | 543a0fbe18d0b44f3d037fe6b59458fa0c0d5e4b (diff) |
[ALSA] ASoC: Add support for BCLK based on (Rate * Chn * Word Size)
This patch adds support for the DAI BCLK to be generated by multiplying
Rate * Channels * Word Size (RCW).
This now gives 3 options for BCLK clocking and synchronisation :-
1. BCLK = Rate * x
2. BCLK = MCLK / x
3. BCLK = Rate * Chn * Word Size. (New)
Changes:-
o Add support for RCW generation of BCLK
o Update Documentation to include RCW.
o Update DAI documentation for label = value DAI modes.
o Add RCW support to wm8731, wm8750 and pxa2xx-i2s drivers.
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index ecdd1fac94b6..3dfe052e0788 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <sound/control.h> | 21 | #include <sound/control.h> |
22 | #include <sound/ac97_codec.h> | 22 | #include <sound/ac97_codec.h> |
23 | 23 | ||
24 | #define SND_SOC_VERSION "0.11.8" | 24 | #define SND_SOC_VERSION "0.12" |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * Convenience kcontrol builders | 27 | * Convenience kcontrol builders |
@@ -141,19 +141,24 @@ | |||
141 | /* bit clock dividers */ | 141 | /* bit clock dividers */ |
142 | #define SND_SOC_FSBD(x) (1 << (x - 1)) /* ratio mclk:bclk */ | 142 | #define SND_SOC_FSBD(x) (1 << (x - 1)) /* ratio mclk:bclk */ |
143 | #define SND_SOC_FSBD_REAL(x) (ffs(x)) | 143 | #define SND_SOC_FSBD_REAL(x) (ffs(x)) |
144 | #define SND_SOC_FSBD_ALL 0xffff /* all bit clock dividers supported */ | ||
145 | 144 | ||
146 | /* bit clock ratio to sample rate */ | 145 | /* bit clock ratio to (sample rate * channels * word size) */ |
147 | #define SND_SOC_FSB(x) (1 << ((x - 16) / 16)) | 146 | #define SND_SOC_FSBW(x) (1 << (x - 1)) |
148 | #define SND_SOC_FSB_REAL(x) (((ffs(x) - 1) * 16) + 16) | 147 | #define SND_SOC_FSBW_REAL(x) (ffs(x)) |
149 | /* all bclk ratios supported */ | 148 | /* all bclk ratios supported */ |
150 | #define SND_SOC_FSB_ALL SND_SOC_FSBD_ALL | 149 | #define SND_SOC_FSB_ALL ~0ULL |
151 | 150 | ||
152 | /* | 151 | /* |
153 | * DAI hardware flags | 152 | * DAI hardware flags |
154 | */ | 153 | */ |
155 | /* use bfs mclk divider mode, else sample rate ratio */ | 154 | /* use bfs mclk divider mode (BCLK = MCLK / x) */ |
156 | #define SND_SOC_DAI_BFS_DIV 0x1 | 155 | #define SND_SOC_DAI_BFS_DIV 0x1 |
156 | /* use bfs rate mulitplier (BCLK = RATE * x)*/ | ||
157 | #define SND_SOC_DAI_BFS_RATE 0x2 | ||
158 | /* use bfs rcw multiplier (BCLK = RATE * CHN * WORD SIZE) */ | ||
159 | #define SND_SOC_DAI_BFS_RCW 0x4 | ||
160 | /* capture and playback can use different clocks */ | ||
161 | #define SND_SOC_DAI_ASYNC 0x8 | ||
157 | 162 | ||
158 | /* | 163 | /* |
159 | * AC97 codec ID's bitmask | 164 | * AC97 codec ID's bitmask |
@@ -264,7 +269,7 @@ struct snd_soc_dai_mode { | |||
264 | u16 pcmdir:2; /* SND_SOC_HWDIR_* */ | 269 | u16 pcmdir:2; /* SND_SOC_HWDIR_* */ |
265 | u16 flags:8; /* hw flags */ | 270 | u16 flags:8; /* hw flags */ |
266 | u16 fs; /* mclk to rate divider */ | 271 | u16 fs; /* mclk to rate divider */ |
267 | u32 bfs; /* mclk to bclk dividers */ | 272 | u64 bfs; /* mclk to bclk dividers */ |
268 | unsigned long priv; /* private mode data */ | 273 | unsigned long priv; /* private mode data */ |
269 | }; | 274 | }; |
270 | 275 | ||