* [PATCH] ASoC: add SND_SOC_BYTES_EXT
@ 2014-05-02 5:28 Vinod Koul
2014-05-02 16:57 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Vinod Koul @ 2014-05-02 5:28 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, lgirdwood
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>
---
include/sound/soc.h | 13 +++++++++++++
sound/soc/soc-core.c | 13 +++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0b83168..63202cf 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -266,6 +266,13 @@
{.base = xbase, .num_regs = xregs, \
.mask = xmask }) }
+#define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
+ .info = snd_soc_bytes_info_ext, \
+ .get = xhandler_get, .put = xhandler_put, \
+ .private_value = (unsigned long)&(struct soc_bytes_ext) \
+ {.max = xcount} }
+
#define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \
xmin, xmax, xinvert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -540,6 +547,8 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
+int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *ucontrol);
int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo);
int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
@@ -1090,6 +1099,10 @@ struct soc_bytes {
u32 mask;
};
+struct soc_bytes_ext {
+ int max;
+};
+
/* multi register control */
struct soc_mreg_control {
long min, max;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 051c006..48e4bba 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3297,6 +3297,19 @@ out:
}
EXPORT_SYMBOL_GPL(snd_soc_bytes_put);
+int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct soc_bytes_ext *params = (void *)kcontrol->private_value;
+
+ ucontrol->type = SNDRV_CTL_ELEM_TYPE_BYTES;
+ ucontrol->count = params->max;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(snd_soc_bytes_info_ext);
+
/**
* snd_soc_info_xr_sx - signed multi register info callback
* @kcontrol: mreg control
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: add SND_SOC_BYTES_EXT
2014-05-02 5:28 [PATCH] ASoC: add SND_SOC_BYTES_EXT Vinod Koul
@ 2014-05-02 16:57 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-05-02 16:57 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 176 bytes --]
On Fri, May 02, 2014 at 10:58:11AM +0530, Vinod Koul wrote:
> we need _EXT version for SND_SOC_BYTES so that DSPs can use this to pass data
> for DSP modules
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-02 16:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-02 5:28 [PATCH] ASoC: add SND_SOC_BYTES_EXT Vinod Koul
2014-05-02 16:57 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox