aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMythri P K <mythri.p.k@intel.com>2015-11-09 12:50:00 -0500
committerMark Brown <broonie@kernel.org>2015-11-18 07:57:50 -0500
commita1e5e7e9b36f360bf75e4f0f7ceb899682f213bd (patch)
tree0aba423f1c401adf7d24a1f1024fddc1d3d573f1
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
ASoC: core: Pass kcontrol to bytes tlv callbacks
Add kcontrol to the tlv callbacks in soc_bytes_ext, as it is needed for referencing the corresponding control in the driver code Also fix the only upstream user in topology core Signed-off-by: Mythri P K <mythri.p.k@intel.com> Signed-off-by: Jeeja KP <jeeja.kp@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc-topology.h6
-rw-r--r--include/sound/soc.h6
-rw-r--r--sound/soc/soc-ops.c4
3 files changed, 10 insertions, 6 deletions
diff --git a/include/sound/soc-topology.h b/include/sound/soc-topology.h
index 086cd7ff6ddc..5b68e3f5aa85 100644
--- a/include/sound/soc-topology.h
+++ b/include/sound/soc-topology.h
@@ -92,8 +92,10 @@ struct snd_soc_tplg_kcontrol_ops {
92/* Bytes ext operations, for TLV byte controls */ 92/* Bytes ext operations, for TLV byte controls */
93struct snd_soc_tplg_bytes_ext_ops { 93struct snd_soc_tplg_bytes_ext_ops {
94 u32 id; 94 u32 id;
95 int (*get)(unsigned int __user *bytes, unsigned int size); 95 int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
96 int (*put)(const unsigned int __user *bytes, unsigned int size); 96 unsigned int size);
97 int (*put)(struct snd_kcontrol *kcontrol,
98 const unsigned int __user *bytes, unsigned int size);
97}; 99};
98 100
99/* 101/*
diff --git a/include/sound/soc.h b/include/sound/soc.h
index a8b4b9c8b1d2..6603155f50ca 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1225,8 +1225,10 @@ struct soc_bytes_ext {
1225 struct snd_soc_dobj dobj; 1225 struct snd_soc_dobj dobj;
1226 1226
1227 /* used for TLV byte control */ 1227 /* used for TLV byte control */
1228 int (*get)(unsigned int __user *bytes, unsigned int size); 1228 int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
1229 int (*put)(const unsigned int __user *bytes, unsigned int size); 1229 unsigned int size);
1230 int (*put)(struct snd_kcontrol *kcontrol, const unsigned int __user *bytes,
1231 unsigned int size);
1230}; 1232};
1231 1233
1232/* multi register control */ 1234/* multi register control */
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index ecd38e52285a..ba3e49010ac3 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -779,11 +779,11 @@ int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag,
779 switch (op_flag) { 779 switch (op_flag) {
780 case SNDRV_CTL_TLV_OP_READ: 780 case SNDRV_CTL_TLV_OP_READ:
781 if (params->get) 781 if (params->get)
782 ret = params->get(tlv, count); 782 ret = params->get(kcontrol, tlv, count);
783 break; 783 break;
784 case SNDRV_CTL_TLV_OP_WRITE: 784 case SNDRV_CTL_TLV_OP_WRITE:
785 if (params->put) 785 if (params->put)
786 ret = params->put(tlv, count); 786 ret = params->put(kcontrol, tlv, count);
787 break; 787 break;
788 } 788 }
789 return ret; 789 return ret;