diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/ac97_codec.h | 2 | ||||
-rw-r--r-- | include/sound/core.h | 37 | ||||
-rw-r--r-- | include/sound/l3.h | 18 | ||||
-rw-r--r-- | include/sound/memalloc.h | 2 | ||||
-rw-r--r-- | include/sound/s3c24xx_uda134x.h | 14 | ||||
-rw-r--r-- | include/sound/soc-dai.h | 231 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 3 | ||||
-rw-r--r-- | include/sound/soc.h | 209 | ||||
-rw-r--r-- | include/sound/tea575x-tuner.h | 1 | ||||
-rw-r--r-- | include/sound/uda134x.h | 26 | ||||
-rw-r--r-- | include/sound/version.h | 2 |
11 files changed, 362 insertions, 183 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 9c309daf492b..251fc1cd5002 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -281,10 +281,12 @@ | |||
281 | /* specific - Analog Devices */ | 281 | /* specific - Analog Devices */ |
282 | #define AC97_AD_TEST 0x5a /* test register */ | 282 | #define AC97_AD_TEST 0x5a /* test register */ |
283 | #define AC97_AD_TEST2 0x5c /* undocumented test register 2 */ | 283 | #define AC97_AD_TEST2 0x5c /* undocumented test register 2 */ |
284 | #define AC97_AD_HPFD_SHIFT 12 /* High Pass Filter Disable */ | ||
284 | #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ | 285 | #define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ |
285 | #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ | 286 | #define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ |
286 | #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ | 287 | #define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ |
287 | #define AC97_AD_MISC 0x76 /* Misc Control Bits */ | 288 | #define AC97_AD_MISC 0x76 /* Misc Control Bits */ |
289 | #define AC97_AD_VREFD_SHIFT 2 /* V_REFOUT Disable (AD1888) */ | ||
288 | 290 | ||
289 | /* specific - Cirrus Logic */ | 291 | /* specific - Cirrus Logic */ |
290 | #define AC97_CSR_ACMODE 0x5e /* AC Mode Register */ | 292 | #define AC97_CSR_ACMODE 0x5e /* AC Mode Register */ |
diff --git a/include/sound/core.h b/include/sound/core.h index e5eec5f73502..f632484bc743 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -43,9 +43,6 @@ | |||
43 | #ifdef CONFIG_PCI | 43 | #ifdef CONFIG_PCI |
44 | struct pci_dev; | 44 | struct pci_dev; |
45 | #endif | 45 | #endif |
46 | #ifdef CONFIG_SBUS | ||
47 | struct sbus_dev; | ||
48 | #endif | ||
49 | 46 | ||
50 | /* device allocation stuff */ | 47 | /* device allocation stuff */ |
51 | 48 | ||
@@ -356,7 +353,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
356 | * snd_printk - printk wrapper | 353 | * snd_printk - printk wrapper |
357 | * @fmt: format string | 354 | * @fmt: format string |
358 | * | 355 | * |
359 | * Works like print() but prints the file and the line of the caller | 356 | * Works like printk() but prints the file and the line of the caller |
360 | * when configured with CONFIG_SND_VERBOSE_PRINTK. | 357 | * when configured with CONFIG_SND_VERBOSE_PRINTK. |
361 | */ | 358 | */ |
362 | #define snd_printk(fmt, args...) \ | 359 | #define snd_printk(fmt, args...) \ |
@@ -383,14 +380,40 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
383 | printk(fmt ,##args) | 380 | printk(fmt ,##args) |
384 | #endif | 381 | #endif |
385 | 382 | ||
383 | /** | ||
384 | * snd_BUG - give a BUG warning message and stack trace | ||
385 | * | ||
386 | * Calls WARN() if CONFIG_SND_DEBUG is set. | ||
387 | * Ignored when CONFIG_SND_DEBUG is not set. | ||
388 | */ | ||
386 | #define snd_BUG() WARN(1, "BUG?\n") | 389 | #define snd_BUG() WARN(1, "BUG?\n") |
390 | |||
391 | /** | ||
392 | * snd_BUG_ON - debugging check macro | ||
393 | * @cond: condition to evaluate | ||
394 | * | ||
395 | * When CONFIG_SND_DEBUG is set, this macro evaluates the given condition, | ||
396 | * and call WARN() and returns the value if it's non-zero. | ||
397 | * | ||
398 | * When CONFIG_SND_DEBUG is not set, this just returns zero, and the given | ||
399 | * condition is ignored. | ||
400 | * | ||
401 | * NOTE: the argument won't be evaluated at all when CONFIG_SND_DEBUG=n. | ||
402 | * Thus, don't put any statement that influences on the code behavior, | ||
403 | * such as pre/post increment, to the argument of this macro. | ||
404 | * If you want to evaluate and give a warning, use standard WARN_ON(). | ||
405 | */ | ||
387 | #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) | 406 | #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) |
388 | 407 | ||
389 | #else /* !CONFIG_SND_DEBUG */ | 408 | #else /* !CONFIG_SND_DEBUG */ |
390 | 409 | ||
391 | #define snd_printd(fmt, args...) /* nothing */ | 410 | #define snd_printd(fmt, args...) do { } while (0) |
392 | #define snd_BUG() /* nothing */ | 411 | #define snd_BUG() do { } while (0) |
393 | #define snd_BUG_ON(cond) ({/*(void)(cond);*/ 0;}) /* always false */ | 412 | static inline int __snd_bug_on(int cond) |
413 | { | ||
414 | return 0; | ||
415 | } | ||
416 | #define snd_BUG_ON(cond) __snd_bug_on(0 && (cond)) /* always false */ | ||
394 | 417 | ||
395 | #endif /* CONFIG_SND_DEBUG */ | 418 | #endif /* CONFIG_SND_DEBUG */ |
396 | 419 | ||
diff --git a/include/sound/l3.h b/include/sound/l3.h new file mode 100644 index 000000000000..423a08f0f1b0 --- /dev/null +++ b/include/sound/l3.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _L3_H_ | ||
2 | #define _L3_H_ 1 | ||
3 | |||
4 | struct l3_pins { | ||
5 | void (*setdat)(int); | ||
6 | void (*setclk)(int); | ||
7 | void (*setmode)(int); | ||
8 | int data_hold; | ||
9 | int data_setup; | ||
10 | int clock_high; | ||
11 | int mode_hold; | ||
12 | int mode; | ||
13 | int mode_setup; | ||
14 | }; | ||
15 | |||
16 | int l3_write(struct l3_pins *adap, u8 addr, u8 *data, int len); | ||
17 | |||
18 | #endif | ||
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index d787a6b4a101..7ccce94a5255 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -37,7 +37,6 @@ struct snd_dma_device { | |||
37 | #ifndef snd_dma_pci_data | 37 | #ifndef snd_dma_pci_data |
38 | #define snd_dma_pci_data(pci) (&(pci)->dev) | 38 | #define snd_dma_pci_data(pci) (&(pci)->dev) |
39 | #define snd_dma_isa_data() NULL | 39 | #define snd_dma_isa_data() NULL |
40 | #define snd_dma_sbus_data(sbus) ((struct device *)(sbus)) | ||
41 | #define snd_dma_continuous_data(x) ((struct device *)(unsigned long)(x)) | 40 | #define snd_dma_continuous_data(x) ((struct device *)(unsigned long)(x)) |
42 | #endif | 41 | #endif |
43 | 42 | ||
@@ -49,7 +48,6 @@ struct snd_dma_device { | |||
49 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ | 48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ |
50 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ | 49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ |
51 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ | 50 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ |
52 | #define SNDRV_DMA_TYPE_SBUS 4 /* SBUS continuous */ | ||
53 | 51 | ||
54 | /* | 52 | /* |
55 | * info for buffer allocation | 53 | * info for buffer allocation |
diff --git a/include/sound/s3c24xx_uda134x.h b/include/sound/s3c24xx_uda134x.h new file mode 100644 index 000000000000..33df4cb909d3 --- /dev/null +++ b/include/sound/s3c24xx_uda134x.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _S3C24XX_UDA134X_H_ | ||
2 | #define _S3C24XX_UDA134X_H_ 1 | ||
3 | |||
4 | #include <sound/uda134x.h> | ||
5 | |||
6 | struct s3c24xx_uda134x_platform_data { | ||
7 | int l3_clk; | ||
8 | int l3_mode; | ||
9 | int l3_data; | ||
10 | void (*power) (int); | ||
11 | int model; | ||
12 | }; | ||
13 | |||
14 | #endif | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h new file mode 100644 index 000000000000..24247f763608 --- /dev/null +++ b/include/sound/soc-dai.h | |||
@@ -0,0 +1,231 @@ | |||
1 | /* | ||
2 | * linux/sound/soc-dai.h -- ALSA SoC Layer | ||
3 | * | ||
4 | * Copyright: 2005-2008 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Digital Audio Interface (DAI) API. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_SND_SOC_DAI_H | ||
14 | #define __LINUX_SND_SOC_DAI_H | ||
15 | |||
16 | |||
17 | #include <linux/list.h> | ||
18 | |||
19 | struct snd_pcm_substream; | ||
20 | |||
21 | /* | ||
22 | * DAI hardware audio formats. | ||
23 | * | ||
24 | * Describes the physical PCM data formating and clocking. Add new formats | ||
25 | * to the end. | ||
26 | */ | ||
27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | ||
28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | ||
29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | ||
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM LRC */ | ||
31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM LRC */ | ||
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | ||
33 | |||
34 | /* left and right justified also known as MSB and LSB respectively */ | ||
35 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | ||
36 | #define SND_SOC_DAIFMT_LSB SND_SOC_DAIFMT_RIGHT_J | ||
37 | |||
38 | /* | ||
39 | * DAI Clock gating. | ||
40 | * | ||
41 | * DAI bit clocks can be be gated (disabled) when not the DAI is not | ||
42 | * sending or receiving PCM data in a frame. This can be used to save power. | ||
43 | */ | ||
44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | ||
45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | ||
46 | |||
47 | /* | ||
48 | * DAI Left/Right Clocks. | ||
49 | * | ||
50 | * Specifies whether the DAI can support different samples for similtanious | ||
51 | * playback and capture. This usually requires a seperate physical frame | ||
52 | * clock for playback and capture. | ||
53 | */ | ||
54 | #define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */ | ||
55 | #define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */ | ||
56 | |||
57 | /* | ||
58 | * TDM | ||
59 | * | ||
60 | * Time Division Multiplexing. Allows PCM data to be multplexed with other | ||
61 | * data on the DAI. | ||
62 | */ | ||
63 | #define SND_SOC_DAIFMT_TDM (1 << 6) | ||
64 | |||
65 | /* | ||
66 | * DAI hardware signal inversions. | ||
67 | * | ||
68 | * Specifies whether the DAI can also support inverted clocks for the specified | ||
69 | * format. | ||
70 | */ | ||
71 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | ||
72 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | ||
73 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | ||
74 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | ||
75 | |||
76 | /* | ||
77 | * DAI hardware clock masters. | ||
78 | * | ||
79 | * This is wrt the codec, the inverse is true for the interface | ||
80 | * i.e. if the codec is clk and frm master then the interface is | ||
81 | * clk and frame slave. | ||
82 | */ | ||
83 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | ||
84 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | ||
85 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | ||
86 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | ||
87 | |||
88 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | ||
89 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | ||
90 | #define SND_SOC_DAIFMT_INV_MASK 0x0f00 | ||
91 | #define SND_SOC_DAIFMT_MASTER_MASK 0xf000 | ||
92 | |||
93 | /* | ||
94 | * Master Clock Directions | ||
95 | */ | ||
96 | #define SND_SOC_CLOCK_IN 0 | ||
97 | #define SND_SOC_CLOCK_OUT 1 | ||
98 | |||
99 | struct snd_soc_dai_ops; | ||
100 | struct snd_soc_dai; | ||
101 | struct snd_ac97_bus_ops; | ||
102 | |||
103 | /* Digital Audio Interface registration */ | ||
104 | int snd_soc_register_dai(struct snd_soc_dai *dai); | ||
105 | void snd_soc_unregister_dai(struct snd_soc_dai *dai); | ||
106 | int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count); | ||
107 | void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count); | ||
108 | |||
109 | /* Digital Audio Interface clocking API.*/ | ||
110 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | ||
111 | unsigned int freq, int dir); | ||
112 | |||
113 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | ||
114 | int div_id, int div); | ||
115 | |||
116 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | ||
117 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
118 | |||
119 | /* Digital Audio interface formatting */ | ||
120 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | ||
121 | |||
122 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | ||
123 | unsigned int mask, int slots); | ||
124 | |||
125 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | ||
126 | |||
127 | /* Digital Audio Interface mute */ | ||
128 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | ||
129 | |||
130 | /* | ||
131 | * Digital Audio Interface. | ||
132 | * | ||
133 | * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97 | ||
134 | * operations an capabilities. Codec and platfom drivers will register a this | ||
135 | * structure for every DAI they have. | ||
136 | * | ||
137 | * This structure covers the clocking, formating and ALSA operations for each | ||
138 | * interface a | ||
139 | */ | ||
140 | struct snd_soc_dai_ops { | ||
141 | /* | ||
142 | * DAI clocking configuration, all optional. | ||
143 | * Called by soc_card drivers, normally in their hw_params. | ||
144 | */ | ||
145 | int (*set_sysclk)(struct snd_soc_dai *dai, | ||
146 | int clk_id, unsigned int freq, int dir); | ||
147 | int (*set_pll)(struct snd_soc_dai *dai, | ||
148 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
149 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); | ||
150 | |||
151 | /* | ||
152 | * DAI format configuration | ||
153 | * Called by soc_card drivers, normally in their hw_params. | ||
154 | */ | ||
155 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | ||
156 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | ||
157 | unsigned int mask, int slots); | ||
158 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | ||
159 | |||
160 | /* | ||
161 | * DAI digital mute - optional. | ||
162 | * Called by soc-core to minimise any pops. | ||
163 | */ | ||
164 | int (*digital_mute)(struct snd_soc_dai *dai, int mute); | ||
165 | |||
166 | /* | ||
167 | * ALSA PCM audio operations - all optional. | ||
168 | * Called by soc-core during audio PCM operations. | ||
169 | */ | ||
170 | int (*startup)(struct snd_pcm_substream *, | ||
171 | struct snd_soc_dai *); | ||
172 | void (*shutdown)(struct snd_pcm_substream *, | ||
173 | struct snd_soc_dai *); | ||
174 | int (*hw_params)(struct snd_pcm_substream *, | ||
175 | struct snd_pcm_hw_params *, struct snd_soc_dai *); | ||
176 | int (*hw_free)(struct snd_pcm_substream *, | ||
177 | struct snd_soc_dai *); | ||
178 | int (*prepare)(struct snd_pcm_substream *, | ||
179 | struct snd_soc_dai *); | ||
180 | int (*trigger)(struct snd_pcm_substream *, int, | ||
181 | struct snd_soc_dai *); | ||
182 | }; | ||
183 | |||
184 | /* | ||
185 | * Digital Audio Interface runtime data. | ||
186 | * | ||
187 | * Holds runtime data for a DAI. | ||
188 | */ | ||
189 | struct snd_soc_dai { | ||
190 | /* DAI description */ | ||
191 | char *name; | ||
192 | unsigned int id; | ||
193 | int ac97_control; | ||
194 | |||
195 | struct device *dev; | ||
196 | |||
197 | /* DAI callbacks */ | ||
198 | int (*probe)(struct platform_device *pdev, | ||
199 | struct snd_soc_dai *dai); | ||
200 | void (*remove)(struct platform_device *pdev, | ||
201 | struct snd_soc_dai *dai); | ||
202 | int (*suspend)(struct snd_soc_dai *dai); | ||
203 | int (*resume)(struct snd_soc_dai *dai); | ||
204 | |||
205 | /* ops */ | ||
206 | struct snd_soc_dai_ops ops; | ||
207 | |||
208 | /* DAI capabilities */ | ||
209 | struct snd_soc_pcm_stream capture; | ||
210 | struct snd_soc_pcm_stream playback; | ||
211 | |||
212 | /* DAI runtime info */ | ||
213 | struct snd_pcm_runtime *runtime; | ||
214 | struct snd_soc_codec *codec; | ||
215 | unsigned int active; | ||
216 | unsigned char pop_wait:1; | ||
217 | void *dma_data; | ||
218 | |||
219 | /* DAI private data */ | ||
220 | void *private_data; | ||
221 | |||
222 | /* parent codec/platform */ | ||
223 | union { | ||
224 | struct snd_soc_codec *codec; | ||
225 | struct snd_soc_platform *platform; | ||
226 | }; | ||
227 | |||
228 | struct list_head list; | ||
229 | }; | ||
230 | |||
231 | #endif | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c1b26fcc0b5c..7ee2f70ca42e 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -221,8 +221,6 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, | |||
221 | int num); | 221 | int num); |
222 | 222 | ||
223 | /* dapm path setup */ | 223 | /* dapm path setup */ |
224 | int __deprecated snd_soc_dapm_connect_input(struct snd_soc_codec *codec, | ||
225 | const char *sink_name, const char *control_name, const char *src_name); | ||
226 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); | 224 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); |
227 | void snd_soc_dapm_free(struct snd_soc_device *socdev); | 225 | void snd_soc_dapm_free(struct snd_soc_device *socdev); |
228 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | 226 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, |
@@ -240,6 +238,7 @@ int snd_soc_dapm_sys_add(struct device *dev); | |||
240 | /* dapm audio pin control and status */ | 238 | /* dapm audio pin control and status */ |
241 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, char *pin); | 239 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, char *pin); |
242 | int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, char *pin); | 240 | int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, char *pin); |
241 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, char *pin); | ||
243 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, char *pin); | 242 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, char *pin); |
244 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); | 243 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); |
245 | 244 | ||
diff --git a/include/sound/soc.h b/include/sound/soc.h index a1e0357a84d7..f86e455d3828 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -21,14 +21,13 @@ | |||
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.13.2" | ||
25 | |||
26 | /* | 24 | /* |
27 | * Convenience kcontrol builders | 25 | * Convenience kcontrol builders |
28 | */ | 26 | */ |
29 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 27 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ |
30 | ((unsigned long)&(struct soc_mixer_control) \ | 28 | ((unsigned long)&(struct soc_mixer_control) \ |
31 | {.reg = xreg, .shift = xshift, .max = xmax, .invert = xinvert}) | 29 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ |
30 | .invert = xinvert}) | ||
32 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 31 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
33 | ((unsigned long)&(struct soc_mixer_control) \ | 32 | ((unsigned long)&(struct soc_mixer_control) \ |
34 | {.reg = xreg, .max = xmax, .invert = xinvert}) | 33 | {.reg = xreg, .max = xmax, .invert = xinvert}) |
@@ -144,105 +143,31 @@ enum snd_soc_bias_level { | |||
144 | SND_SOC_BIAS_OFF, | 143 | SND_SOC_BIAS_OFF, |
145 | }; | 144 | }; |
146 | 145 | ||
147 | /* | ||
148 | * Digital Audio Interface (DAI) types | ||
149 | */ | ||
150 | #define SND_SOC_DAI_AC97 0x1 | ||
151 | #define SND_SOC_DAI_I2S 0x2 | ||
152 | #define SND_SOC_DAI_PCM 0x4 | ||
153 | #define SND_SOC_DAI_AC97_BUS 0x8 /* for custom i.e. non ac97_codec.c */ | ||
154 | |||
155 | /* | ||
156 | * DAI hardware audio formats | ||
157 | */ | ||
158 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | ||
159 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right justified mode */ | ||
160 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | ||
161 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM or LRC */ | ||
162 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM or LRC */ | ||
163 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | ||
164 | |||
165 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | ||
166 | #define SND_SOC_DAIFMT_LSB SND_SOC_DAIFMT_RIGHT_J | ||
167 | |||
168 | /* | ||
169 | * DAI Gating | ||
170 | */ | ||
171 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | ||
172 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated when not Tx/Rx */ | ||
173 | |||
174 | /* | ||
175 | * DAI Sync | ||
176 | * Synchronous LR (Left Right) clocks and Frame signals. | ||
177 | */ | ||
178 | #define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */ | ||
179 | #define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */ | ||
180 | |||
181 | /* | ||
182 | * TDM | ||
183 | */ | ||
184 | #define SND_SOC_DAIFMT_TDM (1 << 6) | ||
185 | |||
186 | /* | ||
187 | * DAI hardware signal inversions | ||
188 | */ | ||
189 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bclk + frm */ | ||
190 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | ||
191 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | ||
192 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | ||
193 | |||
194 | /* | ||
195 | * DAI hardware clock masters | ||
196 | * This is wrt the codec, the inverse is true for the interface | ||
197 | * i.e. if the codec is clk and frm master then the interface is | ||
198 | * clk and frame slave. | ||
199 | */ | ||
200 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | ||
201 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | ||
202 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | ||
203 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | ||
204 | |||
205 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | ||
206 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | ||
207 | #define SND_SOC_DAIFMT_INV_MASK 0x0f00 | ||
208 | #define SND_SOC_DAIFMT_MASTER_MASK 0xf000 | ||
209 | |||
210 | |||
211 | /* | ||
212 | * Master Clock Directions | ||
213 | */ | ||
214 | #define SND_SOC_CLOCK_IN 0 | ||
215 | #define SND_SOC_CLOCK_OUT 1 | ||
216 | |||
217 | /* | ||
218 | * AC97 codec ID's bitmask | ||
219 | */ | ||
220 | #define SND_SOC_DAI_AC97_ID0 (1 << 0) | ||
221 | #define SND_SOC_DAI_AC97_ID1 (1 << 1) | ||
222 | #define SND_SOC_DAI_AC97_ID2 (1 << 2) | ||
223 | #define SND_SOC_DAI_AC97_ID3 (1 << 3) | ||
224 | |||
225 | struct snd_soc_device; | 146 | struct snd_soc_device; |
226 | struct snd_soc_pcm_stream; | 147 | struct snd_soc_pcm_stream; |
227 | struct snd_soc_ops; | 148 | struct snd_soc_ops; |
228 | struct snd_soc_dai_mode; | 149 | struct snd_soc_dai_mode; |
229 | struct snd_soc_pcm_runtime; | 150 | struct snd_soc_pcm_runtime; |
230 | struct snd_soc_dai; | 151 | struct snd_soc_dai; |
152 | struct snd_soc_platform; | ||
231 | struct snd_soc_codec; | 153 | struct snd_soc_codec; |
232 | struct snd_soc_machine_config; | ||
233 | struct soc_enum; | 154 | struct soc_enum; |
234 | struct snd_soc_ac97_ops; | 155 | struct snd_soc_ac97_ops; |
235 | struct snd_soc_clock_info; | ||
236 | 156 | ||
237 | typedef int (*hw_write_t)(void *,const char* ,int); | 157 | typedef int (*hw_write_t)(void *,const char* ,int); |
238 | typedef int (*hw_read_t)(void *,char* ,int); | 158 | typedef int (*hw_read_t)(void *,char* ,int); |
239 | 159 | ||
240 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 160 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
241 | 161 | ||
162 | int snd_soc_register_platform(struct snd_soc_platform *platform); | ||
163 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); | ||
164 | int snd_soc_register_codec(struct snd_soc_codec *codec); | ||
165 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); | ||
166 | |||
242 | /* pcm <-> DAI connect */ | 167 | /* pcm <-> DAI connect */ |
243 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 168 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
244 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); | 169 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); |
245 | int snd_soc_register_card(struct snd_soc_device *socdev); | 170 | int snd_soc_init_card(struct snd_soc_device *socdev); |
246 | 171 | ||
247 | /* set runtime hw params */ | 172 | /* set runtime hw params */ |
248 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, | 173 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, |
@@ -262,27 +187,6 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | |||
262 | struct snd_ac97_bus_ops *ops, int num); | 187 | struct snd_ac97_bus_ops *ops, int num); |
263 | void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); | 188 | void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); |
264 | 189 | ||
265 | /* Digital Audio Interface clocking API.*/ | ||
266 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | ||
267 | unsigned int freq, int dir); | ||
268 | |||
269 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | ||
270 | int div_id, int div); | ||
271 | |||
272 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | ||
273 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
274 | |||
275 | /* Digital Audio interface formatting */ | ||
276 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | ||
277 | |||
278 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | ||
279 | unsigned int mask, int slots); | ||
280 | |||
281 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | ||
282 | |||
283 | /* Digital Audio Interface mute */ | ||
284 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | ||
285 | |||
286 | /* | 190 | /* |
287 | *Controls | 191 | *Controls |
288 | */ | 192 | */ |
@@ -340,66 +244,14 @@ struct snd_soc_ops { | |||
340 | int (*trigger)(struct snd_pcm_substream *, int); | 244 | int (*trigger)(struct snd_pcm_substream *, int); |
341 | }; | 245 | }; |
342 | 246 | ||
343 | /* ASoC DAI ops */ | ||
344 | struct snd_soc_dai_ops { | ||
345 | /* DAI clocking configuration */ | ||
346 | int (*set_sysclk)(struct snd_soc_dai *dai, | ||
347 | int clk_id, unsigned int freq, int dir); | ||
348 | int (*set_pll)(struct snd_soc_dai *dai, | ||
349 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
350 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); | ||
351 | |||
352 | /* DAI format configuration */ | ||
353 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | ||
354 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | ||
355 | unsigned int mask, int slots); | ||
356 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | ||
357 | |||
358 | /* digital mute */ | ||
359 | int (*digital_mute)(struct snd_soc_dai *dai, int mute); | ||
360 | }; | ||
361 | |||
362 | /* SoC DAI (Digital Audio Interface) */ | ||
363 | struct snd_soc_dai { | ||
364 | /* DAI description */ | ||
365 | char *name; | ||
366 | unsigned int id; | ||
367 | unsigned char type; | ||
368 | |||
369 | /* DAI callbacks */ | ||
370 | int (*probe)(struct platform_device *pdev, | ||
371 | struct snd_soc_dai *dai); | ||
372 | void (*remove)(struct platform_device *pdev, | ||
373 | struct snd_soc_dai *dai); | ||
374 | int (*suspend)(struct platform_device *pdev, | ||
375 | struct snd_soc_dai *dai); | ||
376 | int (*resume)(struct platform_device *pdev, | ||
377 | struct snd_soc_dai *dai); | ||
378 | |||
379 | /* ops */ | ||
380 | struct snd_soc_ops ops; | ||
381 | struct snd_soc_dai_ops dai_ops; | ||
382 | |||
383 | /* DAI capabilities */ | ||
384 | struct snd_soc_pcm_stream capture; | ||
385 | struct snd_soc_pcm_stream playback; | ||
386 | |||
387 | /* DAI runtime info */ | ||
388 | struct snd_pcm_runtime *runtime; | ||
389 | struct snd_soc_codec *codec; | ||
390 | unsigned int active; | ||
391 | unsigned char pop_wait:1; | ||
392 | void *dma_data; | ||
393 | |||
394 | /* DAI private data */ | ||
395 | void *private_data; | ||
396 | }; | ||
397 | |||
398 | /* SoC Audio Codec */ | 247 | /* SoC Audio Codec */ |
399 | struct snd_soc_codec { | 248 | struct snd_soc_codec { |
400 | char *name; | 249 | char *name; |
401 | struct module *owner; | 250 | struct module *owner; |
402 | struct mutex mutex; | 251 | struct mutex mutex; |
252 | struct device *dev; | ||
253 | |||
254 | struct list_head list; | ||
403 | 255 | ||
404 | /* callbacks */ | 256 | /* callbacks */ |
405 | int (*set_bias_level)(struct snd_soc_codec *, | 257 | int (*set_bias_level)(struct snd_soc_codec *, |
@@ -425,6 +277,7 @@ struct snd_soc_codec { | |||
425 | short reg_cache_step; | 277 | short reg_cache_step; |
426 | 278 | ||
427 | /* dapm */ | 279 | /* dapm */ |
280 | u32 pop_time; | ||
428 | struct list_head dapm_widgets; | 281 | struct list_head dapm_widgets; |
429 | struct list_head dapm_paths; | 282 | struct list_head dapm_paths; |
430 | enum snd_soc_bias_level bias_level; | 283 | enum snd_soc_bias_level bias_level; |
@@ -434,6 +287,11 @@ struct snd_soc_codec { | |||
434 | /* codec DAI's */ | 287 | /* codec DAI's */ |
435 | struct snd_soc_dai *dai; | 288 | struct snd_soc_dai *dai; |
436 | unsigned int num_dai; | 289 | unsigned int num_dai; |
290 | |||
291 | #ifdef CONFIG_DEBUG_FS | ||
292 | struct dentry *debugfs_reg; | ||
293 | struct dentry *debugfs_pop_time; | ||
294 | #endif | ||
437 | }; | 295 | }; |
438 | 296 | ||
439 | /* codec device */ | 297 | /* codec device */ |
@@ -447,13 +305,12 @@ struct snd_soc_codec_device { | |||
447 | /* SoC platform interface */ | 305 | /* SoC platform interface */ |
448 | struct snd_soc_platform { | 306 | struct snd_soc_platform { |
449 | char *name; | 307 | char *name; |
308 | struct list_head list; | ||
450 | 309 | ||
451 | int (*probe)(struct platform_device *pdev); | 310 | int (*probe)(struct platform_device *pdev); |
452 | int (*remove)(struct platform_device *pdev); | 311 | int (*remove)(struct platform_device *pdev); |
453 | int (*suspend)(struct platform_device *pdev, | 312 | int (*suspend)(struct snd_soc_dai *dai); |
454 | struct snd_soc_dai *dai); | 313 | int (*resume)(struct snd_soc_dai *dai); |
455 | int (*resume)(struct platform_device *pdev, | ||
456 | struct snd_soc_dai *dai); | ||
457 | 314 | ||
458 | /* pcm creation and destruction */ | 315 | /* pcm creation and destruction */ |
459 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, | 316 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, |
@@ -483,9 +340,14 @@ struct snd_soc_dai_link { | |||
483 | struct snd_pcm *pcm; | 340 | struct snd_pcm *pcm; |
484 | }; | 341 | }; |
485 | 342 | ||
486 | /* SoC machine */ | 343 | /* SoC card */ |
487 | struct snd_soc_machine { | 344 | struct snd_soc_card { |
488 | char *name; | 345 | char *name; |
346 | struct device *dev; | ||
347 | |||
348 | struct list_head list; | ||
349 | |||
350 | int instantiated; | ||
489 | 351 | ||
490 | int (*probe)(struct platform_device *pdev); | 352 | int (*probe)(struct platform_device *pdev); |
491 | int (*remove)(struct platform_device *pdev); | 353 | int (*remove)(struct platform_device *pdev); |
@@ -498,23 +360,26 @@ struct snd_soc_machine { | |||
498 | int (*resume_post)(struct platform_device *pdev); | 360 | int (*resume_post)(struct platform_device *pdev); |
499 | 361 | ||
500 | /* callbacks */ | 362 | /* callbacks */ |
501 | int (*set_bias_level)(struct snd_soc_machine *, | 363 | int (*set_bias_level)(struct snd_soc_card *, |
502 | enum snd_soc_bias_level level); | 364 | enum snd_soc_bias_level level); |
503 | 365 | ||
504 | /* CPU <--> Codec DAI links */ | 366 | /* CPU <--> Codec DAI links */ |
505 | struct snd_soc_dai_link *dai_link; | 367 | struct snd_soc_dai_link *dai_link; |
506 | int num_links; | 368 | int num_links; |
369 | |||
370 | struct snd_soc_device *socdev; | ||
371 | |||
372 | struct snd_soc_platform *platform; | ||
373 | struct delayed_work delayed_work; | ||
374 | struct work_struct deferred_resume_work; | ||
507 | }; | 375 | }; |
508 | 376 | ||
509 | /* SoC Device - the audio subsystem */ | 377 | /* SoC Device - the audio subsystem */ |
510 | struct snd_soc_device { | 378 | struct snd_soc_device { |
511 | struct device *dev; | 379 | struct device *dev; |
512 | struct snd_soc_machine *machine; | 380 | struct snd_soc_card *card; |
513 | struct snd_soc_platform *platform; | ||
514 | struct snd_soc_codec *codec; | 381 | struct snd_soc_codec *codec; |
515 | struct snd_soc_codec_device *codec_dev; | 382 | struct snd_soc_codec_device *codec_dev; |
516 | struct delayed_work delayed_work; | ||
517 | struct work_struct deferred_resume_work; | ||
518 | void *codec_data; | 383 | void *codec_data; |
519 | }; | 384 | }; |
520 | 385 | ||
@@ -541,4 +406,6 @@ struct soc_enum { | |||
541 | void *dapm; | 406 | void *dapm; |
542 | }; | 407 | }; |
543 | 408 | ||
409 | #include <sound/soc-dai.h> | ||
410 | |||
544 | #endif | 411 | #endif |
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index b62ce3e077f9..b6870cbaf2b3 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
@@ -43,6 +43,7 @@ struct snd_tea575x { | |||
43 | unsigned int freq_fixup; /* crystal onboard */ | 43 | unsigned int freq_fixup; /* crystal onboard */ |
44 | unsigned int val; /* hw value */ | 44 | unsigned int val; /* hw value */ |
45 | unsigned long freq; /* frequency */ | 45 | unsigned long freq; /* frequency */ |
46 | unsigned long in_use; /* set if the device is in use */ | ||
46 | struct snd_tea575x_ops *ops; | 47 | struct snd_tea575x_ops *ops; |
47 | void *private_data; | 48 | void *private_data; |
48 | }; | 49 | }; |
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h new file mode 100644 index 000000000000..475ef8bb7dcd --- /dev/null +++ b/include/sound/uda134x.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * uda134x.h -- UDA134x ALSA SoC Codec driver | ||
3 | * | ||
4 | * Copyright 2007 Dension Audio Systems Ltd. | ||
5 | * Author: Zoltan Devai | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef _UDA134X_H | ||
13 | #define _UDA134X_H | ||
14 | |||
15 | #include <sound/l3.h> | ||
16 | |||
17 | struct uda134x_platform_data { | ||
18 | struct l3_pins l3; | ||
19 | void (*power) (int); | ||
20 | int model; | ||
21 | #define UDA134X_UDA1340 1 | ||
22 | #define UDA134X_UDA1341 2 | ||
23 | #define UDA134X_UDA1344 3 | ||
24 | }; | ||
25 | |||
26 | #endif /* _UDA134X_H */ | ||
diff --git a/include/sound/version.h b/include/sound/version.h index 4aafeda88634..2b48237e23bf 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h */ | 1 | /* include/version.h */ |
2 | #define CONFIG_SND_VERSION "1.0.18rc3" | 2 | #define CONFIG_SND_VERSION "1.0.18a" |
3 | #define CONFIG_SND_DATE "" | 3 | #define CONFIG_SND_DATE "" |