Skip to content

Commit

Permalink
Merge tag 'asoc-fix-v6.7-rc8' of https://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.7

I recently got a LibreTech Sapphire board for my CI and while
integrating it found and fixed some issues, including crashes for the
enum validation.  There's also a couple of patches adding quirks for
another x86 laptop from Hans and an error handling fix for the Freescale
rpmsg driver.
  • Loading branch information
Takashi Iwai committed Jan 4, 2024
2 parents c344ef3 + b036d8e commit 2cd06bc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
10 changes: 8 additions & 2 deletions sound/soc/fsl/fsl_rpmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static int fsl_rpmsg_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component,
&fsl_rpmsg_dai, 1);
if (ret)
return ret;
goto err_pm_disable;

rpmsg->card_pdev = platform_device_register_data(&pdev->dev,
"imx-audio-rpmsg",
Expand All @@ -248,16 +248,22 @@ static int fsl_rpmsg_probe(struct platform_device *pdev)
if (IS_ERR(rpmsg->card_pdev)) {
dev_err(&pdev->dev, "failed to register rpmsg card\n");
ret = PTR_ERR(rpmsg->card_pdev);
return ret;
goto err_pm_disable;
}

return 0;

err_pm_disable:
pm_runtime_disable(&pdev->dev);
return ret;
}

static void fsl_rpmsg_remove(struct platform_device *pdev)
{
struct fsl_rpmsg *rpmsg = platform_get_drvdata(pdev);

pm_runtime_disable(&pdev->dev);

if (rpmsg->card_pdev)
platform_device_unregister(rpmsg->card_pdev);
}
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/mediatek/mt8186/mt8186-dai-adda.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ static const struct snd_soc_dapm_widget mtk_dai_adda_widgets[] = {
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),

SND_SOC_DAPM_SUPPLY_S("AUD_PAD_TOP", SUPPLY_SEQ_ADDA_AUD_PAD_TOP,
0, 0, 0,
AFE_AUD_PAD_TOP, RG_RX_FIFO_ON_SFT, 0,
mtk_adda_pad_top_event,
SND_SOC_DAPM_PRE_PMU),
SND_SOC_DAPM_SUPPLY_S("ADDA_MTKAIF_CFG", SUPPLY_SEQ_ADDA_MTKAIF_CFG,
Expand Down
5 changes: 4 additions & 1 deletion sound/soc/meson/g12a-toacodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int mux, reg;

if (ucontrol->value.enumerated.item[0] >= e->items)
return -EINVAL;

mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]);
regmap_field_read(priv->field_dat_sel, &reg);

Expand Down Expand Up @@ -101,7 +104,7 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,

snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);

return 0;
return 1;
}

static SOC_ENUM_SINGLE_DECL(g12a_toacodec_mux_enum, TOACODEC_CTRL0,
Expand Down
8 changes: 7 additions & 1 deletion sound/soc/meson/g12a-tohdmitx.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ static int g12a_tohdmitx_i2s_mux_put_enum(struct snd_kcontrol *kcontrol,
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int mux, changed;

if (ucontrol->value.enumerated.item[0] >= e->items)
return -EINVAL;

mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]);
changed = snd_soc_component_test_bits(component, e->reg,
CTRL0_I2S_DAT_SEL,
Expand Down Expand Up @@ -93,6 +96,9 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int mux, changed;

if (ucontrol->value.enumerated.item[0] >= e->items)
return -EINVAL;

mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]);
changed = snd_soc_component_test_bits(component, TOHDMITX_CTRL0,
CTRL0_SPDIF_SEL,
Expand All @@ -112,7 +118,7 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,

snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);

return 0;
return 1;
}

static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_spdif_mux_enum, TOHDMITX_CTRL0,
Expand Down

0 comments on commit 2cd06bc

Please sign in to comment.