mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
ANDROID: SoC: core: Introduce macro SOC_SINGLE_MULTI_EXT
For some of the mixer controls, client would like to register count as a parameter. Macro adds support to specify the count. BUG: 144610828 Change-Id: I26343af2e4a35952d93dc2d5fa0caad2a3e50ffe Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org> Signed-off-by: Meng Wang <mwang@codeaurora.org>
This commit is contained in:
@@ -239,6 +239,14 @@
|
|||||||
.get = xhandler_get, .put = xhandler_put, \
|
.get = xhandler_get, .put = xhandler_put, \
|
||||||
.private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
|
.private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
|
||||||
xmax, xinvert) }
|
xmax, xinvert) }
|
||||||
|
#define SOC_SINGLE_MULTI_EXT(xname, xreg, xshift, xmax, xinvert, xcount,\
|
||||||
|
xhandler_get, xhandler_put) \
|
||||||
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
||||||
|
.info = snd_soc_info_multi_ext, \
|
||||||
|
.get = xhandler_get, .put = xhandler_put, \
|
||||||
|
.private_value = (unsigned long)&(struct soc_multi_mixer_control) \
|
||||||
|
{.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \
|
||||||
|
.count = xcount, .platform_max = xmax, .invert = xinvert} }
|
||||||
#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
|
#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
|
||||||
xhandler_get, xhandler_put, tlv_array) \
|
xhandler_get, xhandler_put, tlv_array) \
|
||||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
||||||
@@ -621,6 +629,8 @@ int snd_soc_get_strobe(struct snd_kcontrol *kcontrol,
|
|||||||
struct snd_ctl_elem_value *ucontrol);
|
struct snd_ctl_elem_value *ucontrol);
|
||||||
int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
|
int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
struct snd_ctl_elem_value *ucontrol);
|
||||||
|
int snd_soc_info_multi_ext(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_info *uinfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct snd_soc_jack_pin - Describes a pin to update based on jack detection
|
* struct snd_soc_jack_pin - Describes a pin to update based on jack detection
|
||||||
@@ -1194,6 +1204,11 @@ struct soc_mreg_control {
|
|||||||
unsigned int regbase, regcount, nbits, invert;
|
unsigned int regbase, regcount, nbits, invert;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct soc_multi_mixer_control {
|
||||||
|
int min, max, platform_max, count;
|
||||||
|
unsigned int reg, rreg, shift, rshift, invert;
|
||||||
|
};
|
||||||
|
|
||||||
/* enumerated kcontrol */
|
/* enumerated kcontrol */
|
||||||
struct soc_enum {
|
struct soc_enum {
|
||||||
int reg;
|
int reg;
|
||||||
|
|||||||
@@ -3313,6 +3313,39 @@ int snd_soc_get_dai_id(struct device_node *ep)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_get_dai_id);
|
EXPORT_SYMBOL_GPL(snd_soc_get_dai_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* snd_soc_info_multi_ext - external single mixer info callback
|
||||||
|
* @kcontrol: mixer control
|
||||||
|
* @uinfo: control element information
|
||||||
|
*
|
||||||
|
* Callback to provide information about a single external mixer control.
|
||||||
|
* that accepts multiple input.
|
||||||
|
*
|
||||||
|
* Returns 0 for success.
|
||||||
|
*/
|
||||||
|
int snd_soc_info_multi_ext(struct snd_kcontrol *kcontrol,
|
||||||
|
struct snd_ctl_elem_info *uinfo)
|
||||||
|
{
|
||||||
|
struct soc_multi_mixer_control *mc =
|
||||||
|
(struct soc_multi_mixer_control *)kcontrol->private_value;
|
||||||
|
int platform_max;
|
||||||
|
|
||||||
|
if (!mc->platform_max)
|
||||||
|
mc->platform_max = mc->max;
|
||||||
|
platform_max = mc->platform_max;
|
||||||
|
|
||||||
|
if (platform_max == 1 && !strnstr(kcontrol->id.name, " Volume", 30))
|
||||||
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
|
||||||
|
else
|
||||||
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||||
|
|
||||||
|
uinfo->count = mc->count;
|
||||||
|
uinfo->value.integer.min = 0;
|
||||||
|
uinfo->value.integer.max = platform_max;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(snd_soc_info_multi_ext);
|
||||||
|
|
||||||
int snd_soc_get_dai_name(struct of_phandle_args *args,
|
int snd_soc_get_dai_name(struct of_phandle_args *args,
|
||||||
const char **dai_name)
|
const char **dai_name)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user