aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/ac97_codec.h9
-rw-r--r--include/sound/ak4641.h26
-rw-r--r--include/sound/alc5623.h15
-rw-r--r--include/sound/asound.h3
-rw-r--r--include/sound/control.h9
-rw-r--r--include/sound/core.h8
-rw-r--r--include/sound/cs4271.h24
-rw-r--r--include/sound/cs46xx_dsp_spos.h2
-rw-r--r--include/sound/emu10k1.h2
-rw-r--r--include/sound/hdsp.h1
-rw-r--r--include/sound/hdspm.h181
-rw-r--r--include/sound/jack.h5
-rw-r--r--include/sound/max98088.h50
-rw-r--r--include/sound/max98095.h54
-rw-r--r--include/sound/minors.h4
-rw-r--r--include/sound/mixer_oss.h3
-rw-r--r--include/sound/pcm.h97
-rw-r--r--include/sound/sb16_csp.h9
-rw-r--r--include/sound/sh_fsi.h83
-rw-r--r--include/sound/soc-dai.h102
-rw-r--r--include/sound/soc-dapm.h219
-rw-r--r--include/sound/soc-of-simple.h25
-rw-r--r--include/sound/soc.h503
-rw-r--r--include/sound/tea575x-tuner.h26
-rw-r--r--include/sound/tlv.h4
-rw-r--r--include/sound/tlv320aic32x4.h31
-rw-r--r--include/sound/tlv320aic3x.h43
-rw-r--r--include/sound/tlv320dac33-plat.h2
-rw-r--r--include/sound/tpa6130a2-plat.h2
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/wm8903.h30
-rw-r--r--include/sound/wm8915.h55
-rw-r--r--include/sound/wm8962.h54
-rw-r--r--include/sound/wm9081.h9
34 files changed, 1243 insertions, 449 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 49400459b477..02cbb50225bb 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -96,6 +96,10 @@
96#define AC97_FUNC_INFO 0x68 /* Function Information */ 96#define AC97_FUNC_INFO 0x68 /* Function Information */
97#define AC97_SENSE_INFO 0x6a /* Sense Details */ 97#define AC97_SENSE_INFO 0x6a /* Sense Details */
98 98
99/* volume controls */
100#define AC97_MUTE_MASK_MONO 0x8000
101#define AC97_MUTE_MASK_STEREO 0x8080
102
99/* slot allocation */ 103/* slot allocation */
100#define AC97_SLOT_TAG 0 104#define AC97_SLOT_TAG 0
101#define AC97_SLOT_CMD_ADDR 1 105#define AC97_SLOT_CMD_ADDR 1
@@ -138,6 +142,7 @@
138#define AC97_BC_18BIT_ADC 0x0100 /* 18-bit ADC resolution */ 142#define AC97_BC_18BIT_ADC 0x0100 /* 18-bit ADC resolution */
139#define AC97_BC_20BIT_ADC 0x0200 /* 20-bit ADC resolution */ 143#define AC97_BC_20BIT_ADC 0x0200 /* 20-bit ADC resolution */
140#define AC97_BC_ADC_MASK 0x0300 144#define AC97_BC_ADC_MASK 0x0300
145#define AC97_BC_3D_TECH_ID_MASK 0x7c00 /* Per-vendor ID of 3D enhancement */
141 146
142/* general purpose */ 147/* general purpose */
143#define AC97_GP_DRSS_MASK 0x0c00 /* double rate slot select */ 148#define AC97_GP_DRSS_MASK 0x0c00 /* double rate slot select */
@@ -380,7 +385,7 @@
380#define AC97_SCAP_DETECT_BY_VENDOR (1<<8) /* use vendor registers for read tests */ 385#define AC97_SCAP_DETECT_BY_VENDOR (1<<8) /* use vendor registers for read tests */
381#define AC97_SCAP_NO_SPDIF (1<<9) /* don't build SPDIF controls */ 386#define AC97_SCAP_NO_SPDIF (1<<9) /* don't build SPDIF controls */
382#define AC97_SCAP_EAPD_LED (1<<10) /* EAPD as mute LED */ 387#define AC97_SCAP_EAPD_LED (1<<10) /* EAPD as mute LED */
383#define AC97_SCAP_POWER_SAVE (1<<11) /* capable for aggresive power-saving */ 388#define AC97_SCAP_POWER_SAVE (1<<11) /* capable for aggressive power-saving */
384 389
385/* ac97->flags */ 390/* ac97->flags */
386#define AC97_HAS_PC_BEEP (1<<0) /* force PC Speaker usage */ 391#define AC97_HAS_PC_BEEP (1<<0) /* force PC Speaker usage */
@@ -477,7 +482,7 @@ struct snd_ac97_template {
477 482
478struct snd_ac97 { 483struct snd_ac97 {
479 /* -- lowlevel (hardware) driver specific -- */ 484 /* -- lowlevel (hardware) driver specific -- */
480 struct snd_ac97_build_ops * build_ops; 485 const struct snd_ac97_build_ops *build_ops;
481 void *private_data; 486 void *private_data;
482 void (*private_free) (struct snd_ac97 *ac97); 487 void (*private_free) (struct snd_ac97 *ac97);
483 /* --- */ 488 /* --- */
diff --git a/include/sound/ak4641.h b/include/sound/ak4641.h
new file mode 100644
index 000000000000..96d1991c811d
--- /dev/null
+++ b/include/sound/ak4641.h
@@ -0,0 +1,26 @@
1/*
2 * AK4641 ALSA SoC Codec driver
3 *
4 * Copyright 2009 Philipp Zabel
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
11#ifndef __AK4641_H
12#define __AK4641_H
13
14/**
15 * struct ak4641_platform_data - platform specific AK4641 configuration
16 * @gpio_power: GPIO to control external power to AK4641
17 * @gpio_npdn: GPIO connected to AK4641 nPDN pin
18 *
19 * Both GPIO parameters are optional.
20 */
21struct ak4641_platform_data {
22 int gpio_power;
23 int gpio_npdn;
24};
25
26#endif /* __AK4641_H */
diff --git a/include/sound/alc5623.h b/include/sound/alc5623.h
new file mode 100644
index 000000000000..422c97d43df3
--- /dev/null
+++ b/include/sound/alc5623.h
@@ -0,0 +1,15 @@
1#ifndef _INCLUDE_SOUND_ALC5623_H
2#define _INCLUDE_SOUND_ALC5623_H
3struct alc5623_platform_data {
4 /* configure : */
5 /* Lineout/Speaker Amps Vmid ratio control */
6 /* enable/disable adc/dac high pass filters */
7 unsigned int add_ctrl;
8 /* configure : */
9 /* output to enable when jack is low */
10 /* output to enable when jack is high */
11 /* jack detect (gpio/nc/jack detect [12] */
12 unsigned int jack_det_ctrl;
13};
14#endif
15
diff --git a/include/sound/asound.h b/include/sound/asound.h
index a1803ecea34d..5d6074faa279 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -259,6 +259,7 @@ typedef int __bitwise snd_pcm_subformat_t;
259#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ 259#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
260#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ 260#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
261#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ 261#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
262#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
262#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ 263#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
263 264
264typedef int __bitwise snd_pcm_state_t; 265typedef int __bitwise snd_pcm_state_t;
@@ -334,6 +335,8 @@ typedef int snd_pcm_hw_param_t;
334#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME 335#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
335 336
336#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ 337#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
338#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
339#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
337 340
338struct snd_interval { 341struct snd_interval {
339 unsigned int min, max; 342 unsigned int min, max;
diff --git a/include/sound/control.h b/include/sound/control.h
index 112374dc0c58..1a94a216ed99 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -113,8 +113,11 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, v
113void snd_ctl_free_one(struct snd_kcontrol * kcontrol); 113void snd_ctl_free_one(struct snd_kcontrol * kcontrol);
114int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); 114int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol);
115int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); 115int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol);
116int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, bool add_on_replace);
116int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); 117int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id);
117int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); 118int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id);
119int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id,
120 int active);
118struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid); 121struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid);
119struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id); 122struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id);
120 123
@@ -160,12 +163,14 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id
160} 163}
161 164
162/* 165/*
163 * Frequently used control callbacks 166 * Frequently used control callbacks/helpers
164 */ 167 */
165int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol, 168int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
166 struct snd_ctl_elem_info *uinfo); 169 struct snd_ctl_elem_info *uinfo);
167int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol, 170int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
168 struct snd_ctl_elem_info *uinfo); 171 struct snd_ctl_elem_info *uinfo);
172int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int channels,
173 unsigned int items, const char *const names[]);
169 174
170/* 175/*
171 * virtual master control 176 * virtual master control
@@ -187,7 +192,7 @@ int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave,
187 * Returns zero if successful or a negative error code. 192 * Returns zero if successful or a negative error code.
188 * 193 *
189 * All slaves must be the same type (returning the same information 194 * All slaves must be the same type (returning the same information
190 * via info callback). The fucntion doesn't check it, so it's your 195 * via info callback). The function doesn't check it, so it's your
191 * responsibility. 196 * responsibility.
192 * 197 *
193 * Also, some additional limitations: 198 * Also, some additional limitations:
diff --git a/include/sound/core.h b/include/sound/core.h
index 89e0ac17f44a..1fa2407c966f 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -133,9 +133,7 @@ struct snd_card {
133 int free_on_last_close; /* free in context of file_release */ 133 int free_on_last_close; /* free in context of file_release */
134 wait_queue_head_t shutdown_sleep; 134 wait_queue_head_t shutdown_sleep;
135 struct device *dev; /* device assigned to this card */ 135 struct device *dev; /* device assigned to this card */
136#ifndef CONFIG_SYSFS_DEPRECATED
137 struct device *card_dev; /* cardX object for sysfs */ 136 struct device *card_dev; /* cardX object for sysfs */
138#endif
139 137
140#ifdef CONFIG_PM 138#ifdef CONFIG_PM
141 unsigned int power_state; /* power state */ 139 unsigned int power_state; /* power state */
@@ -179,7 +177,7 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state);
179#define snd_power_lock(card) do { (void)(card); } while (0) 177#define snd_power_lock(card) do { (void)(card); } while (0)
180#define snd_power_unlock(card) do { (void)(card); } while (0) 178#define snd_power_unlock(card) do { (void)(card); } while (0)
181static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } 179static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; }
182#define snd_power_get_state(card) SNDRV_CTL_POWER_D0 180#define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; })
183#define snd_power_change_state(card, state) do { (void)(card); } while (0) 181#define snd_power_change_state(card, state) do { (void)(card); } while (0)
184 182
185#endif /* CONFIG_PM */ 183#endif /* CONFIG_PM */
@@ -196,11 +194,7 @@ struct snd_minor {
196/* return a device pointer linked to each sound device as a parent */ 194/* return a device pointer linked to each sound device as a parent */
197static inline struct device *snd_card_get_device_link(struct snd_card *card) 195static inline struct device *snd_card_get_device_link(struct snd_card *card)
198{ 196{
199#ifdef CONFIG_SYSFS_DEPRECATED
200 return card ? card->dev : NULL;
201#else
202 return card ? card->card_dev : NULL; 197 return card ? card->card_dev : NULL;
203#endif
204} 198}
205 199
206/* sound.c */ 200/* sound.c */
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h
new file mode 100644
index 000000000000..50a059e7d116
--- /dev/null
+++ b/include/sound/cs4271.h
@@ -0,0 +1,24 @@
1/*
2 * Definitions for CS4271 ASoC codec driver
3 *
4 * Copyright (c) 2010 Alexander Sverdlin <subaparts@yandex.ru>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __CS4271_H
18#define __CS4271_H
19
20struct cs4271_platform_data {
21 int gpio_nreset; /* GPIO driving Reset pin, if any */
22};
23
24#endif /* __CS4271_H */
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index 49b03c9e5e55..8008c59288a6 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -147,7 +147,7 @@ struct dsp_pcm_channel_descriptor {
147}; 147};
148 148
149struct dsp_spos_instance { 149struct dsp_spos_instance {
150 struct dsp_symbol_desc symbol_table; /* currently availble loaded symbols in SP */ 150 struct dsp_symbol_desc symbol_table; /* currently available loaded symbols in SP */
151 151
152 int nmodules; 152 int nmodules;
153 struct dsp_module_desc * modules; /* modules loaded into SP */ 153 struct dsp_module_desc * modules; /* modules loaded into SP */
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 7dc97d12253c..4f865df42f0f 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -438,6 +438,8 @@
438#define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */ 438#define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */
439#define CCCA_CURRADDR 0x18000008 439#define CCCA_CURRADDR 0x18000008
440 440
441/* undefine CCR to avoid conflict with the definition for SH */
442#undef CCR
441#define CCR 0x09 /* Cache control register */ 443#define CCR 0x09 /* Cache control register */
442#define CCR_CACHEINVALIDSIZE 0x07190009 444#define CCR_CACHEINVALIDSIZE 0x07190009
443#define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */ 445#define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h
index d98a78dff2db..0909a3843479 100644
--- a/include/sound/hdsp.h
+++ b/include/sound/hdsp.h
@@ -28,6 +28,7 @@ enum HDSP_IO_Type {
28 Multiface, 28 Multiface,
29 H9652, 29 H9652,
30 H9632, 30 H9632,
31 RPM,
31 Undefined, 32 Undefined,
32}; 33};
33 34
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
index 81990b2bcc98..1f59ea2a4a76 100644
--- a/include/sound/hdspm.h
+++ b/include/sound/hdspm.h
@@ -3,8 +3,8 @@
3/* 3/*
4 * Copyright (C) 2003 Winfried Ritsch (IEM) 4 * Copyright (C) 2003 Winfried Ritsch (IEM)
5 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) 5 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
6 * 6 *
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
@@ -23,50 +23,41 @@
23/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ 23/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
24#define HDSPM_MAX_CHANNELS 64 24#define HDSPM_MAX_CHANNELS 64
25 25
26/* -------------------- IOCTL Peak/RMS Meters -------------------- */ 26enum hdspm_io_type {
27 27 MADI,
28/* peam rms level structure like we get from hardware 28 MADIface,
29 29 AIO,
30 maybe in future we can memory map it so I just copy it 30 AES32,
31 to user on ioctl call now an dont change anything 31 RayDAT
32 rms are made out of low and high values 32};
33 where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
34 (i asume so from the code)
35*/
36
37struct hdspm_peak_rms {
38
39 unsigned int level_offset[1024];
40 33
41 unsigned int input_peak[64]; 34enum hdspm_speed {
42 unsigned int playback_peak[64]; 35 ss,
43 unsigned int output_peak[64]; 36 ds,
44 unsigned int xxx_peak[64]; /* not used */ 37 qs
38};
45 39
46 unsigned int reserved[256]; /* not used */ 40/* -------------------- IOCTL Peak/RMS Meters -------------------- */
47 41
48 unsigned int input_rms_l[64]; 42struct hdspm_peak_rms {
49 unsigned int playback_rms_l[64]; 43 uint32_t input_peaks[64];
50 unsigned int output_rms_l[64]; 44 uint32_t playback_peaks[64];
51 unsigned int xxx_rms_l[64]; /* not used */ 45 uint32_t output_peaks[64];
52 46
53 unsigned int input_rms_h[64]; 47 uint64_t input_rms[64];
54 unsigned int playback_rms_h[64]; 48 uint64_t playback_rms[64];
55 unsigned int output_rms_h[64]; 49 uint64_t output_rms[64];
56 unsigned int xxx_rms_h[64]; /* not used */
57};
58 50
59struct hdspm_peak_rms_ioctl { 51 uint8_t speed; /* enum {ss, ds, qs} */
60 struct hdspm_peak_rms *peak; 52 int status2;
61}; 53};
62 54
63/* use indirect access due to the limit of ioctl bit size */
64#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \ 55#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
65 _IOR('H', 0x40, struct hdspm_peak_rms_ioctl) 56 _IOR('H', 0x42, struct hdspm_peak_rms)
66 57
67/* ------------ CONFIG block IOCTL ---------------------- */ 58/* ------------ CONFIG block IOCTL ---------------------- */
68 59
69struct hdspm_config_info { 60struct hdspm_config {
70 unsigned char pref_sync_ref; 61 unsigned char pref_sync_ref;
71 unsigned char wordclock_sync_check; 62 unsigned char wordclock_sync_check;
72 unsigned char madi_sync_check; 63 unsigned char madi_sync_check;
@@ -80,18 +71,121 @@ struct hdspm_config_info {
80 unsigned int analog_out; 71 unsigned int analog_out;
81}; 72};
82 73
83#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO \ 74#define SNDRV_HDSPM_IOCTL_GET_CONFIG \
84 _IOR('H', 0x41, struct hdspm_config_info) 75 _IOR('H', 0x41, struct hdspm_config)
76
77/**
78 * If there's a TCO (TimeCode Option) board installed,
79 * there are further options and status data available.
80 * The hdspm_ltc structure contains the current SMPTE
81 * timecode and some status information and can be
82 * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
83 * hdspm_status struct.
84 **/
85
86enum hdspm_ltc_format {
87 format_invalid,
88 fps_24,
89 fps_25,
90 fps_2997,
91 fps_30
92};
93
94enum hdspm_ltc_frame {
95 frame_invalid,
96 drop_frame,
97 full_frame
98};
99
100enum hdspm_ltc_input_format {
101 ntsc,
102 pal,
103 no_video
104};
105
106struct hdspm_ltc {
107 unsigned int ltc;
85 108
109 enum hdspm_ltc_format format;
110 enum hdspm_ltc_frame frame;
111 enum hdspm_ltc_input_format input_format;
112};
113
114#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl)
115
116/**
117 * The status data reflects the device's current state
118 * as determined by the card's configuration and
119 * connection status.
120 **/
121
122enum hdspm_sync {
123 hdspm_sync_no_lock = 0,
124 hdspm_sync_lock = 1,
125 hdspm_sync_sync = 2
126};
86 127
87/* get Soundcard Version */ 128enum hdspm_madi_input {
129 hdspm_input_optical = 0,
130 hdspm_input_coax = 1
131};
132
133enum hdspm_madi_channel_format {
134 hdspm_format_ch_64 = 0,
135 hdspm_format_ch_56 = 1
136};
137
138enum hdspm_madi_frame_format {
139 hdspm_frame_48 = 0,
140 hdspm_frame_96 = 1
141};
142
143enum hdspm_syncsource {
144 syncsource_wc = 0,
145 syncsource_madi = 1,
146 syncsource_tco = 2,
147 syncsource_sync = 3,
148 syncsource_none = 4
149};
150
151struct hdspm_status {
152 uint8_t card_type; /* enum hdspm_io_type */
153 enum hdspm_syncsource autosync_source;
154
155 uint64_t card_clock;
156 uint32_t master_period;
157
158 union {
159 struct {
160 uint8_t sync_wc; /* enum hdspm_sync */
161 uint8_t sync_madi; /* enum hdspm_sync */
162 uint8_t sync_tco; /* enum hdspm_sync */
163 uint8_t sync_in; /* enum hdspm_sync */
164 uint8_t madi_input; /* enum hdspm_madi_input */
165 uint8_t channel_format; /* enum hdspm_madi_channel_format */
166 uint8_t frame_format; /* enum hdspm_madi_frame_format */
167 } madi;
168 } card_specific;
169};
170
171#define SNDRV_HDSPM_IOCTL_GET_STATUS \
172 _IOR('H', 0x47, struct hdspm_status)
173
174/**
175 * Get information about the card and its add-ons.
176 **/
177
178#define HDSPM_ADDON_TCO 1
88 179
89struct hdspm_version { 180struct hdspm_version {
181 uint8_t card_type; /* enum hdspm_io_type */
182 char cardname[20];
183 unsigned int serial;
90 unsigned short firmware_rev; 184 unsigned short firmware_rev;
185 int addons;
91}; 186};
92 187
93#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version) 188#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
94
95 189
96/* ------------- get Matrix Mixer IOCTL --------------- */ 190/* ------------- get Matrix Mixer IOCTL --------------- */
97 191
@@ -99,11 +193,11 @@ struct hdspm_version {
99 * 32768 Bytes 193 * 32768 Bytes
100 */ 194 */
101 195
102/* organisation is 64 channelfader in a continous memory block */ 196/* organisation is 64 channelfader in a continuous memory block */
103/* equivalent to hardware definition, maybe for future feature of mmap of 197/* equivalent to hardware definition, maybe for future feature of mmap of
104 * them 198 * them
105 */ 199 */
106/* each of 64 outputs has 64 infader and 64 outfader: 200/* each of 64 outputs has 64 infader and 64 outfader:
107 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ 201 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
108 202
109#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS 203#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
@@ -131,4 +225,5 @@ typedef struct hdspm_version hdspm_version_t;
131typedef struct hdspm_channelfader snd_hdspm_channelfader_t; 225typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
132typedef struct hdspm_mixer hdspm_mixer_t; 226typedef struct hdspm_mixer hdspm_mixer_t;
133 227
134#endif /* __SOUND_HDSPM_H */ 228
229#endif
diff --git a/include/sound/jack.h b/include/sound/jack.h
index d90b9fa32707..c140fc7cbd3f 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -47,6 +47,9 @@ enum snd_jack_types {
47 SND_JACK_BTN_0 = 0x4000, 47 SND_JACK_BTN_0 = 0x4000,
48 SND_JACK_BTN_1 = 0x2000, 48 SND_JACK_BTN_1 = 0x2000,
49 SND_JACK_BTN_2 = 0x1000, 49 SND_JACK_BTN_2 = 0x1000,
50 SND_JACK_BTN_3 = 0x0800,
51 SND_JACK_BTN_4 = 0x0400,
52 SND_JACK_BTN_5 = 0x0200,
50}; 53};
51 54
52struct snd_jack { 55struct snd_jack {
@@ -55,7 +58,7 @@ struct snd_jack {
55 int type; 58 int type;
56 const char *id; 59 const char *id;
57 char name[100]; 60 char name[100];
58 unsigned int key[3]; /* Keep in sync with definitions above */ 61 unsigned int key[6]; /* Keep in sync with definitions above */
59 void *private_data; 62 void *private_data;
60 void (*private_free)(struct snd_jack *); 63 void (*private_free)(struct snd_jack *);
61}; 64};
diff --git a/include/sound/max98088.h b/include/sound/max98088.h
new file mode 100644
index 000000000000..c3ba8239182d
--- /dev/null
+++ b/include/sound/max98088.h
@@ -0,0 +1,50 @@
1/*
2 * Platform data for MAX98088
3 *
4 * Copyright 2010 Maxim Integrated Products
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __SOUND_MAX98088_PDATA_H__
14#define __SOUND_MAX98088_PDATA_H__
15
16/* Equalizer filter response configuration */
17struct max98088_eq_cfg {
18 const char *name;
19 unsigned int rate;
20 u16 band1[5];
21 u16 band2[5];
22 u16 band3[5];
23 u16 band4[5];
24 u16 band5[5];
25};
26
27/* codec platform data */
28struct max98088_pdata {
29
30 /* Equalizers for DAI1 and DAI2 */
31 struct max98088_eq_cfg *eq_cfg;
32 unsigned int eq_cfgcnt;
33
34 /* Receiver output can be configured as power amplifier or LINE out */
35 /* Set receiver_mode to:
36 * 0 = amplifier output, or
37 * 1 = LINE level output
38 */
39 unsigned int receiver_mode:1;
40
41 /* Analog/digital microphone configuration:
42 * 0 = analog microphone input (normal setting)
43 * 1 = digital microphone input
44 */
45 unsigned int digmic_left_mode:1;
46 unsigned int digmic_right_mode:1;
47
48};
49
50#endif
diff --git a/include/sound/max98095.h b/include/sound/max98095.h
new file mode 100644
index 000000000000..7513a42dd4aa
--- /dev/null
+++ b/include/sound/max98095.h
@@ -0,0 +1,54 @@
1/*
2 * Platform data for MAX98095
3 *
4 * Copyright 2011 Maxim Integrated Products
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __SOUND_MAX98095_PDATA_H__
14#define __SOUND_MAX98095_PDATA_H__
15
16/* Equalizer filter response configuration */
17struct max98095_eq_cfg {
18 const char *name;
19 unsigned int rate;
20 u16 band1[5];
21 u16 band2[5];
22 u16 band3[5];
23 u16 band4[5];
24 u16 band5[5];
25};
26
27/* Biquad filter response configuration */
28struct max98095_biquad_cfg {
29 const char *name;
30 unsigned int rate;
31 u16 band1[5];
32 u16 band2[5];
33};
34
35/* codec platform data */
36struct max98095_pdata {
37
38 /* Equalizers for DAI1 and DAI2 */
39 struct max98095_eq_cfg *eq_cfg;
40 unsigned int eq_cfgcnt;
41
42 /* Biquad filter for DAI1 and DAI2 */
43 struct max98095_biquad_cfg *bq_cfg;
44 unsigned int bq_cfgcnt;
45
46 /* Analog/digital microphone configuration:
47 * 0 = analog microphone input (normal setting)
48 * 1 = digital microphone input
49 */
50 unsigned int digmic_left_mode:1;
51 unsigned int digmic_right_mode:1;
52};
53
54#endif
diff --git a/include/sound/minors.h b/include/sound/minors.h
index a81798ab73ed..8f764204a856 100644
--- a/include/sound/minors.h
+++ b/include/sound/minors.h
@@ -31,8 +31,8 @@
31/* these minors can still be used for autoloading devices (/dev/aload*) */ 31/* these minors can still be used for autoloading devices (/dev/aload*) */
32#define SNDRV_MINOR_CONTROL 0 /* 0 */ 32#define SNDRV_MINOR_CONTROL 0 /* 0 */
33#define SNDRV_MINOR_GLOBAL 1 /* 1 */ 33#define SNDRV_MINOR_GLOBAL 1 /* 1 */
34#define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) 34#define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */
35#define SNDRV_MINOR_TIMER (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 /* 2 - 3 (reserved) */
diff --git a/include/sound/mixer_oss.h b/include/sound/mixer_oss.h
index 51fbcb4a277a..13cb0b430a1b 100644
--- a/include/sound/mixer_oss.h
+++ b/include/sound/mixer_oss.h
@@ -73,6 +73,9 @@ struct snd_mixer_oss_file {
73 struct snd_mixer_oss *mixer; 73 struct snd_mixer_oss *mixer;
74}; 74};
75 75
76int snd_mixer_oss_ioctl_card(struct snd_card *card,
77 unsigned int cmd, unsigned long arg);
78
76#endif /* CONFIG_SND_MIXER_OSS */ 79#endif /* CONFIG_SND_MIXER_OSS */
77 80
78#endif /* __SOUND_MIXER_OSS_H */ 81#endif /* __SOUND_MIXER_OSS_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 85f1c6bf8566..e1bad1130616 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -136,48 +136,49 @@ struct snd_pcm_ops {
136 SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000) 136 SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
137#define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\ 137#define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\
138 SNDRV_PCM_RATE_192000) 138 SNDRV_PCM_RATE_192000)
139#define SNDRV_PCM_FMTBIT_S8 (1ULL << SNDRV_PCM_FORMAT_S8) 139#define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
140#define SNDRV_PCM_FMTBIT_U8 (1ULL << SNDRV_PCM_FORMAT_U8) 140#define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8)
141#define SNDRV_PCM_FMTBIT_S16_LE (1ULL << SNDRV_PCM_FORMAT_S16_LE) 141#define SNDRV_PCM_FMTBIT_U8 _SNDRV_PCM_FMTBIT(U8)
142#define SNDRV_PCM_FMTBIT_S16_BE (1ULL << SNDRV_PCM_FORMAT_S16_BE) 142#define SNDRV_PCM_FMTBIT_S16_LE _SNDRV_PCM_FMTBIT(S16_LE)
143#define SNDRV_PCM_FMTBIT_U16_LE (1ULL << SNDRV_PCM_FORMAT_U16_LE) 143#define SNDRV_PCM_FMTBIT_S16_BE _SNDRV_PCM_FMTBIT(S16_BE)
144#define SNDRV_PCM_FMTBIT_U16_BE (1ULL << SNDRV_PCM_FORMAT_U16_BE) 144#define SNDRV_PCM_FMTBIT_U16_LE _SNDRV_PCM_FMTBIT(U16_LE)
145#define SNDRV_PCM_FMTBIT_S24_LE (1ULL << SNDRV_PCM_FORMAT_S24_LE) 145#define SNDRV_PCM_FMTBIT_U16_BE _SNDRV_PCM_FMTBIT(U16_BE)
146#define SNDRV_PCM_FMTBIT_S24_BE (1ULL << SNDRV_PCM_FORMAT_S24_BE) 146#define SNDRV_PCM_FMTBIT_S24_LE _SNDRV_PCM_FMTBIT(S24_LE)
147#define SNDRV_PCM_FMTBIT_U24_LE (1ULL << SNDRV_PCM_FORMAT_U24_LE) 147#define SNDRV_PCM_FMTBIT_S24_BE _SNDRV_PCM_FMTBIT(S24_BE)
148#define SNDRV_PCM_FMTBIT_U24_BE (1ULL << SNDRV_PCM_FORMAT_U24_BE) 148#define SNDRV_PCM_FMTBIT_U24_LE _SNDRV_PCM_FMTBIT(U24_LE)
149#define SNDRV_PCM_FMTBIT_S32_LE (1ULL << SNDRV_PCM_FORMAT_S32_LE) 149#define SNDRV_PCM_FMTBIT_U24_BE _SNDRV_PCM_FMTBIT(U24_BE)
150#define SNDRV_PCM_FMTBIT_S32_BE (1ULL << SNDRV_PCM_FORMAT_S32_BE) 150#define SNDRV_PCM_FMTBIT_S32_LE _SNDRV_PCM_FMTBIT(S32_LE)
151#define SNDRV_PCM_FMTBIT_U32_LE (1ULL << SNDRV_PCM_FORMAT_U32_LE) 151#define SNDRV_PCM_FMTBIT_S32_BE _SNDRV_PCM_FMTBIT(S32_BE)
152#define SNDRV_PCM_FMTBIT_U32_BE (1ULL << SNDRV_PCM_FORMAT_U32_BE) 152#define SNDRV_PCM_FMTBIT_U32_LE _SNDRV_PCM_FMTBIT(U32_LE)
153#define SNDRV_PCM_FMTBIT_FLOAT_LE (1ULL << SNDRV_PCM_FORMAT_FLOAT_LE) 153#define SNDRV_PCM_FMTBIT_U32_BE _SNDRV_PCM_FMTBIT(U32_BE)
154#define SNDRV_PCM_FMTBIT_FLOAT_BE (1ULL << SNDRV_PCM_FORMAT_FLOAT_BE) 154#define SNDRV_PCM_FMTBIT_FLOAT_LE _SNDRV_PCM_FMTBIT(FLOAT_LE)
155#define SNDRV_PCM_FMTBIT_FLOAT64_LE (1ULL << SNDRV_PCM_FORMAT_FLOAT64_LE) 155#define SNDRV_PCM_FMTBIT_FLOAT_BE _SNDRV_PCM_FMTBIT(FLOAT_BE)
156#define SNDRV_PCM_FMTBIT_FLOAT64_BE (1ULL << SNDRV_PCM_FORMAT_FLOAT64_BE) 156#define SNDRV_PCM_FMTBIT_FLOAT64_LE _SNDRV_PCM_FMTBIT(FLOAT64_LE)
157#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE (1ULL << SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE) 157#define SNDRV_PCM_FMTBIT_FLOAT64_BE _SNDRV_PCM_FMTBIT(FLOAT64_BE)
158#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE (1ULL << SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE) 158#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE _SNDRV_PCM_FMTBIT(IEC958_SUBFRAME_LE)
159#define SNDRV_PCM_FMTBIT_MU_LAW (1ULL << SNDRV_PCM_FORMAT_MU_LAW) 159#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE _SNDRV_PCM_FMTBIT(IEC958_SUBFRAME_BE)
160#define SNDRV_PCM_FMTBIT_A_LAW (1ULL << SNDRV_PCM_FORMAT_A_LAW) 160#define SNDRV_PCM_FMTBIT_MU_LAW _SNDRV_PCM_FMTBIT(MU_LAW)
161#define SNDRV_PCM_FMTBIT_IMA_ADPCM (1ULL << SNDRV_PCM_FORMAT_IMA_ADPCM) 161#define SNDRV_PCM_FMTBIT_A_LAW _SNDRV_PCM_FMTBIT(A_LAW)
162#define SNDRV_PCM_FMTBIT_MPEG (1ULL << SNDRV_PCM_FORMAT_MPEG) 162#define SNDRV_PCM_FMTBIT_IMA_ADPCM _SNDRV_PCM_FMTBIT(IMA_ADPCM)
163#define SNDRV_PCM_FMTBIT_GSM (1ULL << SNDRV_PCM_FORMAT_GSM) 163#define SNDRV_PCM_FMTBIT_MPEG _SNDRV_PCM_FMTBIT(MPEG)
164#define SNDRV_PCM_FMTBIT_SPECIAL (1ULL << SNDRV_PCM_FORMAT_SPECIAL) 164#define SNDRV_PCM_FMTBIT_GSM _SNDRV_PCM_FMTBIT(GSM)
165#define SNDRV_PCM_FMTBIT_S24_3LE (1ULL << SNDRV_PCM_FORMAT_S24_3LE) 165#define SNDRV_PCM_FMTBIT_SPECIAL _SNDRV_PCM_FMTBIT(SPECIAL)
166#define SNDRV_PCM_FMTBIT_U24_3LE (1ULL << SNDRV_PCM_FORMAT_U24_3LE) 166#define SNDRV_PCM_FMTBIT_S24_3LE _SNDRV_PCM_FMTBIT(S24_3LE)
167#define SNDRV_PCM_FMTBIT_S24_3BE (1ULL << SNDRV_PCM_FORMAT_S24_3BE) 167#define SNDRV_PCM_FMTBIT_U24_3LE _SNDRV_PCM_FMTBIT(U24_3LE)
168#define SNDRV_PCM_FMTBIT_U24_3BE (1ULL << SNDRV_PCM_FORMAT_U24_3BE) 168#define SNDRV_PCM_FMTBIT_S24_3BE _SNDRV_PCM_FMTBIT(S24_3BE)
169#define SNDRV_PCM_FMTBIT_S20_3LE (1ULL << SNDRV_PCM_FORMAT_S20_3LE) 169#define SNDRV_PCM_FMTBIT_U24_3BE _SNDRV_PCM_FMTBIT(U24_3BE)
170#define SNDRV_PCM_FMTBIT_U20_3LE (1ULL << SNDRV_PCM_FORMAT_U20_3LE) 170#define SNDRV_PCM_FMTBIT_S20_3LE _SNDRV_PCM_FMTBIT(S20_3LE)
171#define SNDRV_PCM_FMTBIT_S20_3BE (1ULL << SNDRV_PCM_FORMAT_S20_3BE) 171#define SNDRV_PCM_FMTBIT_U20_3LE _SNDRV_PCM_FMTBIT(U20_3LE)
172#define SNDRV_PCM_FMTBIT_U20_3BE (1ULL << SNDRV_PCM_FORMAT_U20_3BE) 172#define SNDRV_PCM_FMTBIT_S20_3BE _SNDRV_PCM_FMTBIT(S20_3BE)
173#define SNDRV_PCM_FMTBIT_S18_3LE (1ULL << SNDRV_PCM_FORMAT_S18_3LE) 173#define SNDRV_PCM_FMTBIT_U20_3BE _SNDRV_PCM_FMTBIT(U20_3BE)
174#define SNDRV_PCM_FMTBIT_U18_3LE (1ULL << SNDRV_PCM_FORMAT_U18_3LE) 174#define SNDRV_PCM_FMTBIT_S18_3LE _SNDRV_PCM_FMTBIT(S18_3LE)
175#define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) 175#define SNDRV_PCM_FMTBIT_U18_3LE _SNDRV_PCM_FMTBIT(U18_3LE)
176#define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) 176#define SNDRV_PCM_FMTBIT_S18_3BE _SNDRV_PCM_FMTBIT(S18_3BE)
177#define SNDRV_PCM_FMTBIT_G723_24 (1ULL << SNDRV_PCM_FORMAT_G723_24) 177#define SNDRV_PCM_FMTBIT_U18_3BE _SNDRV_PCM_FMTBIT(U18_3BE)
178#define SNDRV_PCM_FMTBIT_G723_24_1B (1ULL << SNDRV_PCM_FORMAT_G723_24_1B) 178#define SNDRV_PCM_FMTBIT_G723_24 _SNDRV_PCM_FMTBIT(G723_24)
179#define SNDRV_PCM_FMTBIT_G723_40 (1ULL << SNDRV_PCM_FORMAT_G723_40) 179#define SNDRV_PCM_FMTBIT_G723_24_1B _SNDRV_PCM_FMTBIT(G723_24_1B)
180#define SNDRV_PCM_FMTBIT_G723_40_1B (1ULL << SNDRV_PCM_FORMAT_G723_40_1B) 180#define SNDRV_PCM_FMTBIT_G723_40 _SNDRV_PCM_FMTBIT(G723_40)
181#define SNDRV_PCM_FMTBIT_G723_40_1B _SNDRV_PCM_FMTBIT(G723_40_1B)
181 182
182#ifdef SNDRV_LITTLE_ENDIAN 183#ifdef SNDRV_LITTLE_ENDIAN
183#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE 184#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE
@@ -278,6 +279,7 @@ struct snd_pcm_runtime {
278 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ 279 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */
279 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ 280 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
280 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 281 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */
282 unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */
281 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 283 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */
282 284
283 /* -- HW params -- */ 285 /* -- HW params -- */
@@ -296,6 +298,7 @@ struct snd_pcm_runtime {
296 unsigned int info; 298 unsigned int info;
297 unsigned int rate_num; 299 unsigned int rate_num;
298 unsigned int rate_den; 300 unsigned int rate_den;
301 unsigned int no_period_wakeup: 1;
299 302
300 /* -- SW params -- */ 303 /* -- SW params -- */
301 int tstamp_mode; /* mmap timestamp is updated */ 304 int tstamp_mode; /* mmap timestamp is updated */
@@ -488,7 +491,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,
488int snd_pcm_status(struct snd_pcm_substream *substream, 491int snd_pcm_status(struct snd_pcm_substream *substream,
489 struct snd_pcm_status *status); 492 struct snd_pcm_status *status);
490int snd_pcm_start(struct snd_pcm_substream *substream); 493int snd_pcm_start(struct snd_pcm_substream *substream);
491int snd_pcm_stop(struct snd_pcm_substream *substream, int status); 494int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
492int snd_pcm_drain_done(struct snd_pcm_substream *substream); 495int snd_pcm_drain_done(struct snd_pcm_substream *substream);
493#ifdef CONFIG_PM 496#ifdef CONFIG_PM
494int snd_pcm_suspend(struct snd_pcm_substream *substream); 497int snd_pcm_suspend(struct snd_pcm_substream *substream);
@@ -746,8 +749,8 @@ static inline const struct snd_interval *hw_param_interval_c(const struct snd_pc
746 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 749 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
747} 750}
748 751
749#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) 752#define params_access(p) ((__force snd_pcm_access_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)))
750#define params_format(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT)) 753#define params_format(p) ((__force snd_pcm_format_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT)))
751#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) 754#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT))
752#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min 755#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min
753#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min 756#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min
@@ -1028,9 +1031,7 @@ int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_s
1028#define snd_pcm_lib_mmap_iomem NULL 1031#define snd_pcm_lib_mmap_iomem NULL
1029#endif 1032#endif
1030 1033
1031int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream, 1034#define snd_pcm_lib_mmap_vmalloc NULL
1032 struct vm_area_struct *area);
1033#define snd_pcm_lib_mmap_vmalloc snd_pcm_lib_mmap_noncached
1034 1035
1035static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) 1036static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
1036{ 1037{
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index 736eac71d053..af1b49e982df 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -99,7 +99,14 @@ struct snd_sb_csp_info {
99/* get CSP information */ 99/* get CSP information */
100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info) 100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
101/* load microcode to CSP */ 101/* load microcode to CSP */
102#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, struct snd_sb_csp_microcode) 102/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
103 * defined for some architectures like MIPS, and it leads to build errors.
104 * (x86 and co have 14-bit size, thus it's valid, though.)
105 * As a workaround for skipping the size-limit check, here we don't use the
106 * normal _IOW() macro but _IOC() with the manual argument.
107 */
108#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
109 _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
103/* unload microcode from CSP */ 110/* unload microcode from CSP */
104#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) 111#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
105/* start CSP */ 112/* start CSP */
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index 9d51d6f35893..9a155f9d0a12 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -15,67 +15,29 @@
15#define FSI_PORT_A 0 15#define FSI_PORT_A 0
16#define FSI_PORT_B 1 16#define FSI_PORT_B 1
17 17
18/* flags format
19
20 * 0xABCDEEFF
21 *
22 * A: channel size for TDM (input)
23 * B: channel size for TDM (ooutput)
24 * C: inversion
25 * D: mode
26 * E: input format
27 * F: output format
28 */
29
30#include <linux/clk.h> 18#include <linux/clk.h>
31#include <sound/soc.h> 19#include <sound/soc.h>
32 20
33/* TDM channel */ 21/*
34#define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) 22 * flags format
35#define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) 23 *
36 24 * 0x000000BA
37#define SH_FSI_CH_IMASK 0xF0000000 25 *
38#define SH_FSI_CH_OMASK 0x0F000000 26 * A: inversion
39#define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) 27 * B: format mode
40#define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) 28 */
41
42/* clock inversion */
43#define SH_FSI_INVERSION_MASK 0x00F00000
44#define SH_FSI_LRM_INV (1 << 20)
45#define SH_FSI_BRM_INV (1 << 21)
46#define SH_FSI_LRS_INV (1 << 22)
47#define SH_FSI_BRS_INV (1 << 23)
48
49/* mode */
50#define SH_FSI_MODE_MASK 0x000F0000
51#define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */
52#define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */
53
54/* DI format */
55#define SH_FSI_FMT_MASK 0x000000FF
56#define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8)
57#define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0)
58#define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK)
59#define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK)
60
61#define SH_FSI_FMT_MONO 0
62#define SH_FSI_FMT_MONO_DELAY 1
63#define SH_FSI_FMT_PCM 2
64#define SH_FSI_FMT_I2S 3
65#define SH_FSI_FMT_TDM 4
66#define SH_FSI_FMT_TDM_DELAY 5
67#define SH_FSI_FMT_SPDIF 6
68
69 29
70#define SH_FSI_IFMT_TDM_CH(x) \ 30/* A: clock inversion */
71 (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) 31#define SH_FSI_INVERSION_MASK 0x0000000F
72#define SH_FSI_IFMT_TDM_DELAY_CH(x) \ 32#define SH_FSI_LRM_INV (1 << 0)
73 (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x)) 33#define SH_FSI_BRM_INV (1 << 1)
34#define SH_FSI_LRS_INV (1 << 2)
35#define SH_FSI_BRS_INV (1 << 3)
74 36
75#define SH_FSI_OFMT_TDM_CH(x) \ 37/* B: format mode */
76 (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) 38#define SH_FSI_FMT_MASK 0x000000F0
77#define SH_FSI_OFMT_TDM_DELAY_CH(x) \ 39#define SH_FSI_FMT_DAI (0 << 4)
78 (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) 40#define SH_FSI_FMT_SPDIF (1 << 4)
79 41
80 42
81/* 43/*
@@ -85,7 +47,9 @@
85 * ACK_MD (FSI2) 47 * ACK_MD (FSI2)
86 * CKG1 (FSI) 48 * CKG1 (FSI)
87 * 49 *
88 * err: return value < 0 50 * err : return value < 0
51 * no change : return value == 0
52 * change xMD : return value > 0
89 * 53 *
90 * 0x-00000AB 54 * 0x-00000AB
91 * 55 *
@@ -111,10 +75,7 @@
111struct sh_fsi_platform_info { 75struct sh_fsi_platform_info {
112 unsigned long porta_flags; 76 unsigned long porta_flags;
113 unsigned long portb_flags; 77 unsigned long portb_flags;
114 int (*set_rate)(int is_porta, int rate); /* for master mode */ 78 int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
115}; 79};
116 80
117extern struct snd_soc_dai fsi_soc_dai[2];
118extern struct snd_soc_platform fsi_soc_platform;
119
120#endif /* __SOUND_FSI_H */ 81#endif /* __SOUND_FSI_H */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 377693a14385..1bafe95dcf41 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -16,8 +16,6 @@
16 16
17#include <linux/list.h> 17#include <linux/list.h>
18 18
19#include <sound/soc.h>
20
21struct snd_pcm_substream; 19struct snd_pcm_substream;
22 20
23/* 21/*
@@ -91,15 +89,17 @@ struct snd_pcm_substream;
91 SNDRV_PCM_FMTBIT_S32_LE |\ 89 SNDRV_PCM_FMTBIT_S32_LE |\
92 SNDRV_PCM_FMTBIT_S32_BE) 90 SNDRV_PCM_FMTBIT_S32_BE)
93 91
94struct snd_soc_dai_ops; 92struct snd_soc_dai_driver;
95struct snd_soc_dai; 93struct snd_soc_dai;
96struct snd_ac97_bus_ops; 94struct snd_ac97_bus_ops;
97 95
98/* Digital Audio Interface registration */ 96/* Digital Audio Interface registration */
99int snd_soc_register_dai(struct snd_soc_dai *dai); 97int snd_soc_register_dai(struct device *dev,
100void snd_soc_unregister_dai(struct snd_soc_dai *dai); 98 struct snd_soc_dai_driver *dai_drv);
101int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count); 99void snd_soc_unregister_dai(struct device *dev);
102void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count); 100int snd_soc_register_dais(struct device *dev,
101 struct snd_soc_dai_driver *dai_drv, size_t count);
102void snd_soc_unregister_dais(struct device *dev, size_t count);
103 103
104/* Digital Audio Interface clocking API.*/ 104/* Digital Audio Interface clocking API.*/
105int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, 105int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
@@ -126,16 +126,6 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
126/* Digital Audio Interface mute */ 126/* Digital Audio Interface mute */
127int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); 127int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute);
128 128
129/*
130 * Digital Audio Interface.
131 *
132 * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97
133 * operations and capabilities. Codec and platform drivers will register this
134 * structure for every DAI they have.
135 *
136 * This structure covers the clocking, formating and ALSA operations for each
137 * interface.
138 */
139struct snd_soc_dai_ops { 129struct snd_soc_dai_ops {
140 /* 130 /*
141 * DAI clocking configuration, all optional. 131 * DAI clocking configuration, all optional.
@@ -191,54 +181,79 @@ struct snd_soc_dai_ops {
191}; 181};
192 182
193/* 183/*
194 * Digital Audio Interface runtime data. 184 * Digital Audio Interface Driver.
195 * 185 *
196 * Holds runtime data for a DAI. 186 * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97
187 * operations and capabilities. Codec and platform drivers will register this
188 * structure for every DAI they have.
189 *
190 * This structure covers the clocking, formating and ALSA operations for each
191 * interface.
197 */ 192 */
198struct snd_soc_dai { 193struct snd_soc_dai_driver {
199 /* DAI description */ 194 /* DAI description */
200 char *name; 195 const char *name;
201 unsigned int id; 196 unsigned int id;
202 int ac97_control; 197 int ac97_control;
203 198
204 struct device *dev; 199 /* DAI driver callbacks */
205 void *ac97_pdata; /* platform_data for the ac97 codec */ 200 int (*probe)(struct snd_soc_dai *dai);
206 201 int (*remove)(struct snd_soc_dai *dai);
207 /* DAI callbacks */
208 int (*probe)(struct platform_device *pdev,
209 struct snd_soc_dai *dai);
210 void (*remove)(struct platform_device *pdev,
211 struct snd_soc_dai *dai);
212 int (*suspend)(struct snd_soc_dai *dai); 202 int (*suspend)(struct snd_soc_dai *dai);
213 int (*resume)(struct snd_soc_dai *dai); 203 int (*resume)(struct snd_soc_dai *dai);
214 204
215 /* ops */ 205 /* ops */
216 struct snd_soc_dai_ops *ops; 206 const struct snd_soc_dai_ops *ops;
217 207
218 /* DAI capabilities */ 208 /* DAI capabilities */
219 struct snd_soc_pcm_stream capture; 209 struct snd_soc_pcm_stream capture;
220 struct snd_soc_pcm_stream playback; 210 struct snd_soc_pcm_stream playback;
221 unsigned int symmetric_rates:1; 211 unsigned int symmetric_rates:1;
212};
213
214/*
215 * Digital Audio Interface runtime data.
216 *
217 * Holds runtime data for a DAI.
218 */
219struct snd_soc_dai {
220 const char *name;
221 int id;
222 struct device *dev;
223 void *ac97_pdata; /* platform_data for the ac97 codec */
224
225 /* driver ops */
226 struct snd_soc_dai_driver *driver;
222 227
223 /* DAI runtime info */ 228 /* DAI runtime info */
224 struct snd_soc_codec *codec; 229 unsigned int capture_active:1; /* stream is in use */
230 unsigned int playback_active:1; /* stream is in use */
231 unsigned int symmetric_rates:1;
232 struct snd_pcm_runtime *runtime;
225 unsigned int active; 233 unsigned int active;
226 unsigned char pop_wait:1; 234 unsigned char pop_wait:1;
235 unsigned char probed:1;
227 236
228 /* DAI private data */ 237 /* DAI DMA data */
229 void *private_data; 238 void *playback_dma_data;
239 void *capture_dma_data;
230 240
231 /* parent platform */ 241 /* parent platform/codec */
232 struct snd_soc_platform *platform; 242 union {
243 struct snd_soc_platform *platform;
244 struct snd_soc_codec *codec;
245 };
246 struct snd_soc_card *card;
233 247
234 struct list_head list; 248 struct list_head list;
249 struct list_head card_list;
235}; 250};
236 251
237static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, 252static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
238 const struct snd_pcm_substream *ss) 253 const struct snd_pcm_substream *ss)
239{ 254{
240 return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 255 return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
241 dai->playback.dma_data : dai->capture.dma_data; 256 dai->playback_dma_data : dai->capture_dma_data;
242} 257}
243 258
244static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, 259static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
@@ -246,9 +261,20 @@ static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
246 void *data) 261 void *data)
247{ 262{
248 if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) 263 if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
249 dai->playback.dma_data = data; 264 dai->playback_dma_data = data;
250 else 265 else
251 dai->capture.dma_data = data; 266 dai->capture_dma_data = data;
267}
268
269static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai,
270 void *data)
271{
272 dev_set_drvdata(dai->dev, data);
273}
274
275static inline void *snd_soc_dai_get_drvdata(struct snd_soc_dai *dai)
276{
277 return dev_get_drvdata(dai->dev);
252} 278}
253 279
254#endif 280#endif
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c5d9987bc897..c46e7d89561d 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -16,7 +16,6 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <sound/control.h> 18#include <sound/control.h>
19#include <sound/soc.h>
20 19
21/* widget has no PM register bit */ 20/* widget has no PM register bit */
22#define SND_SOC_NOPM -1 21#define SND_SOC_NOPM -1
@@ -24,8 +23,8 @@
24/* 23/*
25 * SoC dynamic audio power management 24 * SoC dynamic audio power management
26 * 25 *
27 * We can have upto 4 power domains 26 * We can have up to 4 power domains
28 * 1. Codec domain - VREF, VMID 27 * 1. Codec domain - VREF, VMID
29 * Usually controlled at codec probe/remove, although can be set 28 * Usually controlled at codec probe/remove, although can be set
30 * at stream time if power is not needed for sidetone, etc. 29 * at stream time if power is not needed for sidetone, etc.
31 * 2. Platform/Machine domain - physically connected inputs and outputs 30 * 2. Platform/Machine domain - physically connected inputs and outputs
@@ -40,141 +39,180 @@
40 39
41/* codec domain */ 40/* codec domain */
42#define SND_SOC_DAPM_VMID(wname) \ 41#define SND_SOC_DAPM_VMID(wname) \
43{ .id = snd_soc_dapm_vmid, .name = wname, .kcontrols = NULL, \ 42{ .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \
44 .num_kcontrols = 0} 43 .num_kcontrols = 0}
45 44
46/* platform domain */ 45/* platform domain */
47#define SND_SOC_DAPM_INPUT(wname) \ 46#define SND_SOC_DAPM_INPUT(wname) \
48{ .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \ 47{ .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \
49 .num_kcontrols = 0} 48 .num_kcontrols = 0, .reg = SND_SOC_NOPM }
50#define SND_SOC_DAPM_OUTPUT(wname) \ 49#define SND_SOC_DAPM_OUTPUT(wname) \
51{ .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \ 50{ .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \
52 .num_kcontrols = 0} 51 .num_kcontrols = 0, .reg = SND_SOC_NOPM }
53#define SND_SOC_DAPM_MIC(wname, wevent) \ 52#define SND_SOC_DAPM_MIC(wname, wevent) \
54{ .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \ 53{ .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \
55 .num_kcontrols = 0, .event = wevent, \ 54 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
56 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 55 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
57#define SND_SOC_DAPM_HP(wname, wevent) \ 56#define SND_SOC_DAPM_HP(wname, wevent) \
58{ .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \ 57{ .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \
59 .num_kcontrols = 0, .event = wevent, \ 58 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
60 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 59 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
61#define SND_SOC_DAPM_SPK(wname, wevent) \ 60#define SND_SOC_DAPM_SPK(wname, wevent) \
62{ .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \ 61{ .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \
63 .num_kcontrols = 0, .event = wevent, \ 62 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
64 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 63 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
65#define SND_SOC_DAPM_LINE(wname, wevent) \ 64#define SND_SOC_DAPM_LINE(wname, wevent) \
66{ .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \ 65{ .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \
67 .num_kcontrols = 0, .event = wevent, \ 66 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
68 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 67 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
69 68
70/* path domain */ 69/* path domain */
71#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ 70#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\
72 wcontrols, wncontrols) \ 71 wcontrols, wncontrols) \
73{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 72{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
74 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} 73 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
74#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
75 wcontrols, wncontrols) \
76{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
77 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
75#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 78#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
76 wcontrols, wncontrols)\ 79 wcontrols, wncontrols)\
77{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 80{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
78 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} 81 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
79#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ 82#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \
80 wcontrols, wncontrols)\ 83 wcontrols, wncontrols)\
81{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 84{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \
82 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ 85 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \
83 .num_kcontrols = wncontrols} 86 .num_kcontrols = wncontrols}
84#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ 87#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \
85{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ 88{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \
86 .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0} 89 .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0}
87#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ 90#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \
88{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 91{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \
89 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} 92 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1}
90#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 93#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
91{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 94{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
92 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} 95 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1}
96#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
97{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
98 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1}
93#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ 99#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
94{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ 100{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \
95 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ 101 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \
96 .num_kcontrols = 1} 102 .num_kcontrols = 1}
97 103
98/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 104/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
99#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 105#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
100 wcontrols) \ 106 wcontrols) \
101{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 107{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
102 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 108 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
103#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 109#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \
104 wcontrols)\ 110 wcontrols)\
105{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 111{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
106 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 112 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
107#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 113#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \
108 wcontrols)\ 114 wcontrols)\
109{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 115{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \
110 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ 116 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \
111 .num_kcontrols = ARRAY_SIZE(wcontrols)} 117 .num_kcontrols = ARRAY_SIZE(wcontrols)}
112 118
113/* path domain with event - event handler must return 0 for success */ 119/* path domain with event - event handler must return 0 for success */
114#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 120#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
115 wncontrols, wevent, wflags) \ 121 wncontrols, wevent, wflags) \
116{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 122{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
117 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ 123 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
124 .event = wevent, .event_flags = wflags}
125#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
126 wncontrols, wevent, wflags) \
127{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
128 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
118 .event = wevent, .event_flags = wflags} 129 .event = wevent, .event_flags = wflags}
119#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 130#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
120 wncontrols, wevent, wflags) \ 131 wncontrols, wevent, wflags) \
121{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 132{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
122 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ 133 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
123 .event = wevent, .event_flags = wflags} 134 .event = wevent, .event_flags = wflags}
124#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ 135#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \
125 wcontrols, wncontrols, wevent, wflags) \ 136 wcontrols, wncontrols, wevent, wflags) \
126{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 137{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
127 .invert = winvert, .kcontrols = wcontrols, \ 138 .invert = winvert, .kcontrol_news = wcontrols, \
128 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} 139 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags}
129#define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \ 140#define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \
130{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ 141{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \
131 .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0, \ 142 .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0, \
132 .event = wevent, .event_flags = wflags} 143 .event = wevent, .event_flags = wflags}
133#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 144#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
134 wevent, wflags) \ 145 wevent, wflags) \
135{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 146{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \
136 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 147 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \
137 .event = wevent, .event_flags = wflags} 148 .event = wevent, .event_flags = wflags}
138#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 149#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
139 wevent, wflags) \ 150 wevent, wflags) \
140{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 151{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
141 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 152 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \
153 .event = wevent, .event_flags = wflags}
154#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
155 wevent, wflags) \
156{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \
157 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \
142 .event = wevent, .event_flags = wflags} 158 .event = wevent, .event_flags = wflags}
143 159
160/* additional sequencing control within an event type */
161#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
162 wevent, wflags) \
163{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
164 .invert = winvert, .event = wevent, .event_flags = wflags, \
165 .subseq = wsubseq}
166#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
167 wflags) \
168{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \
169 .shift = wshift, .invert = winvert, .event = wevent, \
170 .event_flags = wflags, .subseq = wsubseq}
171
144/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 172/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
145#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 173#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
146 wevent, wflags) \ 174 wevent, wflags) \
147{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 175{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
148 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 176 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
149 .event = wevent, .event_flags = wflags} 177 .event = wevent, .event_flags = wflags}
150#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 178#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
151 wevent, wflags) \ 179 wevent, wflags) \
152{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 180{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
153 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 181 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
154 .event = wevent, .event_flags = wflags} 182 .event = wevent, .event_flags = wflags}
155#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 183#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \
156 wcontrols, wevent, wflags) \ 184 wcontrols, wevent, wflags) \
157{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 185{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
158 .invert = winvert, .kcontrols = wcontrols, \ 186 .invert = winvert, .kcontrol_news = wcontrols, \
159 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} 187 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags}
160 188
161/* events that are pre and post DAPM */ 189/* events that are pre and post DAPM */
162#define SND_SOC_DAPM_PRE(wname, wevent) \ 190#define SND_SOC_DAPM_PRE(wname, wevent) \
163{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ 191{ .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \
164 .num_kcontrols = 0, .event = wevent, \ 192 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
165 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} 193 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD}
166#define SND_SOC_DAPM_POST(wname, wevent) \ 194#define SND_SOC_DAPM_POST(wname, wevent) \
167{ .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \ 195{ .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \
168 .num_kcontrols = 0, .event = wevent, \ 196 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
169 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} 197 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}
170 198
171/* stream domain */ 199/* stream domain */
172#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ 200#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \
173{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 201{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
174 .reg = wreg, .shift = wshift, .invert = winvert } 202 .reg = wreg, .shift = wshift, .invert = winvert }
203#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \
204 wevent, wflags) \
205{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
206 .reg = wreg, .shift = wshift, .invert = winvert, \
207 .event = wevent, .event_flags = wflags }
175#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 208#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \
176{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 209{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
177 .reg = wreg, .shift = wshift, .invert = winvert } 210 .reg = wreg, .shift = wshift, .invert = winvert }
211#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \
212 wevent, wflags) \
213{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
214 .reg = wreg, .shift = wshift, .invert = winvert, \
215 .event = wevent, .event_flags = wflags }
178#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 216#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
179{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 217{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
180 .shift = wshift, .invert = winvert} 218 .shift = wshift, .invert = winvert}
@@ -194,7 +232,7 @@
194 232
195/* generic widgets */ 233/* generic widgets */
196#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ 234#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \
197{ .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ 235{ .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \
198 .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ 236 .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \
199 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ 237 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \
200 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 238 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
@@ -209,13 +247,6 @@
209 .info = snd_soc_info_volsw, \ 247 .info = snd_soc_info_volsw, \
210 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 248 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
211 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 249 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
212#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \
213 power) \
214{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
215 .info = snd_soc_info_volsw, \
216 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
217 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
218 ((max) << 16) | ((invert) << 24) }
219#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 250#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
220{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 251{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
221 .info = snd_soc_info_volsw, \ 252 .info = snd_soc_info_volsw, \
@@ -223,15 +254,6 @@
223 .tlv.p = (tlv_array), \ 254 .tlv.p = (tlv_array), \
224 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 255 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
225 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 256 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
226#define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \
227 power, tlv_array) \
228{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
229 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
230 .tlv.p = (tlv_array), \
231 .info = snd_soc_info_volsw, \
232 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
233 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
234 ((max) << 16) | ((invert) << 24) }
235#define SOC_DAPM_ENUM(xname, xenum) \ 257#define SOC_DAPM_ENUM(xname, xenum) \
236{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 258{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
237 .info = snd_soc_info_enum_double, \ 259 .info = snd_soc_info_enum_double, \
@@ -287,6 +309,7 @@ enum snd_soc_dapm_type;
287struct snd_soc_dapm_path; 309struct snd_soc_dapm_path;
288struct snd_soc_dapm_pin; 310struct snd_soc_dapm_pin;
289struct snd_soc_dapm_route; 311struct snd_soc_dapm_route;
312struct snd_soc_dapm_context;
290 313
291int dapm_reg_event(struct snd_soc_dapm_widget *w, 314int dapm_reg_event(struct snd_soc_dapm_widget *w,
292 struct snd_kcontrol *kcontrol, int event); 315 struct snd_kcontrol *kcontrol, int event);
@@ -314,46 +337,53 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
314 struct snd_ctl_elem_value *uncontrol); 337 struct snd_ctl_elem_value *uncontrol);
315int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, 338int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
316 struct snd_ctl_elem_value *uncontrol); 339 struct snd_ctl_elem_value *uncontrol);
317int snd_soc_dapm_new_control(struct snd_soc_codec *codec, 340int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
318 const struct snd_soc_dapm_widget *widget); 341 const struct snd_soc_dapm_widget *widget);
319int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, 342int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
320 const struct snd_soc_dapm_widget *widget, 343 const struct snd_soc_dapm_widget *widget,
321 int num); 344 int num);
322 345
323/* dapm path setup */ 346/* dapm path setup */
324int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); 347int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
325void snd_soc_dapm_free(struct snd_soc_device *socdev); 348void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
326int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, 349int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
327 const struct snd_soc_dapm_route *route, int num); 350 const struct snd_soc_dapm_route *route, int num);
328 351
329/* dapm events */ 352/* dapm events */
330int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, 353int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
331 int event); 354 const char *stream, int event);
332void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); 355void snd_soc_dapm_shutdown(struct snd_soc_card *card);
333 356
334/* dapm sys fs - used by the core */ 357/* dapm sys fs - used by the core */
335int snd_soc_dapm_sys_add(struct device *dev); 358int snd_soc_dapm_sys_add(struct device *dev);
336void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); 359void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
360 struct dentry *parent);
337 361
338/* dapm audio pin control and status */ 362/* dapm audio pin control and status */
339int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); 363int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm,
340int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); 364 const char *pin);
341int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); 365int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm,
342int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); 366 const char *pin);
343int snd_soc_dapm_sync(struct snd_soc_codec *codec); 367int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin);
344int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, 368int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
369 const char *pin);
370int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm);
371int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
345 const char *pin); 372 const char *pin);
346int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin); 373int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
374 const char *pin);
347 375
348/* dapm widget types */ 376/* dapm widget types */
349enum snd_soc_dapm_type { 377enum snd_soc_dapm_type {
350 snd_soc_dapm_input = 0, /* input pin */ 378 snd_soc_dapm_input = 0, /* input pin */
351 snd_soc_dapm_output, /* output pin */ 379 snd_soc_dapm_output, /* output pin */
352 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ 380 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
381 snd_soc_dapm_virt_mux, /* virtual version of snd_soc_dapm_mux */
353 snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ 382 snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */
354 snd_soc_dapm_mixer, /* mixes several analog signals together */ 383 snd_soc_dapm_mixer, /* mixes several analog signals together */
355 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 384 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
356 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 385 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
386 snd_soc_dapm_out_drv, /* output driver */
357 snd_soc_dapm_adc, /* analog to digital converter */ 387 snd_soc_dapm_adc, /* analog to digital converter */
358 snd_soc_dapm_dac, /* digital to analog converter */ 388 snd_soc_dapm_dac, /* digital to analog converter */
359 snd_soc_dapm_micbias, /* microphone bias (power) */ 389 snd_soc_dapm_micbias, /* microphone bias (power) */
@@ -415,6 +445,7 @@ struct snd_soc_dapm_widget {
415 char *sname; /* stream name */ 445 char *sname; /* stream name */
416 struct snd_soc_codec *codec; 446 struct snd_soc_codec *codec;
417 struct list_head list; 447 struct list_head list;
448 struct snd_soc_dapm_context *dapm;
418 449
419 /* dapm control */ 450 /* dapm control */
420 short reg; /* negative reg = no direct dapm */ 451 short reg; /* negative reg = no direct dapm */
@@ -432,6 +463,7 @@ struct snd_soc_dapm_widget {
432 unsigned char ext:1; /* has external widgets */ 463 unsigned char ext:1; /* has external widgets */
433 unsigned char force:1; /* force state */ 464 unsigned char force:1; /* force state */
434 unsigned char ignore_suspend:1; /* kept enabled over suspend */ 465 unsigned char ignore_suspend:1; /* kept enabled over suspend */
466 int subseq; /* sort within widget type */
435 467
436 int (*power_check)(struct snd_soc_dapm_widget *w); 468 int (*power_check)(struct snd_soc_dapm_widget *w);
437 469
@@ -441,7 +473,8 @@ struct snd_soc_dapm_widget {
441 473
442 /* kcontrols that relate to this widget */ 474 /* kcontrols that relate to this widget */
443 int num_kcontrols; 475 int num_kcontrols;
444 const struct snd_kcontrol_new *kcontrols; 476 const struct snd_kcontrol_new *kcontrol_news;
477 struct snd_kcontrol **kcontrols;
445 478
446 /* widget input and outputs */ 479 /* widget input and outputs */
447 struct list_head sources; 480 struct list_head sources;
@@ -451,4 +484,44 @@ struct snd_soc_dapm_widget {
451 struct list_head power_list; 484 struct list_head power_list;
452}; 485};
453 486
487struct snd_soc_dapm_update {
488 struct snd_soc_dapm_widget *widget;
489 struct snd_kcontrol *kcontrol;
490 int reg;
491 int mask;
492 int val;
493};
494
495/* DAPM context */
496struct snd_soc_dapm_context {
497 int n_widgets; /* number of widgets in this context */
498 enum snd_soc_bias_level bias_level;
499 enum snd_soc_bias_level suspend_bias_level;
500 struct delayed_work delayed_work;
501 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
502
503 struct snd_soc_dapm_update *update;
504
505 void (*seq_notifier)(struct snd_soc_dapm_context *,
506 enum snd_soc_dapm_type, int);
507
508 struct device *dev; /* from parent - for debug */
509 struct snd_soc_codec *codec; /* parent codec */
510 struct snd_soc_card *card; /* parent card */
511
512 /* used during DAPM updates */
513 int dev_power;
514 struct list_head list;
515
516#ifdef CONFIG_DEBUG_FS
517 struct dentry *debugfs_dapm;
518#endif
519};
520
521/* A list of widgets associated with an object, typically a snd_kcontrol */
522struct snd_soc_dapm_widget_list {
523 int num_widgets;
524 struct snd_soc_dapm_widget *widgets[0];
525};
526
454#endif 527#endif
diff --git a/include/sound/soc-of-simple.h b/include/sound/soc-of-simple.h
deleted file mode 100644
index a064e1934a56..000000000000
--- a/include/sound/soc-of-simple.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * OF helpers for ALSA SoC
3 *
4 * Copyright (C) 2008, Secret Lab Technologies Ltd.
5 */
6
7#ifndef _INCLUDE_SOC_OF_H_
8#define _INCLUDE_SOC_OF_H_
9
10#if defined(CONFIG_SND_SOC_OF_SIMPLE) || defined(CONFIG_SND_SOC_OF_SIMPLE_MODULE)
11
12#include <linux/of.h>
13#include <sound/soc.h>
14
15int of_snd_soc_register_codec(struct snd_soc_codec_device *codec_dev,
16 void *codec_data, struct snd_soc_dai *dai,
17 struct device_node *node);
18
19int of_snd_soc_register_platform(struct snd_soc_platform *platform,
20 struct device_node *node,
21 struct snd_soc_dai *cpu_dai);
22
23#endif
24
25#endif /* _INCLUDE_SOC_OF_H_ */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 65e9d03ed4f5..3a4bd3a3c68d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -214,27 +214,31 @@
214 * @OFF: Power Off. No restrictions on transition times. 214 * @OFF: Power Off. No restrictions on transition times.
215 */ 215 */
216enum snd_soc_bias_level { 216enum snd_soc_bias_level {
217 SND_SOC_BIAS_ON,
218 SND_SOC_BIAS_PREPARE,
219 SND_SOC_BIAS_STANDBY,
220 SND_SOC_BIAS_OFF, 217 SND_SOC_BIAS_OFF,
218 SND_SOC_BIAS_STANDBY,
219 SND_SOC_BIAS_PREPARE,
220 SND_SOC_BIAS_ON,
221}; 221};
222 222
223struct snd_jack; 223struct snd_jack;
224struct snd_soc_card; 224struct snd_soc_card;
225struct snd_soc_device;
226struct snd_soc_pcm_stream; 225struct snd_soc_pcm_stream;
227struct snd_soc_ops; 226struct snd_soc_ops;
228struct snd_soc_dai_mode;
229struct snd_soc_pcm_runtime; 227struct snd_soc_pcm_runtime;
230struct snd_soc_dai; 228struct snd_soc_dai;
229struct snd_soc_dai_driver;
231struct snd_soc_platform; 230struct snd_soc_platform;
232struct snd_soc_dai_link; 231struct snd_soc_dai_link;
232struct snd_soc_platform_driver;
233struct snd_soc_codec; 233struct snd_soc_codec;
234struct snd_soc_codec_driver;
234struct soc_enum; 235struct soc_enum;
235struct snd_soc_ac97_ops;
236struct snd_soc_jack; 236struct snd_soc_jack;
237struct snd_soc_jack_zone;
237struct snd_soc_jack_pin; 238struct snd_soc_jack_pin;
239struct snd_soc_cache_ops;
240#include <sound/soc-dapm.h>
241
238#ifdef CONFIG_GPIOLIB 242#ifdef CONFIG_GPIOLIB
239struct snd_soc_jack_gpio; 243struct snd_soc_jack_gpio;
240#endif 244#endif
@@ -244,23 +248,55 @@ typedef int (*hw_write_t)(void *,const char* ,int);
244extern struct snd_ac97_bus_ops soc_ac97_ops; 248extern struct snd_ac97_bus_ops soc_ac97_ops;
245 249
246enum snd_soc_control_type { 250enum snd_soc_control_type {
247 SND_SOC_CUSTOM, 251 SND_SOC_I2C = 1,
248 SND_SOC_I2C,
249 SND_SOC_SPI, 252 SND_SOC_SPI,
250}; 253};
251 254
252int snd_soc_register_platform(struct snd_soc_platform *platform); 255enum snd_soc_compress_type {
253void snd_soc_unregister_platform(struct snd_soc_platform *platform); 256 SND_SOC_FLAT_COMPRESSION = 1,
254int snd_soc_register_codec(struct snd_soc_codec *codec); 257 SND_SOC_LZO_COMPRESSION,
255void snd_soc_unregister_codec(struct snd_soc_codec *codec); 258 SND_SOC_RBTREE_COMPRESSION
256int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 259};
260
261int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
262 unsigned int freq, int dir);
263int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
264 unsigned int freq_in, unsigned int freq_out);
265
266int snd_soc_register_card(struct snd_soc_card *card);
267int snd_soc_unregister_card(struct snd_soc_card *card);
268int snd_soc_suspend(struct device *dev);
269int snd_soc_resume(struct device *dev);
270int snd_soc_poweroff(struct device *dev);
271int snd_soc_register_platform(struct device *dev,
272 struct snd_soc_platform_driver *platform_drv);
273void snd_soc_unregister_platform(struct device *dev);
274int snd_soc_register_codec(struct device *dev,
275 const struct snd_soc_codec_driver *codec_drv,
276 struct snd_soc_dai_driver *dai_drv, int num_dai);
277void snd_soc_unregister_codec(struct device *dev);
278int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
279 unsigned int reg);
280int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
281 unsigned int reg);
282int snd_soc_codec_writable_register(struct snd_soc_codec *codec,
283 unsigned int reg);
257int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 284int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
258 int addr_bits, int data_bits, 285 int addr_bits, int data_bits,
259 enum snd_soc_control_type control); 286 enum snd_soc_control_type control);
260 287int snd_soc_cache_sync(struct snd_soc_codec *codec);
261/* pcm <-> DAI connect */ 288int snd_soc_cache_init(struct snd_soc_codec *codec);
262void snd_soc_free_pcms(struct snd_soc_device *socdev); 289int snd_soc_cache_exit(struct snd_soc_codec *codec);
263int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); 290int snd_soc_cache_write(struct snd_soc_codec *codec,
291 unsigned int reg, unsigned int value);
292int snd_soc_cache_read(struct snd_soc_codec *codec,
293 unsigned int reg, unsigned int *value);
294int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
295 unsigned int reg);
296int snd_soc_default_readable_register(struct snd_soc_codec *codec,
297 unsigned int reg);
298int snd_soc_default_writable_register(struct snd_soc_codec *codec,
299 unsigned int reg);
264 300
265/* Utility functions to get clock rates from various things */ 301/* Utility functions to get clock rates from various things */
266int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 302int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -273,7 +309,7 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
273 const struct snd_pcm_hardware *hw); 309 const struct snd_pcm_hardware *hw);
274 310
275/* Jack reporting */ 311/* Jack reporting */
276int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type, 312int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type,
277 struct snd_soc_jack *jack); 313 struct snd_soc_jack *jack);
278void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); 314void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
279int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, 315int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
@@ -282,6 +318,9 @@ void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
282 struct notifier_block *nb); 318 struct notifier_block *nb);
283void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, 319void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
284 struct notifier_block *nb); 320 struct notifier_block *nb);
321int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
322 struct snd_soc_jack_zone *zones);
323int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);
285#ifdef CONFIG_GPIOLIB 324#ifdef CONFIG_GPIOLIB
286int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, 325int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
287 struct snd_soc_jack_gpio *gpios); 326 struct snd_soc_jack_gpio *gpios);
@@ -306,7 +345,8 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
306 *Controls 345 *Controls
307 */ 346 */
308struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 347struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
309 void *data, char *long_name); 348 void *data, char *long_name,
349 const char *prefix);
310int snd_soc_add_controls(struct snd_soc_codec *codec, 350int snd_soc_add_controls(struct snd_soc_codec *codec,
311 const struct snd_kcontrol_new *controls, int num_controls); 351 const struct snd_kcontrol_new *controls, int num_controls);
312int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 352int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
@@ -352,6 +392,22 @@ int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol,
352 struct snd_ctl_elem_value *ucontrol); 392 struct snd_ctl_elem_value *ucontrol);
353 393
354/** 394/**
395 * struct snd_soc_reg_access - Describes whether a given register is
396 * readable, writable or volatile.
397 *
398 * @reg: the register number
399 * @read: whether this register is readable
400 * @write: whether this register is writable
401 * @vol: whether this register is volatile
402 */
403struct snd_soc_reg_access {
404 u16 reg;
405 u16 read;
406 u16 write;
407 u16 vol;
408};
409
410/**
355 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection 411 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
356 * 412 *
357 * @pin: name of the pin to update 413 * @pin: name of the pin to update
@@ -366,6 +422,24 @@ struct snd_soc_jack_pin {
366}; 422};
367 423
368/** 424/**
425 * struct snd_soc_jack_zone - Describes voltage zones of jack detection
426 *
427 * @min_mv: start voltage in mv
428 * @max_mv: end voltage in mv
429 * @jack_type: type of jack that is expected for this voltage
430 * @debounce_time: debounce_time for jack, codec driver should wait for this
431 * duration before reading the adc for voltages
432 * @:list: list container
433 */
434struct snd_soc_jack_zone {
435 unsigned int min_mv;
436 unsigned int max_mv;
437 unsigned int jack_type;
438 unsigned int debounce_time;
439 struct list_head list;
440};
441
442/**
369 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection 443 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
370 * 444 *
371 * @gpio: gpio number 445 * @gpio: gpio number
@@ -373,6 +447,10 @@ struct snd_soc_jack_pin {
373 * @report: value to report when jack detected 447 * @report: value to report when jack detected
374 * @invert: report presence in low state 448 * @invert: report presence in low state
375 * @debouce_time: debouce time in ms 449 * @debouce_time: debouce time in ms
450 * @wake: enable as wake source
451 * @jack_status_check: callback function which overrides the detection
452 * to provide more complex checks (eg, reading an
453 * ADC).
376 */ 454 */
377#ifdef CONFIG_GPIOLIB 455#ifdef CONFIG_GPIOLIB
378struct snd_soc_jack_gpio { 456struct snd_soc_jack_gpio {
@@ -381,8 +459,10 @@ struct snd_soc_jack_gpio {
381 int report; 459 int report;
382 int invert; 460 int invert;
383 int debounce_time; 461 int debounce_time;
462 bool wake;
463
384 struct snd_soc_jack *jack; 464 struct snd_soc_jack *jack;
385 struct work_struct work; 465 struct delayed_work work;
386 466
387 int (*jack_status_check)(void); 467 int (*jack_status_check)(void);
388}; 468};
@@ -390,23 +470,22 @@ struct snd_soc_jack_gpio {
390 470
391struct snd_soc_jack { 471struct snd_soc_jack {
392 struct snd_jack *jack; 472 struct snd_jack *jack;
393 struct snd_soc_card *card; 473 struct snd_soc_codec *codec;
394 struct list_head pins; 474 struct list_head pins;
395 int status; 475 int status;
396 struct blocking_notifier_head notifier; 476 struct blocking_notifier_head notifier;
477 struct list_head jack_zones;
397}; 478};
398 479
399/* SoC PCM stream information */ 480/* SoC PCM stream information */
400struct snd_soc_pcm_stream { 481struct snd_soc_pcm_stream {
401 char *stream_name; 482 const char *stream_name;
402 u64 formats; /* SNDRV_PCM_FMTBIT_* */ 483 u64 formats; /* SNDRV_PCM_FMTBIT_* */
403 unsigned int rates; /* SNDRV_PCM_RATE_* */ 484 unsigned int rates; /* SNDRV_PCM_RATE_* */
404 unsigned int rate_min; /* min rate */ 485 unsigned int rate_min; /* min rate */
405 unsigned int rate_max; /* max rate */ 486 unsigned int rate_max; /* max rate */
406 unsigned int channels_min; /* min channels */ 487 unsigned int channels_min; /* min channels */
407 unsigned int channels_max; /* max channels */ 488 unsigned int channels_max; /* max channels */
408 unsigned int active; /* stream is in use */
409 void *dma_data; /* used by platform code */
410}; 489};
411 490
412/* SoC audio ops */ 491/* SoC audio ops */
@@ -419,82 +498,129 @@ struct snd_soc_ops {
419 int (*trigger)(struct snd_pcm_substream *, int); 498 int (*trigger)(struct snd_pcm_substream *, int);
420}; 499};
421 500
422/* SoC Audio Codec */ 501/* SoC cache ops */
502struct snd_soc_cache_ops {
503 const char *name;
504 enum snd_soc_compress_type id;
505 int (*init)(struct snd_soc_codec *codec);
506 int (*exit)(struct snd_soc_codec *codec);
507 int (*read)(struct snd_soc_codec *codec, unsigned int reg,
508 unsigned int *value);
509 int (*write)(struct snd_soc_codec *codec, unsigned int reg,
510 unsigned int value);
511 int (*sync)(struct snd_soc_codec *codec);
512};
513
514/* SoC Audio Codec device */
423struct snd_soc_codec { 515struct snd_soc_codec {
424 char *name; 516 const char *name;
425 struct module *owner; 517 const char *name_prefix;
426 struct mutex mutex; 518 int id;
427 struct device *dev; 519 struct device *dev;
428 struct snd_soc_device *socdev; 520 const struct snd_soc_codec_driver *driver;
429 521
522 struct mutex mutex;
523 struct snd_soc_card *card;
430 struct list_head list; 524 struct list_head list;
431 525 struct list_head card_list;
432 /* callbacks */ 526 int num_dai;
433 int (*set_bias_level)(struct snd_soc_codec *, 527 enum snd_soc_compress_type compress_type;
434 enum snd_soc_bias_level level); 528 size_t reg_size; /* reg_cache_size * reg_word_size */
529 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
530 int (*readable_register)(struct snd_soc_codec *, unsigned int);
531 int (*writable_register)(struct snd_soc_codec *, unsigned int);
435 532
436 /* runtime */ 533 /* runtime */
437 struct snd_card *card;
438 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 534 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
439 unsigned int active; 535 unsigned int active;
440 unsigned int pcm_devs; 536 unsigned int cache_bypass:1; /* Suppress access to the cache */
441 void *drvdata; 537 unsigned int suspended:1; /* Codec is in suspend PM state */
538 unsigned int probed:1; /* Codec has been probed */
539 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
540 unsigned int ac97_created:1; /* Codec has been created by SoC */
541 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
542 unsigned int cache_init:1; /* codec cache has been initialized */
543 u32 cache_only; /* Suppress writes to hardware */
544 u32 cache_sync; /* Cache needs to be synced to hardware */
442 545
443 /* codec IO */ 546 /* codec IO */
444 void *control_data; /* codec control (i2c/3wire) data */ 547 void *control_data; /* codec control (i2c/3wire) data */
445 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 548 enum snd_soc_control_type control_type;
446 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
447 int (*display_register)(struct snd_soc_codec *, char *,
448 size_t, unsigned int);
449 int (*volatile_register)(unsigned int);
450 int (*readable_register)(unsigned int);
451 hw_write_t hw_write; 549 hw_write_t hw_write;
452 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 550 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
551 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
552 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
553 int (*bulk_write_raw)(struct snd_soc_codec *, unsigned int, const void *, size_t);
453 void *reg_cache; 554 void *reg_cache;
454 short reg_cache_size; 555 const void *reg_def_copy;
455 short reg_cache_step; 556 const struct snd_soc_cache_ops *cache_ops;
456 557 struct mutex cache_rw_mutex;
457 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
458 unsigned int cache_only:1; /* Suppress writes to hardware */
459 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
460 558
461 /* dapm */ 559 /* dapm */
462 u32 pop_time; 560 struct snd_soc_dapm_context dapm;
463 struct list_head dapm_widgets;
464 struct list_head dapm_paths;
465 enum snd_soc_bias_level bias_level;
466 enum snd_soc_bias_level suspend_bias_level;
467 struct delayed_work delayed_work;
468
469 /* codec DAI's */
470 struct snd_soc_dai *dai;
471 unsigned int num_dai;
472 561
473#ifdef CONFIG_DEBUG_FS 562#ifdef CONFIG_DEBUG_FS
474 struct dentry *debugfs_codec_root; 563 struct dentry *debugfs_codec_root;
475 struct dentry *debugfs_reg; 564 struct dentry *debugfs_reg;
476 struct dentry *debugfs_pop_time;
477 struct dentry *debugfs_dapm; 565 struct dentry *debugfs_dapm;
478#endif 566#endif
479}; 567};
480 568
481/* codec device */ 569/* codec driver */
482struct snd_soc_codec_device { 570struct snd_soc_codec_driver {
483 int (*probe)(struct platform_device *pdev); 571
484 int (*remove)(struct platform_device *pdev); 572 /* driver ops */
485 int (*suspend)(struct platform_device *pdev, pm_message_t state); 573 int (*probe)(struct snd_soc_codec *);
486 int (*resume)(struct platform_device *pdev); 574 int (*remove)(struct snd_soc_codec *);
575 int (*suspend)(struct snd_soc_codec *,
576 pm_message_t state);
577 int (*resume)(struct snd_soc_codec *);
578
579 /* Default control and setup, added after probe() is run */
580 const struct snd_kcontrol_new *controls;
581 int num_controls;
582 const struct snd_soc_dapm_widget *dapm_widgets;
583 int num_dapm_widgets;
584 const struct snd_soc_dapm_route *dapm_routes;
585 int num_dapm_routes;
586
587 /* codec wide operations */
588 int (*set_sysclk)(struct snd_soc_codec *codec,
589 int clk_id, unsigned int freq, int dir);
590 int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source,
591 unsigned int freq_in, unsigned int freq_out);
592
593 /* codec IO */
594 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
595 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
596 int (*display_register)(struct snd_soc_codec *, char *,
597 size_t, unsigned int);
598 int (*volatile_register)(struct snd_soc_codec *, unsigned int);
599 int (*readable_register)(struct snd_soc_codec *, unsigned int);
600 int (*writable_register)(struct snd_soc_codec *, unsigned int);
601 short reg_cache_size;
602 short reg_cache_step;
603 short reg_word_size;
604 const void *reg_cache_default;
605 short reg_access_size;
606 const struct snd_soc_reg_access *reg_access_default;
607 enum snd_soc_compress_type compress_type;
608
609 /* codec bias level */
610 int (*set_bias_level)(struct snd_soc_codec *,
611 enum snd_soc_bias_level level);
612
613 void (*seq_notifier)(struct snd_soc_dapm_context *,
614 enum snd_soc_dapm_type, int);
487}; 615};
488 616
489/* SoC platform interface */ 617/* SoC platform interface */
490struct snd_soc_platform { 618struct snd_soc_platform_driver {
491 char *name;
492 struct list_head list;
493 619
494 int (*probe)(struct platform_device *pdev); 620 int (*probe)(struct snd_soc_platform *);
495 int (*remove)(struct platform_device *pdev); 621 int (*remove)(struct snd_soc_platform *);
496 int (*suspend)(struct snd_soc_dai_link *dai_link); 622 int (*suspend)(struct snd_soc_dai *dai);
497 int (*resume)(struct snd_soc_dai_link *dai_link); 623 int (*resume)(struct snd_soc_dai *dai);
498 624
499 /* pcm creation and destruction */ 625 /* pcm creation and destruction */
500 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, 626 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
@@ -509,23 +635,31 @@ struct snd_soc_platform {
509 struct snd_soc_dai *); 635 struct snd_soc_dai *);
510 636
511 /* platform stream ops */ 637 /* platform stream ops */
512 struct snd_pcm_ops *pcm_ops; 638 struct snd_pcm_ops *ops;
513}; 639};
514 640
515/* SoC machine DAI configuration, glues a codec and cpu DAI together */ 641struct snd_soc_platform {
516struct snd_soc_dai_link { 642 const char *name;
517 char *name; /* Codec name */ 643 int id;
518 char *stream_name; /* Stream name */ 644 struct device *dev;
645 struct snd_soc_platform_driver *driver;
519 646
520 /* DAI */ 647 unsigned int suspended:1; /* platform is suspended */
521 struct snd_soc_dai *codec_dai; 648 unsigned int probed:1;
522 struct snd_soc_dai *cpu_dai;
523 649
524 /* machine stream operations */ 650 struct snd_soc_card *card;
525 struct snd_soc_ops *ops; 651 struct list_head list;
652 struct list_head card_list;
653};
526 654
527 /* codec/machine specific init - e.g. add machine controls */ 655struct snd_soc_dai_link {
528 int (*init)(struct snd_soc_codec *codec); 656 /* config - must be set by machine driver */
657 const char *name; /* Codec name */
658 const char *stream_name; /* Stream name */
659 const char *codec_name; /* for multi-codec */
660 const char *platform_name; /* for multi-platform */
661 const char *cpu_dai_name;
662 const char *codec_dai_name;
529 663
530 /* Keep DAI active over suspend */ 664 /* Keep DAI active over suspend */
531 unsigned int ignore_suspend:1; 665 unsigned int ignore_suspend:1;
@@ -533,63 +667,144 @@ struct snd_soc_dai_link {
533 /* Symmetry requirements */ 667 /* Symmetry requirements */
534 unsigned int symmetric_rates:1; 668 unsigned int symmetric_rates:1;
535 669
536 /* Symmetry data - only valid if symmetry is being enforced */ 670 /* codec/machine specific init - e.g. add machine controls */
537 unsigned int rate; 671 int (*init)(struct snd_soc_pcm_runtime *rtd);
538 672
539 /* DAI pcm */ 673 /* machine stream operations */
540 struct snd_pcm *pcm; 674 struct snd_soc_ops *ops;
675};
676
677struct snd_soc_codec_conf {
678 const char *dev_name;
679
680 /*
681 * optional map of kcontrol, widget and path name prefixes that are
682 * associated per device
683 */
684 const char *name_prefix;
685
686 /*
687 * set this to the desired compression type if you want to
688 * override the one supplied in codec->driver->compress_type
689 */
690 enum snd_soc_compress_type compress_type;
691};
692
693struct snd_soc_aux_dev {
694 const char *name; /* Codec name */
695 const char *codec_name; /* for multi-codec */
696
697 /* codec/machine specific init - e.g. add machine controls */
698 int (*init)(struct snd_soc_dapm_context *dapm);
541}; 699};
542 700
543/* SoC card */ 701/* SoC card */
544struct snd_soc_card { 702struct snd_soc_card {
545 char *name; 703 const char *name;
704 const char *long_name;
705 const char *driver_name;
546 struct device *dev; 706 struct device *dev;
707 struct snd_card *snd_card;
708 struct module *owner;
547 709
548 struct list_head list; 710 struct list_head list;
711 struct mutex mutex;
549 712
550 int instantiated; 713 bool instantiated;
551 714
552 int (*probe)(struct platform_device *pdev); 715 int (*probe)(struct snd_soc_card *card);
553 int (*remove)(struct platform_device *pdev); 716 int (*late_probe)(struct snd_soc_card *card);
717 int (*remove)(struct snd_soc_card *card);
554 718
555 /* the pre and post PM functions are used to do any PM work before and 719 /* the pre and post PM functions are used to do any PM work before and
556 * after the codec and DAI's do any PM work. */ 720 * after the codec and DAI's do any PM work. */
557 int (*suspend_pre)(struct platform_device *pdev, pm_message_t state); 721 int (*suspend_pre)(struct snd_soc_card *card);
558 int (*suspend_post)(struct platform_device *pdev, pm_message_t state); 722 int (*suspend_post)(struct snd_soc_card *card);
559 int (*resume_pre)(struct platform_device *pdev); 723 int (*resume_pre)(struct snd_soc_card *card);
560 int (*resume_post)(struct platform_device *pdev); 724 int (*resume_post)(struct snd_soc_card *card);
561 725
562 /* callbacks */ 726 /* callbacks */
563 int (*set_bias_level)(struct snd_soc_card *, 727 int (*set_bias_level)(struct snd_soc_card *,
564 enum snd_soc_bias_level level); 728 enum snd_soc_bias_level level);
729 int (*set_bias_level_post)(struct snd_soc_card *,
730 enum snd_soc_bias_level level);
565 731
566 long pmdown_time; 732 long pmdown_time;
567 733
568 /* CPU <--> Codec DAI links */ 734 /* CPU <--> Codec DAI links */
569 struct snd_soc_dai_link *dai_link; 735 struct snd_soc_dai_link *dai_link;
570 int num_links; 736 int num_links;
737 struct snd_soc_pcm_runtime *rtd;
738 int num_rtd;
571 739
572 struct snd_soc_device *socdev; 740 /* optional codec specific configuration */
741 struct snd_soc_codec_conf *codec_conf;
742 int num_configs;
573 743
574 struct snd_soc_codec *codec; 744 /*
745 * optional auxiliary devices such as amplifiers or codecs with DAI
746 * link unused
747 */
748 struct snd_soc_aux_dev *aux_dev;
749 int num_aux_devs;
750 struct snd_soc_pcm_runtime *rtd_aux;
751 int num_aux_rtd;
752
753 const struct snd_kcontrol_new *controls;
754 int num_controls;
755
756 /*
757 * Card-specific routes and widgets.
758 */
759 const struct snd_soc_dapm_widget *dapm_widgets;
760 int num_dapm_widgets;
761 const struct snd_soc_dapm_route *dapm_routes;
762 int num_dapm_routes;
575 763
576 struct snd_soc_platform *platform;
577 struct delayed_work delayed_work;
578 struct work_struct deferred_resume_work; 764 struct work_struct deferred_resume_work;
765
766 /* lists of probed devices belonging to this card */
767 struct list_head codec_dev_list;
768 struct list_head platform_dev_list;
769 struct list_head dai_dev_list;
770
771 struct list_head widgets;
772 struct list_head paths;
773 struct list_head dapm_list;
774
775 /* Generic DAPM context for the card */
776 struct snd_soc_dapm_context dapm;
777
778#ifdef CONFIG_DEBUG_FS
779 struct dentry *debugfs_card_root;
780 struct dentry *debugfs_pop_time;
781#endif
782 u32 pop_time;
783
784 void *drvdata;
579}; 785};
580 786
581/* SoC Device - the audio subsystem */ 787/* SoC machine DAI configuration, glues a codec and cpu DAI together */
582struct snd_soc_device { 788struct snd_soc_pcm_runtime {
583 struct device *dev; 789 struct device dev;
584 struct snd_soc_card *card; 790 struct snd_soc_card *card;
585 struct snd_soc_codec_device *codec_dev; 791 struct snd_soc_dai_link *dai_link;
586 void *codec_data; 792
587}; 793 unsigned int complete:1;
794 unsigned int dev_registered:1;
795
796 /* Symmetry data - only valid if symmetry is being enforced */
797 unsigned int rate;
798 long pmdown_time;
588 799
589/* runtime channel data */ 800 /* runtime devices */
590struct snd_soc_pcm_runtime { 801 struct snd_pcm *pcm;
591 struct snd_soc_dai_link *dai; 802 struct snd_soc_codec *codec;
592 struct snd_soc_device *socdev; 803 struct snd_soc_platform *platform;
804 struct snd_soc_dai *codec_dai;
805 struct snd_soc_dai *cpu_dai;
806
807 struct delayed_work delayed_work;
593}; 808};
594 809
595/* mixer control */ 810/* mixer control */
@@ -606,35 +821,83 @@ struct soc_enum {
606 unsigned char shift_r; 821 unsigned char shift_r;
607 unsigned int max; 822 unsigned int max;
608 unsigned int mask; 823 unsigned int mask;
609 const char **texts; 824 const char * const *texts;
610 const unsigned int *values; 825 const unsigned int *values;
611 void *dapm; 826 void *dapm;
612}; 827};
613 828
614/* codec IO */ 829/* codec IO */
615static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, 830unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
616 unsigned int reg) 831unsigned int snd_soc_write(struct snd_soc_codec *codec,
832 unsigned int reg, unsigned int val);
833unsigned int snd_soc_bulk_write_raw(struct snd_soc_codec *codec,
834 unsigned int reg, const void *data, size_t len);
835
836/* device driver data */
837
838static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
839 void *data)
617{ 840{
618 return codec->read(codec, reg); 841 card->drvdata = data;
619} 842}
620 843
621static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, 844static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card)
622 unsigned int reg, unsigned int val)
623{ 845{
624 return codec->write(codec, reg, val); 846 return card->drvdata;
625} 847}
626 848
627static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, 849static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
628 void *data) 850 void *data)
629{ 851{
630 codec->drvdata = data; 852 dev_set_drvdata(codec->dev, data);
631} 853}
632 854
633static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec) 855static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec)
634{ 856{
635 return codec->drvdata; 857 return dev_get_drvdata(codec->dev);
636} 858}
637 859
860static inline void snd_soc_platform_set_drvdata(struct snd_soc_platform *platform,
861 void *data)
862{
863 dev_set_drvdata(platform->dev, data);
864}
865
866static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platform)
867{
868 return dev_get_drvdata(platform->dev);
869}
870
871static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd,
872 void *data)
873{
874 dev_set_drvdata(&rtd->dev, data);
875}
876
877static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
878{
879 return dev_get_drvdata(&rtd->dev);
880}
881
882static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
883{
884 INIT_LIST_HEAD(&card->dai_dev_list);
885 INIT_LIST_HEAD(&card->codec_dev_list);
886 INIT_LIST_HEAD(&card->platform_dev_list);
887 INIT_LIST_HEAD(&card->widgets);
888 INIT_LIST_HEAD(&card->paths);
889 INIT_LIST_HEAD(&card->dapm_list);
890}
891
892int snd_soc_util_init(void);
893void snd_soc_util_exit(void);
894
638#include <sound/soc-dai.h> 895#include <sound/soc-dai.h>
639 896
897#ifdef CONFIG_DEBUG_FS
898extern struct dentry *snd_soc_debugfs_root;
899#endif
900
901extern const struct dev_pm_ops snd_soc_pm_ops;
902
640#endif 903#endif
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index 5718a02d3afb..d2ea112fc20f 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -26,29 +26,37 @@
26#include <media/v4l2-dev.h> 26#include <media/v4l2-dev.h>
27#include <media/v4l2-ioctl.h> 27#include <media/v4l2-ioctl.h>
28 28
29#define TEA575X_FMIF 10700
30
31#define TEA575X_DATA (1 << 0)
32#define TEA575X_CLK (1 << 1)
33#define TEA575X_WREN (1 << 2)
34#define TEA575X_MOST (1 << 3)
35
29struct snd_tea575x; 36struct snd_tea575x;
30 37
31struct snd_tea575x_ops { 38struct snd_tea575x_ops {
32 void (*write)(struct snd_tea575x *tea, unsigned int val); 39 void (*set_pins)(struct snd_tea575x *tea, u8 pins);
33 unsigned int (*read)(struct snd_tea575x *tea); 40 u8 (*get_pins)(struct snd_tea575x *tea);
34 void (*mute)(struct snd_tea575x *tea, unsigned int mute); 41 void (*set_direction)(struct snd_tea575x *tea, bool output);
35}; 42};
36 43
37struct snd_tea575x { 44struct snd_tea575x {
38 struct snd_card *card;
39 struct video_device *vd; /* video device */ 45 struct video_device *vd; /* video device */
40 int dev_nr; /* requested device number + 1 */ 46 bool tea5759; /* 5759 chip is present */
41 int tea5759; /* 5759 chip is present */ 47 bool mute; /* Device is muted? */
42 int mute; /* Device is muted? */ 48 bool stereo; /* receiving stereo */
43 unsigned int freq_fixup; /* crystal onboard */ 49 bool tuned; /* tuned to a station */
44 unsigned int val; /* hw value */ 50 unsigned int val; /* hw value */
45 unsigned long freq; /* frequency */ 51 unsigned long freq; /* frequency */
46 unsigned long in_use; /* set if the device is in use */ 52 unsigned long in_use; /* set if the device is in use */
47 struct snd_tea575x_ops *ops; 53 struct snd_tea575x_ops *ops;
48 void *private_data; 54 void *private_data;
55 u8 card[32];
56 u8 bus_info[32];
49}; 57};
50 58
51void snd_tea575x_init(struct snd_tea575x *tea); 59int snd_tea575x_init(struct snd_tea575x *tea);
52void snd_tea575x_exit(struct snd_tea575x *tea); 60void snd_tea575x_exit(struct snd_tea575x *tea);
53 61
54#endif /* __SOUND_TEA575X_TUNER_H */ 62#endif /* __SOUND_TEA575X_TUNER_H */
diff --git a/include/sound/tlv.h b/include/sound/tlv.h
index 9fd5b19ccf5c..7067e2dfb0b9 100644
--- a/include/sound/tlv.h
+++ b/include/sound/tlv.h
@@ -38,9 +38,11 @@
38#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ 38#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */
39#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ 39#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */
40 40
41#define TLV_DB_SCALE_MASK 0xffff
42#define TLV_DB_SCALE_MUTE 0x10000
41#define TLV_DB_SCALE_ITEM(min, step, mute) \ 43#define TLV_DB_SCALE_ITEM(min, step, mute) \
42 SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ 44 SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \
43 (min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0) 45 (min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0)
44#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ 46#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
45 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } 47 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) }
46 48
diff --git a/include/sound/tlv320aic32x4.h b/include/sound/tlv320aic32x4.h
new file mode 100644
index 000000000000..c009f70b4029
--- /dev/null
+++ b/include/sound/tlv320aic32x4.h
@@ -0,0 +1,31 @@
1/*
2 * tlv320aic32x4.h -- TLV320AIC32X4 Soc Audio driver platform data
3 *
4 * Copyright 2011 Vista Silicon S.L.
5 *
6 * Author: Javier Martin <javier.martin@vista-silicon.com>
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 _AIC32X4_PDATA_H
14#define _AIC32X4_PDATA_H
15
16#define AIC32X4_PWR_MICBIAS_2075_LDOIN 0x00000001
17#define AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE 0x00000002
18#define AIC32X4_PWR_AIC32X4_LDO_ENABLE 0x00000004
19#define AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36 0x00000008
20#define AIC32X4_PWR_CMMODE_HP_LDOIN_POWERED 0x00000010
21
22#define AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K 0x00000001
23#define AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K 0x00000002
24
25struct aic32x4_pdata {
26 u32 power_cfg;
27 u32 micpga_routing;
28 bool swapdacs;
29};
30
31#endif
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h
index b1a5f34e5cfa..99e0308bf2c2 100644
--- a/include/sound/tlv320aic3x.h
+++ b/include/sound/tlv320aic3x.h
@@ -10,8 +10,49 @@
10#ifndef __TLV320AIC3x_H__ 10#ifndef __TLV320AIC3x_H__
11#define __TLV320AIC3x_H__ 11#define __TLV320AIC3x_H__
12 12
13/* GPIO API */
14enum {
15 AIC3X_GPIO1_FUNC_DISABLED = 0,
16 AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC = 1,
17 AIC3X_GPIO1_FUNC_CLOCK_MUX = 2,
18 AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2 = 3,
19 AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4 = 4,
20 AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8 = 5,
21 AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ = 6,
22 AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ = 7,
23 AIC3X_GPIO1_FUNC_INPUT = 8,
24 AIC3X_GPIO1_FUNC_OUTPUT = 9,
25 AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10,
26 AIC3X_GPIO1_FUNC_AUDIO_WORDCLK = 11,
27 AIC3X_GPIO1_FUNC_BUTTON_IRQ = 12,
28 AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13,
29 AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 14,
30 AIC3X_GPIO1_FUNC_ALL_IRQ = 16
31};
32
33enum {
34 AIC3X_GPIO2_FUNC_DISABLED = 0,
35 AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2,
36 AIC3X_GPIO2_FUNC_INPUT = 3,
37 AIC3X_GPIO2_FUNC_OUTPUT = 4,
38 AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT = 5,
39 AIC3X_GPIO2_FUNC_AUDIO_BITCLK = 8,
40 AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9,
41 AIC3X_GPIO2_FUNC_ALL_IRQ = 10,
42 AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11,
43 AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12,
44 AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ = 13,
45 AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ = 14,
46 AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15
47};
48
49struct aic3x_setup_data {
50 unsigned int gpio_func[2];
51};
52
13struct aic3x_pdata { 53struct aic3x_pdata {
14 int gpio_reset; /* < 0 if not used */ 54 int gpio_reset; /* < 0 if not used */
55 struct aic3x_setup_data *setup;
15}; 56};
16 57
17#endif \ No newline at end of file 58#endif
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h
index 6c6649656798..0b94192a8cdf 100644
--- a/include/sound/tlv320dac33-plat.h
+++ b/include/sound/tlv320dac33-plat.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Platform header for Texas Instruments TLV320DAC33 codec driver 2 * Platform header for Texas Instruments TLV320DAC33 codec driver
3 * 3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> 4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 * 5 *
6 * Copyright: (C) 2009 Nokia Corporation 6 * Copyright: (C) 2009 Nokia Corporation
7 * 7 *
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h
index e29fde6b5cbe..89beccb57edd 100644
--- a/include/sound/tpa6130a2-plat.h
+++ b/include/sound/tpa6130a2-plat.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) Nokia Corporation 4 * Copyright (C) Nokia Corporation
5 * 5 *
6 * Written by Peter Ujfalusi <peter.ujfalusi@nokia.com> 6 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
diff --git a/include/sound/version.h b/include/sound/version.h
index bf69a5b7e65f..8fc5321e1ecc 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.23" 2#define CONFIG_SND_VERSION "1.0.24"
3#define CONFIG_SND_DATE "" 3#define CONFIG_SND_DATE ""
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h
index b4a0db2307ef..cf7ccb76a8de 100644
--- a/include/sound/wm8903.h
+++ b/include/sound/wm8903.h
@@ -17,13 +17,9 @@
17/* 17/*
18 * R6 (0x06) - Mic Bias Control 0 18 * R6 (0x06) - Mic Bias Control 0
19 */ 19 */
20#define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ 20#define WM8903_MICDET_THR_MASK 0x0030 /* MICDET_THR - [5:4] */
21#define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ 21#define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [5:4] */
22#define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ 22#define WM8903_MICDET_THR_WIDTH 2 /* MICDET_THR - [5:4] */
23#define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */
24#define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */
25#define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */
26#define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */
27#define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ 23#define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */
28#define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ 24#define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */
29#define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ 25#define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */
@@ -37,6 +33,21 @@
37#define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ 33#define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */
38 34
39/* 35/*
36 * WM8903_GPn_FN values
37 *
38 * See datasheets for list of valid values per pin
39 */
40#define WM8903_GPn_FN_GPIO_OUTPUT 0
41#define WM8903_GPn_FN_BCLK 1
42#define WM8903_GPn_FN_IRQ_OUTPT 2
43#define WM8903_GPn_FN_GPIO_INPUT 3
44#define WM8903_GPn_FN_MICBIAS_CURRENT_DETECT 4
45#define WM8903_GPn_FN_MICBIAS_SHORT_DETECT 5
46#define WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT 6
47#define WM8903_GPn_FN_FLL_LOCK_OUTPUT 8
48#define WM8903_GPn_FN_FLL_CLOCK_OUTPUT 9
49
50/*
40 * R116 (0x74) - GPIO Control 1 51 * R116 (0x74) - GPIO Control 1
41 */ 52 */
42#define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */ 53#define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */
@@ -231,6 +242,8 @@
231#define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */ 242#define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */
232#define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ 243#define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */
233 244
245#define WM8903_NUM_GPIO 5
246
234struct wm8903_platform_data { 247struct wm8903_platform_data {
235 bool irq_active_low; /* Set if IRQ active low, default high */ 248 bool irq_active_low; /* Set if IRQ active low, default high */
236 249
@@ -243,7 +256,8 @@ struct wm8903_platform_data {
243 256
244 int micdet_delay; /* Delay after microphone detection (ms) */ 257 int micdet_delay; /* Delay after microphone detection (ms) */
245 258
246 u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */ 259 int gpio_base;
260 u32 gpio_cfg[WM8903_NUM_GPIO]; /* Default register values for GPIO pin mux */
247}; 261};
248 262
249#endif 263#endif
diff --git a/include/sound/wm8915.h b/include/sound/wm8915.h
new file mode 100644
index 000000000000..5817d762f6f3
--- /dev/null
+++ b/include/sound/wm8915.h
@@ -0,0 +1,55 @@
1/*
2 * linux/sound/wm8915.h -- Platform data for WM8915
3 *
4 * Copyright 2011 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
11#ifndef __LINUX_SND_WM8903_H
12#define __LINUX_SND_WM8903_H
13
14enum wm8915_inmode {
15 WM8915_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */
16 WM8915_INVERTING = 1, /* IN1xN */
17 WM8915_NON_INVERTING = 2, /* IN1xP */
18 WM8915_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */
19};
20
21/**
22 * ReTune Mobile configurations are specified with a label, sample
23 * rate and set of values to write (the enable bits will be ignored).
24 *
25 * Configurations are expected to be generated using the ReTune Mobile
26 * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
27 */
28struct wm8915_retune_mobile_config {
29 const char *name;
30 int rate;
31 u16 regs[20];
32};
33
34#define WM8915_SET_DEFAULT 0x10000
35
36struct wm8915_pdata {
37 int irq_flags; /** Set IRQ trigger flags; default active low */
38
39 int ldo_ena; /** GPIO for LDO1; -1 for none */
40
41 int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */
42
43 enum wm8915_inmode inl_mode;
44 enum wm8915_inmode inr_mode;
45
46 u32 spkmute_seq; /** Value for register 0x802 */
47
48 int gpio_base;
49 u32 gpio_default[5];
50
51 int num_retune_mobile_cfgs;
52 struct wm8915_retune_mobile_config *retune_mobile_cfgs;
53};
54
55#endif
diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h
new file mode 100644
index 000000000000..1750bed7c2f6
--- /dev/null
+++ b/include/sound/wm8962.h
@@ -0,0 +1,54 @@
1/*
2 * wm8962.h -- WM8962 Soc Audio driver platform data
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _WM8962_PDATA_H
10#define _WM8962_PDATA_H
11
12#define WM8962_MAX_GPIO 6
13
14/* Use to set GPIO default values to zero */
15#define WM8962_GPIO_SET 0x10000
16
17#define WM8962_GPIO_FN_CLKOUT 0
18#define WM8962_GPIO_FN_LOGIC 1
19#define WM8962_GPIO_FN_SDOUT 2
20#define WM8962_GPIO_FN_IRQ 3
21#define WM8962_GPIO_FN_THERMAL 4
22#define WM8962_GPIO_FN_PLL2_LOCK 6
23#define WM8962_GPIO_FN_PLL3_LOCK 7
24#define WM8962_GPIO_FN_FLL_LOCK 9
25#define WM8962_GPIO_FN_DRC_ACT 10
26#define WM8962_GPIO_FN_WSEQ_DONE 11
27#define WM8962_GPIO_FN_ALC_NG_ACT 12
28#define WM8962_GPIO_FN_ALC_PEAK_LIMIT 13
29#define WM8962_GPIO_FN_ALC_SATURATION 14
30#define WM8962_GPIO_FN_ALC_LEVEL_THR 15
31#define WM8962_GPIO_FN_ALC_LEVEL_LOCK 16
32#define WM8962_GPIO_FN_FIFO_ERR 17
33#define WM8962_GPIO_FN_OPCLK 18
34#define WM8962_GPIO_FN_DMICCLK 19
35#define WM8962_GPIO_FN_DMICDAT 20
36#define WM8962_GPIO_FN_MICD 21
37#define WM8962_GPIO_FN_MICSCD 22
38
39struct wm8962_pdata {
40 int gpio_base;
41 u32 gpio_init[WM8962_MAX_GPIO];
42
43 /* Setup for microphone detection, raw value to be written to
44 * R48(0x30) - only microphone related bits will be updated.
45 * Detection may be enabled here for use with signals brought
46 * out on the GPIOs. */
47 u32 mic_cfg;
48
49 bool irq_active_low;
50
51 bool spk_mono; /* Speaker outputs tied together as mono */
52};
53
54#endif
diff --git a/include/sound/wm9081.h b/include/sound/wm9081.h
index e173ddbf6bd4..f34b0b1716d8 100644
--- a/include/sound/wm9081.h
+++ b/include/sound/wm9081.h
@@ -17,9 +17,12 @@ struct wm9081_retune_mobile_setting {
17 u16 config[20]; 17 u16 config[20];
18}; 18};
19 19
20struct wm9081_retune_mobile_config { 20struct wm9081_pdata {
21 struct wm9081_retune_mobile_setting *configs; 21 bool irq_high; /* IRQ is active high */
22 int num_configs; 22 bool irq_cmos; /* IRQ is in CMOS mode */
23
24 struct wm9081_retune_mobile_setting *retune_configs;
25 int num_retune_configs;
23}; 26};
24 27
25#endif 28#endif