Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89294b76 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wsa883x: add function to get swr device number"

parents a45e739e 77ab1182
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -770,6 +770,30 @@ int wsa883x_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
}
EXPORT_SYMBOL(wsa883x_codec_info_create_codec_entry);

/*
 * wsa883x_codec_get_dev_num - returns swr device number
 * @component: Codec instance
 *
 * Return: swr device number on success or negative error
 * code on failure.
 */
int wsa883x_codec_get_dev_num(struct snd_soc_component *component)
{
	struct wsa883x_priv *wsa883x;

	if (!component)
		return -EINVAL;

	wsa883x = snd_soc_component_get_drvdata(component);
	if (!wsa883x) {
		pr_err("%s: wsa883x component is NULL\n", __func__);
		return -EINVAL;
	}

	return wsa883x->swr_slave->dev_num;
}
EXPORT_SYMBOL(wsa883x_codec_get_dev_num);

static int wsa883x_get_compander(struct snd_kcontrol *kcontrol,
			       struct snd_ctl_elem_value *ucontrol)
{
+5 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ int wsa883x_set_channel_map(struct snd_soc_component *component,
int wsa883x_codec_info_create_codec_entry(
					struct snd_info_entry *codec_root,
					struct snd_soc_component *component);
int wsa883x_codec_get_dev_num(struct snd_soc_component *component);
#else
static int wsa883x_set_channel_map(struct snd_soc_component *component,
				   u8 *port, u8 num_port, unsigned int *ch_mask,
@@ -36,6 +37,10 @@ static int wsa883x_codec_info_create_codec_entry(
	return 0;
}

static int wsa883x_codec_get_dev_num(struct snd_soc_component *component)
{
	return 0;
}
#endif

#endif /* _WSA883X_H */