aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/i2c/twl.h6
-rw-r--r--include/linux/mfd/davinci_voicecodec.h126
-rw-r--r--include/linux/mfd/wm8350/audio.h2
-rw-r--r--include/linux/mfd/wm8994/core.h53
-rw-r--r--include/linux/mfd/wm8994/pdata.h1
-rw-r--r--include/linux/usb/audio-v2.h378
-rw-r--r--include/linux/usb/audio.h227
-rw-r--r--include/sound/asound.h20
-rw-r--r--include/sound/es1688.h11
-rw-r--r--include/sound/info.h24
-rw-r--r--include/sound/jack.h8
-rw-r--r--include/sound/soc-dai.h7
-rw-r--r--include/sound/soc-dapm.h8
-rw-r--r--include/sound/soc.h61
-rw-r--r--include/sound/tlv320aic3x.h17
-rw-r--r--include/sound/tlv320dac33-plat.h1
-rw-r--r--include/sound/uda134x.h1
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/wm8903.h249
-rw-r--r--include/sound/wm8904.h110
-rw-r--r--include/sound/wm8960.h24
-rw-r--r--include/sound/wm9090.h28
22 files changed, 1257 insertions, 107 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index a63b77d89d30..6de90bfc6acd 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -569,9 +569,9 @@ struct twl4030_codec_data {
569 struct twl4030_codec_audio_data *audio; 569 struct twl4030_codec_audio_data *audio;
570 struct twl4030_codec_vibra_data *vibra; 570 struct twl4030_codec_vibra_data *vibra;
571 571
572 /* twl6030 */ 572 /* twl6040 */
573 int audpwron_gpio; /* audio power-on gpio */ 573 int audpwron_gpio; /* audio power-on gpio */
574 int naudint_irq; /* audio interrupt */ 574 int naudint_irq; /* audio interrupt */
575}; 575};
576 576
577struct twl4030_platform_data { 577struct twl4030_platform_data {
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
new file mode 100644
index 000000000000..0ab61320ffa8
--- /dev/null
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -0,0 +1,126 @@
1/*
2 * DaVinci Voice Codec Core Interface for TI platforms
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc
5 *
6 * Author: Miguel Aguilar <miguel.aguilar@ridgerun.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __LINUX_MFD_DAVINCI_VOICECODEC_H_
24#define __LINUX_MFD_DAVINIC_VOICECODEC_H_
25
26#include <linux/kernel.h>
27#include <linux/platform_device.h>
28#include <linux/mfd/core.h>
29
30#include <mach/edma.h>
31
32/*
33 * Register values.
34 */
35#define DAVINCI_VC_PID 0x00
36#define DAVINCI_VC_CTRL 0x04
37#define DAVINCI_VC_INTEN 0x08
38#define DAVINCI_VC_INTSTATUS 0x0c
39#define DAVINCI_VC_INTCLR 0x10
40#define DAVINCI_VC_EMUL_CTRL 0x14
41#define DAVINCI_VC_RFIFO 0x20
42#define DAVINCI_VC_WFIFO 0x24
43#define DAVINCI_VC_FIFOSTAT 0x28
44#define DAVINCI_VC_TST_CTRL 0x2C
45#define DAVINCI_VC_REG05 0x94
46#define DAVINCI_VC_REG09 0xA4
47#define DAVINCI_VC_REG12 0xB0
48
49/* DAVINCI_VC_CTRL bit fields */
50#define DAVINCI_VC_CTRL_MASK 0x5500
51#define DAVINCI_VC_CTRL_RSTADC BIT(0)
52#define DAVINCI_VC_CTRL_RSTDAC BIT(1)
53#define DAVINCI_VC_CTRL_RD_BITS_8 BIT(4)
54#define DAVINCI_VC_CTRL_RD_UNSIGNED BIT(5)
55#define DAVINCI_VC_CTRL_WD_BITS_8 BIT(6)
56#define DAVINCI_VC_CTRL_WD_UNSIGNED BIT(7)
57#define DAVINCI_VC_CTRL_RFIFOEN BIT(8)
58#define DAVINCI_VC_CTRL_RFIFOCL BIT(9)
59#define DAVINCI_VC_CTRL_RFIFOMD_WORD_1 BIT(10)
60#define DAVINCI_VC_CTRL_WFIFOEN BIT(12)
61#define DAVINCI_VC_CTRL_WFIFOCL BIT(13)
62#define DAVINCI_VC_CTRL_WFIFOMD_WORD_1 BIT(14)
63
64/* DAVINCI_VC_INT bit fields */
65#define DAVINCI_VC_INT_MASK 0x3F
66#define DAVINCI_VC_INT_RDRDY_MASK BIT(0)
67#define DAVINCI_VC_INT_RERROVF_MASK BIT(1)
68#define DAVINCI_VC_INT_RERRUDR_MASK BIT(2)
69#define DAVINCI_VC_INT_WDREQ_MASK BIT(3)
70#define DAVINCI_VC_INT_WERROVF_MASKBIT BIT(4)
71#define DAVINCI_VC_INT_WERRUDR_MASK BIT(5)
72
73/* DAVINCI_VC_REG05 bit fields */
74#define DAVINCI_VC_REG05_PGA_GAIN 0x07
75
76/* DAVINCI_VC_REG09 bit fields */
77#define DAVINCI_VC_REG09_MUTE 0x40
78#define DAVINCI_VC_REG09_DIG_ATTEN 0x3F
79
80/* DAVINCI_VC_REG12 bit fields */
81#define DAVINCI_VC_REG12_POWER_ALL_ON 0xFD
82#define DAVINCI_VC_REG12_POWER_ALL_OFF 0x00
83
84#define DAVINCI_VC_CELLS 2
85
86enum davinci_vc_cells {
87 DAVINCI_VC_VCIF_CELL,
88 DAVINCI_VC_CQ93VC_CELL,
89};
90
91struct davinci_vcif {
92 struct platform_device *pdev;
93 u32 dma_tx_channel;
94 u32 dma_rx_channel;
95 dma_addr_t dma_tx_addr;
96 dma_addr_t dma_rx_addr;
97};
98
99struct cq93vc {
100 struct platform_device *pdev;
101 struct snd_soc_codec *codec;
102 u32 sysclk;
103};
104
105struct davinci_vc;
106
107struct davinci_vc {
108 /* Device data */
109 struct device *dev;
110 struct platform_device *pdev;
111 struct clk *clk;
112
113 /* Memory resources */
114 void __iomem *base;
115 resource_size_t pbase;
116 size_t base_size;
117
118 /* MFD cells */
119 struct mfd_cell cells[DAVINCI_VC_CELLS];
120
121 /* Client devices */
122 struct davinci_vcif davinci_vcif;
123 struct cq93vc cq93vc;
124};
125
126#endif
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h
index d899dc0223ba..a95141eafce3 100644
--- a/include/linux/mfd/wm8350/audio.h
+++ b/include/linux/mfd/wm8350/audio.h
@@ -492,6 +492,8 @@
492 */ 492 */
493#define WM8350_JACK_L_LVL 0x0800 493#define WM8350_JACK_L_LVL 0x0800
494#define WM8350_JACK_R_LVL 0x0400 494#define WM8350_JACK_R_LVL 0x0400
495#define WM8350_JACK_MICSCD_LVL 0x0200
496#define WM8350_JACK_MICSD_LVL 0x0100
495 497
496/* 498/*
497 * WM8350 Platform setup 499 * WM8350 Platform setup
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index b06ff2846748..de79baee4925 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -15,14 +15,38 @@
15#ifndef __MFD_WM8994_CORE_H__ 15#ifndef __MFD_WM8994_CORE_H__
16#define __MFD_WM8994_CORE_H__ 16#define __MFD_WM8994_CORE_H__
17 17
18#include <linux/interrupt.h>
19
18struct regulator_dev; 20struct regulator_dev;
19struct regulator_bulk_data; 21struct regulator_bulk_data;
20 22
21#define WM8994_NUM_GPIO_REGS 11 23#define WM8994_NUM_GPIO_REGS 11
22#define WM8994_NUM_LDO_REGS 2 24#define WM8994_NUM_LDO_REGS 2
25#define WM8994_NUM_IRQ_REGS 2
26
27#define WM8994_IRQ_TEMP_SHUT 0
28#define WM8994_IRQ_MIC1_DET 1
29#define WM8994_IRQ_MIC1_SHRT 2
30#define WM8994_IRQ_MIC2_DET 3
31#define WM8994_IRQ_MIC2_SHRT 4
32#define WM8994_IRQ_FLL1_LOCK 5
33#define WM8994_IRQ_FLL2_LOCK 6
34#define WM8994_IRQ_SRC1_LOCK 7
35#define WM8994_IRQ_SRC2_LOCK 8
36#define WM8994_IRQ_AIF1DRC1_SIG_DET 9
37#define WM8994_IRQ_AIF1DRC2_SIG_DET 10
38#define WM8994_IRQ_AIF2DRC_SIG_DET 11
39#define WM8994_IRQ_FIFOS_ERR 12
40#define WM8994_IRQ_WSEQ_DONE 13
41#define WM8994_IRQ_DCS_DONE 14
42#define WM8994_IRQ_TEMP_WARN 15
43
44/* GPIOs in the chip are numbered from 1-11 */
45#define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN)
23 46
24struct wm8994 { 47struct wm8994 {
25 struct mutex io_lock; 48 struct mutex io_lock;
49 struct mutex irq_lock;
26 50
27 struct device *dev; 51 struct device *dev;
28 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, 52 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg,
@@ -33,6 +57,11 @@ struct wm8994 {
33 void *control_data; 57 void *control_data;
34 58
35 int gpio_base; 59 int gpio_base;
60 int irq_base;
61
62 int irq;
63 u16 irq_masks_cur[WM8994_NUM_IRQ_REGS];
64 u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
36 65
37 /* Used over suspend/resume */ 66 /* Used over suspend/resume */
38 u16 ldo_regs[WM8994_NUM_LDO_REGS]; 67 u16 ldo_regs[WM8994_NUM_LDO_REGS];
@@ -51,4 +80,26 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
51int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, 80int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
52 int count, u16 *buf); 81 int count, u16 *buf);
53 82
83
84/* Helper to save on boilerplate */
85static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq,
86 irq_handler_t handler, const char *name,
87 void *data)
88{
89 if (!wm8994->irq_base)
90 return -EINVAL;
91 return request_threaded_irq(wm8994->irq_base + irq, NULL, handler,
92 IRQF_TRIGGER_RISING, name,
93 data);
94}
95static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data)
96{
97 if (!wm8994->irq_base)
98 return;
99 free_irq(wm8994->irq_base + irq, data);
100}
101
102int wm8994_irq_init(struct wm8994 *wm8994);
103void wm8994_irq_exit(struct wm8994 *wm8994);
104
54#endif 105#endif
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 70d6a8687dc5..5c51f367c061 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -70,6 +70,7 @@ struct wm8994_pdata {
70 70
71 struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; 71 struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO];
72 72
73 int irq_base; /** Base IRQ number for WM8994, required for IRQs */
73 74
74 int num_drc_cfgs; 75 int num_drc_cfgs;
75 struct wm8994_drc_cfg *drc_cfgs; 76 struct wm8994_drc_cfg *drc_cfgs;
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h
new file mode 100644
index 000000000000..2389f93a28b5
--- /dev/null
+++ b/include/linux/usb/audio-v2.h
@@ -0,0 +1,378 @@
1/*
2 * Copyright (c) 2010 Daniel Mack <daniel@caiaq.de>
3 *
4 * This software is distributed under the terms of the GNU General Public
5 * License ("GPL") version 2, as published by the Free Software Foundation.
6 *
7 * This file holds USB constants and structures defined
8 * by the USB Device Class Definition for Audio Devices in version 2.0.
9 * Comments below reference relevant sections of the documents contained
10 * in http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip
11 */
12
13#ifndef __LINUX_USB_AUDIO_V2_H
14#define __LINUX_USB_AUDIO_V2_H
15
16#include <linux/types.h>
17
18/* v1.0 and v2.0 of this standard have many things in common. For the rest
19 * of the definitions, please refer to audio.h */
20
21/* 4.7.2.1 Clock Source Descriptor */
22
23struct uac_clock_source_descriptor {
24 __u8 bLength;
25 __u8 bDescriptorType;
26 __u8 bDescriptorSubtype;
27 __u8 bClockID;
28 __u8 bmAttributes;
29 __u8 bmControls;
30 __u8 bAssocTerminal;
31 __u8 iClockSource;
32} __attribute__((packed));
33
34/* 4.7.2.2 Clock Source Descriptor */
35
36struct uac_clock_selector_descriptor {
37 __u8 bLength;
38 __u8 bDescriptorType;
39 __u8 bDescriptorSubtype;
40 __u8 bClockID;
41 __u8 bNrInPins;
42 __u8 bmControls;
43 __u8 baCSourceID[];
44} __attribute__((packed));
45
46/* 4.7.2.4 Input terminal descriptor */
47
48struct uac2_input_terminal_descriptor {
49 __u8 bLength;
50 __u8 bDescriptorType;
51 __u8 bDescriptorSubtype;
52 __u8 bTerminalID;
53 __u16 wTerminalType;
54 __u8 bAssocTerminal;
55 __u8 bCSourceID;
56 __u8 bNrChannels;
57 __u32 bmChannelConfig;
58 __u8 iChannelNames;
59 __u16 bmControls;
60 __u8 iTerminal;
61} __attribute__((packed));
62
63/* 4.7.2.5 Output terminal descriptor */
64
65struct uac2_output_terminal_descriptor {
66 __u8 bLength;
67 __u8 bDescriptorType;
68 __u8 bDescriptorSubtype;
69 __u8 bTerminalID;
70 __u16 wTerminalType;
71 __u8 bAssocTerminal;
72 __u8 bSourceID;
73 __u8 bCSourceID;
74 __u16 bmControls;
75 __u8 iTerminal;
76} __attribute__((packed));
77
78
79
80/* 4.7.2.8 Feature Unit Descriptor */
81
82struct uac2_feature_unit_descriptor {
83 __u8 bLength;
84 __u8 bDescriptorType;
85 __u8 bDescriptorSubtype;
86 __u8 bUnitID;
87 __u8 bSourceID;
88 /* bmaControls is actually u32,
89 * but u8 is needed for the hybrid parser */
90 __u8 bmaControls[0]; /* variable length */
91} __attribute__((packed));
92
93/* 4.9.2 Class-Specific AS Interface Descriptor */
94
95struct uac_as_header_descriptor_v2 {
96 __u8 bLength;
97 __u8 bDescriptorType;
98 __u8 bDescriptorSubtype;
99 __u8 bTerminalLink;
100 __u8 bmControls;
101 __u8 bFormatType;
102 __u32 bmFormats;
103 __u8 bNrChannels;
104 __u32 bmChannelConfig;
105 __u8 iChannelNames;
106} __attribute__((packed));
107
108/* 6.1 Interrupt Data Message */
109
110#define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0)
111#define UAC2_INTERRUPT_DATA_MSG_EP (1 << 1)
112
113struct uac2_interrupt_data_msg {
114 __u8 bInfo;
115 __u8 bAttribute;
116 __le16 wValue;
117 __le16 wIndex;
118} __attribute__((packed));
119
120/* A.7 Audio Function Category Codes */
121#define UAC2_FUNCTION_SUBCLASS_UNDEFINED 0x00
122#define UAC2_FUNCTION_DESKTOP_SPEAKER 0x01
123#define UAC2_FUNCTION_HOME_THEATER 0x02
124#define UAC2_FUNCTION_MICROPHONE 0x03
125#define UAC2_FUNCTION_HEADSET 0x04
126#define UAC2_FUNCTION_TELEPHONE 0x05
127#define UAC2_FUNCTION_CONVERTER 0x06
128#define UAC2_FUNCTION_SOUND_RECORDER 0x07
129#define UAC2_FUNCTION_IO_BOX 0x08
130#define UAC2_FUNCTION_MUSICAL_INSTRUMENT 0x09
131#define UAC2_FUNCTION_PRO_AUDIO 0x0a
132#define UAC2_FUNCTION_AUDIO_VIDEO 0x0b
133#define UAC2_FUNCTION_CONTROL_PANEL 0x0c
134#define UAC2_FUNCTION_OTHER 0xff
135
136/* A.9 Audio Class-Specific AC Interface Descriptor Subtypes */
137/* see audio.h for the rest, which is identical to v1 */
138#define UAC2_EFFECT_UNIT 0x07
139#define UAC2_PROCESSING_UNIT_V2 0x08
140#define UAC2_EXTENSION_UNIT_V2 0x09
141#define UAC2_CLOCK_SOURCE 0x0a
142#define UAC2_CLOCK_SELECTOR 0x0b
143#define UAC2_CLOCK_MULTIPLIER 0x0c
144#define UAC2_SAMPLE_RATE_CONVERTER 0x0d
145
146/* A.10 Audio Class-Specific AS Interface Descriptor Subtypes */
147/* see audio.h for the rest, which is identical to v1 */
148#define UAC2_ENCODER 0x03
149#define UAC2_DECODER 0x04
150
151/* A.11 Effect Unit Effect Types */
152#define UAC2_EFFECT_UNDEFINED 0x00
153#define UAC2_EFFECT_PARAM_EQ 0x01
154#define UAC2_EFFECT_REVERB 0x02
155#define UAC2_EFFECT_MOD_DELAY 0x03
156#define UAC2_EFFECT_DYN_RANGE_COMP 0x04
157
158/* A.12 Processing Unit Process Types */
159#define UAC2_PROCESS_UNDEFINED 0x00
160#define UAC2_PROCESS_UP_DOWNMIX 0x01
161#define UAC2_PROCESS_DOLBY_PROLOCIC 0x02
162#define UAC2_PROCESS_STEREO_EXTENDER 0x03
163
164/* A.14 Audio Class-Specific Request Codes */
165#define UAC2_CS_CUR 0x01
166#define UAC2_CS_RANGE 0x02
167#define UAC2_CS_MEM 0x03
168
169/* A.15 Encoder Type Codes */
170#define UAC2_ENCODER_UNDEFINED 0x00
171#define UAC2_ENCODER_OTHER 0x01
172#define UAC2_ENCODER_MPEG 0x02
173#define UAC2_ENCODER_AC3 0x03
174#define UAC2_ENCODER_WMA 0x04
175#define UAC2_ENCODER_DTS 0x05
176
177/* A.16 Decoder Type Codes */
178#define UAC2_DECODER_UNDEFINED 0x00
179#define UAC2_DECODER_OTHER 0x01
180#define UAC2_DECODER_MPEG 0x02
181#define UAC2_DECODER_AC3 0x03
182#define UAC2_DECODER_WMA 0x04
183#define UAC2_DECODER_DTS 0x05
184
185/* A.17.1 Clock Source Control Selectors */
186#define UAC2_CS_UNDEFINED 0x00
187#define UAC2_CS_CONTROL_SAM_FREQ 0x01
188#define UAC2_CS_CONTROL_CLOCK_VALID 0x02
189
190/* A.17.2 Clock Selector Control Selectors */
191#define UAC2_CX_UNDEFINED 0x00
192#define UAC2_CX_CLOCK_SELECTOR 0x01
193
194/* A.17.3 Clock Multiplier Control Selectors */
195#define UAC2_CM_UNDEFINED 0x00
196#define UAC2_CM_NUMERATOR 0x01
197#define UAC2_CM_DENOMINTATOR 0x02
198
199/* A.17.4 Terminal Control Selectors */
200#define UAC2_TE_UNDEFINED 0x00
201#define UAC2_TE_COPY_PROTECT 0x01
202#define UAC2_TE_CONNECTOR 0x02
203#define UAC2_TE_OVERLOAD 0x03
204#define UAC2_TE_CLUSTER 0x04
205#define UAC2_TE_UNDERFLOW 0x05
206#define UAC2_TE_OVERFLOW 0x06
207#define UAC2_TE_LATENCY 0x07
208
209/* A.17.5 Mixer Control Selectors */
210#define UAC2_MU_UNDEFINED 0x00
211#define UAC2_MU_MIXER 0x01
212#define UAC2_MU_CLUSTER 0x02
213#define UAC2_MU_UNDERFLOW 0x03
214#define UAC2_MU_OVERFLOW 0x04
215#define UAC2_MU_LATENCY 0x05
216
217/* A.17.6 Selector Control Selectors */
218#define UAC2_SU_UNDEFINED 0x00
219#define UAC2_SU_SELECTOR 0x01
220#define UAC2_SU_LATENCY 0x02
221
222/* A.17.7 Feature Unit Control Selectors */
223/* see audio.h for the rest, which is identical to v1 */
224#define UAC2_FU_INPUT_GAIN 0x0b
225#define UAC2_FU_INPUT_GAIN_PAD 0x0c
226#define UAC2_FU_PHASE_INVERTER 0x0d
227#define UAC2_FU_UNDERFLOW 0x0e
228#define UAC2_FU_OVERFLOW 0x0f
229#define UAC2_FU_LATENCY 0x10
230
231/* A.17.8.1 Parametric Equalizer Section Effect Unit Control Selectors */
232#define UAC2_PE_UNDEFINED 0x00
233#define UAC2_PE_ENABLE 0x01
234#define UAC2_PE_CENTERFREQ 0x02
235#define UAC2_PE_QFACTOR 0x03
236#define UAC2_PE_GAIN 0x04
237#define UAC2_PE_UNDERFLOW 0x05
238#define UAC2_PE_OVERFLOW 0x06
239#define UAC2_PE_LATENCY 0x07
240
241/* A.17.8.2 Reverberation Effect Unit Control Selectors */
242#define UAC2_RV_UNDEFINED 0x00
243#define UAC2_RV_ENABLE 0x01
244#define UAC2_RV_TYPE 0x02
245#define UAC2_RV_LEVEL 0x03
246#define UAC2_RV_TIME 0x04
247#define UAC2_RV_FEEDBACK 0x05
248#define UAC2_RV_PREDELAY 0x06
249#define UAC2_RV_DENSITY 0x07
250#define UAC2_RV_HIFREQ_ROLLOFF 0x08
251#define UAC2_RV_UNDERFLOW 0x09
252#define UAC2_RV_OVERFLOW 0x0a
253#define UAC2_RV_LATENCY 0x0b
254
255/* A.17.8.3 Modulation Delay Effect Control Selectors */
256#define UAC2_MD_UNDEFINED 0x00
257#define UAC2_MD_ENABLE 0x01
258#define UAC2_MD_BALANCE 0x02
259#define UAC2_MD_RATE 0x03
260#define UAC2_MD_DEPTH 0x04
261#define UAC2_MD_TIME 0x05
262#define UAC2_MD_FEEDBACK 0x06
263#define UAC2_MD_UNDERFLOW 0x07
264#define UAC2_MD_OVERFLOW 0x08
265#define UAC2_MD_LATENCY 0x09
266
267/* A.17.8.4 Dynamic Range Compressor Effect Unit Control Selectors */
268#define UAC2_DR_UNDEFINED 0x00
269#define UAC2_DR_ENABLE 0x01
270#define UAC2_DR_COMPRESSION_RATE 0x02
271#define UAC2_DR_MAXAMPL 0x03
272#define UAC2_DR_THRESHOLD 0x04
273#define UAC2_DR_ATTACK_TIME 0x05
274#define UAC2_DR_RELEASE_TIME 0x06
275#define UAC2_DR_UNDEFLOW 0x07
276#define UAC2_DR_OVERFLOW 0x08
277#define UAC2_DR_LATENCY 0x09
278
279/* A.17.9.1 Up/Down-mix Processing Unit Control Selectors */
280#define UAC2_UD_UNDEFINED 0x00
281#define UAC2_UD_ENABLE 0x01
282#define UAC2_UD_MODE_SELECT 0x02
283#define UAC2_UD_CLUSTER 0x03
284#define UAC2_UD_UNDERFLOW 0x04
285#define UAC2_UD_OVERFLOW 0x05
286#define UAC2_UD_LATENCY 0x06
287
288/* A.17.9.2 Dolby Prologic[tm] Processing Unit Control Selectors */
289#define UAC2_DP_UNDEFINED 0x00
290#define UAC2_DP_ENABLE 0x01
291#define UAC2_DP_MODE_SELECT 0x02
292#define UAC2_DP_CLUSTER 0x03
293#define UAC2_DP_UNDERFFLOW 0x04
294#define UAC2_DP_OVERFLOW 0x05
295#define UAC2_DP_LATENCY 0x06
296
297/* A.17.9.3 Stereo Expander Processing Unit Control Selectors */
298#define UAC2_ST_EXT_UNDEFINED 0x00
299#define UAC2_ST_EXT_ENABLE 0x01
300#define UAC2_ST_EXT_WIDTH 0x02
301#define UAC2_ST_EXT_UNDEFLOW 0x03
302#define UAC2_ST_EXT_OVERFLOW 0x04
303#define UAC2_ST_EXT_LATENCY 0x05
304
305/* A.17.10 Extension Unit Control Selectors */
306#define UAC2_XU_UNDEFINED 0x00
307#define UAC2_XU_ENABLE 0x01
308#define UAC2_XU_CLUSTER 0x02
309#define UAC2_XU_UNDERFLOW 0x03
310#define UAC2_XU_OVERFLOW 0x04
311#define UAC2_XU_LATENCY 0x05
312
313/* A.17.11 AudioStreaming Interface Control Selectors */
314#define UAC2_AS_UNDEFINED 0x00
315#define UAC2_AS_ACT_ALT_SETTING 0x01
316#define UAC2_AS_VAL_ALT_SETTINGS 0x02
317#define UAC2_AS_AUDIO_DATA_FORMAT 0x03
318
319/* A.17.12 Encoder Control Selectors */
320#define UAC2_EN_UNDEFINED 0x00
321#define UAC2_EN_BIT_RATE 0x01
322#define UAC2_EN_QUALITY 0x02
323#define UAC2_EN_VBR 0x03
324#define UAC2_EN_TYPE 0x04
325#define UAC2_EN_UNDERFLOW 0x05
326#define UAC2_EN_OVERFLOW 0x06
327#define UAC2_EN_ENCODER_ERROR 0x07
328#define UAC2_EN_PARAM1 0x08
329#define UAC2_EN_PARAM2 0x09
330#define UAC2_EN_PARAM3 0x0a
331#define UAC2_EN_PARAM4 0x0b
332#define UAC2_EN_PARAM5 0x0c
333#define UAC2_EN_PARAM6 0x0d
334#define UAC2_EN_PARAM7 0x0e
335#define UAC2_EN_PARAM8 0x0f
336
337/* A.17.13.1 MPEG Decoder Control Selectors */
338#define UAC2_MPEG_UNDEFINED 0x00
339#define UAC2_MPEG_DUAL_CHANNEL 0x01
340#define UAC2_MPEG_SECOND_STEREO 0x02
341#define UAC2_MPEG_MULTILINGUAL 0x03
342#define UAC2_MPEG_DYN_RANGE 0x04
343#define UAC2_MPEG_SCALING 0x05
344#define UAC2_MPEG_HILO_SCALING 0x06
345#define UAC2_MPEG_UNDERFLOW 0x07
346#define UAC2_MPEG_OVERFLOW 0x08
347#define UAC2_MPEG_DECODER_ERROR 0x09
348
349/* A17.13.2 AC3 Decoder Control Selectors */
350#define UAC2_AC3_UNDEFINED 0x00
351#define UAC2_AC3_MODE 0x01
352#define UAC2_AC3_DYN_RANGE 0x02
353#define UAC2_AC3_SCALING 0x03
354#define UAC2_AC3_HILO_SCALING 0x04
355#define UAC2_AC3_UNDERFLOW 0x05
356#define UAC2_AC3_OVERFLOW 0x06
357#define UAC2_AC3_DECODER_ERROR 0x07
358
359/* A17.13.3 WMA Decoder Control Selectors */
360#define UAC2_WMA_UNDEFINED 0x00
361#define UAC2_WMA_UNDERFLOW 0x01
362#define UAC2_WMA_OVERFLOW 0x02
363#define UAC2_WMA_DECODER_ERROR 0x03
364
365/* A17.13.4 DTS Decoder Control Selectors */
366#define UAC2_DTS_UNDEFINED 0x00
367#define UAC2_DTS_UNDERFLOW 0x01
368#define UAC2_DTS_OVERFLOW 0x02
369#define UAC2_DTS_DECODER_ERROR 0x03
370
371/* A17.14 Endpoint Control Selectors */
372#define UAC2_EP_CS_UNDEFINED 0x00
373#define UAC2_EP_CS_PITCH 0x01
374#define UAC2_EP_CS_DATA_OVERRUN 0x02
375#define UAC2_EP_CS_DATA_UNDERRUN 0x03
376
377#endif /* __LINUX_USB_AUDIO_V2_H */
378
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index 4d3e450e2b03..c0ef18dc2da7 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -13,6 +13,9 @@
13 * Comments below reference relevant sections of that document: 13 * Comments below reference relevant sections of that document:
14 * 14 *
15 * http://www.usb.org/developers/devclass_docs/audio10.pdf 15 * http://www.usb.org/developers/devclass_docs/audio10.pdf
16 *
17 * Types and defines in this file are either specific to version 1.0 of
18 * this standard or common for newer versions.
16 */ 19 */
17 20
18#ifndef __LINUX_USB_AUDIO_H 21#ifndef __LINUX_USB_AUDIO_H
@@ -20,14 +23,15 @@
20 23
21#include <linux/types.h> 24#include <linux/types.h>
22 25
26/* bInterfaceProtocol values to denote the version of the standard used */
27#define UAC_VERSION_1 0x00
28#define UAC_VERSION_2 0x20
29
23/* A.2 Audio Interface Subclass Codes */ 30/* A.2 Audio Interface Subclass Codes */
24#define USB_SUBCLASS_AUDIOCONTROL 0x01 31#define USB_SUBCLASS_AUDIOCONTROL 0x01
25#define USB_SUBCLASS_AUDIOSTREAMING 0x02 32#define USB_SUBCLASS_AUDIOSTREAMING 0x02
26#define USB_SUBCLASS_MIDISTREAMING 0x03 33#define USB_SUBCLASS_MIDISTREAMING 0x03
27 34
28#define UAC_VERSION_1 0x00
29#define UAC_VERSION_2 0x20
30
31/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ 35/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
32#define UAC_HEADER 0x01 36#define UAC_HEADER 0x01
33#define UAC_INPUT_TERMINAL 0x02 37#define UAC_INPUT_TERMINAL 0x02
@@ -38,15 +42,6 @@
38#define UAC_PROCESSING_UNIT_V1 0x07 42#define UAC_PROCESSING_UNIT_V1 0x07
39#define UAC_EXTENSION_UNIT_V1 0x08 43#define UAC_EXTENSION_UNIT_V1 0x08
40 44
41/* UAC v2.0 types */
42#define UAC_EFFECT_UNIT 0x07
43#define UAC_PROCESSING_UNIT_V2 0x08
44#define UAC_EXTENSION_UNIT_V2 0x09
45#define UAC_CLOCK_SOURCE 0x0a
46#define UAC_CLOCK_SELECTOR 0x0b
47#define UAC_CLOCK_MULTIPLIER 0x0c
48#define UAC_SAMPLE_RATE_CONVERTER 0x0d
49
50/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 45/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
51#define UAC_AS_GENERAL 0x01 46#define UAC_AS_GENERAL 0x01
52#define UAC_FORMAT_TYPE 0x02 47#define UAC_FORMAT_TYPE 0x02
@@ -78,10 +73,6 @@
78 73
79#define UAC_GET_STAT 0xff 74#define UAC_GET_STAT 0xff
80 75
81/* Audio class v2.0 handles all the parameter calls differently */
82#define UAC2_CS_CUR 0x01
83#define UAC2_CS_RANGE 0x02
84
85/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ 76/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
86#define UAC_MS_HEADER 0x01 77#define UAC_MS_HEADER 0x01
87#define UAC_MIDI_IN_JACK 0x02 78#define UAC_MIDI_IN_JACK 0x02
@@ -190,6 +181,156 @@ struct uac_feature_unit_descriptor_##ch { \
190 __u8 iFeature; \ 181 __u8 iFeature; \
191} __attribute__ ((packed)) 182} __attribute__ ((packed))
192 183
184/* 4.3.2.3 Mixer Unit Descriptor */
185struct uac_mixer_unit_descriptor {
186 __u8 bLength;
187 __u8 bDescriptorType;
188 __u8 bDescriptorSubtype;
189 __u8 bUnitID;
190 __u8 bNrInPins;
191 __u8 baSourceID[];
192} __attribute__ ((packed));
193
194static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc)
195{
196 return desc->baSourceID[desc->bNrInPins];
197}
198
199static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc,
200 int protocol)
201{
202 if (protocol == UAC_VERSION_1)
203 return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
204 desc->baSourceID[desc->bNrInPins + 1];
205 else
206 return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
207 (desc->baSourceID[desc->bNrInPins + 3] << 16) |
208 (desc->baSourceID[desc->bNrInPins + 2] << 8) |
209 (desc->baSourceID[desc->bNrInPins + 1]);
210}
211
212static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc,
213 int protocol)
214{
215 return (protocol == UAC_VERSION_1) ?
216 desc->baSourceID[desc->bNrInPins + 3] :
217 desc->baSourceID[desc->bNrInPins + 5];
218}
219
220static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc,
221 int protocol)
222{
223 return (protocol == UAC_VERSION_1) ?
224 &desc->baSourceID[desc->bNrInPins + 4] :
225 &desc->baSourceID[desc->bNrInPins + 6];
226}
227
228static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc)
229{
230 __u8 *raw = (__u8 *) desc;
231 return raw[desc->bLength - 1];
232}
233
234/* 4.3.2.4 Selector Unit Descriptor */
235struct uac_selector_unit_descriptor {
236 __u8 bLength;
237 __u8 bDescriptorType;
238 __u8 bDescriptorSubtype;
239 __u8 bUintID;
240 __u8 bNrInPins;
241 __u8 baSourceID[];
242} __attribute__ ((packed));
243
244static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
245{
246 __u8 *raw = (__u8 *) desc;
247 return raw[9 + desc->bLength - 1];
248}
249
250/* 4.3.2.5 Feature Unit Descriptor */
251struct uac_feature_unit_descriptor {
252 __u8 bLength;
253 __u8 bDescriptorType;
254 __u8 bDescriptorSubtype;
255 __u8 bUnitID;
256 __u8 bSourceID;
257 __u8 bControlSize;
258 __u8 bmaControls[0]; /* variable length */
259} __attribute__((packed));
260
261static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
262{
263 __u8 *raw = (__u8 *) desc;
264 return raw[desc->bLength - 1];
265}
266
267/* 4.3.2.6 Processing Unit Descriptors */
268struct uac_processing_unit_descriptor {
269 __u8 bLength;
270 __u8 bDescriptorType;
271 __u8 bDescriptorSubtype;
272 __u8 bUnitID;
273 __u16 wProcessType;
274 __u8 bNrInPins;
275 __u8 baSourceID[];
276} __attribute__ ((packed));
277
278static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc)
279{
280 return desc->baSourceID[desc->bNrInPins];
281}
282
283static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc,
284 int protocol)
285{
286 if (protocol == UAC_VERSION_1)
287 return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
288 desc->baSourceID[desc->bNrInPins + 1];
289 else
290 return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
291 (desc->baSourceID[desc->bNrInPins + 3] << 16) |
292 (desc->baSourceID[desc->bNrInPins + 2] << 8) |
293 (desc->baSourceID[desc->bNrInPins + 1]);
294}
295
296static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc,
297 int protocol)
298{
299 return (protocol == UAC_VERSION_1) ?
300 desc->baSourceID[desc->bNrInPins + 3] :
301 desc->baSourceID[desc->bNrInPins + 5];
302}
303
304static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc,
305 int protocol)
306{
307 return (protocol == UAC_VERSION_1) ?
308 desc->baSourceID[desc->bNrInPins + 4] :
309 desc->baSourceID[desc->bNrInPins + 6];
310}
311
312static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
313 int protocol)
314{
315 return (protocol == UAC_VERSION_1) ?
316 &desc->baSourceID[desc->bNrInPins + 5] :
317 &desc->baSourceID[desc->bNrInPins + 7];
318}
319
320static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
321 int protocol)
322{
323 __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
324 return desc->baSourceID[desc->bNrInPins + control_size];
325}
326
327static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
328 int protocol)
329{
330 __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
331 return &desc->baSourceID[desc->bNrInPins + control_size + 1];
332}
333
193/* 4.5.2 Class-Specific AS Interface Descriptor */ 334/* 4.5.2 Class-Specific AS Interface Descriptor */
194struct uac_as_header_descriptor_v1 { 335struct uac_as_header_descriptor_v1 {
195 __u8 bLength; /* in bytes: 7 */ 336 __u8 bLength; /* in bytes: 7 */
@@ -200,19 +341,6 @@ struct uac_as_header_descriptor_v1 {
200 __le16 wFormatTag; /* The Audio Data Format */ 341 __le16 wFormatTag; /* The Audio Data Format */
201} __attribute__ ((packed)); 342} __attribute__ ((packed));
202 343
203struct uac_as_header_descriptor_v2 {
204 __u8 bLength;
205 __u8 bDescriptorType;
206 __u8 bDescriptorSubtype;
207 __u8 bTerminalLink;
208 __u8 bmControls;
209 __u8 bFormatType;
210 __u32 bmFormats;
211 __u8 bNrChannels;
212 __u32 bmChannelConfig;
213 __u8 iChannelNames;
214} __attribute__((packed));
215
216#define UAC_DT_AS_HEADER_SIZE 7 344#define UAC_DT_AS_HEADER_SIZE 7
217 345
218/* Formats - A.1.1 Audio Data Format Type I Codes */ 346/* Formats - A.1.1 Audio Data Format Type I Codes */
@@ -277,7 +405,6 @@ struct uac_format_type_i_ext_descriptor {
277 __u8 bSideBandProtocol; 405 __u8 bSideBandProtocol;
278} __attribute__((packed)); 406} __attribute__((packed));
279 407
280
281/* Formats - Audio Data Format Type I Codes */ 408/* Formats - Audio Data Format Type I Codes */
282 409
283#define UAC_FORMAT_TYPE_II_MPEG 0x1001 410#define UAC_FORMAT_TYPE_II_MPEG 0x1001
@@ -329,38 +456,15 @@ struct uac_iso_endpoint_descriptor {
329 __u8 bmAttributes; 456 __u8 bmAttributes;
330 __u8 bLockDelayUnits; 457 __u8 bLockDelayUnits;
331 __le16 wLockDelay; 458 __le16 wLockDelay;
332}; 459} __attribute__((packed));
333#define UAC_ISO_ENDPOINT_DESC_SIZE 7 460#define UAC_ISO_ENDPOINT_DESC_SIZE 7
334 461
335#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 462#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01
336#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 463#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
337#define UAC_EP_CS_ATTR_FILL_MAX 0x80 464#define UAC_EP_CS_ATTR_FILL_MAX 0x80
338 465
339/* Audio class v2.0: CLOCK_SOURCE descriptor */
340
341struct uac_clock_source_descriptor {
342 __u8 bLength;
343 __u8 bDescriptorType;
344 __u8 bDescriptorSubtype;
345 __u8 bClockID;
346 __u8 bmAttributes;
347 __u8 bmControls;
348 __u8 bAssocTerminal;
349 __u8 iClockSource;
350} __attribute__((packed));
351
352/* A.10.2 Feature Unit Control Selectors */ 466/* A.10.2 Feature Unit Control Selectors */
353 467
354struct uac_feature_unit_descriptor {
355 __u8 bLength;
356 __u8 bDescriptorType;
357 __u8 bDescriptorSubtype;
358 __u8 bUnitID;
359 __u8 bSourceID;
360 __u8 bControlSize;
361 __u8 controls[0]; /* variable length */
362} __attribute__((packed));
363
364#define UAC_FU_CONTROL_UNDEFINED 0x00 468#define UAC_FU_CONTROL_UNDEFINED 0x00
365#define UAC_MUTE_CONTROL 0x01 469#define UAC_MUTE_CONTROL 0x01
366#define UAC_VOLUME_CONTROL 0x02 470#define UAC_VOLUME_CONTROL 0x02
@@ -384,6 +488,21 @@ struct uac_feature_unit_descriptor {
384#define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) 488#define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1))
385#define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) 489#define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1))
386 490
491/* status word format (3.7.1.1) */
492
493#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f
494#define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0
495#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1
496#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2
497
498#define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7)
499#define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6)
500
501struct uac1_status_word {
502 __u8 bStatusType;
503 __u8 bOriginator;
504} __attribute__((packed));
505
387#ifdef __KERNEL__ 506#ifdef __KERNEL__
388 507
389struct usb_audio_control { 508struct usb_audio_control {
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 098595500632..9f1eecf99e6b 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -574,7 +574,7 @@ enum {
574#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ 574#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
575 575
576struct snd_timer_id { 576struct snd_timer_id {
577 int dev_class; 577 int dev_class;
578 int dev_sclass; 578 int dev_sclass;
579 int card; 579 int card;
580 int device; 580 int device;
@@ -762,7 +762,7 @@ struct snd_ctl_elem_id {
762 snd_ctl_elem_iface_t iface; /* interface identifier */ 762 snd_ctl_elem_iface_t iface; /* interface identifier */
763 unsigned int device; /* device/client number */ 763 unsigned int device; /* device/client number */
764 unsigned int subdevice; /* subdevice (substream) number */ 764 unsigned int subdevice; /* subdevice (substream) number */
765 unsigned char name[44]; /* ASCII name of item */ 765 unsigned char name[44]; /* ASCII name of item */
766 unsigned int index; /* index of item */ 766 unsigned int index; /* index of item */
767}; 767};
768 768
@@ -809,7 +809,7 @@ struct snd_ctl_elem_info {
809struct snd_ctl_elem_value { 809struct snd_ctl_elem_value {
810 struct snd_ctl_elem_id id; /* W: element ID */ 810 struct snd_ctl_elem_id id; /* W: element ID */
811 unsigned int indirect: 1; /* W: indirect access - obsoleted */ 811 unsigned int indirect: 1; /* W: indirect access - obsoleted */
812 union { 812 union {
813 union { 813 union {
814 long value[128]; 814 long value[128];
815 long *value_ptr; /* obsoleted */ 815 long *value_ptr; /* obsoleted */
@@ -827,15 +827,15 @@ struct snd_ctl_elem_value {
827 unsigned char *data_ptr; /* obsoleted */ 827 unsigned char *data_ptr; /* obsoleted */
828 } bytes; 828 } bytes;
829 struct snd_aes_iec958 iec958; 829 struct snd_aes_iec958 iec958;
830 } value; /* RO */ 830 } value; /* RO */
831 struct timespec tstamp; 831 struct timespec tstamp;
832 unsigned char reserved[128-sizeof(struct timespec)]; 832 unsigned char reserved[128-sizeof(struct timespec)];
833}; 833};
834 834
835struct snd_ctl_tlv { 835struct snd_ctl_tlv {
836 unsigned int numid; /* control element numeric identification */ 836 unsigned int numid; /* control element numeric identification */
837 unsigned int length; /* in bytes aligned to 4 */ 837 unsigned int length; /* in bytes aligned to 4 */
838 unsigned int tlv[0]; /* first TLV */ 838 unsigned int tlv[0]; /* first TLV */
839}; 839};
840 840
841#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) 841#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
@@ -886,8 +886,8 @@ struct snd_ctl_event {
886 unsigned int mask; 886 unsigned int mask;
887 struct snd_ctl_elem_id id; 887 struct snd_ctl_elem_id id;
888 } elem; 888 } elem;
889 unsigned char data8[60]; 889 unsigned char data8[60];
890 } data; 890 } data;
891}; 891};
892 892
893/* 893/*
diff --git a/include/sound/es1688.h b/include/sound/es1688.h
index 10fcf1465810..3ec7ecbe2502 100644
--- a/include/sound/es1688.h
+++ b/include/sound/es1688.h
@@ -44,7 +44,6 @@ struct snd_es1688 {
44 unsigned char pad; 44 unsigned char pad;
45 unsigned int dma_size; 45 unsigned int dma_size;
46 46
47 struct snd_card *card;
48 struct snd_pcm *pcm; 47 struct snd_pcm *pcm;
49 struct snd_pcm_substream *playback_substream; 48 struct snd_pcm_substream *playback_substream;
50 struct snd_pcm_substream *capture_substream; 49 struct snd_pcm_substream *capture_substream;
@@ -108,14 +107,16 @@ struct snd_es1688 {
108void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data); 107void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data);
109 108
110int snd_es1688_create(struct snd_card *card, 109int snd_es1688_create(struct snd_card *card,
110 struct snd_es1688 *chip,
111 unsigned long port, 111 unsigned long port,
112 unsigned long mpu_port, 112 unsigned long mpu_port,
113 int irq, 113 int irq,
114 int mpu_irq, 114 int mpu_irq,
115 int dma8, 115 int dma8,
116 unsigned short hardware, 116 unsigned short hardware);
117 struct snd_es1688 ** rchip); 117int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device,
118int snd_es1688_pcm(struct snd_es1688 *chip, int device, struct snd_pcm ** rpcm); 118 struct snd_pcm **rpcm);
119int snd_es1688_mixer(struct snd_es1688 *chip); 119int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip);
120int snd_es1688_reset(struct snd_es1688 *chip);
120 121
121#endif /* __SOUND_ES1688_H */ 122#endif /* __SOUND_ES1688_H */
diff --git a/include/sound/info.h b/include/sound/info.h
index 112e8949e1a7..4e94cf1ff762 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -51,18 +51,18 @@ struct snd_info_entry_ops {
51 unsigned short mode, void **file_private_data); 51 unsigned short mode, void **file_private_data);
52 int (*release)(struct snd_info_entry *entry, 52 int (*release)(struct snd_info_entry *entry,
53 unsigned short mode, void *file_private_data); 53 unsigned short mode, void *file_private_data);
54 long (*read)(struct snd_info_entry *entry, void *file_private_data, 54 ssize_t (*read)(struct snd_info_entry *entry, void *file_private_data,
55 struct file *file, char __user *buf, 55 struct file *file, char __user *buf,
56 unsigned long count, unsigned long pos); 56 size_t count, loff_t pos);
57 long (*write)(struct snd_info_entry *entry, void *file_private_data, 57 ssize_t (*write)(struct snd_info_entry *entry, void *file_private_data,
58 struct file *file, const char __user *buf, 58 struct file *file, const char __user *buf,
59 unsigned long count, unsigned long pos); 59 size_t count, loff_t pos);
60 long long (*llseek)(struct snd_info_entry *entry, 60 loff_t (*llseek)(struct snd_info_entry *entry,
61 void *file_private_data, struct file *file, 61 void *file_private_data, struct file *file,
62 long long offset, int orig); 62 loff_t offset, int orig);
63 unsigned int(*poll)(struct snd_info_entry *entry, 63 unsigned int (*poll)(struct snd_info_entry *entry,
64 void *file_private_data, struct file *file, 64 void *file_private_data, struct file *file,
65 poll_table *wait); 65 poll_table *wait);
66 int (*ioctl)(struct snd_info_entry *entry, void *file_private_data, 66 int (*ioctl)(struct snd_info_entry *entry, void *file_private_data,
67 struct file *file, unsigned int cmd, unsigned long arg); 67 struct file *file, unsigned int cmd, unsigned long arg);
68 int (*mmap)(struct snd_info_entry *entry, void *file_private_data, 68 int (*mmap)(struct snd_info_entry *entry, void *file_private_data,
diff --git a/include/sound/jack.h b/include/sound/jack.h
index f236e426a706..d90b9fa32707 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -42,6 +42,11 @@ enum snd_jack_types {
42 SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ 42 SND_JACK_MECHANICAL = 0x0008, /* If detected separately */
43 SND_JACK_VIDEOOUT = 0x0010, 43 SND_JACK_VIDEOOUT = 0x0010,
44 SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, 44 SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT,
45
46 /* Kept separate from switches to facilitate implementation */
47 SND_JACK_BTN_0 = 0x4000,
48 SND_JACK_BTN_1 = 0x2000,
49 SND_JACK_BTN_2 = 0x1000,
45}; 50};
46 51
47struct snd_jack { 52struct snd_jack {
@@ -50,6 +55,7 @@ struct snd_jack {
50 int type; 55 int type;
51 const char *id; 56 const char *id;
52 char name[100]; 57 char name[100];
58 unsigned int key[3]; /* Keep in sync with definitions above */
53 void *private_data; 59 void *private_data;
54 void (*private_free)(struct snd_jack *); 60 void (*private_free)(struct snd_jack *);
55}; 61};
@@ -59,6 +65,8 @@ struct snd_jack {
59int snd_jack_new(struct snd_card *card, const char *id, int type, 65int snd_jack_new(struct snd_card *card, const char *id, int type,
60 struct snd_jack **jack); 66 struct snd_jack **jack);
61void snd_jack_set_parent(struct snd_jack *jack, struct device *parent); 67void snd_jack_set_parent(struct snd_jack *jack, struct device *parent);
68int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type,
69 int keytype);
62 70
63void snd_jack_report(struct snd_jack *jack, int status); 71void snd_jack_report(struct snd_jack *jack, int status);
64 72
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 0a0b019d41ad..377693a14385 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -182,6 +182,12 @@ struct snd_soc_dai_ops {
182 struct snd_soc_dai *); 182 struct snd_soc_dai *);
183 int (*trigger)(struct snd_pcm_substream *, int, 183 int (*trigger)(struct snd_pcm_substream *, int,
184 struct snd_soc_dai *); 184 struct snd_soc_dai *);
185 /*
186 * For hardware based FIFO caused delay reporting.
187 * Optional.
188 */
189 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
190 struct snd_soc_dai *);
185}; 191};
186 192
187/* 193/*
@@ -215,7 +221,6 @@ struct snd_soc_dai {
215 unsigned int symmetric_rates:1; 221 unsigned int symmetric_rates:1;
216 222
217 /* DAI runtime info */ 223 /* DAI runtime info */
218 struct snd_pcm_runtime *runtime;
219 struct snd_soc_codec *codec; 224 struct snd_soc_codec *codec;
220 unsigned int active; 225 unsigned int active;
221 unsigned char pop_wait:1; 226 unsigned char pop_wait:1;
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c0922a034223..66ff4c124dbd 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -339,6 +339,9 @@ int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin);
339int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); 339int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin);
340int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); 340int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin);
341int snd_soc_dapm_sync(struct snd_soc_codec *codec); 341int snd_soc_dapm_sync(struct snd_soc_codec *codec);
342int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec,
343 const char *pin);
344int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin);
342 345
343/* dapm widget types */ 346/* dapm widget types */
344enum snd_soc_dapm_type { 347enum snd_soc_dapm_type {
@@ -425,9 +428,8 @@ struct snd_soc_dapm_widget {
425 unsigned char connected:1; /* connected codec pin */ 428 unsigned char connected:1; /* connected codec pin */
426 unsigned char new:1; /* cnew complete */ 429 unsigned char new:1; /* cnew complete */
427 unsigned char ext:1; /* has external widgets */ 430 unsigned char ext:1; /* has external widgets */
428 unsigned char muted:1; /* muted for pop reduction */ 431 unsigned char force:1; /* force state */
429 unsigned char suspend:1; /* was active before suspend */ 432 unsigned char ignore_suspend:1; /* kept enabled over suspend */
430 unsigned char pmdown:1; /* waiting for timeout */
431 433
432 int (*power_check)(struct snd_soc_dapm_widget *w); 434 int (*power_check)(struct snd_soc_dapm_widget *w);
433 435
diff --git a/include/sound/soc.h b/include/sound/soc.h
index a57fbfcd4c8f..697e7ffe39d7 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/notifier.h>
18#include <linux/workqueue.h> 19#include <linux/workqueue.h>
19#include <linux/interrupt.h> 20#include <linux/interrupt.h>
20#include <linux/kernel.h> 21#include <linux/kernel.h>
@@ -29,10 +30,10 @@
29#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ 30#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \
30 ((unsigned long)&(struct soc_mixer_control) \ 31 ((unsigned long)&(struct soc_mixer_control) \
31 {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ 32 {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \
32 .invert = xinvert}) 33 .platform_max = xmax, .invert = xinvert})
33#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 34#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \
34 ((unsigned long)&(struct soc_mixer_control) \ 35 ((unsigned long)&(struct soc_mixer_control) \
35 {.reg = xreg, .max = xmax, .invert = xinvert}) 36 {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert})
36#define SOC_SINGLE(xname, reg, shift, max, invert) \ 37#define SOC_SINGLE(xname, reg, shift, max, invert) \
37{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 38{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
38 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 39 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
@@ -52,14 +53,14 @@
52 .put = snd_soc_put_volsw, \ 53 .put = snd_soc_put_volsw, \
53 .private_value = (unsigned long)&(struct soc_mixer_control) \ 54 .private_value = (unsigned long)&(struct soc_mixer_control) \
54 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 55 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \
55 .max = xmax, .invert = xinvert} } 56 .max = xmax, .platform_max = xmax, .invert = xinvert} }
56#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ 57#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
57{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 58{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
58 .info = snd_soc_info_volsw_2r, \ 59 .info = snd_soc_info_volsw_2r, \
59 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ 60 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
60 .private_value = (unsigned long)&(struct soc_mixer_control) \ 61 .private_value = (unsigned long)&(struct soc_mixer_control) \
61 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 62 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
62 .max = xmax, .invert = xinvert} } 63 .max = xmax, .platform_max = xmax, .invert = xinvert} }
63#define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ 64#define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \
64{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 65{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
65 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 66 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
@@ -69,7 +70,7 @@
69 .put = snd_soc_put_volsw, \ 70 .put = snd_soc_put_volsw, \
70 .private_value = (unsigned long)&(struct soc_mixer_control) \ 71 .private_value = (unsigned long)&(struct soc_mixer_control) \
71 {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ 72 {.reg = xreg, .shift = shift_left, .rshift = shift_right,\
72 .max = xmax, .invert = xinvert} } 73 .max = xmax, .platform_max = xmax, .invert = xinvert} }
73#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ 74#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \
74{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 75{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
75 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 76 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
@@ -79,7 +80,7 @@
79 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ 80 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
80 .private_value = (unsigned long)&(struct soc_mixer_control) \ 81 .private_value = (unsigned long)&(struct soc_mixer_control) \
81 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 82 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
82 .max = xmax, .invert = xinvert} } 83 .max = xmax, .platform_max = xmax, .invert = xinvert} }
83#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ 84#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
84{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 85{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
85 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 86 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
@@ -88,7 +89,8 @@
88 .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \ 89 .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \
89 .put = snd_soc_put_volsw_s8, \ 90 .put = snd_soc_put_volsw_s8, \
90 .private_value = (unsigned long)&(struct soc_mixer_control) \ 91 .private_value = (unsigned long)&(struct soc_mixer_control) \
91 {.reg = xreg, .min = xmin, .max = xmax} } 92 {.reg = xreg, .min = xmin, .max = xmax, \
93 .platform_max = xmax} }
92#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ 94#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \
93{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ 95{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
94 .max = xmax, .texts = xtexts } 96 .max = xmax, .texts = xtexts }
@@ -125,7 +127,7 @@
125 .get = xhandler_get, .put = xhandler_put, \ 127 .get = xhandler_get, .put = xhandler_put, \
126 .private_value = (unsigned long)&(struct soc_mixer_control) \ 128 .private_value = (unsigned long)&(struct soc_mixer_control) \
127 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 129 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \
128 .max = xmax, .invert = xinvert} } 130 .max = xmax, .platform_max = xmax, .invert = xinvert} }
129#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ 131#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
130 xhandler_get, xhandler_put, tlv_array) \ 132 xhandler_get, xhandler_put, tlv_array) \
131{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 133{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
@@ -145,7 +147,7 @@
145 .get = xhandler_get, .put = xhandler_put, \ 147 .get = xhandler_get, .put = xhandler_put, \
146 .private_value = (unsigned long)&(struct soc_mixer_control) \ 148 .private_value = (unsigned long)&(struct soc_mixer_control) \
147 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 149 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \
148 .max = xmax, .invert = xinvert} } 150 .max = xmax, .platform_max = xmax, .invert = xinvert} }
149#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 151#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\
150 xhandler_get, xhandler_put, tlv_array) \ 152 xhandler_get, xhandler_put, tlv_array) \
151{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 153{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -156,7 +158,7 @@
156 .get = xhandler_get, .put = xhandler_put, \ 158 .get = xhandler_get, .put = xhandler_put, \
157 .private_value = (unsigned long)&(struct soc_mixer_control) \ 159 .private_value = (unsigned long)&(struct soc_mixer_control) \
158 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 160 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
159 .max = xmax, .invert = xinvert} } 161 .max = xmax, .platform_max = xmax, .invert = xinvert} }
160#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ 162#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
161{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 163{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
162 .info = snd_soc_info_bool_ext, \ 164 .info = snd_soc_info_bool_ext, \
@@ -212,6 +214,7 @@ struct snd_soc_dai_mode;
212struct snd_soc_pcm_runtime; 214struct snd_soc_pcm_runtime;
213struct snd_soc_dai; 215struct snd_soc_dai;
214struct snd_soc_platform; 216struct snd_soc_platform;
217struct snd_soc_dai_link;
215struct snd_soc_codec; 218struct snd_soc_codec;
216struct soc_enum; 219struct soc_enum;
217struct snd_soc_ac97_ops; 220struct snd_soc_ac97_ops;
@@ -260,6 +263,10 @@ int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type,
260void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); 263void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
261int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, 264int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
262 struct snd_soc_jack_pin *pins); 265 struct snd_soc_jack_pin *pins);
266void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
267 struct notifier_block *nb);
268void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
269 struct notifier_block *nb);
263#ifdef CONFIG_GPIOLIB 270#ifdef CONFIG_GPIOLIB
264int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, 271int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
265 struct snd_soc_jack_gpio *gpios); 272 struct snd_soc_jack_gpio *gpios);
@@ -320,6 +327,8 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
320 struct snd_ctl_elem_value *ucontrol); 327 struct snd_ctl_elem_value *ucontrol);
321int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, 328int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
322 struct snd_ctl_elem_value *ucontrol); 329 struct snd_ctl_elem_value *ucontrol);
330int snd_soc_limit_volume(struct snd_soc_codec *codec,
331 const char *name, int max);
323 332
324/** 333/**
325 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection 334 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
@@ -363,6 +372,7 @@ struct snd_soc_jack {
363 struct snd_soc_card *card; 372 struct snd_soc_card *card;
364 struct list_head pins; 373 struct list_head pins;
365 int status; 374 int status;
375 struct blocking_notifier_head notifier;
366}; 376};
367 377
368/* SoC PCM stream information */ 378/* SoC PCM stream information */
@@ -374,7 +384,7 @@ struct snd_soc_pcm_stream {
374 unsigned int rate_max; /* max rate */ 384 unsigned int rate_max; /* max rate */
375 unsigned int channels_min; /* min channels */ 385 unsigned int channels_min; /* min channels */
376 unsigned int channels_max; /* max channels */ 386 unsigned int channels_max; /* max channels */
377 unsigned int active:1; /* stream is in use */ 387 unsigned int active; /* stream is in use */
378 void *dma_data; /* used by platform code */ 388 void *dma_data; /* used by platform code */
379}; 389};
380 390
@@ -407,7 +417,7 @@ struct snd_soc_codec {
407 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 417 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
408 unsigned int active; 418 unsigned int active;
409 unsigned int pcm_devs; 419 unsigned int pcm_devs;
410 void *private_data; 420 void *drvdata;
411 421
412 /* codec IO */ 422 /* codec IO */
413 void *control_data; /* codec control (i2c/3wire) data */ 423 void *control_data; /* codec control (i2c/3wire) data */
@@ -462,14 +472,21 @@ struct snd_soc_platform {
462 472
463 int (*probe)(struct platform_device *pdev); 473 int (*probe)(struct platform_device *pdev);
464 int (*remove)(struct platform_device *pdev); 474 int (*remove)(struct platform_device *pdev);
465 int (*suspend)(struct snd_soc_dai *dai); 475 int (*suspend)(struct snd_soc_dai_link *dai_link);
466 int (*resume)(struct snd_soc_dai *dai); 476 int (*resume)(struct snd_soc_dai_link *dai_link);
467 477
468 /* pcm creation and destruction */ 478 /* pcm creation and destruction */
469 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, 479 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
470 struct snd_pcm *); 480 struct snd_pcm *);
471 void (*pcm_free)(struct snd_pcm *); 481 void (*pcm_free)(struct snd_pcm *);
472 482
483 /*
484 * For platform caused delay reporting.
485 * Optional.
486 */
487 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
488 struct snd_soc_dai *);
489
473 /* platform stream ops */ 490 /* platform stream ops */
474 struct snd_pcm_ops *pcm_ops; 491 struct snd_pcm_ops *pcm_ops;
475}; 492};
@@ -489,6 +506,9 @@ struct snd_soc_dai_link {
489 /* codec/machine specific init - e.g. add machine controls */ 506 /* codec/machine specific init - e.g. add machine controls */
490 int (*init)(struct snd_soc_codec *codec); 507 int (*init)(struct snd_soc_codec *codec);
491 508
509 /* Keep DAI active over suspend */
510 unsigned int ignore_suspend:1;
511
492 /* Symmetry requirements */ 512 /* Symmetry requirements */
493 unsigned int symmetric_rates:1; 513 unsigned int symmetric_rates:1;
494 514
@@ -553,7 +573,7 @@ struct snd_soc_pcm_runtime {
553 573
554/* mixer control */ 574/* mixer control */
555struct soc_mixer_control { 575struct soc_mixer_control {
556 int min, max; 576 int min, max, platform_max;
557 unsigned int reg, rreg, shift, rshift, invert; 577 unsigned int reg, rreg, shift, rshift, invert;
558}; 578};
559 579
@@ -583,6 +603,17 @@ static inline unsigned int snd_soc_write(struct snd_soc_codec *codec,
583 return codec->write(codec, reg, val); 603 return codec->write(codec, reg, val);
584} 604}
585 605
606static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
607 void *data)
608{
609 codec->drvdata = data;
610}
611
612static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec)
613{
614 return codec->drvdata;
615}
616
586#include <sound/soc-dai.h> 617#include <sound/soc-dai.h>
587 618
588#endif 619#endif
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h
new file mode 100644
index 000000000000..b1a5f34e5cfa
--- /dev/null
+++ b/include/sound/tlv320aic3x.h
@@ -0,0 +1,17 @@
1/*
2 * Platform data for Texas Instruments TLV320AIC3x codec
3 *
4 * Author: Jarkko Nikula <jhnikula@gmail.com>
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#ifndef __TLV320AIC3x_H__
11#define __TLV320AIC3x_H__
12
13struct aic3x_pdata {
14 int gpio_reset; /* < 0 if not used */
15};
16
17#endif \ No newline at end of file
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h
index ac0665264bdf..3f428d53195b 100644
--- a/include/sound/tlv320dac33-plat.h
+++ b/include/sound/tlv320dac33-plat.h
@@ -15,6 +15,7 @@
15 15
16struct tlv320dac33_platform_data { 16struct tlv320dac33_platform_data {
17 int power_gpio; 17 int power_gpio;
18 int keep_bclk; /* Keep the BCLK running in FIFO modes */
18 u8 burst_bclkdiv; 19 u8 burst_bclkdiv;
19}; 20};
20 21
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h
index 475ef8bb7dcd..509efb050176 100644
--- a/include/sound/uda134x.h
+++ b/include/sound/uda134x.h
@@ -21,6 +21,7 @@ struct uda134x_platform_data {
21#define UDA134X_UDA1340 1 21#define UDA134X_UDA1340 1
22#define UDA134X_UDA1341 2 22#define UDA134X_UDA1341 2
23#define UDA134X_UDA1344 3 23#define UDA134X_UDA1344 3
24#define UDA134X_UDA1345 4
24}; 25};
25 26
26#endif /* _UDA134X_H */ 27#endif /* _UDA134X_H */
diff --git a/include/sound/version.h b/include/sound/version.h
index 7fed23442db8..bf69a5b7e65f 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.22.1" 2#define CONFIG_SND_VERSION "1.0.23"
3#define CONFIG_SND_DATE "" 3#define CONFIG_SND_DATE ""
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h
new file mode 100644
index 000000000000..b4a0db2307ef
--- /dev/null
+++ b/include/sound/wm8903.h
@@ -0,0 +1,249 @@
1/*
2 * linux/sound/wm8903.h -- Platform data for WM8903
3 *
4 * Copyright 2010 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
14/* Used to enable configuration of a GPIO to all zeros */
15#define WM8903_GPIO_NO_CONFIG 0x8000
16
17/*
18 * R6 (0x06) - Mic Bias Control 0
19 */
20#define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */
21#define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */
22#define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */
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] */
28#define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */
29#define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */
30#define WM8903_MICDET_ENA 0x0002 /* MICDET_ENA */
31#define WM8903_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */
32#define WM8903_MICDET_ENA_SHIFT 1 /* MICDET_ENA */
33#define WM8903_MICDET_ENA_WIDTH 1 /* MICDET_ENA */
34#define WM8903_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */
35#define WM8903_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */
36#define WM8903_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */
37#define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */
38
39/*
40 * R116 (0x74) - GPIO Control 1
41 */
42#define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */
43#define WM8903_GP1_FN_SHIFT 8 /* GP1_FN - [12:8] */
44#define WM8903_GP1_FN_WIDTH 5 /* GP1_FN - [12:8] */
45#define WM8903_GP1_DIR 0x0080 /* GP1_DIR */
46#define WM8903_GP1_DIR_MASK 0x0080 /* GP1_DIR */
47#define WM8903_GP1_DIR_SHIFT 7 /* GP1_DIR */
48#define WM8903_GP1_DIR_WIDTH 1 /* GP1_DIR */
49#define WM8903_GP1_OP_CFG 0x0040 /* GP1_OP_CFG */
50#define WM8903_GP1_OP_CFG_MASK 0x0040 /* GP1_OP_CFG */
51#define WM8903_GP1_OP_CFG_SHIFT 6 /* GP1_OP_CFG */
52#define WM8903_GP1_OP_CFG_WIDTH 1 /* GP1_OP_CFG */
53#define WM8903_GP1_IP_CFG 0x0020 /* GP1_IP_CFG */
54#define WM8903_GP1_IP_CFG_MASK 0x0020 /* GP1_IP_CFG */
55#define WM8903_GP1_IP_CFG_SHIFT 5 /* GP1_IP_CFG */
56#define WM8903_GP1_IP_CFG_WIDTH 1 /* GP1_IP_CFG */
57#define WM8903_GP1_LVL 0x0010 /* GP1_LVL */
58#define WM8903_GP1_LVL_MASK 0x0010 /* GP1_LVL */
59#define WM8903_GP1_LVL_SHIFT 4 /* GP1_LVL */
60#define WM8903_GP1_LVL_WIDTH 1 /* GP1_LVL */
61#define WM8903_GP1_PD 0x0008 /* GP1_PD */
62#define WM8903_GP1_PD_MASK 0x0008 /* GP1_PD */
63#define WM8903_GP1_PD_SHIFT 3 /* GP1_PD */
64#define WM8903_GP1_PD_WIDTH 1 /* GP1_PD */
65#define WM8903_GP1_PU 0x0004 /* GP1_PU */
66#define WM8903_GP1_PU_MASK 0x0004 /* GP1_PU */
67#define WM8903_GP1_PU_SHIFT 2 /* GP1_PU */
68#define WM8903_GP1_PU_WIDTH 1 /* GP1_PU */
69#define WM8903_GP1_INTMODE 0x0002 /* GP1_INTMODE */
70#define WM8903_GP1_INTMODE_MASK 0x0002 /* GP1_INTMODE */
71#define WM8903_GP1_INTMODE_SHIFT 1 /* GP1_INTMODE */
72#define WM8903_GP1_INTMODE_WIDTH 1 /* GP1_INTMODE */
73#define WM8903_GP1_DB 0x0001 /* GP1_DB */
74#define WM8903_GP1_DB_MASK 0x0001 /* GP1_DB */
75#define WM8903_GP1_DB_SHIFT 0 /* GP1_DB */
76#define WM8903_GP1_DB_WIDTH 1 /* GP1_DB */
77
78/*
79 * R117 (0x75) - GPIO Control 2
80 */
81#define WM8903_GP2_FN_MASK 0x1F00 /* GP2_FN - [12:8] */
82#define WM8903_GP2_FN_SHIFT 8 /* GP2_FN - [12:8] */
83#define WM8903_GP2_FN_WIDTH 5 /* GP2_FN - [12:8] */
84#define WM8903_GP2_DIR 0x0080 /* GP2_DIR */
85#define WM8903_GP2_DIR_MASK 0x0080 /* GP2_DIR */
86#define WM8903_GP2_DIR_SHIFT 7 /* GP2_DIR */
87#define WM8903_GP2_DIR_WIDTH 1 /* GP2_DIR */
88#define WM8903_GP2_OP_CFG 0x0040 /* GP2_OP_CFG */
89#define WM8903_GP2_OP_CFG_MASK 0x0040 /* GP2_OP_CFG */
90#define WM8903_GP2_OP_CFG_SHIFT 6 /* GP2_OP_CFG */
91#define WM8903_GP2_OP_CFG_WIDTH 1 /* GP2_OP_CFG */
92#define WM8903_GP2_IP_CFG 0x0020 /* GP2_IP_CFG */
93#define WM8903_GP2_IP_CFG_MASK 0x0020 /* GP2_IP_CFG */
94#define WM8903_GP2_IP_CFG_SHIFT 5 /* GP2_IP_CFG */
95#define WM8903_GP2_IP_CFG_WIDTH 1 /* GP2_IP_CFG */
96#define WM8903_GP2_LVL 0x0010 /* GP2_LVL */
97#define WM8903_GP2_LVL_MASK 0x0010 /* GP2_LVL */
98#define WM8903_GP2_LVL_SHIFT 4 /* GP2_LVL */
99#define WM8903_GP2_LVL_WIDTH 1 /* GP2_LVL */
100#define WM8903_GP2_PD 0x0008 /* GP2_PD */
101#define WM8903_GP2_PD_MASK 0x0008 /* GP2_PD */
102#define WM8903_GP2_PD_SHIFT 3 /* GP2_PD */
103#define WM8903_GP2_PD_WIDTH 1 /* GP2_PD */
104#define WM8903_GP2_PU 0x0004 /* GP2_PU */
105#define WM8903_GP2_PU_MASK 0x0004 /* GP2_PU */
106#define WM8903_GP2_PU_SHIFT 2 /* GP2_PU */
107#define WM8903_GP2_PU_WIDTH 1 /* GP2_PU */
108#define WM8903_GP2_INTMODE 0x0002 /* GP2_INTMODE */
109#define WM8903_GP2_INTMODE_MASK 0x0002 /* GP2_INTMODE */
110#define WM8903_GP2_INTMODE_SHIFT 1 /* GP2_INTMODE */
111#define WM8903_GP2_INTMODE_WIDTH 1 /* GP2_INTMODE */
112#define WM8903_GP2_DB 0x0001 /* GP2_DB */
113#define WM8903_GP2_DB_MASK 0x0001 /* GP2_DB */
114#define WM8903_GP2_DB_SHIFT 0 /* GP2_DB */
115#define WM8903_GP2_DB_WIDTH 1 /* GP2_DB */
116
117/*
118 * R118 (0x76) - GPIO Control 3
119 */
120#define WM8903_GP3_FN_MASK 0x1F00 /* GP3_FN - [12:8] */
121#define WM8903_GP3_FN_SHIFT 8 /* GP3_FN - [12:8] */
122#define WM8903_GP3_FN_WIDTH 5 /* GP3_FN - [12:8] */
123#define WM8903_GP3_DIR 0x0080 /* GP3_DIR */
124#define WM8903_GP3_DIR_MASK 0x0080 /* GP3_DIR */
125#define WM8903_GP3_DIR_SHIFT 7 /* GP3_DIR */
126#define WM8903_GP3_DIR_WIDTH 1 /* GP3_DIR */
127#define WM8903_GP3_OP_CFG 0x0040 /* GP3_OP_CFG */
128#define WM8903_GP3_OP_CFG_MASK 0x0040 /* GP3_OP_CFG */
129#define WM8903_GP3_OP_CFG_SHIFT 6 /* GP3_OP_CFG */
130#define WM8903_GP3_OP_CFG_WIDTH 1 /* GP3_OP_CFG */
131#define WM8903_GP3_IP_CFG 0x0020 /* GP3_IP_CFG */
132#define WM8903_GP3_IP_CFG_MASK 0x0020 /* GP3_IP_CFG */
133#define WM8903_GP3_IP_CFG_SHIFT 5 /* GP3_IP_CFG */
134#define WM8903_GP3_IP_CFG_WIDTH 1 /* GP3_IP_CFG */
135#define WM8903_GP3_LVL 0x0010 /* GP3_LVL */
136#define WM8903_GP3_LVL_MASK 0x0010 /* GP3_LVL */
137#define WM8903_GP3_LVL_SHIFT 4 /* GP3_LVL */
138#define WM8903_GP3_LVL_WIDTH 1 /* GP3_LVL */
139#define WM8903_GP3_PD 0x0008 /* GP3_PD */
140#define WM8903_GP3_PD_MASK 0x0008 /* GP3_PD */
141#define WM8903_GP3_PD_SHIFT 3 /* GP3_PD */
142#define WM8903_GP3_PD_WIDTH 1 /* GP3_PD */
143#define WM8903_GP3_PU 0x0004 /* GP3_PU */
144#define WM8903_GP3_PU_MASK 0x0004 /* GP3_PU */
145#define WM8903_GP3_PU_SHIFT 2 /* GP3_PU */
146#define WM8903_GP3_PU_WIDTH 1 /* GP3_PU */
147#define WM8903_GP3_INTMODE 0x0002 /* GP3_INTMODE */
148#define WM8903_GP3_INTMODE_MASK 0x0002 /* GP3_INTMODE */
149#define WM8903_GP3_INTMODE_SHIFT 1 /* GP3_INTMODE */
150#define WM8903_GP3_INTMODE_WIDTH 1 /* GP3_INTMODE */
151#define WM8903_GP3_DB 0x0001 /* GP3_DB */
152#define WM8903_GP3_DB_MASK 0x0001 /* GP3_DB */
153#define WM8903_GP3_DB_SHIFT 0 /* GP3_DB */
154#define WM8903_GP3_DB_WIDTH 1 /* GP3_DB */
155
156/*
157 * R119 (0x77) - GPIO Control 4
158 */
159#define WM8903_GP4_FN_MASK 0x1F00 /* GP4_FN - [12:8] */
160#define WM8903_GP4_FN_SHIFT 8 /* GP4_FN - [12:8] */
161#define WM8903_GP4_FN_WIDTH 5 /* GP4_FN - [12:8] */
162#define WM8903_GP4_DIR 0x0080 /* GP4_DIR */
163#define WM8903_GP4_DIR_MASK 0x0080 /* GP4_DIR */
164#define WM8903_GP4_DIR_SHIFT 7 /* GP4_DIR */
165#define WM8903_GP4_DIR_WIDTH 1 /* GP4_DIR */
166#define WM8903_GP4_OP_CFG 0x0040 /* GP4_OP_CFG */
167#define WM8903_GP4_OP_CFG_MASK 0x0040 /* GP4_OP_CFG */
168#define WM8903_GP4_OP_CFG_SHIFT 6 /* GP4_OP_CFG */
169#define WM8903_GP4_OP_CFG_WIDTH 1 /* GP4_OP_CFG */
170#define WM8903_GP4_IP_CFG 0x0020 /* GP4_IP_CFG */
171#define WM8903_GP4_IP_CFG_MASK 0x0020 /* GP4_IP_CFG */
172#define WM8903_GP4_IP_CFG_SHIFT 5 /* GP4_IP_CFG */
173#define WM8903_GP4_IP_CFG_WIDTH 1 /* GP4_IP_CFG */
174#define WM8903_GP4_LVL 0x0010 /* GP4_LVL */
175#define WM8903_GP4_LVL_MASK 0x0010 /* GP4_LVL */
176#define WM8903_GP4_LVL_SHIFT 4 /* GP4_LVL */
177#define WM8903_GP4_LVL_WIDTH 1 /* GP4_LVL */
178#define WM8903_GP4_PD 0x0008 /* GP4_PD */
179#define WM8903_GP4_PD_MASK 0x0008 /* GP4_PD */
180#define WM8903_GP4_PD_SHIFT 3 /* GP4_PD */
181#define WM8903_GP4_PD_WIDTH 1 /* GP4_PD */
182#define WM8903_GP4_PU 0x0004 /* GP4_PU */
183#define WM8903_GP4_PU_MASK 0x0004 /* GP4_PU */
184#define WM8903_GP4_PU_SHIFT 2 /* GP4_PU */
185#define WM8903_GP4_PU_WIDTH 1 /* GP4_PU */
186#define WM8903_GP4_INTMODE 0x0002 /* GP4_INTMODE */
187#define WM8903_GP4_INTMODE_MASK 0x0002 /* GP4_INTMODE */
188#define WM8903_GP4_INTMODE_SHIFT 1 /* GP4_INTMODE */
189#define WM8903_GP4_INTMODE_WIDTH 1 /* GP4_INTMODE */
190#define WM8903_GP4_DB 0x0001 /* GP4_DB */
191#define WM8903_GP4_DB_MASK 0x0001 /* GP4_DB */
192#define WM8903_GP4_DB_SHIFT 0 /* GP4_DB */
193#define WM8903_GP4_DB_WIDTH 1 /* GP4_DB */
194
195/*
196 * R120 (0x78) - GPIO Control 5
197 */
198#define WM8903_GP5_FN_MASK 0x1F00 /* GP5_FN - [12:8] */
199#define WM8903_GP5_FN_SHIFT 8 /* GP5_FN - [12:8] */
200#define WM8903_GP5_FN_WIDTH 5 /* GP5_FN - [12:8] */
201#define WM8903_GP5_DIR 0x0080 /* GP5_DIR */
202#define WM8903_GP5_DIR_MASK 0x0080 /* GP5_DIR */
203#define WM8903_GP5_DIR_SHIFT 7 /* GP5_DIR */
204#define WM8903_GP5_DIR_WIDTH 1 /* GP5_DIR */
205#define WM8903_GP5_OP_CFG 0x0040 /* GP5_OP_CFG */
206#define WM8903_GP5_OP_CFG_MASK 0x0040 /* GP5_OP_CFG */
207#define WM8903_GP5_OP_CFG_SHIFT 6 /* GP5_OP_CFG */
208#define WM8903_GP5_OP_CFG_WIDTH 1 /* GP5_OP_CFG */
209#define WM8903_GP5_IP_CFG 0x0020 /* GP5_IP_CFG */
210#define WM8903_GP5_IP_CFG_MASK 0x0020 /* GP5_IP_CFG */
211#define WM8903_GP5_IP_CFG_SHIFT 5 /* GP5_IP_CFG */
212#define WM8903_GP5_IP_CFG_WIDTH 1 /* GP5_IP_CFG */
213#define WM8903_GP5_LVL 0x0010 /* GP5_LVL */
214#define WM8903_GP5_LVL_MASK 0x0010 /* GP5_LVL */
215#define WM8903_GP5_LVL_SHIFT 4 /* GP5_LVL */
216#define WM8903_GP5_LVL_WIDTH 1 /* GP5_LVL */
217#define WM8903_GP5_PD 0x0008 /* GP5_PD */
218#define WM8903_GP5_PD_MASK 0x0008 /* GP5_PD */
219#define WM8903_GP5_PD_SHIFT 3 /* GP5_PD */
220#define WM8903_GP5_PD_WIDTH 1 /* GP5_PD */
221#define WM8903_GP5_PU 0x0004 /* GP5_PU */
222#define WM8903_GP5_PU_MASK 0x0004 /* GP5_PU */
223#define WM8903_GP5_PU_SHIFT 2 /* GP5_PU */
224#define WM8903_GP5_PU_WIDTH 1 /* GP5_PU */
225#define WM8903_GP5_INTMODE 0x0002 /* GP5_INTMODE */
226#define WM8903_GP5_INTMODE_MASK 0x0002 /* GP5_INTMODE */
227#define WM8903_GP5_INTMODE_SHIFT 1 /* GP5_INTMODE */
228#define WM8903_GP5_INTMODE_WIDTH 1 /* GP5_INTMODE */
229#define WM8903_GP5_DB 0x0001 /* GP5_DB */
230#define WM8903_GP5_DB_MASK 0x0001 /* GP5_DB */
231#define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */
232#define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */
233
234struct wm8903_platform_data {
235 bool irq_active_low; /* Set if IRQ active low, default high */
236
237 /* Default register value for R6 (Mic bias), used to configure
238 * microphone detection. In conjunction with gpio_cfg this
239 * can be used to route the microphone status signals out onto
240 * the GPIOs for use with snd_soc_jack_add_gpios().
241 */
242 u16 micdet_cfg;
243
244 int micdet_delay; /* Delay after microphone detection (ms) */
245
246 u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */
247};
248
249#endif
diff --git a/include/sound/wm8904.h b/include/sound/wm8904.h
index d66575a601be..898be3a8db9a 100644
--- a/include/sound/wm8904.h
+++ b/include/sound/wm8904.h
@@ -15,8 +15,111 @@
15#ifndef __MFD_WM8994_PDATA_H__ 15#ifndef __MFD_WM8994_PDATA_H__
16#define __MFD_WM8994_PDATA_H__ 16#define __MFD_WM8994_PDATA_H__
17 17
18#define WM8904_DRC_REGS 4 18/* Used to enable configuration of a GPIO to all zeros */
19#define WM8904_EQ_REGS 25 19#define WM8904_GPIO_NO_CONFIG 0x8000
20
21/*
22 * R6 (0x06) - Mic Bias Control 0
23 */
24#define WM8904_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */
25#define WM8904_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */
26#define WM8904_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */
27#define WM8904_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */
28#define WM8904_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */
29#define WM8904_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */
30#define WM8904_MICDET_ENA 0x0002 /* MICDET_ENA */
31#define WM8904_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */
32#define WM8904_MICDET_ENA_SHIFT 1 /* MICDET_ENA */
33#define WM8904_MICDET_ENA_WIDTH 1 /* MICDET_ENA */
34#define WM8904_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */
35#define WM8904_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */
36#define WM8904_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */
37#define WM8904_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */
38
39/*
40 * R7 (0x07) - Mic Bias Control 1
41 */
42#define WM8904_MIC_DET_FILTER_ENA 0x8000 /* MIC_DET_FILTER_ENA */
43#define WM8904_MIC_DET_FILTER_ENA_MASK 0x8000 /* MIC_DET_FILTER_ENA */
44#define WM8904_MIC_DET_FILTER_ENA_SHIFT 15 /* MIC_DET_FILTER_ENA */
45#define WM8904_MIC_DET_FILTER_ENA_WIDTH 1 /* MIC_DET_FILTER_ENA */
46#define WM8904_MIC_SHORT_FILTER_ENA 0x4000 /* MIC_SHORT_FILTER_ENA */
47#define WM8904_MIC_SHORT_FILTER_ENA_MASK 0x4000 /* MIC_SHORT_FILTER_ENA */
48#define WM8904_MIC_SHORT_FILTER_ENA_SHIFT 14 /* MIC_SHORT_FILTER_ENA */
49#define WM8904_MIC_SHORT_FILTER_ENA_WIDTH 1 /* MIC_SHORT_FILTER_ENA */
50#define WM8904_MICBIAS_SEL_MASK 0x0007 /* MICBIAS_SEL - [2:0] */
51#define WM8904_MICBIAS_SEL_SHIFT 0 /* MICBIAS_SEL - [2:0] */
52#define WM8904_MICBIAS_SEL_WIDTH 3 /* MICBIAS_SEL - [2:0] */
53
54
55/*
56 * R121 (0x79) - GPIO Control 1
57 */
58#define WM8904_GPIO1_PU 0x0020 /* GPIO1_PU */
59#define WM8904_GPIO1_PU_MASK 0x0020 /* GPIO1_PU */
60#define WM8904_GPIO1_PU_SHIFT 5 /* GPIO1_PU */
61#define WM8904_GPIO1_PU_WIDTH 1 /* GPIO1_PU */
62#define WM8904_GPIO1_PD 0x0010 /* GPIO1_PD */
63#define WM8904_GPIO1_PD_MASK 0x0010 /* GPIO1_PD */
64#define WM8904_GPIO1_PD_SHIFT 4 /* GPIO1_PD */
65#define WM8904_GPIO1_PD_WIDTH 1 /* GPIO1_PD */
66#define WM8904_GPIO1_SEL_MASK 0x000F /* GPIO1_SEL - [3:0] */
67#define WM8904_GPIO1_SEL_SHIFT 0 /* GPIO1_SEL - [3:0] */
68#define WM8904_GPIO1_SEL_WIDTH 4 /* GPIO1_SEL - [3:0] */
69
70/*
71 * R122 (0x7A) - GPIO Control 2
72 */
73#define WM8904_GPIO2_PU 0x0020 /* GPIO2_PU */
74#define WM8904_GPIO2_PU_MASK 0x0020 /* GPIO2_PU */
75#define WM8904_GPIO2_PU_SHIFT 5 /* GPIO2_PU */
76#define WM8904_GPIO2_PU_WIDTH 1 /* GPIO2_PU */
77#define WM8904_GPIO2_PD 0x0010 /* GPIO2_PD */
78#define WM8904_GPIO2_PD_MASK 0x0010 /* GPIO2_PD */
79#define WM8904_GPIO2_PD_SHIFT 4 /* GPIO2_PD */
80#define WM8904_GPIO2_PD_WIDTH 1 /* GPIO2_PD */
81#define WM8904_GPIO2_SEL_MASK 0x000F /* GPIO2_SEL - [3:0] */
82#define WM8904_GPIO2_SEL_SHIFT 0 /* GPIO2_SEL - [3:0] */
83#define WM8904_GPIO2_SEL_WIDTH 4 /* GPIO2_SEL - [3:0] */
84
85/*
86 * R123 (0x7B) - GPIO Control 3
87 */
88#define WM8904_GPIO3_PU 0x0020 /* GPIO3_PU */
89#define WM8904_GPIO3_PU_MASK 0x0020 /* GPIO3_PU */
90#define WM8904_GPIO3_PU_SHIFT 5 /* GPIO3_PU */
91#define WM8904_GPIO3_PU_WIDTH 1 /* GPIO3_PU */
92#define WM8904_GPIO3_PD 0x0010 /* GPIO3_PD */
93#define WM8904_GPIO3_PD_MASK 0x0010 /* GPIO3_PD */
94#define WM8904_GPIO3_PD_SHIFT 4 /* GPIO3_PD */
95#define WM8904_GPIO3_PD_WIDTH 1 /* GPIO3_PD */
96#define WM8904_GPIO3_SEL_MASK 0x000F /* GPIO3_SEL - [3:0] */
97#define WM8904_GPIO3_SEL_SHIFT 0 /* GPIO3_SEL - [3:0] */
98#define WM8904_GPIO3_SEL_WIDTH 4 /* GPIO3_SEL - [3:0] */
99
100/*
101 * R124 (0x7C) - GPIO Control 4
102 */
103#define WM8904_GPI7_ENA 0x0200 /* GPI7_ENA */
104#define WM8904_GPI7_ENA_MASK 0x0200 /* GPI7_ENA */
105#define WM8904_GPI7_ENA_SHIFT 9 /* GPI7_ENA */
106#define WM8904_GPI7_ENA_WIDTH 1 /* GPI7_ENA */
107#define WM8904_GPI8_ENA 0x0100 /* GPI8_ENA */
108#define WM8904_GPI8_ENA_MASK 0x0100 /* GPI8_ENA */
109#define WM8904_GPI8_ENA_SHIFT 8 /* GPI8_ENA */
110#define WM8904_GPI8_ENA_WIDTH 1 /* GPI8_ENA */
111#define WM8904_GPIO_BCLK_MODE_ENA 0x0080 /* GPIO_BCLK_MODE_ENA */
112#define WM8904_GPIO_BCLK_MODE_ENA_MASK 0x0080 /* GPIO_BCLK_MODE_ENA */
113#define WM8904_GPIO_BCLK_MODE_ENA_SHIFT 7 /* GPIO_BCLK_MODE_ENA */
114#define WM8904_GPIO_BCLK_MODE_ENA_WIDTH 1 /* GPIO_BCLK_MODE_ENA */
115#define WM8904_GPIO_BCLK_SEL_MASK 0x000F /* GPIO_BCLK_SEL - [3:0] */
116#define WM8904_GPIO_BCLK_SEL_SHIFT 0 /* GPIO_BCLK_SEL - [3:0] */
117#define WM8904_GPIO_BCLK_SEL_WIDTH 4 /* GPIO_BCLK_SEL - [3:0] */
118
119#define WM8904_MIC_REGS 2
120#define WM8904_GPIO_REGS 4
121#define WM8904_DRC_REGS 4
122#define WM8904_EQ_REGS 25
20 123
21/** 124/**
22 * DRC configurations are specified with a label and a set of register 125 * DRC configurations are specified with a label and a set of register
@@ -52,6 +155,9 @@ struct wm8904_pdata {
52 155
53 int num_retune_mobile_cfgs; 156 int num_retune_mobile_cfgs;
54 struct wm8904_retune_mobile_cfg *retune_mobile_cfgs; 157 struct wm8904_retune_mobile_cfg *retune_mobile_cfgs;
158
159 u32 gpio_cfg[WM8904_GPIO_REGS];
160 u32 mic_cfg[WM8904_MIC_REGS];
55}; 161};
56 162
57#endif 163#endif
diff --git a/include/sound/wm8960.h b/include/sound/wm8960.h
new file mode 100644
index 000000000000..74e9a95529c5
--- /dev/null
+++ b/include/sound/wm8960.h
@@ -0,0 +1,24 @@
1/*
2 * wm8960.h -- WM8960 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 _WM8960_PDATA_H
10#define _WM8960_PDATA_H
11
12#define WM8960_DRES_400R 0
13#define WM8960_DRES_200R 1
14#define WM8960_DRES_600R 2
15#define WM8960_DRES_150R 3
16#define WM8960_DRES_MAX 3
17
18struct wm8960_data {
19 bool capless; /* Headphone outputs configured in capless mode */
20
21 int dres; /* Discharge resistance for headphone outputs */
22};
23
24#endif
diff --git a/include/sound/wm9090.h b/include/sound/wm9090.h
new file mode 100644
index 000000000000..3718928cde1a
--- /dev/null
+++ b/include/sound/wm9090.h
@@ -0,0 +1,28 @@
1/*
2 * linux/sound/wm9090.h -- Platform data for WM9090
3 *
4 * Copyright 2009, 2010 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_WM9090_H
12#define __LINUX_SND_WM9090_H
13
14struct wm9090_platform_data {
15 /* Line inputs 1 & 2 can optionally be differential */
16 unsigned int lin1_diff:1;
17 unsigned int lin2_diff:1;
18
19 /* AGC configuration. This is intended to protect the speaker
20 * against overdriving and will therefore depend on the
21 * hardware setup with incorrect runtime configuration
22 * potentially causing hardware damage.
23 */
24 unsigned int agc_ena:1;
25 u16 agc[3];
26};
27
28#endif