diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/soc-dai.h | 29 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 19 | ||||
-rw-r--r-- | include/sound/soc.h | 14 |
3 files changed, 38 insertions, 24 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 13676472ddfc..496dc30457b7 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -45,24 +45,6 @@ struct snd_pcm_substream; | |||
45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | 45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * DAI Left/Right Clocks. | ||
49 | * | ||
50 | * Specifies whether the DAI can support different samples for similtanious | ||
51 | * playback and capture. This usually requires a seperate physical frame | ||
52 | * clock for playback and capture. | ||
53 | */ | ||
54 | #define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */ | ||
55 | #define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */ | ||
56 | |||
57 | /* | ||
58 | * TDM | ||
59 | * | ||
60 | * Time Division Multiplexing. Allows PCM data to be multplexed with other | ||
61 | * data on the DAI. | ||
62 | */ | ||
63 | #define SND_SOC_DAIFMT_TDM (1 << 6) | ||
64 | |||
65 | /* | ||
66 | * DAI hardware signal inversions. | 48 | * DAI hardware signal inversions. |
67 | * | 49 | * |
68 | * Specifies whether the DAI can also support inverted clocks for the specified | 50 | * Specifies whether the DAI can also support inverted clocks for the specified |
@@ -96,6 +78,9 @@ struct snd_pcm_substream; | |||
96 | #define SND_SOC_CLOCK_IN 0 | 78 | #define SND_SOC_CLOCK_IN 0 |
97 | #define SND_SOC_CLOCK_OUT 1 | 79 | #define SND_SOC_CLOCK_OUT 1 |
98 | 80 | ||
81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S16_LE |\ | ||
82 | SNDRV_PCM_FMTBIT_S32_LE) | ||
83 | |||
99 | struct snd_soc_dai_ops; | 84 | struct snd_soc_dai_ops; |
100 | struct snd_soc_dai; | 85 | struct snd_soc_dai; |
101 | struct snd_ac97_bus_ops; | 86 | struct snd_ac97_bus_ops; |
@@ -208,6 +193,7 @@ struct snd_soc_dai { | |||
208 | /* DAI capabilities */ | 193 | /* DAI capabilities */ |
209 | struct snd_soc_pcm_stream capture; | 194 | struct snd_soc_pcm_stream capture; |
210 | struct snd_soc_pcm_stream playback; | 195 | struct snd_soc_pcm_stream playback; |
196 | unsigned int symmetric_rates:1; | ||
211 | 197 | ||
212 | /* DAI runtime info */ | 198 | /* DAI runtime info */ |
213 | struct snd_pcm_runtime *runtime; | 199 | struct snd_pcm_runtime *runtime; |
@@ -219,11 +205,8 @@ struct snd_soc_dai { | |||
219 | /* DAI private data */ | 205 | /* DAI private data */ |
220 | void *private_data; | 206 | void *private_data; |
221 | 207 | ||
222 | /* parent codec/platform */ | 208 | /* parent platform */ |
223 | union { | 209 | struct snd_soc_platform *platform; |
224 | struct snd_soc_codec *codec; | ||
225 | struct snd_soc_platform *platform; | ||
226 | }; | ||
227 | 210 | ||
228 | struct list_head list; | 211 | struct list_head list; |
229 | }; | 212 | }; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index a7def6a9a030..533f9f256496 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -140,16 +140,30 @@ | |||
140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ |
142 | .shift = wshift, .invert = winvert} | 142 | .shift = wshift, .invert = winvert} |
143 | #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ | ||
144 | wevent, wflags) \ | ||
145 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | ||
146 | .shift = wshift, .invert = winvert, \ | ||
147 | .event = wevent, .event_flags = wflags} | ||
143 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ | 148 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ |
144 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 149 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ |
145 | .shift = wshift, .invert = winvert} | 150 | .shift = wshift, .invert = winvert} |
151 | #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ | ||
152 | wevent, wflags) \ | ||
153 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | ||
154 | .shift = wshift, .invert = winvert, \ | ||
155 | .event = wevent, .event_flags = wflags} | ||
146 | 156 | ||
147 | /* generic register modifier widget */ | 157 | /* generic widgets */ |
148 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ | 158 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ |
149 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ | 159 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ |
150 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ | 160 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ |
151 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ | 161 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ |
152 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | 162 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} |
163 | #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ | ||
164 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | ||
165 | .shift = wshift, .invert = winvert, .event = wevent, \ | ||
166 | .event_flags = wflags} | ||
153 | 167 | ||
154 | /* dapm kcontrol types */ | 168 | /* dapm kcontrol types */ |
155 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ | 169 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ |
@@ -298,6 +312,7 @@ enum snd_soc_dapm_type { | |||
298 | snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ | 312 | snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ |
299 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ | 313 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ |
300 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 314 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
315 | snd_soc_dapm_supply, /* power/clock supply */ | ||
301 | }; | 316 | }; |
302 | 317 | ||
303 | /* | 318 | /* |
@@ -357,6 +372,8 @@ struct snd_soc_dapm_widget { | |||
357 | unsigned char suspend:1; /* was active before suspend */ | 372 | unsigned char suspend:1; /* was active before suspend */ |
358 | unsigned char pmdown:1; /* waiting for timeout */ | 373 | unsigned char pmdown:1; /* waiting for timeout */ |
359 | 374 | ||
375 | int (*power_check)(struct snd_soc_dapm_widget *w); | ||
376 | |||
360 | /* external events */ | 377 | /* external events */ |
361 | unsigned short event_flags; /* flags to specify event types */ | 378 | unsigned short event_flags; /* flags to specify event types */ |
362 | int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); | 379 | int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); |
diff --git a/include/sound/soc.h b/include/sound/soc.h index a40bc6f316fc..6ab80bf7abd2 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -118,6 +118,14 @@ | |||
118 | .info = snd_soc_info_volsw, \ | 118 | .info = snd_soc_info_volsw, \ |
119 | .get = xhandler_get, .put = xhandler_put, \ | 119 | .get = xhandler_get, .put = xhandler_put, \ |
120 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 120 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
121 | #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | ||
122 | xhandler_get, xhandler_put) \ | ||
123 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
124 | .info = snd_soc_info_volsw, \ | ||
125 | .get = xhandler_get, .put = xhandler_put, \ | ||
126 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
127 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | ||
128 | .max = xmax, .invert = xinvert} } | ||
121 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 129 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
122 | xhandler_get, xhandler_put, tlv_array) \ | 130 | xhandler_get, xhandler_put, tlv_array) \ |
123 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 131 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -417,6 +425,12 @@ struct snd_soc_dai_link { | |||
417 | /* codec/machine specific init - e.g. add machine controls */ | 425 | /* codec/machine specific init - e.g. add machine controls */ |
418 | int (*init)(struct snd_soc_codec *codec); | 426 | int (*init)(struct snd_soc_codec *codec); |
419 | 427 | ||
428 | /* Symmetry requirements */ | ||
429 | unsigned int symmetric_rates:1; | ||
430 | |||
431 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
432 | unsigned int rate; | ||
433 | |||
420 | /* DAI pcm */ | 434 | /* DAI pcm */ |
421 | struct snd_pcm *pcm; | 435 | struct snd_pcm *pcm; |
422 | }; | 436 | }; |