aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 11:00:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 11:00:30 -0500
commita429638cac1e5c656818a45aaff78df7b743004e (patch)
tree0465e0d7a431bff97a3dd5a1f91d9b30c69ae0d8 /include
parent5cf9a4e69c1ff0ccdd1d2b7404f95c0531355274 (diff)
parent9e4ce164ee3a1d07580f017069c25d180b0aa785 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (526 commits) ASoC: twl6040 - Add method to query optimum PDM_DL1 gain ALSA: hda - Fix the lost power-setup of seconary pins after PM resume ALSA: usb-audio: add Yamaha MOX6/MOX8 support ALSA: virtuoso: add S/PDIF input support for all Xonars ALSA: ice1724 - Support for ooAoo SQ210a ALSA: ice1724 - Allow card info based on model only ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations ALSA: hdspm - Provide unique driver id based on card serial ASoC: Dynamically allocate the rtd device for a non-empty release() ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC ALSA: hda - Fix the detection of "Loopback Mixing" control for VIA codecs ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs ALSA: hda - Use auto-parser for HP laptops with cx20459 codec ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info() ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref() ALSA: hda/cirrus - support for iMac12,2 model ASoC: cx20442: add bias control over a platform provided regulator ALSA: usb-audio - Avoid flood of frame-active debug messages ALSA: snd-usb-us122l: Delete calls to preempt_disable mfd: Put WM8994 into cache only mode when suspending ... Fix up trivial conflicts in: - arch/arm/mach-s3c64xx/mach-crag6410.c: renamed speyside_wm8962 to tobermory, added littlemill right next to it - drivers/base/regmap/{regcache.c,regmap.c}: duplicate diff that had already come in with other changes in the regmap tree
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/wm8994/core.h7
-rw-r--r--include/linux/mfd/wm8994/pdata.h31
-rw-r--r--include/linux/mfd/wm8994/registers.h112
-rw-r--r--include/linux/sigma.h55
-rw-r--r--include/sound/Kbuild2
-rw-r--r--include/sound/compress_driver.h167
-rw-r--r--include/sound/compress_offload.h161
-rw-r--r--include/sound/compress_params.h397
-rw-r--r--include/sound/control.h8
-rw-r--r--include/sound/core.h1
-rw-r--r--include/sound/minors.h4
-rw-r--r--include/sound/sh_fsi.h12
-rw-r--r--include/sound/soc-dapm.h5
-rw-r--r--include/sound/soc.h27
-rw-r--r--include/sound/sta32x.h35
-rw-r--r--include/sound/wm8903.h7
16 files changed, 960 insertions, 71 deletions
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index f44bdb7273bd..9eff2a351ec5 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -15,6 +15,7 @@
15#ifndef __MFD_WM8994_CORE_H__ 15#ifndef __MFD_WM8994_CORE_H__
16#define __MFD_WM8994_CORE_H__ 16#define __MFD_WM8994_CORE_H__
17 17
18#include <linux/mutex.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19 20
20enum wm8994_type { 21enum wm8994_type {
@@ -55,6 +56,7 @@ struct wm8994 {
55 struct mutex irq_lock; 56 struct mutex irq_lock;
56 57
57 enum wm8994_type type; 58 enum wm8994_type type;
59 int revision;
58 60
59 struct device *dev; 61 struct device *dev;
60 struct regmap *regmap; 62 struct regmap *regmap;
@@ -65,13 +67,10 @@ struct wm8994 {
65 int irq_base; 67 int irq_base;
66 68
67 int irq; 69 int irq;
68 u16 irq_masks_cur[WM8994_NUM_IRQ_REGS]; 70 struct regmap_irq_chip_data *irq_data;
69 u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
70 71
71 /* Used over suspend/resume */ 72 /* Used over suspend/resume */
72 bool suspended; 73 bool suspended;
73 u16 ldo_regs[WM8994_NUM_LDO_REGS];
74 u16 gpio_regs[WM8994_NUM_GPIO_REGS];
75 74
76 struct regulator_dev *dbvdd; 75 struct regulator_dev *dbvdd;
77 int num_supplies; 76 int num_supplies;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index ea32f306dca6..3fb1f407d5e6 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -23,7 +23,7 @@ struct wm8994_ldo_pdata {
23 int enable; 23 int enable;
24 24
25 const char *supply; 25 const char *supply;
26 struct regulator_init_data *init_data; 26 const struct regulator_init_data *init_data;
27}; 27};
28 28
29#define WM8994_CONFIGURE_GPIO 0x10000 29#define WM8994_CONFIGURE_GPIO 0x10000
@@ -113,6 +113,23 @@ struct wm8958_enh_eq_cfg {
113 u16 regs[WM8958_ENH_EQ_REGS]; 113 u16 regs[WM8958_ENH_EQ_REGS];
114}; 114};
115 115
116/**
117 * Microphone detection rates, used to tune response rates and power
118 * consumption for WM8958/WM1811 microphone detection.
119 *
120 * @sysclk: System clock rate to use this configuration for.
121 * @idle: True if this configuration should use when no accessory is detected,
122 * false otherwise.
123 * @start: Value for MICD_BIAS_START_TIME register field (not shifted).
124 * @rate: Value for MICD_RATE register field (not shifted).
125 */
126struct wm8958_micd_rate {
127 int sysclk;
128 bool idle;
129 int start;
130 int rate;
131};
132
116struct wm8994_pdata { 133struct wm8994_pdata {
117 int gpio_base; 134 int gpio_base;
118 135
@@ -144,6 +161,9 @@ struct wm8994_pdata {
144 int num_enh_eq_cfgs; 161 int num_enh_eq_cfgs;
145 struct wm8958_enh_eq_cfg *enh_eq_cfgs; 162 struct wm8958_enh_eq_cfg *enh_eq_cfgs;
146 163
164 int num_micd_rates;
165 struct wm8958_micd_rate *micd_rates;
166
147 /* LINEOUT can be differential or single ended */ 167 /* LINEOUT can be differential or single ended */
148 unsigned int lineout1_diff:1; 168 unsigned int lineout1_diff:1;
149 unsigned int lineout2_diff:1; 169 unsigned int lineout2_diff:1;
@@ -168,12 +188,21 @@ struct wm8994_pdata {
168 /* WM8958 microphone bias configuration */ 188 /* WM8958 microphone bias configuration */
169 int micbias[2]; 189 int micbias[2];
170 190
191 /* WM8958 microphone detection ranges */
192 u16 micd_lvl_sel;
193
171 /* Disable the internal pull downs on the LDOs if they are 194 /* Disable the internal pull downs on the LDOs if they are
172 * always driven (eg, connected to an always on supply or 195 * always driven (eg, connected to an always on supply or
173 * GPIO that always drives an output. If they float power 196 * GPIO that always drives an output. If they float power
174 * consumption will rise. 197 * consumption will rise.
175 */ 198 */
176 bool ldo_ena_always_driven; 199 bool ldo_ena_always_driven;
200
201 /*
202 * SPKMODE must be pulled internally by the device on this
203 * system.
204 */
205 bool spkmode_pu;
177}; 206};
178 207
179#endif 208#endif
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
index 83a9caec0e43..86e6a032a078 100644
--- a/include/linux/mfd/wm8994/registers.h
+++ b/include/linux/mfd/wm8994/registers.h
@@ -95,11 +95,15 @@
95#define WM8994_FLL1_CONTROL_3 0x222 95#define WM8994_FLL1_CONTROL_3 0x222
96#define WM8994_FLL1_CONTROL_4 0x223 96#define WM8994_FLL1_CONTROL_4 0x223
97#define WM8994_FLL1_CONTROL_5 0x224 97#define WM8994_FLL1_CONTROL_5 0x224
98#define WM8958_FLL1_EFS_1 0x226
99#define WM8958_FLL1_EFS_2 0x227
98#define WM8994_FLL2_CONTROL_1 0x240 100#define WM8994_FLL2_CONTROL_1 0x240
99#define WM8994_FLL2_CONTROL_2 0x241 101#define WM8994_FLL2_CONTROL_2 0x241
100#define WM8994_FLL2_CONTROL_3 0x242 102#define WM8994_FLL2_CONTROL_3 0x242
101#define WM8994_FLL2_CONTROL_4 0x243 103#define WM8994_FLL2_CONTROL_4 0x243
102#define WM8994_FLL2_CONTROL_5 0x244 104#define WM8994_FLL2_CONTROL_5 0x244
105#define WM8958_FLL2_EFS_1 0x246
106#define WM8958_FLL2_EFS_2 0x247
103#define WM8994_AIF1_CONTROL_1 0x300 107#define WM8994_AIF1_CONTROL_1 0x300
104#define WM8994_AIF1_CONTROL_2 0x301 108#define WM8994_AIF1_CONTROL_2 0x301
105#define WM8994_AIF1_MASTER_SLAVE 0x302 109#define WM8994_AIF1_MASTER_SLAVE 0x302
@@ -116,6 +120,7 @@
116#define WM8994_AIF2DAC_LRCLK 0x315 120#define WM8994_AIF2DAC_LRCLK 0x315
117#define WM8994_AIF2DAC_DATA 0x316 121#define WM8994_AIF2DAC_DATA 0x316
118#define WM8994_AIF2ADC_DATA 0x317 122#define WM8994_AIF2ADC_DATA 0x317
123#define WM1811_AIF2TX_CONTROL 0x318
119#define WM8958_AIF3_CONTROL_1 0x320 124#define WM8958_AIF3_CONTROL_1 0x320
120#define WM8958_AIF3_CONTROL_2 0x321 125#define WM8958_AIF3_CONTROL_2 0x321
121#define WM8958_AIF3DAC_DATA 0x322 126#define WM8958_AIF3DAC_DATA 0x322
@@ -166,6 +171,7 @@
166#define WM8994_AIF1_DAC1_EQ_BAND_5_A 0x491 171#define WM8994_AIF1_DAC1_EQ_BAND_5_A 0x491
167#define WM8994_AIF1_DAC1_EQ_BAND_5_B 0x492 172#define WM8994_AIF1_DAC1_EQ_BAND_5_B 0x492
168#define WM8994_AIF1_DAC1_EQ_BAND_5_PG 0x493 173#define WM8994_AIF1_DAC1_EQ_BAND_5_PG 0x493
174#define WM8994_AIF1_DAC1_EQ_BAND_1_C 0x494
169#define WM8994_AIF1_DAC2_EQ_GAINS_1 0x4A0 175#define WM8994_AIF1_DAC2_EQ_GAINS_1 0x4A0
170#define WM8994_AIF1_DAC2_EQ_GAINS_2 0x4A1 176#define WM8994_AIF1_DAC2_EQ_GAINS_2 0x4A1
171#define WM8994_AIF1_DAC2_EQ_BAND_1_A 0x4A2 177#define WM8994_AIF1_DAC2_EQ_BAND_1_A 0x4A2
@@ -186,6 +192,7 @@
186#define WM8994_AIF1_DAC2_EQ_BAND_5_A 0x4B1 192#define WM8994_AIF1_DAC2_EQ_BAND_5_A 0x4B1
187#define WM8994_AIF1_DAC2_EQ_BAND_5_B 0x4B2 193#define WM8994_AIF1_DAC2_EQ_BAND_5_B 0x4B2
188#define WM8994_AIF1_DAC2_EQ_BAND_5_PG 0x4B3 194#define WM8994_AIF1_DAC2_EQ_BAND_5_PG 0x4B3
195#define WM8994_AIF1_DAC2_EQ_BAND_1_C 0x4B4
189#define WM8994_AIF2_ADC_LEFT_VOLUME 0x500 196#define WM8994_AIF2_ADC_LEFT_VOLUME 0x500
190#define WM8994_AIF2_ADC_RIGHT_VOLUME 0x501 197#define WM8994_AIF2_ADC_RIGHT_VOLUME 0x501
191#define WM8994_AIF2_DAC_LEFT_VOLUME 0x502 198#define WM8994_AIF2_DAC_LEFT_VOLUME 0x502
@@ -219,6 +226,7 @@
219#define WM8994_AIF2_EQ_BAND_5_A 0x591 226#define WM8994_AIF2_EQ_BAND_5_A 0x591
220#define WM8994_AIF2_EQ_BAND_5_B 0x592 227#define WM8994_AIF2_EQ_BAND_5_B 0x592
221#define WM8994_AIF2_EQ_BAND_5_PG 0x593 228#define WM8994_AIF2_EQ_BAND_5_PG 0x593
229#define WM8994_AIF2_EQ_BAND_1_C 0x594
222#define WM8994_DAC1_MIXER_VOLUMES 0x600 230#define WM8994_DAC1_MIXER_VOLUMES 0x600
223#define WM8994_DAC1_LEFT_MIXER_ROUTING 0x601 231#define WM8994_DAC1_LEFT_MIXER_ROUTING 0x601
224#define WM8994_DAC1_RIGHT_MIXER_ROUTING 0x602 232#define WM8994_DAC1_RIGHT_MIXER_ROUTING 0x602
@@ -242,6 +250,7 @@
242#define WM8994_GPIO_4 0x703 250#define WM8994_GPIO_4 0x703
243#define WM8994_GPIO_5 0x704 251#define WM8994_GPIO_5 0x704
244#define WM8994_GPIO_6 0x705 252#define WM8994_GPIO_6 0x705
253#define WM1811_JACKDET_CTRL 0x705
245#define WM8994_GPIO_7 0x706 254#define WM8994_GPIO_7 0x706
246#define WM8994_GPIO_8 0x707 255#define WM8994_GPIO_8 0x707
247#define WM8994_GPIO_9 0x708 256#define WM8994_GPIO_9 0x708
@@ -264,7 +273,43 @@
264#define WM8958_DSP2_RELEASETIME 0xA03 273#define WM8958_DSP2_RELEASETIME 0xA03
265#define WM8958_DSP2_VERMAJMIN 0xA04 274#define WM8958_DSP2_VERMAJMIN 0xA04
266#define WM8958_DSP2_VERBUILD 0xA05 275#define WM8958_DSP2_VERBUILD 0xA05
276#define WM8958_DSP2_TESTREG 0xA06
277#define WM8958_DSP2_XORREG 0xA07
278#define WM8958_DSP2_SHIFTMAXX 0xA08
279#define WM8958_DSP2_SHIFTMAXY 0xA09
280#define WM8958_DSP2_SHIFTMAXZ 0xA0A
281#define WM8958_DSP2_SHIFTMAXEXTLO 0xA0B
282#define WM8958_DSP2_AESSELECT 0xA0C
267#define WM8958_DSP2_EXECCONTROL 0xA0D 283#define WM8958_DSP2_EXECCONTROL 0xA0D
284#define WM8958_DSP2_SAMPLEBREAK 0xA0E
285#define WM8958_DSP2_COUNTBREAK 0xA0F
286#define WM8958_DSP2_INTSTATUS 0xA10
287#define WM8958_DSP2_EVENTSTATUS 0xA11
288#define WM8958_DSP2_INTMASK 0xA12
289#define WM8958_DSP2_CONFIGDWIDTH 0xA13
290#define WM8958_DSP2_CONFIGINSTR 0xA14
291#define WM8958_DSP2_CONFIGDMEM 0xA15
292#define WM8958_DSP2_CONFIGDELAYS 0xA16
293#define WM8958_DSP2_CONFIGNUMIO 0xA17
294#define WM8958_DSP2_CONFIGEXTDEPTH 0xA18
295#define WM8958_DSP2_CONFIGMULTIPLIER 0xA19
296#define WM8958_DSP2_CONFIGCTRLDWIDTH 0xA1A
297#define WM8958_DSP2_CONFIGPIPELINE 0xA1B
298#define WM8958_DSP2_SHIFTMAXEXTHI 0xA1C
299#define WM8958_DSP2_SWVERSIONREG 0xA1D
300#define WM8958_DSP2_CONFIGXMEM 0xA1E
301#define WM8958_DSP2_CONFIGYMEM 0xA1F
302#define WM8958_DSP2_CONFIGZMEM 0xA20
303#define WM8958_FW_BUILD_1 0x2000
304#define WM8958_FW_BUILD_0 0x2001
305#define WM8958_FW_ID_1 0x2002
306#define WM8958_FW_ID_0 0x2003
307#define WM8958_FW_MAJOR_1 0x2004
308#define WM8958_FW_MAJOR_0 0x2005
309#define WM8958_FW_MINOR_1 0x2006
310#define WM8958_FW_MINOR_0 0x2007
311#define WM8958_FW_PATCH_1 0x2008
312#define WM8958_FW_PATCH_0 0x2009
268#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200 313#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200
269#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201 314#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201
270#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202 315#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202
@@ -333,6 +378,14 @@
333#define WM8958_MBC_B2_PG2_2 0x242D 378#define WM8958_MBC_B2_PG2_2 0x242D
334#define WM8958_MBC_B1_PG2_1 0x242E 379#define WM8958_MBC_B1_PG2_1 0x242E
335#define WM8958_MBC_B1_PG2_2 0x242F 380#define WM8958_MBC_B1_PG2_2 0x242F
381#define WM8958_MBC_CROSSOVER_1 0x2600
382#define WM8958_MBC_CROSSOVER_2 0x2601
383#define WM8958_MBC_HPF_1 0x2602
384#define WM8958_MBC_HPF_2 0x2603
385#define WM8958_MBC_LPF_1 0x2606
386#define WM8958_MBC_LPF_2 0x2607
387#define WM8958_MBC_RMS_LIMIT_1 0x260A
388#define WM8958_MBC_RMS_LIMIT_2 0x260B
336#define WM8994_WRITE_SEQUENCER_0 0x3000 389#define WM8994_WRITE_SEQUENCER_0 0x3000
337#define WM8994_WRITE_SEQUENCER_1 0x3001 390#define WM8994_WRITE_SEQUENCER_1 0x3001
338#define WM8994_WRITE_SEQUENCER_2 0x3002 391#define WM8994_WRITE_SEQUENCER_2 0x3002
@@ -1852,6 +1905,9 @@
1852/* 1905/*
1853 * R57 (0x39) - AntiPOP (2) 1906 * R57 (0x39) - AntiPOP (2)
1854 */ 1907 */
1908#define WM1811_JACKDET_MODE_MASK 0x0180 /* JACKDET_MODE - [8:7] */
1909#define WM1811_JACKDET_MODE_SHIFT 7 /* JACKDET_MODE - [8:7] */
1910#define WM1811_JACKDET_MODE_WIDTH 2 /* JACKDET_MODE - [8:7] */
1855#define WM8994_MICB2_DISCH 0x0100 /* MICB2_DISCH */ 1911#define WM8994_MICB2_DISCH 0x0100 /* MICB2_DISCH */
1856#define WM8994_MICB2_DISCH_MASK 0x0100 /* MICB2_DISCH */ 1912#define WM8994_MICB2_DISCH_MASK 0x0100 /* MICB2_DISCH */
1857#define WM8994_MICB2_DISCH_SHIFT 8 /* MICB2_DISCH */ 1913#define WM8994_MICB2_DISCH_SHIFT 8 /* MICB2_DISCH */
@@ -2389,6 +2445,10 @@
2389/* 2445/*
2390 * R548 (0x224) - FLL1 Control (5) 2446 * R548 (0x224) - FLL1 Control (5)
2391 */ 2447 */
2448#define WM8958_FLL1_BYP 0x8000 /* FLL1_BYP */
2449#define WM8958_FLL1_BYP_MASK 0x8000 /* FLL1_BYP */
2450#define WM8958_FLL1_BYP_SHIFT 15 /* FLL1_BYP */
2451#define WM8958_FLL1_BYP_WIDTH 1 /* FLL1_BYP */
2392#define WM8994_FLL1_FRC_NCO_VAL_MASK 0x1F80 /* FLL1_FRC_NCO_VAL - [12:7] */ 2452#define WM8994_FLL1_FRC_NCO_VAL_MASK 0x1F80 /* FLL1_FRC_NCO_VAL - [12:7] */
2393#define WM8994_FLL1_FRC_NCO_VAL_SHIFT 7 /* FLL1_FRC_NCO_VAL - [12:7] */ 2453#define WM8994_FLL1_FRC_NCO_VAL_SHIFT 7 /* FLL1_FRC_NCO_VAL - [12:7] */
2394#define WM8994_FLL1_FRC_NCO_VAL_WIDTH 6 /* FLL1_FRC_NCO_VAL - [12:7] */ 2454#define WM8994_FLL1_FRC_NCO_VAL_WIDTH 6 /* FLL1_FRC_NCO_VAL - [12:7] */
@@ -2404,6 +2464,24 @@
2404#define WM8994_FLL1_REFCLK_SRC_WIDTH 2 /* FLL1_REFCLK_SRC - [1:0] */ 2464#define WM8994_FLL1_REFCLK_SRC_WIDTH 2 /* FLL1_REFCLK_SRC - [1:0] */
2405 2465
2406/* 2466/*
2467 * R550 (0x226) - FLL1 EFS 1
2468 */
2469#define WM8958_FLL1_LAMBDA_MASK 0xFFFF /* FLL1_LAMBDA - [15:0] */
2470#define WM8958_FLL1_LAMBDA_SHIFT 0 /* FLL1_LAMBDA - [15:0] */
2471#define WM8958_FLL1_LAMBDA_WIDTH 16 /* FLL1_LAMBDA - [15:0] */
2472
2473/*
2474 * R551 (0x227) - FLL1 EFS 2
2475 */
2476#define WM8958_FLL1_LFSR_SEL_MASK 0x0006 /* FLL1_LFSR_SEL - [2:1] */
2477#define WM8958_FLL1_LFSR_SEL_SHIFT 1 /* FLL1_LFSR_SEL - [2:1] */
2478#define WM8958_FLL1_LFSR_SEL_WIDTH 2 /* FLL1_LFSR_SEL - [2:1] */
2479#define WM8958_FLL1_EFS_ENA 0x0001 /* FLL1_EFS_ENA */
2480#define WM8958_FLL1_EFS_ENA_MASK 0x0001 /* FLL1_EFS_ENA */
2481#define WM8958_FLL1_EFS_ENA_SHIFT 0 /* FLL1_EFS_ENA */
2482#define WM8958_FLL1_EFS_ENA_WIDTH 1 /* FLL1_EFS_ENA */
2483
2484/*
2407 * R576 (0x240) - FLL2 Control (1) 2485 * R576 (0x240) - FLL2 Control (1)
2408 */ 2486 */
2409#define WM8994_FLL2_FRAC 0x0004 /* FLL2_FRAC */ 2487#define WM8994_FLL2_FRAC 0x0004 /* FLL2_FRAC */
@@ -2452,6 +2530,10 @@
2452/* 2530/*
2453 * R580 (0x244) - FLL2 Control (5) 2531 * R580 (0x244) - FLL2 Control (5)
2454 */ 2532 */
2533#define WM8958_FLL2_BYP 0x8000 /* FLL2_BYP */
2534#define WM8958_FLL2_BYP_MASK 0x8000 /* FLL2_BYP */
2535#define WM8958_FLL2_BYP_SHIFT 15 /* FLL2_BYP */
2536#define WM8958_FLL2_BYP_WIDTH 1 /* FLL2_BYP */
2455#define WM8994_FLL2_FRC_NCO_VAL_MASK 0x1F80 /* FLL2_FRC_NCO_VAL - [12:7] */ 2537#define WM8994_FLL2_FRC_NCO_VAL_MASK 0x1F80 /* FLL2_FRC_NCO_VAL - [12:7] */
2456#define WM8994_FLL2_FRC_NCO_VAL_SHIFT 7 /* FLL2_FRC_NCO_VAL - [12:7] */ 2538#define WM8994_FLL2_FRC_NCO_VAL_SHIFT 7 /* FLL2_FRC_NCO_VAL - [12:7] */
2457#define WM8994_FLL2_FRC_NCO_VAL_WIDTH 6 /* FLL2_FRC_NCO_VAL - [12:7] */ 2539#define WM8994_FLL2_FRC_NCO_VAL_WIDTH 6 /* FLL2_FRC_NCO_VAL - [12:7] */
@@ -2467,6 +2549,24 @@
2467#define WM8994_FLL2_REFCLK_SRC_WIDTH 2 /* FLL2_REFCLK_SRC - [1:0] */ 2549#define WM8994_FLL2_REFCLK_SRC_WIDTH 2 /* FLL2_REFCLK_SRC - [1:0] */
2468 2550
2469/* 2551/*
2552 * R582 (0x246) - FLL2 EFS 1
2553 */
2554#define WM8958_FLL2_LAMBDA_MASK 0xFFFF /* FLL2_LAMBDA - [15:0] */
2555#define WM8958_FLL2_LAMBDA_SHIFT 0 /* FLL2_LAMBDA - [15:0] */
2556#define WM8958_FLL2_LAMBDA_WIDTH 16 /* FLL2_LAMBDA - [15:0] */
2557
2558/*
2559 * R583 (0x247) - FLL2 EFS 2
2560 */
2561#define WM8958_FLL2_LFSR_SEL_MASK 0x0006 /* FLL2_LFSR_SEL - [2:1] */
2562#define WM8958_FLL2_LFSR_SEL_SHIFT 1 /* FLL2_LFSR_SEL - [2:1] */
2563#define WM8958_FLL2_LFSR_SEL_WIDTH 2 /* FLL2_LFSR_SEL - [2:1] */
2564#define WM8958_FLL2_EFS_ENA 0x0001 /* FLL2_EFS_ENA */
2565#define WM8958_FLL2_EFS_ENA_MASK 0x0001 /* FLL2_EFS_ENA */
2566#define WM8958_FLL2_EFS_ENA_SHIFT 0 /* FLL2_EFS_ENA */
2567#define WM8958_FLL2_EFS_ENA_WIDTH 1 /* FLL2_EFS_ENA */
2568
2569/*
2470 * R768 (0x300) - AIF1 Control (1) 2570 * R768 (0x300) - AIF1 Control (1)
2471 */ 2571 */
2472#define WM8994_AIF1ADCL_SRC 0x8000 /* AIF1ADCL_SRC */ 2572#define WM8994_AIF1ADCL_SRC 0x8000 /* AIF1ADCL_SRC */
@@ -4187,6 +4287,18 @@
4187#define WM8994_STL_SEL_WIDTH 1 /* STL_SEL */ 4287#define WM8994_STL_SEL_WIDTH 1 /* STL_SEL */
4188 4288
4189/* 4289/*
4290 * R1797 (0x705) - JACKDET Ctrl
4291 */
4292#define WM1811_JACKDET_DB 0x0100 /* JACKDET_DB */
4293#define WM1811_JACKDET_DB_MASK 0x0100 /* JACKDET_DB */
4294#define WM1811_JACKDET_DB_SHIFT 8 /* JACKDET_DB */
4295#define WM1811_JACKDET_DB_WIDTH 1 /* JACKDET_DB */
4296#define WM1811_JACKDET_LVL 0x0040 /* JACKDET_LVL */
4297#define WM1811_JACKDET_LVL_MASK 0x0040 /* JACKDET_LVL */
4298#define WM1811_JACKDET_LVL_SHIFT 6 /* JACKDET_LVL */
4299#define WM1811_JACKDET_LVL_WIDTH 1 /* JACKDET_LVL */
4300
4301/*
4190 * R1824 (0x720) - Pull Control (1) 4302 * R1824 (0x720) - Pull Control (1)
4191 */ 4303 */
4192#define WM8994_DMICDAT2_PU 0x0800 /* DMICDAT2_PU */ 4304#define WM8994_DMICDAT2_PU 0x0800 /* DMICDAT2_PU */
diff --git a/include/linux/sigma.h b/include/linux/sigma.h
deleted file mode 100644
index d0de882c0d96..000000000000
--- a/include/linux/sigma.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Load firmware files from Analog Devices SigmaStudio
3 *
4 * Copyright 2009-2011 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __SIGMA_FIRMWARE_H__
10#define __SIGMA_FIRMWARE_H__
11
12#include <linux/firmware.h>
13#include <linux/types.h>
14
15struct i2c_client;
16
17#define SIGMA_MAGIC "ADISIGM"
18
19struct sigma_firmware {
20 const struct firmware *fw;
21 size_t pos;
22};
23
24struct sigma_firmware_header {
25 unsigned char magic[7];
26 u8 version;
27 __le32 crc;
28};
29
30enum {
31 SIGMA_ACTION_WRITEXBYTES = 0,
32 SIGMA_ACTION_WRITESINGLE,
33 SIGMA_ACTION_WRITESAFELOAD,
34 SIGMA_ACTION_DELAY,
35 SIGMA_ACTION_PLLWAIT,
36 SIGMA_ACTION_NOOP,
37 SIGMA_ACTION_END,
38};
39
40struct sigma_action {
41 u8 instr;
42 u8 len_hi;
43 __le16 len;
44 __be16 addr;
45 unsigned char payload[];
46};
47
48static inline u32 sigma_action_len(struct sigma_action *sa)
49{
50 return (sa->len_hi << 16) | le16_to_cpu(sa->len);
51}
52
53extern int process_sigma_firmware(struct i2c_client *client, const char *name);
54
55#endif
diff --git a/include/sound/Kbuild b/include/sound/Kbuild
index 802947f60915..6df30ed1581c 100644
--- a/include/sound/Kbuild
+++ b/include/sound/Kbuild
@@ -6,3 +6,5 @@ header-y += hdsp.h
6header-y += hdspm.h 6header-y += hdspm.h
7header-y += sb16_csp.h 7header-y += sb16_csp.h
8header-y += sfnt_info.h 8header-y += sfnt_info.h
9header-y += compress_params.h
10header-y += compress_offload.h
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h
new file mode 100644
index 000000000000..48f2a1ff2bbc
--- /dev/null
+++ b/include/sound/compress_driver.h
@@ -0,0 +1,167 @@
1/*
2 * compress_driver.h - compress offload driver definations
3 *
4 * Copyright (C) 2011 Intel Corporation
5 * Authors: Vinod Koul <vinod.koul@linux.intel.com>
6 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 *
24 */
25#ifndef __COMPRESS_DRIVER_H
26#define __COMPRESS_DRIVER_H
27
28#include <linux/types.h>
29#include <linux/sched.h>
30#include <sound/compress_offload.h>
31#include <sound/asound.h>
32#include <sound/pcm.h>
33
34struct snd_compr_ops;
35
36/**
37 * struct snd_compr_runtime: runtime stream description
38 * @state: stream state
39 * @ops: pointer to DSP callbacks
40 * @buffer: pointer to kernel buffer, valid only when not in mmap mode or
41 * DSP doesn't implement copy
42 * @buffer_size: size of the above buffer
43 * @fragment_size: size of buffer fragment in bytes
44 * @fragments: number of such fragments
45 * @hw_pointer: offset of last location in buffer where DSP copied data
46 * @app_pointer: offset of last location in buffer where app wrote data
47 * @total_bytes_available: cumulative number of bytes made available in
48 * the ring buffer
49 * @total_bytes_transferred: cumulative bytes transferred by offload DSP
50 * @sleep: poll sleep
51 */
52struct snd_compr_runtime {
53 snd_pcm_state_t state;
54 struct snd_compr_ops *ops;
55 void *buffer;
56 u64 buffer_size;
57 u32 fragment_size;
58 u32 fragments;
59 u64 hw_pointer;
60 u64 app_pointer;
61 u64 total_bytes_available;
62 u64 total_bytes_transferred;
63 wait_queue_head_t sleep;
64};
65
66/**
67 * struct snd_compr_stream: compressed stream
68 * @name: device name
69 * @ops: pointer to DSP callbacks
70 * @runtime: pointer to runtime structure
71 * @device: device pointer
72 * @direction: stream direction, playback/recording
73 * @private_data: pointer to DSP private data
74 */
75struct snd_compr_stream {
76 const char *name;
77 struct snd_compr_ops *ops;
78 struct snd_compr_runtime *runtime;
79 struct snd_compr *device;
80 enum snd_compr_direction direction;
81 void *private_data;
82};
83
84/**
85 * struct snd_compr_ops: compressed path DSP operations
86 * @open: Open the compressed stream
87 * This callback is mandatory and shall keep dsp ready to receive the stream
88 * parameter
89 * @free: Close the compressed stream, mandatory
90 * @set_params: Sets the compressed stream parameters, mandatory
91 * This can be called in during stream creation only to set codec params
92 * and the stream properties
93 * @get_params: retrieve the codec parameters, mandatory
94 * @trigger: Trigger operations like start, pause, resume, drain, stop.
95 * This callback is mandatory
96 * @pointer: Retrieve current h/w pointer information. Mandatory
97 * @copy: Copy the compressed data to/from userspace, Optional
98 * Can't be implemented if DSP supports mmap
99 * @mmap: DSP mmap method to mmap DSP memory
100 * @ack: Ack for DSP when data is written to audio buffer, Optional
101 * Not valid if copy is implemented
102 * @get_caps: Retrieve DSP capabilities, mandatory
103 * @get_codec_caps: Retrieve capabilities for a specific codec, mandatory
104 */
105struct snd_compr_ops {
106 int (*open)(struct snd_compr_stream *stream);
107 int (*free)(struct snd_compr_stream *stream);
108 int (*set_params)(struct snd_compr_stream *stream,
109 struct snd_compr_params *params);
110 int (*get_params)(struct snd_compr_stream *stream,
111 struct snd_codec *params);
112 int (*trigger)(struct snd_compr_stream *stream, int cmd);
113 int (*pointer)(struct snd_compr_stream *stream,
114 struct snd_compr_tstamp *tstamp);
115 int (*copy)(struct snd_compr_stream *stream, const char __user *buf,
116 size_t count);
117 int (*mmap)(struct snd_compr_stream *stream,
118 struct vm_area_struct *vma);
119 int (*ack)(struct snd_compr_stream *stream, size_t bytes);
120 int (*get_caps) (struct snd_compr_stream *stream,
121 struct snd_compr_caps *caps);
122 int (*get_codec_caps) (struct snd_compr_stream *stream,
123 struct snd_compr_codec_caps *codec);
124};
125
126/**
127 * struct snd_compr: Compressed device
128 * @name: DSP device name
129 * @dev: Device pointer
130 * @ops: pointer to DSP callbacks
131 * @private_data: pointer to DSP pvt data
132 * @card: sound card pointer
133 * @direction: Playback or capture direction
134 * @lock: device lock
135 * @device: device id
136 */
137struct snd_compr {
138 const char *name;
139 struct device *dev;
140 struct snd_compr_ops *ops;
141 void *private_data;
142 struct snd_card *card;
143 unsigned int direction;
144 struct mutex lock;
145 int device;
146};
147
148/* compress device register APIs */
149int snd_compress_register(struct snd_compr *device);
150int snd_compress_deregister(struct snd_compr *device);
151int snd_compress_new(struct snd_card *card, int device,
152 int type, struct snd_compr *compr);
153
154/* dsp driver callback apis
155 * For playback: driver should call snd_compress_fragment_elapsed() to let the
156 * framework know that a fragment has been consumed from the ring buffer
157 *
158 * For recording: we want to know when a frame is available or when
159 * at least one frame is available so snd_compress_frame_elapsed()
160 * callback should be called when a encodeded frame is available
161 */
162static inline void snd_compr_fragment_elapsed(struct snd_compr_stream *stream)
163{
164 wake_up(&stream->runtime->sleep);
165}
166
167#endif
diff --git a/include/sound/compress_offload.h b/include/sound/compress_offload.h
new file mode 100644
index 000000000000..05341a43fedf
--- /dev/null
+++ b/include/sound/compress_offload.h
@@ -0,0 +1,161 @@
1/*
2 * compress_offload.h - compress offload header definations
3 *
4 * Copyright (C) 2011 Intel Corporation
5 * Authors: Vinod Koul <vinod.koul@linux.intel.com>
6 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 *
24 */
25#ifndef __COMPRESS_OFFLOAD_H
26#define __COMPRESS_OFFLOAD_H
27
28#include <linux/types.h>
29#include <sound/asound.h>
30#include <sound/compress_params.h>
31
32
33#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0)
34/**
35 * struct snd_compressed_buffer: compressed buffer
36 * @fragment_size: size of buffer fragment in bytes
37 * @fragments: number of such fragments
38 */
39struct snd_compressed_buffer {
40 __u32 fragment_size;
41 __u32 fragments;
42};
43
44/**
45 * struct snd_compr_params: compressed stream params
46 * @buffer: buffer description
47 * @codec: codec parameters
48 * @no_wake_mode: dont wake on fragment elapsed
49 */
50struct snd_compr_params {
51 struct snd_compressed_buffer buffer;
52 struct snd_codec codec;
53 __u8 no_wake_mode;
54};
55
56/**
57 * struct snd_compr_tstamp: timestamp descriptor
58 * @byte_offset: Byte offset in ring buffer to DSP
59 * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP
60 * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by
61 * large steps and should only be used to monitor encoding/decoding
62 * progress. It shall not be used for timing estimates.
63 * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio
64 * output/input. This field should be used for A/V sync or time estimates.
65 * @sampling_rate: sampling rate of audio
66 */
67struct snd_compr_tstamp {
68 __u32 byte_offset;
69 __u32 copied_total;
70 snd_pcm_uframes_t pcm_frames;
71 snd_pcm_uframes_t pcm_io_frames;
72 __u32 sampling_rate;
73};
74
75/**
76 * struct snd_compr_avail: avail descriptor
77 * @avail: Number of bytes available in ring buffer for writing/reading
78 * @tstamp: timestamp infomation
79 */
80struct snd_compr_avail {
81 __u64 avail;
82 struct snd_compr_tstamp tstamp;
83};
84
85enum snd_compr_direction {
86 SND_COMPRESS_PLAYBACK = 0,
87 SND_COMPRESS_CAPTURE
88};
89
90/**
91 * struct snd_compr_caps: caps descriptor
92 * @codecs: pointer to array of codecs
93 * @direction: direction supported. Of type snd_compr_direction
94 * @min_fragment_size: minimum fragment supported by DSP
95 * @max_fragment_size: maximum fragment supported by DSP
96 * @min_fragments: min fragments supported by DSP
97 * @max_fragments: max fragments supported by DSP
98 * @num_codecs: number of codecs supported
99 * @reserved: reserved field
100 */
101struct snd_compr_caps {
102 __u32 num_codecs;
103 __u32 direction;
104 __u32 min_fragment_size;
105 __u32 max_fragment_size;
106 __u32 min_fragments;
107 __u32 max_fragments;
108 __u32 codecs[MAX_NUM_CODECS];
109 __u32 reserved[11];
110};
111
112/**
113 * struct snd_compr_codec_caps: query capability of codec
114 * @codec: codec for which capability is queried
115 * @num_descriptors: number of codec descriptors
116 * @descriptor: array of codec capability descriptor
117 */
118struct snd_compr_codec_caps {
119 __u32 codec;
120 __u32 num_descriptors;
121 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
122};
123
124/**
125 * compress path ioctl definitions
126 * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP
127 * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec
128 * SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters
129 * Note: only codec params can be changed runtime and stream params cant be
130 * SNDRV_COMPRESS_GET_PARAMS: Query codec params
131 * SNDRV_COMPRESS_TSTAMP: get the current timestamp value
132 * SNDRV_COMPRESS_AVAIL: get the current buffer avail value.
133 * This also queries the tstamp properties
134 * SNDRV_COMPRESS_PAUSE: Pause the running stream
135 * SNDRV_COMPRESS_RESUME: resume a paused stream
136 * SNDRV_COMPRESS_START: Start a stream
137 * SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content
138 * and the buffers currently with DSP
139 * SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that
140 * SNDRV_COMPRESS_IOCTL_VERSION: Query the API version
141 */
142#define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)
143#define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)
144#define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\
145 struct snd_compr_codec_caps)
146#define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params)
147#define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec)
148#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
149#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
150#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
151#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
152#define SNDRV_COMPRESS_START _IO('C', 0x32)
153#define SNDRV_COMPRESS_STOP _IO('C', 0x33)
154#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)
155/*
156 * TODO
157 * 1. add mmap support
158 *
159 */
160#define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */
161#endif
diff --git a/include/sound/compress_params.h b/include/sound/compress_params.h
new file mode 100644
index 000000000000..d97d69f81a7d
--- /dev/null
+++ b/include/sound/compress_params.h
@@ -0,0 +1,397 @@
1/*
2 * compress_params.h - codec types and parameters for compressed data
3 * streaming interface
4 *
5 * Copyright (C) 2011 Intel Corporation
6 * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
7 * Vinod Koul <vinod.koul@linux.intel.com>
8 *
9 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; version 2 of the License.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 *
24 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25 *
26 * The definitions in this file are derived from the OpenMAX AL version 1.1
27 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
28 *
29 * Copyright (c) 2007-2010 The Khronos Group Inc.
30 *
31 * Permission is hereby granted, free of charge, to any person obtaining
32 * a copy of this software and/or associated documentation files (the
33 * "Materials "), to deal in the Materials without restriction, including
34 * without limitation the rights to use, copy, modify, merge, publish,
35 * distribute, sublicense, and/or sell copies of the Materials, and to
36 * permit persons to whom the Materials are furnished to do so, subject to
37 * the following conditions:
38 *
39 * The above copyright notice and this permission notice shall be included
40 * in all copies or substantial portions of the Materials.
41 *
42 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
43 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
49 *
50 */
51#ifndef __SND_COMPRESS_PARAMS_H
52#define __SND_COMPRESS_PARAMS_H
53
54/* AUDIO CODECS SUPPORTED */
55#define MAX_NUM_CODECS 32
56#define MAX_NUM_CODEC_DESCRIPTORS 32
57#define MAX_NUM_BITRATES 32
58
59/* Codecs are listed linearly to allow for extensibility */
60#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
61#define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
62#define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
63#define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
64#define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
65#define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
66#define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
67#define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
68#define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
69#define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
70#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
71#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
72#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
73
74/*
75 * Profile and modes are listed with bit masks. This allows for a
76 * more compact representation of fields that will not evolve
77 * (in contrast to the list of codecs)
78 */
79
80#define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
81
82/* MP3 modes are only useful for encoders */
83#define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
84#define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
85#define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
86#define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
87
88#define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
89
90/* AMR modes are only useful for encoders */
91#define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
92#define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
93#define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
94
95#define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
96#define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
97#define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
98#define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
99#define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
100#define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
101#define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
102
103#define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
104
105/* AMRWB modes are only useful for encoders */
106#define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
107#define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
108#define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
109
110#define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
111
112#define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
113
114/* AAC modes are required for encoders and decoders */
115#define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
116#define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
117#define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
118#define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
119#define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
120#define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
121#define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
122#define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
123#define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
124#define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
125
126/* AAC formats are required for encoders and decoders */
127#define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
128#define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
129#define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
130#define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
131#define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
132#define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
133#define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
134
135#define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
136#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
137#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
138#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
139
140#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
141#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
142#define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
143#define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
144#define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
145#define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
146#define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
147#define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
148
149#define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
150/*
151 * Some implementations strip the ASF header and only send ASF packets
152 * to the DSP
153 */
154#define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
155
156#define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
157
158#define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
159#define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
160#define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
161#define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
162
163#define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
164
165#define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
166
167#define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
168
169/*
170 * Define quality levels for FLAC encoders, from LEVEL0 (fast)
171 * to LEVEL8 (best)
172 */
173#define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
174#define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
175#define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
176#define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
177#define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
178#define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
179#define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
180#define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
181#define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
182
183#define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
184#define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
185
186/* IEC61937 payloads without CUVP and preambles */
187#define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
188/* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
189#define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
190
191/*
192 * IEC modes are mandatory for decoders. Format autodetection
193 * will only happen on the DSP side with mode 0. The PCM mode should
194 * not be used, the PCM codec should be used instead.
195 */
196#define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
197#define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
198#define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
199#define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
200#define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
201#define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
202#define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
203#define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
204#define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
205#define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
206#define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
207#define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
208#define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
209#define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
210#define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
211#define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
212#define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
213#define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
214#define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
215
216#define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
217
218#define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
219#define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
220#define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
221
222#define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
223
224#define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
225#define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
226
227/* <FIXME: multichannel encoders aren't supported for now. Would need
228 an additional definition of channel arrangement> */
229
230/* VBR/CBR definitions */
231#define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
232#define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
233
234/* Encoder options */
235
236struct snd_enc_wma {
237 __u32 super_block_align; /* WMA Type-specific data */
238};
239
240
241/**
242 * struct snd_enc_vorbis
243 * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
244 * In the default mode of operation, the quality level is 3.
245 * Normal quality range is 0 - 10.
246 * @managed: Boolean. Set bitrate management mode. This turns off the
247 * normal VBR encoding, but allows hard or soft bitrate constraints to be
248 * enforced by the encoder. This mode can be slower, and may also be
249 * lower quality. It is primarily useful for streaming.
250 * @max_bit_rate: Enabled only if managed is TRUE
251 * @min_bit_rate: Enabled only if managed is TRUE
252 * @downmix: Boolean. Downmix input from stereo to mono (has no effect on
253 * non-stereo streams). Useful for lower-bitrate encoding.
254 *
255 * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc
256 * properties
257 *
258 * For best quality users should specify VBR mode and set quality levels.
259 */
260
261struct snd_enc_vorbis {
262 __s32 quality;
263 __u32 managed;
264 __u32 max_bit_rate;
265 __u32 min_bit_rate;
266 __u32 downmix;
267};
268
269
270/**
271 * struct snd_enc_real
272 * @quant_bits: number of coupling quantization bits in the stream
273 * @start_region: coupling start region in the stream
274 * @num_regions: number of regions value
275 *
276 * These options were extracted from the OpenMAX IL spec
277 */
278
279struct snd_enc_real {
280 __u32 quant_bits;
281 __u32 start_region;
282 __u32 num_regions;
283};
284
285/**
286 * struct snd_enc_flac
287 * @num: serial number, valid only for OGG formats
288 * needs to be set by application
289 * @gain: Add replay gain tags
290 *
291 * These options were extracted from the FLAC online documentation
292 * at http://flac.sourceforge.net/documentation_tools_flac.html
293 *
294 * To make the API simpler, it is assumed that the user will select quality
295 * profiles. Additional options that affect encoding quality and speed can
296 * be added at a later stage if needed.
297 *
298 * By default the Subset format is used by encoders.
299 *
300 * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are
301 * not supported in this API.
302 */
303
304struct snd_enc_flac {
305 __u32 num;
306 __u32 gain;
307};
308
309struct snd_enc_generic {
310 __u32 bw; /* encoder bandwidth */
311 __s32 reserved[15];
312};
313
314union snd_codec_options {
315 struct snd_enc_wma wma;
316 struct snd_enc_vorbis vorbis;
317 struct snd_enc_real real;
318 struct snd_enc_flac flac;
319 struct snd_enc_generic generic;
320};
321
322/** struct snd_codec_desc - description of codec capabilities
323 * @max_ch: Maximum number of audio channels
324 * @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this
325 * @bit_rate: Indexed array containing supported bit rates
326 * @num_bitrates: Number of valid values in bit_rate array
327 * @rate_control: value is specified by SND_RATECONTROLMODE defines.
328 * @profiles: Supported profiles. See SND_AUDIOPROFILE defines.
329 * @modes: Supported modes. See SND_AUDIOMODE defines
330 * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
331 * @min_buffer: Minimum buffer size handled by codec implementation
332 * @reserved: reserved for future use
333 *
334 * This structure provides a scalar value for profiles, modes and stream
335 * format fields.
336 * If an implementation supports multiple combinations, they will be listed as
337 * codecs with different descriptors, for example there would be 2 descriptors
338 * for AAC-RAW and AAC-ADTS.
339 * This entails some redundancy but makes it easier to avoid invalid
340 * configurations.
341 *
342 */
343
344struct snd_codec_desc {
345 __u32 max_ch;
346 __u32 sample_rates;
347 __u32 bit_rate[MAX_NUM_BITRATES];
348 __u32 num_bitrates;
349 __u32 rate_control;
350 __u32 profiles;
351 __u32 modes;
352 __u32 formats;
353 __u32 min_buffer;
354 __u32 reserved[15];
355};
356
357/** struct snd_codec
358 * @id: Identifies the supported audio encoder/decoder.
359 * See SND_AUDIOCODEC macros.
360 * @ch_in: Number of input audio channels
361 * @ch_out: Number of output channels. In case of contradiction between
362 * this field and the channelMode field, the channelMode field
363 * overrides.
364 * @sample_rate: Audio sample rate of input data
365 * @bit_rate: Bitrate of encoded data. May be ignored by decoders
366 * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
367 * Encoders may rely on profiles for quality levels.
368 * May be ignored by decoders.
369 * @profile: Mandatory for encoders, can be mandatory for specific
370 * decoders as well. See SND_AUDIOPROFILE defines.
371 * @level: Supported level (Only used by WMA at the moment)
372 * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines
373 * @format: Format of encoded bistream. Mandatory when defined.
374 * See SND_AUDIOSTREAMFORMAT defines.
375 * @align: Block alignment in bytes of an audio sample.
376 * Only required for PCM or IEC formats.
377 * @options: encoder-specific settings
378 * @reserved: reserved for future use
379 */
380
381struct snd_codec {
382 __u32 id;
383 __u32 ch_in;
384 __u32 ch_out;
385 __u32 sample_rate;
386 __u32 bit_rate;
387 __u32 rate_control;
388 __u32 profile;
389 __u32 level;
390 __u32 ch_mode;
391 __u32 format;
392 __u32 align;
393 union snd_codec_options options;
394 __u32 reserved[3];
395};
396
397#endif
diff --git a/include/sound/control.h b/include/sound/control.h
index 1a94a216ed99..b2796e83c7ac 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -227,4 +227,12 @@ snd_ctl_add_slave_uncached(struct snd_kcontrol *master,
227 return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE); 227 return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE);
228} 228}
229 229
230/*
231 * Helper functions for jack-detection controls
232 */
233struct snd_kcontrol *
234snd_kctl_jack_new(const char *name, int idx, void *private_data);
235void snd_kctl_jack_report(struct snd_card *card,
236 struct snd_kcontrol *kctl, bool status);
237
230#endif /* __SOUND_CONTROL_H */ 238#endif /* __SOUND_CONTROL_H */
diff --git a/include/sound/core.h b/include/sound/core.h
index 3be5ab782b99..5ab255f196cc 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -62,6 +62,7 @@ typedef int __bitwise snd_device_type_t;
62#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007) 62#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007)
63#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008) 63#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008)
64#define SNDRV_DEV_JACK ((__force snd_device_type_t) 0x1009) 64#define SNDRV_DEV_JACK ((__force snd_device_type_t) 0x1009)
65#define SNDRV_DEV_COMPRESS ((__force snd_device_type_t) 0x100A)
65#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000) 66#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000)
66 67
67typedef int __bitwise snd_device_state_t; 68typedef int __bitwise snd_device_state_t;
diff --git a/include/sound/minors.h b/include/sound/minors.h
index 8f764204a856..5978f9a8c8b2 100644
--- a/include/sound/minors.h
+++ b/include/sound/minors.h
@@ -35,7 +35,7 @@
35#define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ 35#define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */
36 36
37#ifndef CONFIG_SND_DYNAMIC_MINORS 37#ifndef CONFIG_SND_DYNAMIC_MINORS
38 /* 2 - 3 (reserved) */ 38#define SNDRV_MINOR_COMPRESS 2 /* 2 - 3 */
39#define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ 39#define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */
40#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ 40#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */
41#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */ 41#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */
@@ -49,6 +49,7 @@
49#define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE 49#define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE
50#define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER 50#define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER
51#define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER 51#define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER
52#define SNDRV_DEVICE_TYPE_COMPRESS SNDRV_MINOR_COMPRESS
52 53
53#else /* CONFIG_SND_DYNAMIC_MINORS */ 54#else /* CONFIG_SND_DYNAMIC_MINORS */
54 55
@@ -60,6 +61,7 @@ enum {
60 SNDRV_DEVICE_TYPE_RAWMIDI, 61 SNDRV_DEVICE_TYPE_RAWMIDI,
61 SNDRV_DEVICE_TYPE_PCM_PLAYBACK, 62 SNDRV_DEVICE_TYPE_PCM_PLAYBACK,
62 SNDRV_DEVICE_TYPE_PCM_CAPTURE, 63 SNDRV_DEVICE_TYPE_PCM_CAPTURE,
64 SNDRV_DEVICE_TYPE_COMPRESS,
63}; 65};
64 66
65#endif /* CONFIG_SND_DYNAMIC_MINORS */ 67#endif /* CONFIG_SND_DYNAMIC_MINORS */
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index 9a155f9d0a12..9b1aacaa82fe 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -78,4 +78,16 @@ struct sh_fsi_platform_info {
78 int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); 78 int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
79}; 79};
80 80
81/*
82 * for fsi-ak4642
83 */
84struct fsi_ak4642_info {
85 const char *name;
86 const char *card;
87 const char *cpu_dai;
88 const char *codec;
89 const char *platform;
90 int id;
91};
92
81#endif /* __SOUND_FSI_H */ 93#endif /* __SOUND_FSI_H */
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 17a4c17f19f5..d26a9b784772 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -43,6 +43,9 @@
43 .num_kcontrols = 0} 43 .num_kcontrols = 0}
44 44
45/* platform domain */ 45/* platform domain */
46#define SND_SOC_DAPM_SIGGEN(wname) \
47{ .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \
48 .num_kcontrols = 0, .reg = SND_SOC_NOPM }
46#define SND_SOC_DAPM_INPUT(wname) \ 49#define SND_SOC_DAPM_INPUT(wname) \
47{ .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ 50{ .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \
48 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 51 .num_kcontrols = 0, .reg = SND_SOC_NOPM }
@@ -380,6 +383,7 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
380 const char *pin); 383 const char *pin);
381int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, 384int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
382 const char *pin); 385 const char *pin);
386void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec);
383 387
384/* Mostly internal - should not normally be used */ 388/* Mostly internal - should not normally be used */
385void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); 389void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason);
@@ -409,6 +413,7 @@ enum snd_soc_dapm_type {
409 snd_soc_dapm_supply, /* power/clock supply */ 413 snd_soc_dapm_supply, /* power/clock supply */
410 snd_soc_dapm_aif_in, /* audio interface input */ 414 snd_soc_dapm_aif_in, /* audio interface input */
411 snd_soc_dapm_aif_out, /* audio interface output */ 415 snd_soc_dapm_aif_out, /* audio interface output */
416 snd_soc_dapm_siggen, /* signal generator */
412}; 417};
413 418
414/* 419/*
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 11cfb5953e06..0992dff55959 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -231,6 +231,7 @@ enum snd_soc_bias_level {
231 SND_SOC_BIAS_ON = 3, 231 SND_SOC_BIAS_ON = 3,
232}; 232};
233 233
234struct device_node;
234struct snd_jack; 235struct snd_jack;
235struct snd_soc_card; 236struct snd_soc_card;
236struct snd_soc_pcm_stream; 237struct snd_soc_pcm_stream;
@@ -266,8 +267,6 @@ enum snd_soc_control_type {
266 267
267enum snd_soc_compress_type { 268enum snd_soc_compress_type {
268 SND_SOC_FLAT_COMPRESSION = 1, 269 SND_SOC_FLAT_COMPRESSION = 1,
269 SND_SOC_LZO_COMPRESSION,
270 SND_SOC_RBTREE_COMPRESSION
271}; 270};
272 271
273enum snd_soc_pcm_subclass { 272enum snd_soc_pcm_subclass {
@@ -318,6 +317,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform,
318 unsigned int reg); 317 unsigned int reg);
319int snd_soc_platform_write(struct snd_soc_platform *platform, 318int snd_soc_platform_write(struct snd_soc_platform *platform,
320 unsigned int reg, unsigned int val); 319 unsigned int reg, unsigned int val);
320int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
321 321
322/* Utility functions to get clock rates from various things */ 322/* Utility functions to get clock rates from various things */
323int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 323int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -593,8 +593,7 @@ struct snd_soc_codec_driver {
593 /* driver ops */ 593 /* driver ops */
594 int (*probe)(struct snd_soc_codec *); 594 int (*probe)(struct snd_soc_codec *);
595 int (*remove)(struct snd_soc_codec *); 595 int (*remove)(struct snd_soc_codec *);
596 int (*suspend)(struct snd_soc_codec *, 596 int (*suspend)(struct snd_soc_codec *);
597 pm_message_t state);
598 int (*resume)(struct snd_soc_codec *); 597 int (*resume)(struct snd_soc_codec *);
599 598
600 /* Default control and setup, added after probe() is run */ 599 /* Default control and setup, added after probe() is run */
@@ -706,8 +705,11 @@ struct snd_soc_dai_link {
706 const char *name; /* Codec name */ 705 const char *name; /* Codec name */
707 const char *stream_name; /* Stream name */ 706 const char *stream_name; /* Stream name */
708 const char *codec_name; /* for multi-codec */ 707 const char *codec_name; /* for multi-codec */
708 const struct device_node *codec_of_node;
709 const char *platform_name; /* for multi-platform */ 709 const char *platform_name; /* for multi-platform */
710 const struct device_node *platform_of_node;
710 const char *cpu_dai_name; 711 const char *cpu_dai_name;
712 const struct device_node *cpu_dai_of_node;
711 const char *codec_dai_name; 713 const char *codec_dai_name;
712 714
713 unsigned int dai_fmt; /* format to set on init */ 715 unsigned int dai_fmt; /* format to set on init */
@@ -718,6 +720,9 @@ struct snd_soc_dai_link {
718 /* Symmetry requirements */ 720 /* Symmetry requirements */
719 unsigned int symmetric_rates:1; 721 unsigned int symmetric_rates:1;
720 722
723 /* pmdown_time is ignored at stop */
724 unsigned int ignore_pmdown_time:1;
725
721 /* codec/machine specific init - e.g. add machine controls */ 726 /* codec/machine specific init - e.g. add machine controls */
722 int (*init)(struct snd_soc_pcm_runtime *rtd); 727 int (*init)(struct snd_soc_pcm_runtime *rtd);
723 728
@@ -813,6 +818,7 @@ struct snd_soc_card {
813 int num_dapm_widgets; 818 int num_dapm_widgets;
814 const struct snd_soc_dapm_route *dapm_routes; 819 const struct snd_soc_dapm_route *dapm_routes;
815 int num_dapm_routes; 820 int num_dapm_routes;
821 bool fully_routed;
816 822
817 struct work_struct deferred_resume_work; 823 struct work_struct deferred_resume_work;
818 824
@@ -840,8 +846,8 @@ struct snd_soc_card {
840}; 846};
841 847
842/* SoC machine DAI configuration, glues a codec and cpu DAI together */ 848/* SoC machine DAI configuration, glues a codec and cpu DAI together */
843struct snd_soc_pcm_runtime { 849struct snd_soc_pcm_runtime {
844 struct device dev; 850 struct device *dev;
845 struct snd_soc_card *card; 851 struct snd_soc_card *card;
846 struct snd_soc_dai_link *dai_link; 852 struct snd_soc_dai_link *dai_link;
847 struct mutex pcm_mutex; 853 struct mutex pcm_mutex;
@@ -927,12 +933,12 @@ static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platfo
927static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd, 933static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd,
928 void *data) 934 void *data)
929{ 935{
930 dev_set_drvdata(&rtd->dev, data); 936 dev_set_drvdata(rtd->dev, data);
931} 937}
932 938
933static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd) 939static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
934{ 940{
935 return dev_get_drvdata(&rtd->dev); 941 return dev_get_drvdata(rtd->dev);
936} 942}
937 943
938static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) 944static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
@@ -960,6 +966,11 @@ static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc)
960int snd_soc_util_init(void); 966int snd_soc_util_init(void);
961void snd_soc_util_exit(void); 967void snd_soc_util_exit(void);
962 968
969int snd_soc_of_parse_card_name(struct snd_soc_card *card,
970 const char *propname);
971int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
972 const char *propname);
973
963#include <sound/soc-dai.h> 974#include <sound/soc-dai.h>
964 975
965#ifdef CONFIG_DEBUG_FS 976#ifdef CONFIG_DEBUG_FS
diff --git a/include/sound/sta32x.h b/include/sound/sta32x.h
new file mode 100644
index 000000000000..8d93b0357a14
--- /dev/null
+++ b/include/sound/sta32x.h
@@ -0,0 +1,35 @@
1/*
2 * Platform data for ST STA32x ASoC codec driver.
3 *
4 * Copyright: 2011 Raumfeld GmbH
5 * Author: Johannes Stezenbach <js@sig21.net>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#ifndef __LINUX_SND__STA32X_H
13#define __LINUX_SND__STA32X_H
14
15#define STA32X_OCFG_2CH 0
16#define STA32X_OCFG_2_1CH 1
17#define STA32X_OCFG_1CH 3
18
19#define STA32X_OM_CH1 0
20#define STA32X_OM_CH2 1
21#define STA32X_OM_CH3 2
22
23#define STA32X_THERMAL_ADJUSTMENT_ENABLE 1
24#define STA32X_THERMAL_RECOVERY_ENABLE 2
25
26struct sta32x_platform_data {
27 int output_conf;
28 int ch1_output_mapping;
29 int ch2_output_mapping;
30 int ch3_output_mapping;
31 int thermal_conf;
32 int needs_esd_watchdog;
33};
34
35#endif /* __LINUX_SND__STA32X_H */
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h
index cf7ccb76a8de..b310c5a3a958 100644
--- a/include/sound/wm8903.h
+++ b/include/sound/wm8903.h
@@ -11,8 +11,11 @@
11#ifndef __LINUX_SND_WM8903_H 11#ifndef __LINUX_SND_WM8903_H
12#define __LINUX_SND_WM8903_H 12#define __LINUX_SND_WM8903_H
13 13
14/* Used to enable configuration of a GPIO to all zeros */ 14/*
15#define WM8903_GPIO_NO_CONFIG 0x8000 15 * Used to enable configuration of a GPIO to all zeros; a gpio_cfg value of
16 * zero in platform data means "don't touch this pin".
17 */
18#define WM8903_GPIO_CONFIG_ZERO 0x8000
16 19
17/* 20/*
18 * R6 (0x06) - Mic Bias Control 0 21 * R6 (0x06) - Mic Bias Control 0