diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-12-04 10:22:41 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-04 10:22:41 -0500 |
commit | baf9226667734579e344f612ed39f727079cad51 (patch) | |
tree | 9744efb5f1838ea73b695a0ab862547fdcf92ecf /include/sound | |
parent | 57648cd52b1848c6885bdbd948d113d52f3ddd43 (diff) | |
parent | 43f0de8d0298e624e6c3bf2185b6003a59b331bd (diff) |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc-dai.h | 14 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 17 | ||||
-rw-r--r-- | include/sound/soc.h | 15 | ||||
-rw-r--r-- | include/sound/tlv320dac33-plat.h | 20 | ||||
-rw-r--r-- | include/sound/tpa6130a2-plat.h | 30 |
5 files changed, 87 insertions, 9 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 97ca9af414dc..ca24e7f7a3f5 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -30,6 +30,7 @@ struct snd_pcm_substream; | |||
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ | 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 */ | 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ |
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ |
33 | #define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */ | ||
33 | 34 | ||
34 | /* left and right justified also known as MSB and LSB respectively */ | 35 | /* 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_MSB SND_SOC_DAIFMT_LEFT_J |
@@ -106,7 +107,7 @@ int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | |||
106 | int div_id, int div); | 107 | int div_id, int div); |
107 | 108 | ||
108 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | 109 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, |
109 | int pll_id, unsigned int freq_in, unsigned int freq_out); | 110 | int pll_id, int source, unsigned int freq_in, unsigned int freq_out); |
110 | 111 | ||
111 | /* Digital Audio interface formatting */ | 112 | /* Digital Audio interface formatting */ |
112 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 113 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
@@ -114,6 +115,10 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | |||
114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 115 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); | 116 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
116 | 117 | ||
118 | int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, | ||
119 | unsigned int tx_num, unsigned int *tx_slot, | ||
120 | unsigned int rx_num, unsigned int *rx_slot); | ||
121 | |||
117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 122 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
118 | 123 | ||
119 | /* Digital Audio Interface mute */ | 124 | /* Digital Audio Interface mute */ |
@@ -136,8 +141,8 @@ struct snd_soc_dai_ops { | |||
136 | */ | 141 | */ |
137 | int (*set_sysclk)(struct snd_soc_dai *dai, | 142 | int (*set_sysclk)(struct snd_soc_dai *dai, |
138 | int clk_id, unsigned int freq, int dir); | 143 | int clk_id, unsigned int freq, int dir); |
139 | int (*set_pll)(struct snd_soc_dai *dai, | 144 | int (*set_pll)(struct snd_soc_dai *dai, int pll_id, int source, |
140 | int pll_id, unsigned int freq_in, unsigned int freq_out); | 145 | unsigned int freq_in, unsigned int freq_out); |
141 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); | 146 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); |
142 | 147 | ||
143 | /* | 148 | /* |
@@ -148,6 +153,9 @@ struct snd_soc_dai_ops { | |||
148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 153 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
149 | unsigned int tx_mask, unsigned int rx_mask, | 154 | unsigned int tx_mask, unsigned int rx_mask, |
150 | int slots, int slot_width); | 155 | int slots, int slot_width); |
156 | int (*set_channel_map)(struct snd_soc_dai *dai, | ||
157 | unsigned int tx_num, unsigned int *tx_slot, | ||
158 | unsigned int rx_num, unsigned int *rx_slot); | ||
151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 159 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
152 | 160 | ||
153 | /* | 161 | /* |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c1410e3191e3..c5c95e1da65b 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -206,6 +206,12 @@ | |||
206 | .get = snd_soc_dapm_get_enum_double, \ | 206 | .get = snd_soc_dapm_get_enum_double, \ |
207 | .put = snd_soc_dapm_put_enum_double, \ | 207 | .put = snd_soc_dapm_put_enum_double, \ |
208 | .private_value = (unsigned long)&xenum } | 208 | .private_value = (unsigned long)&xenum } |
209 | #define SOC_DAPM_ENUM_VIRT(xname, xenum) \ | ||
210 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
211 | .info = snd_soc_info_enum_double, \ | ||
212 | .get = snd_soc_dapm_get_enum_virt, \ | ||
213 | .put = snd_soc_dapm_put_enum_virt, \ | ||
214 | .private_value = (unsigned long)&xenum } | ||
209 | #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ | 215 | #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ |
210 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 216 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
211 | .info = snd_soc_info_enum_double, \ | 217 | .info = snd_soc_info_enum_double, \ |
@@ -260,6 +266,10 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, | |||
260 | struct snd_ctl_elem_value *ucontrol); | 266 | struct snd_ctl_elem_value *ucontrol); |
261 | int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | 267 | int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, |
262 | struct snd_ctl_elem_value *ucontrol); | 268 | struct snd_ctl_elem_value *ucontrol); |
269 | int snd_soc_dapm_get_enum_virt(struct snd_kcontrol *kcontrol, | ||
270 | struct snd_ctl_elem_value *ucontrol); | ||
271 | int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol, | ||
272 | struct snd_ctl_elem_value *ucontrol); | ||
263 | int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, | 273 | int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, |
264 | struct snd_ctl_elem_value *ucontrol); | 274 | struct snd_ctl_elem_value *ucontrol); |
265 | int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | 275 | int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, |
@@ -333,6 +343,10 @@ struct snd_soc_dapm_route { | |||
333 | const char *sink; | 343 | const char *sink; |
334 | const char *control; | 344 | const char *control; |
335 | const char *source; | 345 | const char *source; |
346 | |||
347 | /* Note: currently only supported for links where source is a supply */ | ||
348 | int (*connected)(struct snd_soc_dapm_widget *source, | ||
349 | struct snd_soc_dapm_widget *sink); | ||
336 | }; | 350 | }; |
337 | 351 | ||
338 | /* dapm audio path between two widgets */ | 352 | /* dapm audio path between two widgets */ |
@@ -349,6 +363,9 @@ struct snd_soc_dapm_path { | |||
349 | u32 connect:1; /* source and sink widgets are connected */ | 363 | u32 connect:1; /* source and sink widgets are connected */ |
350 | u32 walked:1; /* path has been walked */ | 364 | u32 walked:1; /* path has been walked */ |
351 | 365 | ||
366 | int (*connected)(struct snd_soc_dapm_widget *source, | ||
367 | struct snd_soc_dapm_widget *sink); | ||
368 | |||
352 | struct list_head list_source; | 369 | struct list_head list_source; |
353 | struct list_head list_sink; | 370 | struct list_head list_sink; |
354 | struct list_head list; | 371 | struct list_head list; |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 475cb7ed6bec..0d7718f9280d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -223,15 +223,15 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
223 | int addr_bits, int data_bits, | 223 | int addr_bits, int data_bits, |
224 | enum snd_soc_control_type control); | 224 | enum snd_soc_control_type control); |
225 | 225 | ||
226 | #ifdef CONFIG_PM | ||
227 | int snd_soc_suspend_device(struct device *dev); | ||
228 | int snd_soc_resume_device(struct device *dev); | ||
229 | #endif | ||
230 | |||
231 | /* pcm <-> DAI connect */ | 226 | /* pcm <-> DAI connect */ |
232 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 227 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
233 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); | 228 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); |
234 | int snd_soc_init_card(struct snd_soc_device *socdev); | 229 | |
230 | /* Utility functions to get clock rates from various things */ | ||
231 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | ||
232 | int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); | ||
233 | int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots); | ||
234 | int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); | ||
235 | 235 | ||
236 | /* set runtime hw params */ | 236 | /* set runtime hw params */ |
237 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, | 237 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, |
@@ -333,6 +333,8 @@ struct snd_soc_jack_gpio { | |||
333 | int debounce_time; | 333 | int debounce_time; |
334 | struct snd_soc_jack *jack; | 334 | struct snd_soc_jack *jack; |
335 | struct work_struct work; | 335 | struct work_struct work; |
336 | |||
337 | int (*jack_status_check)(void); | ||
336 | }; | 338 | }; |
337 | #endif | 339 | #endif |
338 | 340 | ||
@@ -413,6 +415,7 @@ struct snd_soc_codec { | |||
413 | unsigned int num_dai; | 415 | unsigned int num_dai; |
414 | 416 | ||
415 | #ifdef CONFIG_DEBUG_FS | 417 | #ifdef CONFIG_DEBUG_FS |
418 | struct dentry *debugfs_codec_root; | ||
416 | struct dentry *debugfs_reg; | 419 | struct dentry *debugfs_reg; |
417 | struct dentry *debugfs_pop_time; | 420 | struct dentry *debugfs_pop_time; |
418 | struct dentry *debugfs_dapm; | 421 | struct dentry *debugfs_dapm; |
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h new file mode 100644 index 000000000000..5858d06a7ffa --- /dev/null +++ b/include/sound/tlv320dac33-plat.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Platform header for Texas Instruments TLV320DAC33 codec driver | ||
3 | * | ||
4 | * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> | ||
5 | * | ||
6 | * Copyright: (C) 2009 Nokia Corporation | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __TLV320DAC33_PLAT_H | ||
14 | #define __TLV320DAC33_PLAT_H | ||
15 | |||
16 | struct tlv320dac33_platform_data { | ||
17 | int power_gpio; | ||
18 | }; | ||
19 | |||
20 | #endif /* __TLV320DAC33_PLAT_H */ | ||
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h new file mode 100644 index 000000000000..e8c901e749d8 --- /dev/null +++ b/include/sound/tpa6130a2-plat.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * TPA6130A2 driver platform header | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Written by Peter Ujfalusi <peter.ujfalusi@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef TPA6130A2_PLAT_H | ||
24 | #define TPA6130A2_PLAT_H | ||
25 | |||
26 | struct tpa6130a2_platform_data { | ||
27 | int power_gpio; | ||
28 | }; | ||
29 | |||
30 | #endif | ||