aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
diff options
context:
space:
mode:
authorOmair Mohammed Abdullah <omair.m.abdullah@intel.com>2014-07-15 12:04:48 -0400
committerMark Brown <broonie@linaro.org>2014-07-16 17:43:59 -0400
commit7523a271682fc1f35355da344249ce8f8c8b8cb9 (patch)
tree5e1c50131b61909dddd438ad40a63cfb3789d646 /include/sound/soc.h
parent0cea76f3393782d67ccea8f07e9abf341bc4f60e (diff)
ASoC: core: add a helper for extended byte controls using TLV
ALSA supports arbitrary length TLVs for each kcontrol that can be used to pass metadata about the control (e.g. volumes, enum information). The same transport mechanism is now used for arbitrary length data by defining a new helper. Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r--include/sound/soc.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index ed9e2d7e5fdc..688fa667dee5 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -270,7 +270,14 @@
270 .get = xhandler_get, .put = xhandler_put, \ 270 .get = xhandler_get, .put = xhandler_put, \
271 .private_value = (unsigned long)&(struct soc_bytes_ext) \ 271 .private_value = (unsigned long)&(struct soc_bytes_ext) \
272 {.max = xcount} } 272 {.max = xcount} }
273 273#define SND_SOC_BYTES_TLV(xname, xcount, xhandler_get, xhandler_put) \
274{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
275 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE | \
276 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \
277 .tlv.c = (snd_soc_bytes_tlv_callback), \
278 .info = snd_soc_info_bytes_ext, \
279 .private_value = (unsigned long)&(struct soc_bytes_ext) \
280 {.max = xcount, .get = xhandler_get, .put = xhandler_put, } }
274#define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \ 281#define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \
275 xmin, xmax, xinvert) \ 282 xmin, xmax, xinvert) \
276{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 283{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -552,6 +559,8 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
552 struct snd_ctl_elem_value *ucontrol); 559 struct snd_ctl_elem_value *ucontrol);
553int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol, 560int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol,
554 struct snd_ctl_elem_info *ucontrol); 561 struct snd_ctl_elem_info *ucontrol);
562int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag,
563 unsigned int size, unsigned int __user *tlv);
555int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol, 564int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol,
556 struct snd_ctl_elem_info *uinfo); 565 struct snd_ctl_elem_info *uinfo);
557int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, 566int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
@@ -1119,6 +1128,9 @@ struct soc_bytes {
1119 1128
1120struct soc_bytes_ext { 1129struct soc_bytes_ext {
1121 int max; 1130 int max;
1131 /* used for TLV byte control */
1132 int (*get)(unsigned int __user *bytes, unsigned int size);
1133 int (*put)(const unsigned int __user *bytes, unsigned int size);
1122}; 1134};
1123 1135
1124/* multi register control */ 1136/* multi register control */