aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc-dapm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/soc-dapm.h')
-rw-r--r--include/sound/soc-dapm.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 2b1ae8edc43c..a105b01e06d5 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -22,7 +22,7 @@
22#define SND_SOC_NOPM -1 22#define SND_SOC_NOPM -1
23 23
24/* 24/*
25 * SoC dynamic audio power managment 25 * SoC dynamic audio power management
26 * 26 *
27 * We can have upto 4 power domains 27 * We can have upto 4 power domains
28 * 1. Codec domain - VREF, VMID 28 * 1. Codec domain - VREF, VMID
@@ -131,18 +131,34 @@
131 .shift = wshift, .invert = winvert} 131 .shift = wshift, .invert = winvert}
132 132
133/* dapm kcontrol types */ 133/* dapm kcontrol types */
134#define SOC_DAPM_SINGLE(xname, reg, shift, mask, invert) \ 134#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \
135{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 135{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
136 .info = snd_soc_info_volsw, \ 136 .info = snd_soc_info_volsw, \
137 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 137 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
138 .private_value = SOC_SINGLE_VALUE(reg, shift, mask, invert) } 138 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
139#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, mask, invert, \ 139#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \
140 power) \ 140 power) \
141{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 141{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
142 .info = snd_soc_info_volsw, \ 142 .info = snd_soc_info_volsw, \
143 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 143 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
144 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\ 144 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
145 ((mask) << 16) | ((invert) << 24) } 145 ((max) << 16) | ((invert) << 24) }
146#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
147{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
148 .info = snd_soc_info_volsw, \
149 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
150 .tlv.p = (tlv_array), \
151 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
152 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
153#define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \
154 power, tlv_array) \
155{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
156 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
157 .tlv.p = (tlv_array), \
158 .info = snd_soc_info_volsw, \
159 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
160 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
161 ((max) << 16) | ((invert) << 24) }
146#define SOC_DAPM_ENUM(xname, xenum) \ 162#define SOC_DAPM_ENUM(xname, xenum) \
147{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 163{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
148 .info = snd_soc_info_enum_double, \ 164 .info = snd_soc_info_enum_double, \
@@ -199,6 +215,7 @@ void snd_soc_dapm_free(struct snd_soc_device *socdev);
199/* dapm events */ 215/* dapm events */
200int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, 216int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream,
201 int event); 217 int event);
218int snd_soc_dapm_device_event(struct snd_soc_device *socdev, int event);
202 219
203/* dapm sys fs - used by the core */ 220/* dapm sys fs - used by the core */
204int snd_soc_dapm_sys_add(struct device *dev); 221int snd_soc_dapm_sys_add(struct device *dev);
@@ -272,7 +289,7 @@ struct snd_soc_dapm_widget {
272 289
273 /* external events */ 290 /* external events */
274 unsigned short event_flags; /* flags to specify event types */ 291 unsigned short event_flags; /* flags to specify event types */
275 int (*event)(struct snd_soc_dapm_widget*, int); 292 int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int);
276 293
277 /* kcontrols that relate to this widget */ 294 /* kcontrols that relate to this widget */
278 int num_kcontrols; 295 int num_kcontrols;