asoc: codec: wcd938x: Get swr device number
add wcd938x_codec_get_dev_num to return swr device number Change-Id: I45f4324645643b4edc6182cee508ce1e647c3612 signed-off-by: sarath varma ganapahiraju <ganavarm@codeaurora.org>
此提交包含在:

提交者
Gerrit - the friendly Code Review server

父節點
4a24723e3d
當前提交
2db2fd8857
@@ -2739,6 +2739,29 @@ static int wcd938x_ear_pa_gain_put(struct snd_kcontrol *kcontrol,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* wcd938x_codec_get_dev_num - returns swr device number
|
||||
* @component: Codec instance
|
||||
*
|
||||
* Return: swr device number on success or negative error
|
||||
* code on failure.
|
||||
*/
|
||||
int wcd938x_codec_get_dev_num(struct snd_soc_component *component)
|
||||
{
|
||||
struct wcd938x_priv *wcd938x;
|
||||
|
||||
if (!component)
|
||||
return -EINVAL;
|
||||
|
||||
wcd938x = snd_soc_component_get_drvdata(component);
|
||||
if (!wcd938x || !wcd938x->rx_swr_dev) {
|
||||
pr_err("%s: wcd938x component is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return wcd938x->rx_swr_dev->dev_num;
|
||||
}
|
||||
EXPORT_SYMBOL(wcd938x_codec_get_dev_num);
|
||||
|
||||
static int wcd938x_get_compander(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
|
新增問題並參考
封鎖使用者