summaryrefslogtreecommitdiff
path: root/sound/soc/mediatek/mt8195
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mediatek/mt8195')
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-afe-pcm.c7
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-dai-adda.c8
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-dai-etdm.c3
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-mt6359.c21
4 files changed, 20 insertions, 19 deletions
diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
index 5d025ad72263..bc0a63457cd7 100644
--- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
+++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
@@ -1460,8 +1460,7 @@ static const unsigned int mt8195_afe_1x_en_sel_values[] = {
static int mt8195_memif_1x_en_sel_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
struct mt8195_afe_private *afe_priv = afe->platform_priv;
struct mtk_dai_memif_priv *memif_priv;
@@ -1484,8 +1483,7 @@ static int mt8195_memif_1x_en_sel_put(struct snd_kcontrol *kcontrol,
static int mt8195_asys_irq_1x_en_sel_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
struct mt8195_afe_private *afe_priv = afe->platform_priv;
unsigned int id = kcontrol->id.device;
@@ -3176,7 +3174,6 @@ err_pm_put:
static void mt8195_afe_pcm_dev_remove(struct platform_device *pdev)
{
- pm_runtime_disable(&pdev->dev);
if (!pm_runtime_status_suspended(&pdev->dev))
mt8195_afe_runtime_suspend(&pdev->dev);
}
diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-adda.c b/sound/soc/mediatek/mt8195/mt8195-dai-adda.c
index 8da1587128cc..94abde15ea09 100644
--- a/sound/soc/mediatek/mt8195/mt8195-dai-adda.c
+++ b/sound/soc/mediatek/mt8195/mt8195-dai-adda.c
@@ -484,7 +484,7 @@ static int mt8195_adda_dl_gain_get(struct snd_kcontrol *kcontrol,
static int mt8195_adda6_only_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mt8195_afe_private *afe_priv = afe->platform_priv;
struct mtkaif_param *param = &afe_priv->mtkaif_params;
@@ -496,7 +496,7 @@ static int mt8195_adda6_only_get(struct snd_kcontrol *kcontrol,
static int mt8195_adda6_only_set(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mt8195_afe_private *afe_priv = afe->platform_priv;
struct mtkaif_param *param = &afe_priv->mtkaif_params;
@@ -515,7 +515,7 @@ static int mt8195_adda6_only_set(struct snd_kcontrol *kcontrol,
static int mt8195_adda_dmic_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mt8195_afe_private *afe_priv = afe->platform_priv;
struct mtkaif_param *param = &afe_priv->mtkaif_params;
@@ -527,7 +527,7 @@ static int mt8195_adda_dmic_get(struct snd_kcontrol *kcontrol,
static int mt8195_adda_dmic_set(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mt8195_afe_private *afe_priv = afe->platform_priv;
struct mtkaif_param *param = &afe_priv->mtkaif_params;
diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
index fd4f9f8f032d..723cab01e72e 100644
--- a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
+++ b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
@@ -738,8 +738,7 @@ static int mt8195_etdm_clk_src_sel_put(struct snd_kcontrol *kcontrol,
static int mt8195_etdm_clk_src_sel_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
unsigned int value = 0;
unsigned int reg = 0;
diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359.c b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
index 7b96c843a14a..4d62bc654a58 100644
--- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c
+++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
@@ -451,6 +451,7 @@ static int mt8195_rt5682_init(struct snd_soc_pcm_runtime *rtd)
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
struct mt8195_afe_private *afe_priv = afe->platform_priv;
struct snd_soc_card *card = rtd->card;
+ struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
int ret;
priv->i2so1_mclk = afe_priv->clk[MT8195_CLK_TOP_APLL12_DIV2];
@@ -477,7 +478,7 @@ static int mt8195_rt5682_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
- ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_rt5682_routes,
+ ret = snd_soc_dapm_add_routes(dapm, mt8195_rt5682_routes,
ARRAY_SIZE(mt8195_rt5682_routes));
if (ret)
dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret);
@@ -547,9 +548,10 @@ static const struct snd_soc_ops mt8195_sof_be_ops = {
static int mt8195_rt1011_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);
int ret;
- ret = snd_soc_dapm_new_controls(&card->dapm, mt8195_dual_speaker_widgets,
+ ret = snd_soc_dapm_new_controls(dapm, mt8195_dual_speaker_widgets,
ARRAY_SIZE(mt8195_dual_speaker_widgets));
if (ret) {
dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret);
@@ -564,7 +566,7 @@ static int mt8195_rt1011_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
- ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_rt1011_routes,
+ ret = snd_soc_dapm_add_routes(dapm, mt8195_rt1011_routes,
ARRAY_SIZE(mt8195_rt1011_routes));
if (ret)
dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret);
@@ -575,9 +577,10 @@ static int mt8195_rt1011_init(struct snd_soc_pcm_runtime *rtd)
static int mt8195_dumb_amp_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);
int ret;
- ret = snd_soc_dapm_new_controls(&card->dapm, mt8195_speaker_widgets,
+ ret = snd_soc_dapm_new_controls(dapm, mt8195_speaker_widgets,
ARRAY_SIZE(mt8195_speaker_widgets));
if (ret) {
dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret);
@@ -598,13 +601,14 @@ static int mt8195_dumb_amp_init(struct snd_soc_pcm_runtime *rtd)
static int mt8195_rt1019_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);
int ret;
ret = mt8195_dumb_amp_init(rtd);
if (ret)
return ret;
- ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_rt1019_routes,
+ ret = snd_soc_dapm_add_routes(dapm, mt8195_rt1019_routes,
ARRAY_SIZE(mt8195_rt1019_routes));
if (ret)
dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret);
@@ -615,9 +619,10 @@ static int mt8195_rt1019_init(struct snd_soc_pcm_runtime *rtd)
static int mt8195_max98390_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);
int ret;
- ret = snd_soc_dapm_new_controls(&card->dapm, mt8195_dual_speaker_widgets,
+ ret = snd_soc_dapm_new_controls(dapm, mt8195_dual_speaker_widgets,
ARRAY_SIZE(mt8195_dual_speaker_widgets));
if (ret) {
dev_err(rtd->dev, "unable to add dapm controls, ret %d\n", ret);
@@ -632,7 +637,7 @@ static int mt8195_max98390_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
- ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_max98390_routes,
+ ret = snd_soc_dapm_add_routes(dapm, mt8195_max98390_routes,
ARRAY_SIZE(mt8195_max98390_routes));
if (ret)
dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret);
@@ -655,7 +660,7 @@ static int mt8195_etdm_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
static int mt8195_set_bias_level_post(struct snd_soc_card *card,
struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level)
{
- struct snd_soc_component *component = dapm->component;
+ struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card);
struct mt8195_mt6359_priv *priv = soc_card_data->mach_priv;
int ret;