aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2014-05-02 01:28:11 -0400
committerMark Brown <broonie@linaro.org>2014-05-02 16:44:24 -0400
commitd98812082c87732b45c71d63afc6a9ba3cca3f03 (patch)
treecd2c24fb6c54c1814c3b98e25b6c7b9c83887bbb
parent3dcba280f739772a4156fbcdae39229d6bb5e02b (diff)
ASoC: add SND_SOC_BYTES_EXT
we need _EXT version for SND_SOC_BYTES so that DSPs can use this to pass data for DSP modules Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/soc.h13
-rw-r--r--sound/soc/soc-core.c12
2 files changed, 25 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 192ddc40ae0a..3da5f2328ff3 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -266,6 +266,13 @@
266 {.base = xbase, .num_regs = xregs, \ 266 {.base = xbase, .num_regs = xregs, \
267 .mask = xmask }) } 267 .mask = xmask }) }
268 268
269#define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \
270{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
271 .info = snd_soc_bytes_info_ext, \
272 .get = xhandler_get, .put = xhandler_put, \
273 .private_value = (unsigned long)&(struct soc_bytes_ext) \
274 {.max = xcount} }
275
269#define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \ 276#define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \
270 xmin, xmax, xinvert) \ 277 xmin, xmax, xinvert) \
271{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 278{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -534,6 +541,8 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
534 struct snd_ctl_elem_value *ucontrol); 541 struct snd_ctl_elem_value *ucontrol);
535int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, 542int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
536 struct snd_ctl_elem_value *ucontrol); 543 struct snd_ctl_elem_value *ucontrol);
544int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol,
545 struct snd_ctl_elem_info *ucontrol);
537int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol, 546int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol,
538 struct snd_ctl_elem_info *uinfo); 547 struct snd_ctl_elem_info *uinfo);
539int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, 548int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
@@ -1080,6 +1089,10 @@ struct soc_bytes {
1080 u32 mask; 1089 u32 mask;
1081}; 1090};
1082 1091
1092struct soc_bytes_ext {
1093 int max;
1094};
1095
1083/* multi register control */ 1096/* multi register control */
1084struct soc_mreg_control { 1097struct soc_mreg_control {
1085 long min, max; 1098 long min, max;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 799cbe81fe39..7fa3b4a04bd3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3107,6 +3107,18 @@ out:
3107} 3107}
3108EXPORT_SYMBOL_GPL(snd_soc_bytes_put); 3108EXPORT_SYMBOL_GPL(snd_soc_bytes_put);
3109 3109
3110int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol,
3111 struct snd_ctl_elem_info *ucontrol)
3112{
3113 struct soc_bytes_ext *params = (void *)kcontrol->private_value;
3114
3115 ucontrol->type = SNDRV_CTL_ELEM_TYPE_BYTES;
3116 ucontrol->count = params->max;
3117
3118 return 0;
3119}
3120EXPORT_SYMBOL_GPL(snd_soc_bytes_info_ext);
3121
3110/** 3122/**
3111 * snd_soc_info_xr_sx - signed multi register info callback 3123 * snd_soc_info_xr_sx - signed multi register info callback
3112 * @kcontrol: mreg control 3124 * @kcontrol: mreg control