1
0

asoc: Add wcd937x support for Cliffs

Add wcd937x support for Cliffs.

Change-Id: I21ca52133b40b621a36a82f0caa2366a1461d255
Signed-off-by: Faiz Nabi Kuchay <quic_fkuchay@quicinc.com>
Este cometimento está contido em:
Faiz Nabi Kuchay
2023-09-08 20:23:49 +05:30
ascendente ba09b0efd6
cometimento 80d2171c35
4 ficheiros modificados com 71 adições e 1 eliminações

Ver ficheiro

@@ -2048,6 +2048,29 @@ static int wcd937x_ear_pa_gain_put(struct snd_kcontrol *kcontrol,
return 0;
}
/* wcd937x_codec_get_dev_num - returns swr device number
* @component: Codec instance
*
* Return: swr device number on success or negative error
* code on failure.
*/
int wcd937x_codec_get_dev_num(struct snd_soc_component *component)
{
struct wcd937x_priv *wcd937x;
if (!component)
return -EINVAL;
wcd937x = snd_soc_component_get_drvdata(component);
if (!wcd937x || !wcd937x->rx_swr_dev) {
pr_err("%s: wcd937x component is NULL\n", __func__);
return -EINVAL;
}
return wcd937x->rx_swr_dev->dev_num;
}
EXPORT_SYMBOL_GPL(wcd937x_codec_get_dev_num);
static int wcd937x_get_compander(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -2794,6 +2817,30 @@ static struct snd_info_entry_ops wcd937x_variant_ops = {
.read = wcd937x_variant_read,
};
/*
* wcd937x_get_codec_variant
* @component: component instance
*
* Return: codec variant or -EINVAL in error.
*/
int wcd937x_get_codec_variant(struct snd_soc_component *component)
{
struct wcd937x_priv *priv = NULL;
if (!component)
return -EINVAL;
priv = snd_soc_component_get_drvdata(component);
if (!priv) {
dev_err(component->dev,
"%s:wcd937x not probed\n", __func__);
return 0;
}
return priv->variant;
}
EXPORT_SYMBOL_GPL(wcd937x_get_codec_variant);
/*
* wcd937x_info_create_codec_entry - creates wcd937x module
* @codec_root: The parent directory