Commit a1e5e7e9 authored by Mythri P K's avatar Mythri P K Committed by Mark Brown

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: default avatarMythri P K <mythri.p.k@intel.com>
Signed-off-by: default avatarJeeja KP <jeeja.kp@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8005c49d
......@@ -92,8 +92,10 @@ struct snd_soc_tplg_kcontrol_ops {
/* Bytes ext operations, for TLV byte controls */
struct snd_soc_tplg_bytes_ext_ops {
u32 id;
int (*get)(unsigned int __user *bytes, unsigned int size);
int (*put)(const unsigned int __user *bytes, unsigned int size);
int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
unsigned int size);
int (*put)(struct snd_kcontrol *kcontrol,
const unsigned int __user *bytes, unsigned int size);
};
/*
......
......@@ -1225,8 +1225,10 @@ struct soc_bytes_ext {
struct snd_soc_dobj dobj;
/* used for TLV byte control */
int (*get)(unsigned int __user *bytes, unsigned int size);
int (*put)(const unsigned int __user *bytes, unsigned int size);
int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
unsigned int size);
int (*put)(struct snd_kcontrol *kcontrol, const unsigned int __user *bytes,
unsigned int size);
};
/* multi register control */
......
......@@ -779,11 +779,11 @@ int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag,
switch (op_flag) {
case SNDRV_CTL_TLV_OP_READ:
if (params->get)
ret = params->get(tlv, count);
ret = params->get(kcontrol, tlv, count);
break;
case SNDRV_CTL_TLV_OP_WRITE:
if (params->put)
ret = params->put(tlv, count);
ret = params->put(kcontrol, tlv, count);
break;
}
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment