aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 16:05:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 16:05:43 -0400
commit2e341ca686042aa464efa755447e7bcee91d1eb6 (patch)
treec6b16b6b6a6e871fa04396cb2c7eb759bcad5be3 /include
parent927ad551031798d4cba49766549600bbb33872d7 (diff)
parent85e184e4c3cd3e2285ceab91ff8f0cac094e8a85 (diff)
Merge tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "This is the first big chunk for 3.5 merges of sound stuff. There are a few big changes in different areas. First off, the streaming logic of USB-audio endpoints has been largely rewritten for the better support of "implicit feedback". If anything about USB got broken, this change has to be checked. For HD-audio, the resume procedure was changed; instead of delaying the resume of the hardware until the first use, now waking up immediately at resume. This is for buggy BIOS. For ASoC, dynamic PCM support and the improved support for digital links between off-SoC devices are major framework changes. Some highlights are below: * HD-audio - Avoid accesses of invalid pin-control bits that may stall the codec - V-ref setup cleanups - Fix the races in power-saving code - Fix the races in codec cache hashes and connection lists - Split some common codes for BIOS auto-parser to hda_auto_parser.c - Changed the PM resume code to wake up immediately for buggy BIOS - Creative SoundCore3D support - Add Conexant CX20751/2/3/4 codec support * ASoC - Dynamic PCM support, allowing support for SoCs with internal routing through components with tight sequencing and formatting constraints within their internal paths or where there are multiple components connected with CPU managed DMA controllers inside the SoC. - Greatly improved support for direct digital links between off-SoC devices, providing a much simpler way of connecting things like digital basebands to CODECs. - Much more fine grained and robust locking, cleaning up some of the confusion that crept in with multi-component. - CPU support for nVidia Tegra 30 I2S and audio hub controllers and ST-Ericsson MSP I2S controolers - New CODEC drivers for Cirrus CS42L52, LAPIS Semiconductor ML26124, Texas Instruments LM49453. - Some regmap changes needed by the Tegra I2S driver. - mc13783 audio support. * Misc - Rewrite with module_pci_driver() - Xonar DGX support for snd-oxygen - Improvement of packet handling in snd-firewire driver - New USB-endpoint streaming logic - Enhanced M-audio FTU quirks and relevant cleanups - Increment the support of OSS devices to 256 - snd-aloop accuracy improvement There are a few more pending changes for 3.5, but they will be sent slightly later as partly depending on the changes of DRM." Fix up conflicts in regmap (due to duplicate patches, with some further updates then having already come in from the regmap tree). Also some fairly trivial context conflicts in the imx and mcx soc drivers. * tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (280 commits) ALSA: snd-usb: fix stream info output in /proc ALSA: pcm - Add proper state checks to snd_pcm_drain() ALSA: sh: Fix up namespace collision in sh_dac_audio. ALSA: hda/realtek - Fix unused variable compile warning ASoC: sh: fsi: enable chip specific data transfer mode ASoC: sh: fsi: call fsi_hw_startup/shutdown from fsi_dai_trigger() ASoC: sh: fsi: use same format for IN/OUT ASoC: sh: fsi: add fsi_version() and removed meaningless version check ASoC: sh: fsi: use register field macro name on IN/OUT_DMAC ASoC: tegra: Add machine driver for WM8753 codec ALSA: hda - Fix possible races of accesses to connection list array ASoC: OMAP: HDMI: Introduce codec ARM: mx31_3ds: Add sound support ASoC: imx-mc13783 cleanup mx31moboard: Add sound support ASoC: mc13783 codec cleanups ASoC: add imx-mc13783 sound support ASoC: Add mc13783 codec mfd: mc13xxx: add codec platform data ASoC: don't flip master of DT-instantiated DAI links ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/mc13xxx.h11
-rw-r--r--include/sound/asound.h14
-rw-r--r--include/sound/asoundef.h41
-rw-r--r--include/sound/cs42l52.h36
-rw-r--r--include/sound/max98095.h12
-rw-r--r--include/sound/sh_fsi.h18
-rw-r--r--include/sound/simple_card.h38
-rw-r--r--include/sound/soc-dai.h4
-rw-r--r--include/sound/soc-dapm.h28
-rw-r--r--include/sound/soc-dpcm.h138
-rw-r--r--include/sound/soc.h118
-rw-r--r--include/trace/events/asoc.h80
12 files changed, 496 insertions, 42 deletions
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index 10e038bac8dd..bf070755982e 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -170,6 +170,16 @@ struct mc13xxx_ts_platform_data {
170 bool atox; 170 bool atox;
171}; 171};
172 172
173enum mc13783_ssi_port {
174 MC13783_SSI1_PORT,
175 MC13783_SSI2_PORT,
176};
177
178struct mc13xxx_codec_platform_data {
179 enum mc13783_ssi_port adc_ssi_port;
180 enum mc13783_ssi_port dac_ssi_port;
181};
182
173struct mc13xxx_platform_data { 183struct mc13xxx_platform_data {
174#define MC13XXX_USE_TOUCHSCREEN (1 << 0) 184#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
175#define MC13XXX_USE_CODEC (1 << 1) 185#define MC13XXX_USE_CODEC (1 << 1)
@@ -181,6 +191,7 @@ struct mc13xxx_platform_data {
181 struct mc13xxx_leds_platform_data *leds; 191 struct mc13xxx_leds_platform_data *leds;
182 struct mc13xxx_buttons_platform_data *buttons; 192 struct mc13xxx_buttons_platform_data *buttons;
183 struct mc13xxx_ts_platform_data touch; 193 struct mc13xxx_ts_platform_data touch;
194 struct mc13xxx_codec_platform_data *codec;
184}; 195};
185 196
186#define MC13XXX_ADC_MODE_TS 1 197#define MC13XXX_ADC_MODE_TS 1
diff --git a/include/sound/asound.h b/include/sound/asound.h
index a2e4ff5ba9e9..0876a1e76aef 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -70,6 +70,20 @@ struct snd_aes_iec958 {
70 70
71/**************************************************************************** 71/****************************************************************************
72 * * 72 * *
73 * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
74 * *
75 ****************************************************************************/
76
77struct snd_cea_861_aud_if {
78 unsigned char db1_ct_cc; /* coding type and channel count */
79 unsigned char db2_sf_ss; /* sample frequency and size */
80 unsigned char db3; /* not used, all zeros */
81 unsigned char db4_ca; /* channel allocation code */
82 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
83};
84
85/****************************************************************************
86 * *
73 * Section for driver hardware dependent interface - /dev/snd/hw? * 87 * Section for driver hardware dependent interface - /dev/snd/hw? *
74 * * 88 * *
75 ****************************************************************************/ 89 ****************************************************************************/
diff --git a/include/sound/asoundef.h b/include/sound/asoundef.h
index 20ebf3298eba..bb05c02f89b0 100644
--- a/include/sound/asoundef.h
+++ b/include/sound/asoundef.h
@@ -170,6 +170,47 @@
170#define IEC958_AES5_CON_CGMSA_COPYNOMORE (2<<0) /* condition not be used */ 170#define IEC958_AES5_CON_CGMSA_COPYNOMORE (2<<0) /* condition not be used */
171#define IEC958_AES5_CON_CGMSA_COPYNEVER (3<<0) /* no copying is permitted */ 171#define IEC958_AES5_CON_CGMSA_COPYNEVER (3<<0) /* no copying is permitted */
172 172
173/****************************************************************************
174 * *
175 * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
176 * *
177 ****************************************************************************/
178#define CEA861_AUDIO_INFOFRAME_DB1CC (7<<0) /* mask - channel count */
179#define CEA861_AUDIO_INFOFRAME_DB1CT (0xf<<4) /* mask - coding type */
180#define CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM (0<<4) /* refer to stream */
181#define CEA861_AUDIO_INFOFRAME_DB1CT_IEC60958 (1<<4) /* IEC-60958 L-PCM */
182#define CEA861_AUDIO_INFOFRAME_DB1CT_AC3 (2<<4) /* AC-3 */
183#define CEA861_AUDIO_INFOFRAME_DB1CT_MPEG1 (3<<4) /* MPEG1 Layers 1 & 2 */
184#define CEA861_AUDIO_INFOFRAME_DB1CT_MP3 (4<<4) /* MPEG1 Layer 3 */
185#define CEA861_AUDIO_INFOFRAME_DB1CT_MPEG2_MULTICH (5<<4) /* MPEG2 Multichannel */
186#define CEA861_AUDIO_INFOFRAME_DB1CT_AAC (6<<4) /* AAC */
187#define CEA861_AUDIO_INFOFRAME_DB1CT_DTS (7<<4) /* DTS */
188#define CEA861_AUDIO_INFOFRAME_DB1CT_ATRAC (8<<4) /* ATRAC */
189#define CEA861_AUDIO_INFOFRAME_DB1CT_ONEBIT (9<<4) /* One Bit Audio */
190#define CEA861_AUDIO_INFOFRAME_DB1CT_DOLBY_DIG_PLUS (10<<4) /* Dolby Digital + */
191#define CEA861_AUDIO_INFOFRAME_DB1CT_DTS_HD (11<<4) /* DTS-HD */
192#define CEA861_AUDIO_INFOFRAME_DB1CT_MAT (12<<4) /* MAT (MLP) */
193#define CEA861_AUDIO_INFOFRAME_DB1CT_DST (13<<4) /* DST */
194#define CEA861_AUDIO_INFOFRAME_DB1CT_WMA_PRO (14<<4) /* WMA Pro */
195#define CEA861_AUDIO_INFOFRAME_DB2SF (7<<2) /* mask - sample frequency */
196#define CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM (0<<2) /* refer to stream */
197#define CEA861_AUDIO_INFOFRAME_DB2SF_32000 (1<<2) /* 32kHz */
198#define CEA861_AUDIO_INFOFRAME_DB2SF_44100 (2<<2) /* 44.1kHz */
199#define CEA861_AUDIO_INFOFRAME_DB2SF_48000 (3<<2) /* 48kHz */
200#define CEA861_AUDIO_INFOFRAME_DB2SF_88200 (4<<2) /* 88.2kHz */
201#define CEA861_AUDIO_INFOFRAME_DB2SF_96000 (5<<2) /* 96kHz */
202#define CEA861_AUDIO_INFOFRAME_DB2SF_176400 (6<<2) /* 176.4kHz */
203#define CEA861_AUDIO_INFOFRAME_DB2SF_192000 (7<<2) /* 192kHz */
204#define CEA861_AUDIO_INFOFRAME_DB2SS (3<<0) /* mask - sample size */
205#define CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM (0<<0) /* refer to stream */
206#define CEA861_AUDIO_INFOFRAME_DB2SS_16BIT (1<<0) /* 16 bits */
207#define CEA861_AUDIO_INFOFRAME_DB2SS_20BIT (2<<0) /* 20 bits */
208#define CEA861_AUDIO_INFOFRAME_DB2SS_24BIT (3<<0) /* 24 bits */
209#define CEA861_AUDIO_INFOFRAME_DB5_DM_INH (1<<7) /* mask - inhibit downmixing */
210#define CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PERMITTED (0<<7) /* stereo downmix permitted */
211#define CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED (1<<7) /* stereo downmis prohibited */
212#define CEA861_AUDIO_INFOFRAME_DB5_LSV (0xf<<3) /* mask - level-shift values */
213
173/***************************************************************************** 214/*****************************************************************************
174 * * 215 * *
175 * MIDI v1.0 interface * 216 * MIDI v1.0 interface *
diff --git a/include/sound/cs42l52.h b/include/sound/cs42l52.h
new file mode 100644
index 000000000000..4c68955f7330
--- /dev/null
+++ b/include/sound/cs42l52.h
@@ -0,0 +1,36 @@
1/*
2 * linux/sound/cs42l52.h -- Platform data for CS42L52
3 *
4 * Copyright (c) 2012 Cirrus Logic Inc.
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 __CS42L52_H
12#define __CS42L52_H
13
14struct cs42l52_platform_data {
15
16 /* MICBIAS Level. Check datasheet Pg48 */
17 unsigned int micbias_lvl;
18
19 /* MICA mode selection 0=Single 1=Differential */
20 unsigned int mica_cfg;
21
22 /* MICB mode selection 0=Single 1=Differential */
23 unsigned int micb_cfg;
24
25 /* MICA Select 0=MIC1A 1=MIC2A */
26 unsigned int mica_sel;
27
28 /* MICB Select 0=MIC2A 1=MIC2B */
29 unsigned int micb_sel;
30
31 /* Charge Pump Freq. Check datasheet Pg73 */
32 unsigned int chgfreq;
33
34};
35
36#endif /* __CS42L52_H */
diff --git a/include/sound/max98095.h b/include/sound/max98095.h
index 7513a42dd4aa..e87ae67b0a55 100644
--- a/include/sound/max98095.h
+++ b/include/sound/max98095.h
@@ -49,6 +49,18 @@ struct max98095_pdata {
49 */ 49 */
50 unsigned int digmic_left_mode:1; 50 unsigned int digmic_left_mode:1;
51 unsigned int digmic_right_mode:1; 51 unsigned int digmic_right_mode:1;
52
53 /* Pin5 is the mechanical method of sensing jack insertion
54 * but it is something that might not be supported.
55 * 0 = PIN5 not supported
56 * 1 = PIN5 supported
57 */
58 unsigned int jack_detect_pin5en:1;
59
60 /* Slew amount for jack detection. Calculated as 4 * (delay + 1).
61 * Default delay is 24 to get a time of 100ms.
62 */
63 unsigned int jack_detect_delay;
52}; 64};
53 65
54#endif 66#endif
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index b457e87fbd08..906010344dd7 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -21,10 +21,11 @@
21/* 21/*
22 * flags format 22 * flags format
23 * 23 *
24 * 0x000000BA 24 * 0x00000CBA
25 * 25 *
26 * A: inversion 26 * A: inversion
27 * B: format mode 27 * B: format mode
28 * C: chip specific
28 */ 29 */
29 30
30/* A: clock inversion */ 31/* A: clock inversion */
@@ -39,6 +40,9 @@
39#define SH_FSI_FMT_DAI (0 << 4) 40#define SH_FSI_FMT_DAI (0 << 4)
40#define SH_FSI_FMT_SPDIF (1 << 4) 41#define SH_FSI_FMT_SPDIF (1 << 4)
41 42
43/* C: chip specific */
44#define SH_FSI_OPTION_MASK 0x00000F00
45#define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */
42 46
43/* 47/*
44 * set_rate return value 48 * set_rate return value
@@ -84,16 +88,4 @@ struct sh_fsi_platform_info {
84 struct sh_fsi_port_info port_b; 88 struct sh_fsi_port_info port_b;
85}; 89};
86 90
87/*
88 * for fsi-ak4642
89 */
90struct fsi_ak4642_info {
91 const char *name;
92 const char *card;
93 const char *cpu_dai;
94 const char *codec;
95 const char *platform;
96 int id;
97};
98
99#endif /* __SOUND_FSI_H */ 91#endif /* __SOUND_FSI_H */
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
new file mode 100644
index 000000000000..4b62b8dc6a4f
--- /dev/null
+++ b/include/sound/simple_card.h
@@ -0,0 +1,38 @@
1/*
2 * ASoC simple sound card support
3 *
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __SIMPLE_CARD_H
13#define __SIMPLE_CARD_H
14
15#include <sound/soc.h>
16
17struct asoc_simple_dai_init_info {
18 unsigned int fmt;
19 unsigned int cpu_daifmt;
20 unsigned int codec_daifmt;
21 unsigned int sysclk;
22};
23
24struct asoc_simple_card_info {
25 const char *name;
26 const char *card;
27 const char *cpu_dai;
28 const char *codec;
29 const char *platform;
30 const char *codec_dai;
31 struct asoc_simple_dai_init_info *init; /* for snd_link.init */
32
33 /* used in simple-card.c */
34 struct snd_soc_dai_link snd_link;
35 struct snd_soc_card snd_card;
36};
37
38#endif /* __SIMPLE_CARD_H */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index c429f248cf4e..1f69e0af2941 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -173,6 +173,8 @@ struct snd_soc_dai_ops {
173 struct snd_soc_dai *); 173 struct snd_soc_dai *);
174 int (*trigger)(struct snd_pcm_substream *, int, 174 int (*trigger)(struct snd_pcm_substream *, int,
175 struct snd_soc_dai *); 175 struct snd_soc_dai *);
176 int (*bespoke_trigger)(struct snd_pcm_substream *, int,
177 struct snd_soc_dai *);
176 /* 178 /*
177 * For hardware based FIFO caused delay reporting. 179 * For hardware based FIFO caused delay reporting.
178 * Optional. 180 * Optional.
@@ -196,6 +198,7 @@ struct snd_soc_dai_driver {
196 const char *name; 198 const char *name;
197 unsigned int id; 199 unsigned int id;
198 int ac97_control; 200 int ac97_control;
201 unsigned int base;
199 202
200 /* DAI driver callbacks */ 203 /* DAI driver callbacks */
201 int (*probe)(struct snd_soc_dai *dai); 204 int (*probe)(struct snd_soc_dai *dai);
@@ -241,6 +244,7 @@ struct snd_soc_dai {
241 244
242 struct snd_soc_dapm_widget *playback_widget; 245 struct snd_soc_dapm_widget *playback_widget;
243 struct snd_soc_dapm_widget *capture_widget; 246 struct snd_soc_dapm_widget *capture_widget;
247 struct snd_soc_dapm_context dapm;
244 248
245 /* DAI DMA data */ 249 /* DAI DMA data */
246 void *playback_dma_data; 250 void *playback_dma_data;
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 8da3c2409060..e3833d9f1914 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -141,10 +141,6 @@ struct device;
141{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 141{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
142 .invert = winvert, .kcontrol_news = wcontrols, \ 142 .invert = winvert, .kcontrol_news = wcontrols, \
143 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} 143 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags}
144#define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \
145{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \
146 .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0, \
147 .event = wevent, .event_flags = wflags}
148#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 144#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
149 wevent, wflags) \ 145 wevent, wflags) \
150{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 146{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \
@@ -324,6 +320,8 @@ struct snd_soc_dapm_path;
324struct snd_soc_dapm_pin; 320struct snd_soc_dapm_pin;
325struct snd_soc_dapm_route; 321struct snd_soc_dapm_route;
326struct snd_soc_dapm_context; 322struct snd_soc_dapm_context;
323struct regulator;
324struct snd_soc_dapm_widget_list;
327 325
328int dapm_reg_event(struct snd_soc_dapm_widget *w, 326int dapm_reg_event(struct snd_soc_dapm_widget *w,
329 struct snd_kcontrol *kcontrol, int event); 327 struct snd_kcontrol *kcontrol, int event);
@@ -359,6 +357,10 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
359int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, 357int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
360 struct snd_soc_dai *dai); 358 struct snd_soc_dai *dai);
361int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); 359int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
360int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
361 const struct snd_soc_pcm_stream *params,
362 struct snd_soc_dapm_widget *source,
363 struct snd_soc_dapm_widget *sink);
362 364
363/* dapm path setup */ 365/* dapm path setup */
364int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); 366int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
@@ -369,8 +371,8 @@ int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
369 const struct snd_soc_dapm_route *route, int num); 371 const struct snd_soc_dapm_route *route, int num);
370 372
371/* dapm events */ 373/* dapm events */
372int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, 374void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
373 struct snd_soc_dai *dai, int event); 375 int event);
374void snd_soc_dapm_shutdown(struct snd_soc_card *card); 376void snd_soc_dapm_shutdown(struct snd_soc_card *card);
375 377
376/* external DAPM widget events */ 378/* external DAPM widget events */
@@ -402,6 +404,10 @@ void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec);
402/* Mostly internal - should not normally be used */ 404/* Mostly internal - should not normally be used */
403void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); 405void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason);
404 406
407/* dapm path query */
408int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
409 struct snd_soc_dapm_widget_list **list);
410
405/* dapm widget types */ 411/* dapm widget types */
406enum snd_soc_dapm_type { 412enum snd_soc_dapm_type {
407 snd_soc_dapm_input = 0, /* input pin */ 413 snd_soc_dapm_input = 0, /* input pin */
@@ -430,6 +436,12 @@ enum snd_soc_dapm_type {
430 snd_soc_dapm_aif_out, /* audio interface output */ 436 snd_soc_dapm_aif_out, /* audio interface output */
431 snd_soc_dapm_siggen, /* signal generator */ 437 snd_soc_dapm_siggen, /* signal generator */
432 snd_soc_dapm_dai, /* link to DAI structure */ 438 snd_soc_dapm_dai, /* link to DAI structure */
439 snd_soc_dapm_dai_link, /* link between two DAI structures */
440};
441
442enum snd_soc_dapm_subclass {
443 SND_SOC_DAPM_CLASS_INIT = 0,
444 SND_SOC_DAPM_CLASS_RUNTIME = 1,
433}; 445};
434 446
435/* 447/*
@@ -482,9 +494,11 @@ struct snd_soc_dapm_widget {
482 struct snd_soc_dapm_context *dapm; 494 struct snd_soc_dapm_context *dapm;
483 495
484 void *priv; /* widget specific data */ 496 void *priv; /* widget specific data */
497 struct regulator *regulator; /* attached regulator */
498 const struct snd_soc_pcm_stream *params; /* params for dai links */
485 499
486 /* dapm control */ 500 /* dapm control */
487 short reg; /* negative reg = no direct dapm */ 501 int reg; /* negative reg = no direct dapm */
488 unsigned char shift; /* bits to shift */ 502 unsigned char shift; /* bits to shift */
489 unsigned int saved_value; /* widget saved value */ 503 unsigned int saved_value; /* widget saved value */
490 unsigned int value; /* widget current value */ 504 unsigned int value; /* widget current value */
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
new file mode 100644
index 000000000000..04598f1efd77
--- /dev/null
+++ b/include/sound/soc-dpcm.h
@@ -0,0 +1,138 @@
1/*
2 * linux/sound/soc-dpcm.h -- ALSA SoC Dynamic PCM Support
3 *
4 * Author: Liam Girdwood <lrg@ti.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
11#ifndef __LINUX_SND_SOC_DPCM_H
12#define __LINUX_SND_SOC_DPCM_H
13
14#include <linux/list.h>
15#include <sound/pcm.h>
16
17struct snd_soc_pcm_runtime;
18
19/*
20 * Types of runtime_update to perform. e.g. originated from FE PCM ops
21 * or audio route changes triggered by muxes/mixers.
22 */
23enum snd_soc_dpcm_update {
24 SND_SOC_DPCM_UPDATE_NO = 0,
25 SND_SOC_DPCM_UPDATE_BE,
26 SND_SOC_DPCM_UPDATE_FE,
27};
28
29/*
30 * Dynamic PCM Frontend -> Backend link management states.
31 */
32enum snd_soc_dpcm_link_state {
33 SND_SOC_DPCM_LINK_STATE_NEW = 0, /* newly created link */
34 SND_SOC_DPCM_LINK_STATE_FREE, /* link to be dismantled */
35};
36
37/*
38 * Dynamic PCM Frontend -> Backend link PCM states.
39 */
40enum snd_soc_dpcm_state {
41 SND_SOC_DPCM_STATE_NEW = 0,
42 SND_SOC_DPCM_STATE_OPEN,
43 SND_SOC_DPCM_STATE_HW_PARAMS,
44 SND_SOC_DPCM_STATE_PREPARE,
45 SND_SOC_DPCM_STATE_START,
46 SND_SOC_DPCM_STATE_STOP,
47 SND_SOC_DPCM_STATE_PAUSED,
48 SND_SOC_DPCM_STATE_SUSPEND,
49 SND_SOC_DPCM_STATE_HW_FREE,
50 SND_SOC_DPCM_STATE_CLOSE,
51};
52
53/*
54 * Dynamic PCM trigger ordering. Triggering flexibility is required as some
55 * DSPs require triggering before/after their CPU platform and DAIs.
56 *
57 * i.e. some clients may want to manually order this call in their PCM
58 * trigger() whilst others will just use the regular core ordering.
59 */
60enum snd_soc_dpcm_trigger {
61 SND_SOC_DPCM_TRIGGER_PRE = 0,
62 SND_SOC_DPCM_TRIGGER_POST,
63 SND_SOC_DPCM_TRIGGER_BESPOKE,
64};
65
66/*
67 * Dynamic PCM link
68 * This links together a FE and BE DAI at runtime and stores the link
69 * state information and the hw_params configuration.
70 */
71struct snd_soc_dpcm {
72 /* FE and BE DAIs*/
73 struct snd_soc_pcm_runtime *be;
74 struct snd_soc_pcm_runtime *fe;
75
76 /* link state */
77 enum snd_soc_dpcm_link_state state;
78
79 /* list of BE and FE for this DPCM link */
80 struct list_head list_be;
81 struct list_head list_fe;
82
83 /* hw params for this link - may be different for each link */
84 struct snd_pcm_hw_params hw_params;
85#ifdef CONFIG_DEBUG_FS
86 struct dentry *debugfs_state;
87#endif
88};
89
90/*
91 * Dynamic PCM runtime data.
92 */
93struct snd_soc_dpcm_runtime {
94 struct list_head be_clients;
95 struct list_head fe_clients;
96
97 int users;
98 struct snd_pcm_runtime *runtime;
99 struct snd_pcm_hw_params hw_params;
100
101 /* state and update */
102 enum snd_soc_dpcm_update runtime_update;
103 enum snd_soc_dpcm_state state;
104};
105
106/* can this BE stop and free */
107int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
108 struct snd_soc_pcm_runtime *be, int stream);
109
110/* can this BE perform a hw_params() */
111int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
112 struct snd_soc_pcm_runtime *be, int stream);
113
114/* is the current PCM operation for this FE ? */
115int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream);
116
117/* is the current PCM operation for this BE ? */
118int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe,
119 struct snd_soc_pcm_runtime *be, int stream);
120
121/* get the substream for this BE */
122struct snd_pcm_substream *
123 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream);
124
125/* get the BE runtime state */
126enum snd_soc_dpcm_state
127 snd_soc_dpcm_be_get_state(struct snd_soc_pcm_runtime *be, int stream);
128
129/* set the BE runtime state */
130void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
131 enum snd_soc_dpcm_state state);
132
133/* internal use only */
134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
136int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *);
137
138#endif
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2ebf7877c148..c703871f5f65 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -55,6 +55,18 @@
55 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 55 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
56 .put = snd_soc_put_volsw, \ 56 .put = snd_soc_put_volsw, \
57 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 57 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
58#define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \
59{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
60 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
61 SNDRV_CTL_ELEM_ACCESS_READWRITE, \
62 .tlv.p = (tlv_array),\
63 .info = snd_soc_info_volsw, \
64 .get = snd_soc_get_volsw_sx,\
65 .put = snd_soc_put_volsw_sx, \
66 .private_value = (unsigned long)&(struct soc_mixer_control) \
67 {.reg = xreg, .rreg = xreg, \
68 .shift = xshift, .rshift = xshift, \
69 .max = xmax, .min = xmin} }
58#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ 70#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \
59{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 71{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
60 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 72 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
@@ -85,6 +97,18 @@
85 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ 97 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
86 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 98 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
87 xmax, xinvert) } 99 xmax, xinvert) }
100#define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \
101{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
102 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
103 SNDRV_CTL_ELEM_ACCESS_READWRITE, \
104 .tlv.p = (tlv_array), \
105 .info = snd_soc_info_volsw, \
106 .get = snd_soc_get_volsw_sx, \
107 .put = snd_soc_put_volsw_sx, \
108 .private_value = (unsigned long)&(struct soc_mixer_control) \
109 {.reg = xreg, .rreg = xrreg, \
110 .shift = xshift, .rshift = xshift, \
111 .max = xmax, .min = xmin} }
88#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ 112#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
89{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 113{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
90 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 114 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
@@ -171,20 +195,6 @@
171 .get = xhandler_get, .put = xhandler_put, \ 195 .get = xhandler_get, .put = xhandler_put, \
172 .private_value = (unsigned long)&xenum } 196 .private_value = (unsigned long)&xenum }
173 197
174#define SOC_DOUBLE_R_SX_TLV(xname, xreg_left, xreg_right, xshift,\
175 xmin, xmax, tlv_array) \
176{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
177 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
178 SNDRV_CTL_ELEM_ACCESS_READWRITE, \
179 .tlv.p = (tlv_array), \
180 .info = snd_soc_info_volsw_2r_sx, \
181 .get = snd_soc_get_volsw_2r_sx, \
182 .put = snd_soc_put_volsw_2r_sx, \
183 .private_value = (unsigned long)&(struct soc_mixer_control) \
184 {.reg = xreg_left, \
185 .rreg = xreg_right, .shift = xshift, \
186 .min = xmin, .max = xmax} }
187
188#define SND_SOC_BYTES(xname, xbase, xregs) \ 198#define SND_SOC_BYTES(xname, xbase, xregs) \
189{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 199{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
190 .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \ 200 .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
@@ -200,6 +210,19 @@
200 {.base = xbase, .num_regs = xregs, \ 210 {.base = xbase, .num_regs = xregs, \
201 .mask = xmask }) } 211 .mask = xmask }) }
202 212
213#define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \
214 xmin, xmax, xinvert) \
215{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
216 .info = snd_soc_info_xr_sx, .get = snd_soc_get_xr_sx, \
217 .put = snd_soc_put_xr_sx, \
218 .private_value = (unsigned long)&(struct soc_mreg_control) \
219 {.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \
220 .invert = xinvert, .min = xmin, .max = xmax} }
221
222#define SOC_SINGLE_STROBE(xname, xreg, xshift, xinvert) \
223 SOC_SINGLE_EXT(xname, xreg, xshift, 1, xinvert, \
224 snd_soc_get_strobe, snd_soc_put_strobe)
225
203/* 226/*
204 * Simplified versions of above macros, declaring a struct and calculating 227 * Simplified versions of above macros, declaring a struct and calculating
205 * ARRAY_SIZE internally 228 * ARRAY_SIZE internally
@@ -264,6 +287,7 @@ struct snd_soc_jack_zone;
264struct snd_soc_jack_pin; 287struct snd_soc_jack_pin;
265struct snd_soc_cache_ops; 288struct snd_soc_cache_ops;
266#include <sound/soc-dapm.h> 289#include <sound/soc-dapm.h>
290#include <sound/soc-dpcm.h>
267 291
268#ifdef CONFIG_GPIOLIB 292#ifdef CONFIG_GPIOLIB
269struct snd_soc_jack_gpio; 293struct snd_soc_jack_gpio;
@@ -288,6 +312,11 @@ enum snd_soc_pcm_subclass {
288 SND_SOC_PCM_CLASS_BE = 1, 312 SND_SOC_PCM_CLASS_BE = 1,
289}; 313};
290 314
315enum snd_soc_card_subclass {
316 SND_SOC_CARD_CLASS_INIT = 0,
317 SND_SOC_CARD_CLASS_RUNTIME = 1,
318};
319
291int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, 320int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
292 int source, unsigned int freq, int dir); 321 int source, unsigned int freq, int dir);
293int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, 322int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
@@ -333,6 +362,11 @@ int snd_soc_platform_write(struct snd_soc_platform *platform,
333 unsigned int reg, unsigned int val); 362 unsigned int reg, unsigned int val);
334int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); 363int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
335 364
365struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
366 const char *dai_link, int stream);
367struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
368 const char *dai_link);
369
336/* Utility functions to get clock rates from various things */ 370/* Utility functions to get clock rates from various things */
337int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 371int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
338int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); 372int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
@@ -343,6 +377,9 @@ int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
343int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, 377int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
344 const struct snd_pcm_hardware *hw); 378 const struct snd_pcm_hardware *hw);
345 379
380int snd_soc_platform_trigger(struct snd_pcm_substream *substream,
381 int cmd, struct snd_soc_platform *platform);
382
346/* Jack reporting */ 383/* Jack reporting */
347int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, 384int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type,
348 struct snd_soc_jack *jack); 385 struct snd_soc_jack *jack);
@@ -413,6 +450,10 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
413 struct snd_ctl_elem_value *ucontrol); 450 struct snd_ctl_elem_value *ucontrol);
414#define snd_soc_get_volsw_2r snd_soc_get_volsw 451#define snd_soc_get_volsw_2r snd_soc_get_volsw
415#define snd_soc_put_volsw_2r snd_soc_put_volsw 452#define snd_soc_put_volsw_2r snd_soc_put_volsw
453int snd_soc_get_volsw_sx(struct snd_kcontrol *kcontrol,
454 struct snd_ctl_elem_value *ucontrol);
455int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
456 struct snd_ctl_elem_value *ucontrol);
416int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, 457int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol,
417 struct snd_ctl_elem_info *uinfo); 458 struct snd_ctl_elem_info *uinfo);
418int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, 459int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol,
@@ -421,19 +462,22 @@ int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol,
421 struct snd_ctl_elem_value *ucontrol); 462 struct snd_ctl_elem_value *ucontrol);
422int snd_soc_limit_volume(struct snd_soc_codec *codec, 463int snd_soc_limit_volume(struct snd_soc_codec *codec,
423 const char *name, int max); 464 const char *name, int max);
424int snd_soc_info_volsw_2r_sx(struct snd_kcontrol *kcontrol,
425 struct snd_ctl_elem_info *uinfo);
426int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol,
427 struct snd_ctl_elem_value *ucontrol);
428int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol,
429 struct snd_ctl_elem_value *ucontrol);
430int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, 465int snd_soc_bytes_info(struct snd_kcontrol *kcontrol,
431 struct snd_ctl_elem_info *uinfo); 466 struct snd_ctl_elem_info *uinfo);
432int snd_soc_bytes_get(struct snd_kcontrol *kcontrol, 467int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
433 struct snd_ctl_elem_value *ucontrol); 468 struct snd_ctl_elem_value *ucontrol);
434int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, 469int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
435 struct snd_ctl_elem_value *ucontrol); 470 struct snd_ctl_elem_value *ucontrol);
436 471int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol,
472 struct snd_ctl_elem_info *uinfo);
473int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
474 struct snd_ctl_elem_value *ucontrol);
475int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
476 struct snd_ctl_elem_value *ucontrol);
477int snd_soc_get_strobe(struct snd_kcontrol *kcontrol,
478 struct snd_ctl_elem_value *ucontrol);
479int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
480 struct snd_ctl_elem_value *ucontrol);
437 481
438/** 482/**
439 * struct snd_soc_reg_access - Describes whether a given register is 483 * struct snd_soc_reg_access - Describes whether a given register is
@@ -513,6 +557,7 @@ struct snd_soc_jack_gpio {
513#endif 557#endif
514 558
515struct snd_soc_jack { 559struct snd_soc_jack {
560 struct mutex mutex;
516 struct snd_jack *jack; 561 struct snd_jack *jack;
517 struct snd_soc_codec *codec; 562 struct snd_soc_codec *codec;
518 struct list_head pins; 563 struct list_head pins;
@@ -711,6 +756,7 @@ struct snd_soc_platform_driver {
711 /* platform IO - used for platform DAPM */ 756 /* platform IO - used for platform DAPM */
712 unsigned int (*read)(struct snd_soc_platform *, unsigned int); 757 unsigned int (*read)(struct snd_soc_platform *, unsigned int);
713 int (*write)(struct snd_soc_platform *, unsigned int, unsigned int); 758 int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
759 int (*bespoke_trigger)(struct snd_pcm_substream *, int);
714}; 760};
715 761
716struct snd_soc_platform { 762struct snd_soc_platform {
@@ -746,21 +792,36 @@ struct snd_soc_dai_link {
746 const char *cpu_dai_name; 792 const char *cpu_dai_name;
747 const struct device_node *cpu_dai_of_node; 793 const struct device_node *cpu_dai_of_node;
748 const char *codec_dai_name; 794 const char *codec_dai_name;
795 int be_id; /* optional ID for machine driver BE identification */
796
797 const struct snd_soc_pcm_stream *params;
749 798
750 unsigned int dai_fmt; /* format to set on init */ 799 unsigned int dai_fmt; /* format to set on init */
751 800
801 enum snd_soc_dpcm_trigger trigger[2]; /* trigger type for DPCM */
802
752 /* Keep DAI active over suspend */ 803 /* Keep DAI active over suspend */
753 unsigned int ignore_suspend:1; 804 unsigned int ignore_suspend:1;
754 805
755 /* Symmetry requirements */ 806 /* Symmetry requirements */
756 unsigned int symmetric_rates:1; 807 unsigned int symmetric_rates:1;
757 808
809 /* Do not create a PCM for this DAI link (Backend link) */
810 unsigned int no_pcm:1;
811
812 /* This DAI link can route to other DAI links at runtime (Frontend)*/
813 unsigned int dynamic:1;
814
758 /* pmdown_time is ignored at stop */ 815 /* pmdown_time is ignored at stop */
759 unsigned int ignore_pmdown_time:1; 816 unsigned int ignore_pmdown_time:1;
760 817
761 /* codec/machine specific init - e.g. add machine controls */ 818 /* codec/machine specific init - e.g. add machine controls */
762 int (*init)(struct snd_soc_pcm_runtime *rtd); 819 int (*init)(struct snd_soc_pcm_runtime *rtd);
763 820
821 /* optional hw_params re-writing for BE and FE sync */
822 int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
823 struct snd_pcm_hw_params *params);
824
764 /* machine stream operations */ 825 /* machine stream operations */
765 struct snd_soc_ops *ops; 826 struct snd_soc_ops *ops;
766}; 827};
@@ -800,6 +861,7 @@ struct snd_soc_card {
800 861
801 struct list_head list; 862 struct list_head list;
802 struct mutex mutex; 863 struct mutex mutex;
864 struct mutex dapm_mutex;
803 865
804 bool instantiated; 866 bool instantiated;
805 867
@@ -889,9 +951,11 @@ struct snd_soc_pcm_runtime {
889 enum snd_soc_pcm_subclass pcm_subclass; 951 enum snd_soc_pcm_subclass pcm_subclass;
890 struct snd_pcm_ops ops; 952 struct snd_pcm_ops ops;
891 953
892 unsigned int complete:1;
893 unsigned int dev_registered:1; 954 unsigned int dev_registered:1;
894 955
956 /* Dynamic PCM BE runtime data */
957 struct snd_soc_dpcm_runtime dpcm[2];
958
895 long pmdown_time; 959 long pmdown_time;
896 960
897 /* runtime devices */ 961 /* runtime devices */
@@ -902,6 +966,10 @@ struct snd_soc_pcm_runtime {
902 struct snd_soc_dai *cpu_dai; 966 struct snd_soc_dai *cpu_dai;
903 967
904 struct delayed_work delayed_work; 968 struct delayed_work delayed_work;
969#ifdef CONFIG_DEBUG_FS
970 struct dentry *debugfs_dpcm_root;
971 struct dentry *debugfs_dpcm_state;
972#endif
905}; 973};
906 974
907/* mixer control */ 975/* mixer control */
@@ -916,6 +984,12 @@ struct soc_bytes {
916 u32 mask; 984 u32 mask;
917}; 985};
918 986
987/* multi register control */
988struct soc_mreg_control {
989 long min, max;
990 unsigned int regbase, regcount, nbits, invert;
991};
992
919/* enumerated kcontrol */ 993/* enumerated kcontrol */
920struct soc_enum { 994struct soc_enum {
921 unsigned short reg; 995 unsigned short reg;
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h
index ab26f8aa3c78..5fc2dcdd21cd 100644
--- a/include/trace/events/asoc.h
+++ b/include/trace/events/asoc.h
@@ -7,6 +7,8 @@
7#include <linux/ktime.h> 7#include <linux/ktime.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9 9
10#define DAPM_DIRECT "(direct)"
11
10struct snd_soc_jack; 12struct snd_soc_jack;
11struct snd_soc_codec; 13struct snd_soc_codec;
12struct snd_soc_platform; 14struct snd_soc_platform;
@@ -241,6 +243,84 @@ TRACE_EVENT(snd_soc_dapm_walk_done,
241 (int)__entry->path_checks, (int)__entry->neighbour_checks) 243 (int)__entry->path_checks, (int)__entry->neighbour_checks)
242); 244);
243 245
246TRACE_EVENT(snd_soc_dapm_output_path,
247
248 TP_PROTO(struct snd_soc_dapm_widget *widget,
249 struct snd_soc_dapm_path *path),
250
251 TP_ARGS(widget, path),
252
253 TP_STRUCT__entry(
254 __string( wname, widget->name )
255 __string( pname, path->name ? path->name : DAPM_DIRECT)
256 __string( psname, path->sink->name )
257 __field( int, path_sink )
258 __field( int, path_connect )
259 ),
260
261 TP_fast_assign(
262 __assign_str(wname, widget->name);
263 __assign_str(pname, path->name ? path->name : DAPM_DIRECT);
264 __assign_str(psname, path->sink->name);
265 __entry->path_connect = path->connect;
266 __entry->path_sink = (long)path->sink;
267 ),
268
269 TP_printk("%c%s -> %s -> %s\n",
270 (int) __entry->path_sink &&
271 (int) __entry->path_connect ? '*' : ' ',
272 __get_str(wname), __get_str(pname), __get_str(psname))
273);
274
275TRACE_EVENT(snd_soc_dapm_input_path,
276
277 TP_PROTO(struct snd_soc_dapm_widget *widget,
278 struct snd_soc_dapm_path *path),
279
280 TP_ARGS(widget, path),
281
282 TP_STRUCT__entry(
283 __string( wname, widget->name )
284 __string( pname, path->name ? path->name : DAPM_DIRECT)
285 __string( psname, path->source->name )
286 __field( int, path_source )
287 __field( int, path_connect )
288 ),
289
290 TP_fast_assign(
291 __assign_str(wname, widget->name);
292 __assign_str(pname, path->name ? path->name : DAPM_DIRECT);
293 __assign_str(psname, path->source->name);
294 __entry->path_connect = path->connect;
295 __entry->path_source = (long)path->source;
296 ),
297
298 TP_printk("%c%s <- %s <- %s\n",
299 (int) __entry->path_source &&
300 (int) __entry->path_connect ? '*' : ' ',
301 __get_str(wname), __get_str(pname), __get_str(psname))
302);
303
304TRACE_EVENT(snd_soc_dapm_connected,
305
306 TP_PROTO(int paths, int stream),
307
308 TP_ARGS(paths, stream),
309
310 TP_STRUCT__entry(
311 __field( int, paths )
312 __field( int, stream )
313 ),
314
315 TP_fast_assign(
316 __entry->paths = paths;
317 __entry->stream = stream;
318 ),
319
320 TP_printk("%s: found %d paths\n",
321 __entry->stream ? "capture" : "playback", __entry->paths)
322);
323
244TRACE_EVENT(snd_soc_jack_irq, 324TRACE_EVENT(snd_soc_jack_irq,
245 325
246 TP_PROTO(const char *name), 326 TP_PROTO(const char *name),