mirror of https://github.com/torvalds/linux.git
ASoC: mediatek: mt8186-mt6366: convert to snd_soc_dapm_xxx()
This patch converts below functions. dapm->dev -> snd_soc_dapm_to_dev() dapm->card -> snd_soc_dapm_to_card() dapm->component -> snd_soc_dapm_to_component() dapm_kcontrol_get_value() -> snd_soc_dapm_kcontrol_get_value() snd_soc_component_enable_pin() -> snd_soc_dapm_enable_pin() snd_soc_component_enable_pin_unlocked() -> snd_soc_dapm_enable_pin_unlocked() snd_soc_component_disable_pin() -> snd_soc_dapm_disable_pin() snd_soc_component_disable_pin_unlocked() -> snd_soc_dapm_disable_pin_unlocked() snd_soc_component_nc_pin() -> snd_soc_dapm_nc_pin() snd_soc_component_nc_pin_unlocked() -> snd_soc_dapm_nc_pin_unlocked() snd_soc_component_get_pin_status() -> snd_soc_dapm_get_pin_status() snd_soc_component_force_enable_pin() -> snd_soc_dapm_force_enable_pin() snd_soc_component_force_enable_pin_unlocked() -> snd_soc_dapm_force_enable_pin_unlocked() snd_soc_component_force_bias_level() -> snd_soc_dapm_force_bias_level() snd_soc_component_get_bias_level() -> snd_soc_dapm_get_bias_level() snd_soc_component_init_bias_level() -> snd_soc_dapm_init_bias_level() snd_soc_component_get_dapm() -> snd_soc_component_to_dapm() snd_soc_dapm_kcontrol_component() -> snd_soc_dapm_kcontrol_to_component() snd_soc_dapm_kcontrol_widget() -> snd_soc_dapm_kcontrol_to_widget() snd_soc_dapm_kcontrol_dapm() -> snd_soc_dapm_kcontrol_to_dapm() snd_soc_dapm_np_pin() -> snd_soc_dapm_disable_pin() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/875xbhwgps.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
aa851ed874
commit
771f522d64
|
|
@ -88,9 +88,9 @@ static struct snd_soc_codec_conf mt8186_mt6366_rt1019_rt5682s_codec_conf[] = {
|
|||
static int dmic_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
|
||||
struct mtk_soc_card_data *soc_card_data =
|
||||
snd_soc_card_get_drvdata(dapm->card);
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
|
||||
struct snd_soc_card *card = snd_soc_dapm_to_card(dapm);
|
||||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card);
|
||||
struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
|
||||
|
||||
ucontrol->value.integer.value[0] = priv->dmic_switch;
|
||||
|
|
@ -100,15 +100,15 @@ static int dmic_get(struct snd_kcontrol *kcontrol,
|
|||
static int dmic_set(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
|
||||
struct mtk_soc_card_data *soc_card_data =
|
||||
snd_soc_card_get_drvdata(dapm->card);
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
|
||||
struct snd_soc_card *card = snd_soc_dapm_to_card(dapm);
|
||||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card);
|
||||
struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
|
||||
|
||||
priv->dmic_switch = ucontrol->value.integer.value[0];
|
||||
if (priv->dmic_sel) {
|
||||
gpiod_set_value(priv->dmic_sel, priv->dmic_switch);
|
||||
dev_dbg(dapm->card->dev, "dmic_set_value %d\n",
|
||||
dev_dbg(card->dev, "dmic_set_value %d\n",
|
||||
priv->dmic_switch);
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -140,6 +140,7 @@ static const struct snd_soc_dapm_route dmic_map[] = {
|
|||
static int primary_codec_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
|
||||
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card);
|
||||
struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
|
||||
int ret;
|
||||
|
|
@ -156,7 +157,7 @@ static int primary_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets,
|
||||
ret = snd_soc_dapm_new_controls(dapm, dmic_widgets,
|
||||
ARRAY_SIZE(dmic_widgets));
|
||||
if (ret) {
|
||||
dev_err(card->dev, "DMic widget addition failed: %d\n", ret);
|
||||
|
|
@ -164,7 +165,7 @@ static int primary_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map,
|
||||
ret = snd_soc_dapm_add_routes(dapm, dmic_map,
|
||||
ARRAY_SIZE(dmic_map));
|
||||
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in New Issue