aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 16:00:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 16:00:13 -0400
commitb2094ef840697bc8ca5d17a83b7e30fad5f1e9fa (patch)
tree64e5f7253b6a85b6d5d36f95c0d3c67c1798918d /include
parent424a6f6ef990b7e9f56f6627bfc6c46b493faeb4 (diff)
parent6681bc0deba495fad0d6fb349e40524abd1b1732 (diff)
Merge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull updates of sound stuff from Takashi Iwai: "Here is the first big update chunk of sound stuff for 3.4-rc1. In the common sound infrastructure, there are a few changes for dynamic PCM support (used in ASoC) and a few clean-ups. Majority of changes are found, as usual, in HD-audio and ASoC. Some highlights of HD-audio changes: - All the long-standing static quirk codes for Realtek codec were finally removed by fixing and extending the Realtek auto-parser. - The mute-LED control is standardized over all HD-audio codec drivers using the extended vmaster hook. - The vmaster slave mixer elements are initialized to 0dB as default so that the user won't be annoyed by the silent output after updates, e.g. due to the additions of new elements. - Other many fix-ups for the misc HD-audio devices. In the ASoC side, this is a very active release, including a quite a few framework enhancements. Some highlights: - Support for widgets not associated with a CODEC, an important part of the dynamic PCM framework. - A library factoring out the common code shared by dmaengine based DMA drivers contributed by Lars-Peter Clausen. This will save a lot of code and make it much easier to deploy enhancements to dmaengine. - Support for binary controls, used for providing runtime configuration of algorithm coefficients. - A new DAPM widget type for regulator supplies allowing drivers for devices that can power down unused supplies while active to do without any per-driver code. - DAPM widgets for DAIs, initially giving a speed boost for playback startup and shutdown and also the basis for CODEC<->CODEC DAI link support. - Support for specifying the number of significant bits on audio interfaces, useful for allowing applications to know how much effort to put into generating data for a larger sample format. - Conversion of the FSI driver used on some SH processors to DMAEngine. - Conversion of EP93xx drivers to DMAEngine. - New CODEC drivers for Maxim MAX9768 and Wolfson Microelectronics WM2200. - Move audmux driver from arc/arm to sound/soc - McBSP move from arch/ to sound/ and updates Also, a few small updates and fixes for other drivers like au88x0, ymfpci, USB 6fire, USB usx2yaudio are included." * tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (446 commits) ASoC: wm8994: Provide VMID mode control and fix default sequence ASoC: wm8994: Add missing break in resume ASoC: wm_hubs: Don't actively manage LINEOUT_VMID_BUF ASoC: pxa-ssp: atomically set stream active masks ASoC: fsl: p1022ds: tell the WM8776 codec driver that it's the master ASoC: Samsung: Added to support mono recording ALSA: hda - Fix build with CONFIG_PM=n ALSA: au88x0 - Avoid possible Oops at unbinding ALSA: usb-audio - Fix build error by consitification of rate list ASoC: core: Fix obscure leak of runtime array ALSA: pcm - Avoid GFP_ATOMIC in snd_pcm_link() ALSA: pcm: Constify the list in snd_pcm_hw_constraint_list ASoC: wm8996: Add 44.1kHz support ALSA: hda - Fix build of patch_sigmatel.c without CONFIG_SND_HDA_POWER_SAVE ASoC: mx27vis-aic32x4: Convert it to platform driver ALSA: hda - fix printing of high HDMI sample rates ALSA: ymfpci - Fix legacy registers on S3/S4 resume ALSA: control - Fixe a trailing white space error ALSA: hda - Add expose_enum_ctl flag to snd_hda_add_vmaster_hook() ALSA: hda - Add "Mute-LED Mode" enum control ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/wm8994/pdata.h3
-rw-r--r--include/linux/platform_data/omap-abe-twl6040.h49
-rw-r--r--include/linux/regmap.h4
-rw-r--r--include/sound/control.h7
-rw-r--r--include/sound/dmaengine_pcm.h49
-rw-r--r--include/sound/jack.h3
-rw-r--r--include/sound/max9768.h24
-rw-r--r--include/sound/pcm.h9
-rw-r--r--include/sound/sh_fsi.h12
-rw-r--r--include/sound/soc-dai.h11
-rw-r--r--include/sound/soc-dapm.h33
-rw-r--r--include/sound/soc.h45
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/wm2200.h41
-rw-r--r--include/sound/wm8962.h6
-rw-r--r--include/sound/ymfpci.h2
16 files changed, 279 insertions, 21 deletions
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 3fb1f407d5e6..dc3e05011689 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -185,6 +185,9 @@ struct wm8994_pdata {
185 unsigned int jd_scthr:2; 185 unsigned int jd_scthr:2;
186 unsigned int jd_thr:2; 186 unsigned int jd_thr:2;
187 187
188 /* Configure WM1811 jack detection for use with external capacitor */
189 unsigned int jd_ext_cap:1;
190
188 /* WM8958 microphone bias configuration */ 191 /* WM8958 microphone bias configuration */
189 int micbias[2]; 192 int micbias[2];
190 193
diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h
new file mode 100644
index 000000000000..5d298ac10fc2
--- /dev/null
+++ b/include/linux/platform_data/omap-abe-twl6040.h
@@ -0,0 +1,49 @@
1/**
2 * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
3 *
4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
5 * All rights reserved.
6 *
7 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24#ifndef _OMAP_ABE_TWL6040_H_
25#define _OMAP_ABE_TWL6040_H_
26
27/* To select if only one channel is connected in a stereo port */
28#define ABE_TWL6040_LEFT (1 << 0)
29#define ABE_TWL6040_RIGHT (1 << 1)
30
31struct omap_abe_twl6040_data {
32 char *card_name;
33 /* Feature flags for connected audio pins */
34 u8 has_hs;
35 u8 has_hf;
36 bool has_ep;
37 u8 has_aux;
38 u8 has_vibra;
39 bool has_dmic;
40 bool has_hsmic;
41 bool has_mainmic;
42 bool has_submic;
43 u8 has_afm;
44 /* Other features */
45 bool jack_detection; /* board can detect jack events */
46 int mclk_freq; /* MCLK frequency speed for twl6040 */
47};
48
49#endif /* _OMAP_ABE_TWL6040_H_ */
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index eb93921cdd30..c47898d47c8a 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -143,12 +143,16 @@ int regmap_update_bits(struct regmap *map, unsigned int reg,
143int regmap_update_bits_check(struct regmap *map, unsigned int reg, 143int regmap_update_bits_check(struct regmap *map, unsigned int reg,
144 unsigned int mask, unsigned int val, 144 unsigned int mask, unsigned int val,
145 bool *change); 145 bool *change);
146int regmap_get_val_bytes(struct regmap *map);
146 147
147int regcache_sync(struct regmap *map); 148int regcache_sync(struct regmap *map);
148void regcache_cache_only(struct regmap *map, bool enable); 149void regcache_cache_only(struct regmap *map, bool enable);
149void regcache_cache_bypass(struct regmap *map, bool enable); 150void regcache_cache_bypass(struct regmap *map, bool enable);
150void regcache_mark_dirty(struct regmap *map); 151void regcache_mark_dirty(struct regmap *map);
151 152
153int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
154 int num_regs);
155
152/** 156/**
153 * Description of an IRQ for the generic regmap irq_chip. 157 * Description of an IRQ for the generic regmap irq_chip.
154 * 158 *
diff --git a/include/sound/control.h b/include/sound/control.h
index b2796e83c7ac..8332e865c759 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -40,7 +40,7 @@ struct snd_kcontrol_new {
40 snd_ctl_elem_iface_t iface; /* interface identifier */ 40 snd_ctl_elem_iface_t iface; /* interface identifier */
41 unsigned int device; /* device/client number */ 41 unsigned int device; /* device/client number */
42 unsigned int subdevice; /* subdevice (substream) number */ 42 unsigned int subdevice; /* subdevice (substream) number */
43 unsigned char *name; /* ASCII name of item */ 43 const unsigned char *name; /* ASCII name of item */
44 unsigned int index; /* index of item */ 44 unsigned int index; /* index of item */
45 unsigned int access; /* access rights */ 45 unsigned int access; /* access rights */
46 unsigned int count; /* count of same elements */ 46 unsigned int count; /* count of same elements */
@@ -227,6 +227,11 @@ snd_ctl_add_slave_uncached(struct snd_kcontrol *master,
227 return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE); 227 return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE);
228} 228}
229 229
230int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kctl,
231 void (*hook)(void *private_data, int),
232 void *private_data);
233void snd_ctl_sync_vmaster_hook(struct snd_kcontrol *kctl);
234
230/* 235/*
231 * Helper functions for jack-detection controls 236 * Helper functions for jack-detection controls
232 */ 237 */
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
new file mode 100644
index 000000000000..a8fcaa6d531f
--- /dev/null
+++ b/include/sound/dmaengine_pcm.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2012, Analog Devices Inc.
3 * Author: Lars-Peter Clausen <lars@metafoo.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * You should have received a copy of the GNU General Public License along
11 * with this program; if not, write to the Free Software Foundation, Inc.,
12 * 675 Mass Ave, Cambridge, MA 02139, USA.
13 *
14 */
15#ifndef __SOUND_DMAENGINE_PCM_H__
16#define __SOUND_DMAENGINE_PCM_H__
17
18#include <sound/pcm.h>
19#include <linux/dmaengine.h>
20
21/**
22 * snd_pcm_substream_to_dma_direction - Get dma_transfer_direction for a PCM
23 * substream
24 * @substream: PCM substream
25 */
26static inline enum dma_transfer_direction
27snd_pcm_substream_to_dma_direction(const struct snd_pcm_substream *substream)
28{
29 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
30 return DMA_MEM_TO_DEV;
31 else
32 return DMA_DEV_TO_MEM;
33}
34
35void snd_dmaengine_pcm_set_data(struct snd_pcm_substream *substream, void *data);
36void *snd_dmaengine_pcm_get_data(struct snd_pcm_substream *substream);
37
38int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream,
39 const struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config);
40int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
41snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream);
42
43int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
44 dma_filter_fn filter_fn, void *filter_data);
45int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
46
47struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream);
48
49#endif
diff --git a/include/sound/jack.h b/include/sound/jack.h
index 63c790742db4..58916573db58 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -53,6 +53,9 @@ enum snd_jack_types {
53 SND_JACK_BTN_5 = 0x0200, 53 SND_JACK_BTN_5 = 0x0200,
54}; 54};
55 55
56/* Keep in sync with definitions above */
57#define SND_JACK_SWITCH_TYPES 6
58
56struct snd_jack { 59struct snd_jack {
57 struct input_dev *input_dev; 60 struct input_dev *input_dev;
58 int registered; 61 int registered;
diff --git a/include/sound/max9768.h b/include/sound/max9768.h
new file mode 100644
index 000000000000..0f78b41d030e
--- /dev/null
+++ b/include/sound/max9768.h
@@ -0,0 +1,24 @@
1/*
2 * Platform data for MAX9768
3 * Copyright (C) 2011, 2012 by Wolfram Sang, Pengutronix e.K.
4 * same licence as the driver
5 */
6
7#ifndef __SOUND_MAX9768_PDATA_H__
8#define __SOUND_MAX9768_PDATA_H__
9
10/**
11 * struct max9768_pdata - optional platform specific MAX9768 configuration
12 * @shdn_gpio: GPIO to SHDN pin. If not valid, pin must be hardwired HIGH
13 * @mute_gpio: GPIO to MUTE pin. If not valid, control for mute won't be added
14 * @flags: configuration flags, e.g. set classic PWM mode (check datasheet
15 * regarding "filterless modulation" which is default).
16 */
17struct max9768_pdata {
18 int shdn_gpio;
19 int mute_gpio;
20 unsigned flags;
21#define MAX9768_FLAG_CLASSIC_PWM (1 << 0)
22};
23
24#endif /* __SOUND_MAX9768_PDATA_H__*/
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 0cf91b2f08ca..0d1112815be3 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -264,7 +264,7 @@ struct snd_pcm_hw_constraint_ratdens {
264 264
265struct snd_pcm_hw_constraint_list { 265struct snd_pcm_hw_constraint_list {
266 unsigned int count; 266 unsigned int count;
267 unsigned int *list; 267 const unsigned int *list;
268 unsigned int mask; 268 unsigned int mask;
269}; 269};
270 270
@@ -454,6 +454,7 @@ struct snd_pcm {
454 void *private_data; 454 void *private_data;
455 void (*private_free) (struct snd_pcm *pcm); 455 void (*private_free) (struct snd_pcm *pcm);
456 struct device *dev; /* actual hw device this belongs to */ 456 struct device *dev; /* actual hw device this belongs to */
457 bool internal; /* pcm is for internal use only */
457#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 458#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
458 struct snd_pcm_oss oss; 459 struct snd_pcm_oss oss;
459#endif 460#endif
@@ -475,6 +476,9 @@ extern const struct file_operations snd_pcm_f_ops[2];
475int snd_pcm_new(struct snd_card *card, const char *id, int device, 476int snd_pcm_new(struct snd_card *card, const char *id, int device,
476 int playback_count, int capture_count, 477 int playback_count, int capture_count,
477 struct snd_pcm **rpcm); 478 struct snd_pcm **rpcm);
479int snd_pcm_new_internal(struct snd_card *card, const char *id, int device,
480 int playback_count, int capture_count,
481 struct snd_pcm **rpcm);
478int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count); 482int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count);
479 483
480int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree); 484int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree);
@@ -781,7 +785,8 @@ void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interva
781 unsigned int k, struct snd_interval *c); 785 unsigned int k, struct snd_interval *c);
782void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, 786void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
783 const struct snd_interval *b, struct snd_interval *c); 787 const struct snd_interval *b, struct snd_interval *c);
784int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask); 788int snd_interval_list(struct snd_interval *i, unsigned int count,
789 const unsigned int *list, unsigned int mask);
785int snd_interval_ratnum(struct snd_interval *i, 790int snd_interval_ratnum(struct snd_interval *i,
786 unsigned int rats_count, struct snd_ratnum *rats, 791 unsigned int rats_count, struct snd_ratnum *rats,
787 unsigned int *nump, unsigned int *denp); 792 unsigned int *nump, unsigned int *denp);
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index 9b1aacaa82fe..b457e87fbd08 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -72,10 +72,16 @@
72#define SH_FSI_BPFMD_32 (5 << 4) 72#define SH_FSI_BPFMD_32 (5 << 4)
73#define SH_FSI_BPFMD_16 (6 << 4) 73#define SH_FSI_BPFMD_16 (6 << 4)
74 74
75struct sh_fsi_port_info {
76 unsigned long flags;
77 int tx_id;
78 int rx_id;
79 int (*set_rate)(struct device *dev, int rate, int enable);
80};
81
75struct sh_fsi_platform_info { 82struct sh_fsi_platform_info {
76 unsigned long porta_flags; 83 struct sh_fsi_port_info port_a;
77 unsigned long portb_flags; 84 struct sh_fsi_port_info port_b;
78 int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
79}; 85};
80 86
81/* 87/*
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 2413acc54883..c429f248cf4e 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -17,6 +17,7 @@
17#include <linux/list.h> 17#include <linux/list.h>
18 18
19struct snd_pcm_substream; 19struct snd_pcm_substream;
20struct snd_soc_dapm_widget;
20 21
21/* 22/*
22 * DAI hardware audio formats. 23 * DAI hardware audio formats.
@@ -238,6 +239,9 @@ struct snd_soc_dai {
238 unsigned char pop_wait:1; 239 unsigned char pop_wait:1;
239 unsigned char probed:1; 240 unsigned char probed:1;
240 241
242 struct snd_soc_dapm_widget *playback_widget;
243 struct snd_soc_dapm_widget *capture_widget;
244
241 /* DAI DMA data */ 245 /* DAI DMA data */
242 void *playback_dma_data; 246 void *playback_dma_data;
243 void *capture_dma_data; 247 void *capture_dma_data;
@@ -246,10 +250,9 @@ struct snd_soc_dai {
246 unsigned int rate; 250 unsigned int rate;
247 251
248 /* parent platform/codec */ 252 /* parent platform/codec */
249 union { 253 struct snd_soc_platform *platform;
250 struct snd_soc_platform *platform; 254 struct snd_soc_codec *codec;
251 struct snd_soc_codec *codec; 255
252 };
253 struct snd_soc_card *card; 256 struct snd_soc_card *card;
254 257
255 struct list_head list; 258 struct list_head list;
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index d26a9b784772..e46107fffeb4 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -243,6 +243,10 @@
243{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 243{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \
244 .shift = wshift, .invert = winvert, .event = wevent, \ 244 .shift = wshift, .invert = winvert, .event = wevent, \
245 .event_flags = wflags} 245 .event_flags = wflags}
246#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay) \
247{ .id = snd_soc_dapm_regulator_supply, .name = wname, \
248 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \
249 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD }
246 250
247/* dapm kcontrol types */ 251/* dapm kcontrol types */
248#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ 252#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \
@@ -322,6 +326,8 @@ struct snd_soc_dapm_context;
322 326
323int dapm_reg_event(struct snd_soc_dapm_widget *w, 327int dapm_reg_event(struct snd_soc_dapm_widget *w,
324 struct snd_kcontrol *kcontrol, int event); 328 struct snd_kcontrol *kcontrol, int event);
329int dapm_regulator_event(struct snd_soc_dapm_widget *w,
330 struct snd_kcontrol *kcontrol, int event);
325 331
326/* dapm controls */ 332/* dapm controls */
327int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, 333int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
@@ -346,11 +352,12 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
346 struct snd_ctl_elem_value *uncontrol); 352 struct snd_ctl_elem_value *uncontrol);
347int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, 353int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
348 struct snd_ctl_elem_value *uncontrol); 354 struct snd_ctl_elem_value *uncontrol);
349int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
350 const struct snd_soc_dapm_widget *widget);
351int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, 355int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
352 const struct snd_soc_dapm_widget *widget, 356 const struct snd_soc_dapm_widget *widget,
353 int num); 357 int num);
358int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
359 struct snd_soc_dai *dai);
360int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
354 361
355/* dapm path setup */ 362/* dapm path setup */
356int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); 363int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
@@ -361,10 +368,16 @@ int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
361 const struct snd_soc_dapm_route *route, int num); 368 const struct snd_soc_dapm_route *route, int num);
362 369
363/* dapm events */ 370/* dapm events */
364int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, 371int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
365 const char *stream, int event); 372 struct snd_soc_dai *dai, int event);
366void snd_soc_dapm_shutdown(struct snd_soc_card *card); 373void snd_soc_dapm_shutdown(struct snd_soc_card *card);
367 374
375/* external DAPM widget events */
376int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
377 struct snd_kcontrol *kcontrol, int connect);
378int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
379 struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e);
380
368/* dapm sys fs - used by the core */ 381/* dapm sys fs - used by the core */
369int snd_soc_dapm_sys_add(struct device *dev); 382int snd_soc_dapm_sys_add(struct device *dev);
370void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, 383void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
@@ -411,9 +424,11 @@ enum snd_soc_dapm_type {
411 snd_soc_dapm_pre, /* machine specific pre widget - exec first */ 424 snd_soc_dapm_pre, /* machine specific pre widget - exec first */
412 snd_soc_dapm_post, /* machine specific post widget - exec last */ 425 snd_soc_dapm_post, /* machine specific post widget - exec last */
413 snd_soc_dapm_supply, /* power/clock supply */ 426 snd_soc_dapm_supply, /* power/clock supply */
427 snd_soc_dapm_regulator_supply, /* external regulator */
414 snd_soc_dapm_aif_in, /* audio interface input */ 428 snd_soc_dapm_aif_in, /* audio interface input */
415 snd_soc_dapm_aif_out, /* audio interface output */ 429 snd_soc_dapm_aif_out, /* audio interface output */
416 snd_soc_dapm_siggen, /* signal generator */ 430 snd_soc_dapm_siggen, /* signal generator */
431 snd_soc_dapm_dai, /* link to DAI structure */
417}; 432};
418 433
419/* 434/*
@@ -434,8 +449,8 @@ struct snd_soc_dapm_route {
434 449
435/* dapm audio path between two widgets */ 450/* dapm audio path between two widgets */
436struct snd_soc_dapm_path { 451struct snd_soc_dapm_path {
437 char *name; 452 const char *name;
438 char *long_name; 453 const char *long_name;
439 454
440 /* source (input) and sink (output) widgets */ 455 /* source (input) and sink (output) widgets */
441 struct snd_soc_dapm_widget *source; 456 struct snd_soc_dapm_widget *source;
@@ -458,13 +473,15 @@ struct snd_soc_dapm_path {
458/* dapm widget */ 473/* dapm widget */
459struct snd_soc_dapm_widget { 474struct snd_soc_dapm_widget {
460 enum snd_soc_dapm_type id; 475 enum snd_soc_dapm_type id;
461 char *name; /* widget name */ 476 const char *name; /* widget name */
462 char *sname; /* stream name */ 477 const char *sname; /* stream name */
463 struct snd_soc_codec *codec; 478 struct snd_soc_codec *codec;
464 struct snd_soc_platform *platform; 479 struct snd_soc_platform *platform;
465 struct list_head list; 480 struct list_head list;
466 struct snd_soc_dapm_context *dapm; 481 struct snd_soc_dapm_context *dapm;
467 482
483 void *priv; /* widget specific data */
484
468 /* dapm control */ 485 /* dapm control */
469 short reg; /* negative reg = no direct dapm */ 486 short reg; /* negative reg = no direct dapm */
470 unsigned char shift; /* bits to shift */ 487 unsigned char shift; /* bits to shift */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0992dff55959..2ebf7877c148 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -185,6 +185,20 @@
185 .rreg = xreg_right, .shift = xshift, \ 185 .rreg = xreg_right, .shift = xshift, \
186 .min = xmin, .max = xmax} } 186 .min = xmin, .max = xmax} }
187 187
188#define SND_SOC_BYTES(xname, xbase, xregs) \
189{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
190 .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
191 .put = snd_soc_bytes_put, .private_value = \
192 ((unsigned long)&(struct soc_bytes) \
193 {.base = xbase, .num_regs = xregs }) }
194
195#define SND_SOC_BYTES_MASK(xname, xbase, xregs, xmask) \
196{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
197 .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
198 .put = snd_soc_bytes_put, .private_value = \
199 ((unsigned long)&(struct soc_bytes) \
200 {.base = xbase, .num_regs = xregs, \
201 .mask = xmask }) }
188 202
189/* 203/*
190 * Simplified versions of above macros, declaring a struct and calculating 204 * Simplified versions of above macros, declaring a struct and calculating
@@ -366,12 +380,16 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
366 *Controls 380 *Controls
367 */ 381 */
368struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 382struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
369 void *data, char *long_name, 383 void *data, const char *long_name,
370 const char *prefix); 384 const char *prefix);
371int snd_soc_add_controls(struct snd_soc_codec *codec, 385int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
372 const struct snd_kcontrol_new *controls, int num_controls); 386 const struct snd_kcontrol_new *controls, int num_controls);
373int snd_soc_add_platform_controls(struct snd_soc_platform *platform, 387int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
374 const struct snd_kcontrol_new *controls, int num_controls); 388 const struct snd_kcontrol_new *controls, int num_controls);
389int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
390 const struct snd_kcontrol_new *controls, int num_controls);
391int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
392 const struct snd_kcontrol_new *controls, int num_controls);
375int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 393int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
376 struct snd_ctl_elem_info *uinfo); 394 struct snd_ctl_elem_info *uinfo);
377int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, 395int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
@@ -409,6 +427,13 @@ int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol,
409 struct snd_ctl_elem_value *ucontrol); 427 struct snd_ctl_elem_value *ucontrol);
410int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol, 428int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol,
411 struct snd_ctl_elem_value *ucontrol); 429 struct snd_ctl_elem_value *ucontrol);
430int snd_soc_bytes_info(struct snd_kcontrol *kcontrol,
431 struct snd_ctl_elem_info *uinfo);
432int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
433 struct snd_ctl_elem_value *ucontrol);
434int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
435 struct snd_ctl_elem_value *ucontrol);
436
412 437
413/** 438/**
414 * struct snd_soc_reg_access - Describes whether a given register is 439 * struct snd_soc_reg_access - Describes whether a given register is
@@ -505,6 +530,7 @@ struct snd_soc_pcm_stream {
505 unsigned int rate_max; /* max rate */ 530 unsigned int rate_max; /* max rate */
506 unsigned int channels_min; /* min channels */ 531 unsigned int channels_min; /* min channels */
507 unsigned int channels_max; /* max channels */ 532 unsigned int channels_max; /* max channels */
533 unsigned int sig_bits; /* number of bits of content */
508}; 534};
509 535
510/* SoC audio ops */ 536/* SoC audio ops */
@@ -559,6 +585,7 @@ struct snd_soc_codec {
559 unsigned int ac97_created:1; /* Codec has been created by SoC */ 585 unsigned int ac97_created:1; /* Codec has been created by SoC */
560 unsigned int sysfs_registered:1; /* codec has been sysfs registered */ 586 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
561 unsigned int cache_init:1; /* codec cache has been initialized */ 587 unsigned int cache_init:1; /* codec cache has been initialized */
588 unsigned int using_regmap:1; /* using regmap access */
562 u32 cache_only; /* Suppress writes to hardware */ 589 u32 cache_only; /* Suppress writes to hardware */
563 u32 cache_sync; /* Cache needs to be synced to hardware */ 590 u32 cache_sync; /* Cache needs to be synced to hardware */
564 591
@@ -637,6 +664,8 @@ struct snd_soc_codec_driver {
637 /* codec stream completion event */ 664 /* codec stream completion event */
638 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); 665 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
639 666
667 bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */
668
640 /* probe ordering - for components with runtime dependencies */ 669 /* probe ordering - for components with runtime dependencies */
641 int probe_order; 670 int probe_order;
642 int remove_order; 671 int remove_order;
@@ -689,6 +718,7 @@ struct snd_soc_platform {
689 int id; 718 int id;
690 struct device *dev; 719 struct device *dev;
691 struct snd_soc_platform_driver *driver; 720 struct snd_soc_platform_driver *driver;
721 struct mutex mutex;
692 722
693 unsigned int suspended:1; /* platform is suspended */ 723 unsigned int suspended:1; /* platform is suspended */
694 unsigned int probed:1; 724 unsigned int probed:1;
@@ -698,6 +728,11 @@ struct snd_soc_platform {
698 struct list_head card_list; 728 struct list_head card_list;
699 729
700 struct snd_soc_dapm_context dapm; 730 struct snd_soc_dapm_context dapm;
731
732#ifdef CONFIG_DEBUG_FS
733 struct dentry *debugfs_platform_root;
734 struct dentry *debugfs_dapm;
735#endif
701}; 736};
702 737
703struct snd_soc_dai_link { 738struct snd_soc_dai_link {
@@ -875,6 +910,12 @@ struct soc_mixer_control {
875 unsigned int reg, rreg, shift, rshift, invert; 910 unsigned int reg, rreg, shift, rshift, invert;
876}; 911};
877 912
913struct soc_bytes {
914 int base;
915 int num_regs;
916 u32 mask;
917};
918
878/* enumerated kcontrol */ 919/* enumerated kcontrol */
879struct soc_enum { 920struct soc_enum {
880 unsigned short reg; 921 unsigned short reg;
diff --git a/include/sound/version.h b/include/sound/version.h
index 8fc5321e1ecc..cc75024c1089 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.24" 2#define CONFIG_SND_VERSION "1.0.25"
3#define CONFIG_SND_DATE "" 3#define CONFIG_SND_DATE ""
diff --git a/include/sound/wm2200.h b/include/sound/wm2200.h
new file mode 100644
index 000000000000..79bf55be7ffa
--- /dev/null
+++ b/include/sound/wm2200.h
@@ -0,0 +1,41 @@
1/*
2 * linux/sound/wm2200.h -- Platform data for WM2200
3 *
4 * Copyright 2012 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_WM2200_H
12#define __LINUX_SND_WM2200_H
13
14#define WM2200_GPIO_SET 0x10000
15
16enum wm2200_in_mode {
17 WM2200_IN_SE = 0,
18 WM2200_IN_DIFF = 1,
19 WM2200_IN_DMIC = 2,
20};
21
22enum wm2200_dmic_sup {
23 WM2200_DMIC_SUP_MICVDD = 0,
24 WM2200_DMIC_SUP_MICBIAS1 = 1,
25 WM2200_DMIC_SUP_MICBIAS2 = 2,
26};
27
28struct wm2200_pdata {
29 int reset; /** GPIO controlling /RESET, if any */
30 int ldo_ena; /** GPIO controlling LODENA, if any */
31 int irq_flags;
32
33 int gpio_defaults[4];
34
35 enum wm2200_in_mode in_mode[3];
36 enum wm2200_dmic_sup dmic_sup[3];
37
38 int micbias_cfg[2]; /** Register value to configure MICBIAS */
39};
40
41#endif
diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h
index 1750bed7c2f6..79e6d427b858 100644
--- a/include/sound/wm8962.h
+++ b/include/sound/wm8962.h
@@ -49,6 +49,12 @@ struct wm8962_pdata {
49 bool irq_active_low; 49 bool irq_active_low;
50 50
51 bool spk_mono; /* Speaker outputs tied together as mono */ 51 bool spk_mono; /* Speaker outputs tied together as mono */
52
53 /**
54 * This flag should be set if one or both IN4 inputs is wired
55 * in a DC measurement configuration.
56 */
57 bool in4_dc_measure;
52}; 58};
53 59
54#endif 60#endif
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index 444cd6ba0ba7..41199664666b 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -366,6 +366,8 @@ struct snd_ymfpci {
366#ifdef CONFIG_PM 366#ifdef CONFIG_PM
367 u32 *saved_regs; 367 u32 *saved_regs;
368 u32 saved_ydsxgr_mode; 368 u32 saved_ydsxgr_mode;
369 u16 saved_dsxg_legacy;
370 u16 saved_dsxg_elegacy;
369#endif 371#endif
370}; 372};
371 373