Commit e1d809b3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-fix-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of fixes for rc1.

  The majority of changes are various ASoC driver-specific small fixes
  and usual HD-audio quirks, while there are a couple of core changes: a
  fix in ALSA core procfs code to avoid deadlocks at disconnection and
  an ASoC core fix for DAPM clock widgets"

* tag 'sound-fix-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  OSS: dmasound/paula: Convert to platform remove callback returning void
  ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus
  ALSA: info: Fix potential deadlock at disconnection
  ASoC: nau8540: Add self recovery to improve capture quility
  ALSA: hda/realtek: Add support dual speaker for Dell
  ALSA: hda: Add ASRock X670E Taichi to denylist
  ALSA: hda/realtek: Add quirk for ASUS UX7602ZM
  ASoC: SOF: sof-client: trivial: fix comment typo
  ASoC: dapm: fix clock get name
  ASoC: hdmi-codec: register hpd callback on component probe
  ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages
  ASoC: da7219: Improve system suspend and resume handling
  ASoC: codecs: Modify macro value error
  ASoC: codecs: Modify the wrong judgment of re value
  ASoC: codecs: Modify the maximum value of calib
  ASoC: amd: acp: fix for i2s mode register field update
  ASoC: codecs: aw88399: Fix -Wuninitialized in aw_dev_set_vcalb()
  ASoC: rt712-sdca: fix speaker route missing issue
  ASoC: rockchip: Fix unused rockchip_i2s_tdm_match warning for !CONFIG_OF
  ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings
parents ae4f52a7 bce36aa6
...@@ -56,7 +56,7 @@ struct snd_info_private_data { ...@@ -56,7 +56,7 @@ struct snd_info_private_data {
}; };
static int snd_info_version_init(void); static int snd_info_version_init(void);
static void snd_info_disconnect(struct snd_info_entry *entry); static void snd_info_clear_entries(struct snd_info_entry *entry);
/* /*
...@@ -569,11 +569,16 @@ void snd_info_card_disconnect(struct snd_card *card) ...@@ -569,11 +569,16 @@ void snd_info_card_disconnect(struct snd_card *card)
{ {
if (!card) if (!card)
return; return;
mutex_lock(&info_mutex);
proc_remove(card->proc_root_link); proc_remove(card->proc_root_link);
card->proc_root_link = NULL;
if (card->proc_root) if (card->proc_root)
snd_info_disconnect(card->proc_root); proc_remove(card->proc_root->p);
mutex_lock(&info_mutex);
if (card->proc_root)
snd_info_clear_entries(card->proc_root);
card->proc_root_link = NULL;
card->proc_root = NULL;
mutex_unlock(&info_mutex); mutex_unlock(&info_mutex);
} }
...@@ -745,15 +750,14 @@ struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card, ...@@ -745,15 +750,14 @@ struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card,
} }
EXPORT_SYMBOL(snd_info_create_card_entry); EXPORT_SYMBOL(snd_info_create_card_entry);
static void snd_info_disconnect(struct snd_info_entry *entry) static void snd_info_clear_entries(struct snd_info_entry *entry)
{ {
struct snd_info_entry *p; struct snd_info_entry *p;
if (!entry->p) if (!entry->p)
return; return;
list_for_each_entry(p, &entry->children, list) list_for_each_entry(p, &entry->children, list)
snd_info_disconnect(p); snd_info_clear_entries(p);
proc_remove(entry->p);
entry->p = NULL; entry->p = NULL;
} }
...@@ -770,8 +774,9 @@ void snd_info_free_entry(struct snd_info_entry * entry) ...@@ -770,8 +774,9 @@ void snd_info_free_entry(struct snd_info_entry * entry)
if (!entry) if (!entry)
return; return;
if (entry->p) { if (entry->p) {
proc_remove(entry->p);
mutex_lock(&info_mutex); mutex_lock(&info_mutex);
snd_info_disconnect(entry); snd_info_clear_entries(entry);
mutex_unlock(&info_mutex); mutex_unlock(&info_mutex);
} }
......
...@@ -720,14 +720,13 @@ static int __init amiga_audio_probe(struct platform_device *pdev) ...@@ -720,14 +720,13 @@ static int __init amiga_audio_probe(struct platform_device *pdev)
return dmasound_init(); return dmasound_init();
} }
static int __exit amiga_audio_remove(struct platform_device *pdev) static void __exit amiga_audio_remove(struct platform_device *pdev)
{ {
dmasound_deinit(); dmasound_deinit();
return 0;
} }
static struct platform_driver amiga_audio_driver = { static struct platform_driver amiga_audio_driver = {
.remove = __exit_p(amiga_audio_remove), .remove_new = __exit_p(amiga_audio_remove),
.driver = { .driver = {
.name = "amiga-audio", .name = "amiga-audio",
}, },
......
...@@ -2068,6 +2068,7 @@ static const struct pci_device_id driver_denylist[] = { ...@@ -2068,6 +2068,7 @@ static const struct pci_device_id driver_denylist[] = {
{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */
{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */
{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */
{ PCI_DEVICE_SUB(0x1022, 0x15e3, 0x1022, 0xd601) }, /* ASRock X670E Taichi */
{} {}
}; };
......
...@@ -7343,8 +7343,10 @@ enum { ...@@ -7343,8 +7343,10 @@ enum {
ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
ALC299_FIXUP_PREDATOR_SPK, ALC299_FIXUP_PREDATOR_SPK,
ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
ALC289_FIXUP_DELL_SPK1,
ALC289_FIXUP_DELL_SPK2, ALC289_FIXUP_DELL_SPK2,
ALC289_FIXUP_DUAL_SPK, ALC289_FIXUP_DUAL_SPK,
ALC289_FIXUP_RTK_AMP_DUAL_SPK,
ALC294_FIXUP_SPK2_TO_DAC1, ALC294_FIXUP_SPK2_TO_DAC1,
ALC294_FIXUP_ASUS_DUAL_SPK, ALC294_FIXUP_ASUS_DUAL_SPK,
ALC285_FIXUP_THINKPAD_X1_GEN7, ALC285_FIXUP_THINKPAD_X1_GEN7,
...@@ -7444,6 +7446,8 @@ enum { ...@@ -7444,6 +7446,8 @@ enum {
ALC287_FIXUP_THINKPAD_I2S_SPK, ALC287_FIXUP_THINKPAD_I2S_SPK,
ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD, ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
ALC2XX_FIXUP_HEADSET_MIC, ALC2XX_FIXUP_HEADSET_MIC,
ALC289_FIXUP_DELL_CS35L41_SPI_2,
ALC294_FIXUP_CS35L41_I2C_2,
}; };
/* A special fixup for Lenovo C940 and Yoga Duet 7; /* A special fixup for Lenovo C940 and Yoga Duet 7;
...@@ -8670,6 +8674,15 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -8670,6 +8674,15 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true, .chained = true,
.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
}, },
[ALC289_FIXUP_DELL_SPK1] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
{ 0x14, 0x90170140 },
{ }
},
.chained = true,
.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
},
[ALC289_FIXUP_DELL_SPK2] = { [ALC289_FIXUP_DELL_SPK2] = {
.type = HDA_FIXUP_PINS, .type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) { .v.pins = (const struct hda_pintbl[]) {
...@@ -8685,6 +8698,12 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -8685,6 +8698,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true, .chained = true,
.chain_id = ALC289_FIXUP_DELL_SPK2 .chain_id = ALC289_FIXUP_DELL_SPK2
}, },
[ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc285_fixup_speaker2_to_dac1,
.chained = true,
.chain_id = ALC289_FIXUP_DELL_SPK1
},
[ALC294_FIXUP_SPK2_TO_DAC1] = { [ALC294_FIXUP_SPK2_TO_DAC1] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc285_fixup_speaker2_to_dac1, .v.func = alc285_fixup_speaker2_to_dac1,
...@@ -9552,6 +9571,16 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -9552,6 +9571,16 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc_fixup_headset_mic, .v.func = alc_fixup_headset_mic,
}, },
[ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
.type = HDA_FIXUP_FUNC,
.v.func = cs35l41_fixup_spi_two,
.chained = true,
.chain_id = ALC289_FIXUP_DUAL_SPK
},
[ALC294_FIXUP_CS35L41_I2C_2] = {
.type = HDA_FIXUP_FUNC,
.v.func = cs35l41_fixup_i2c_two,
},
}; };
static const struct snd_pci_quirk alc269_fixup_tbl[] = { static const struct snd_pci_quirk alc269_fixup_tbl[] = {
...@@ -9662,13 +9691,15 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -9662,13 +9691,15 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
...@@ -9913,6 +9944,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -9913,6 +9944,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
...@@ -9929,6 +9961,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -9929,6 +9961,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#define DRV_NAME "acp_i2s_playcap" #define DRV_NAME "acp_i2s_playcap"
#define I2S_MASTER_MODE_ENABLE 1 #define I2S_MASTER_MODE_ENABLE 1
#define I2S_MODE_ENABLE 0
#define LRCLK_DIV_FIELD GENMASK(10, 2) #define LRCLK_DIV_FIELD GENMASK(10, 2)
#define BCLK_DIV_FIELD GENMASK(23, 11) #define BCLK_DIV_FIELD GENMASK(23, 11)
#define ACP63_LRCLK_DIV_FIELD GENMASK(12, 2) #define ACP63_LRCLK_DIV_FIELD GENMASK(12, 2)
...@@ -56,7 +55,8 @@ static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id) ...@@ -56,7 +55,8 @@ static inline void acp_set_i2s_clk(struct acp_dev_data *adata, int dai_id)
} }
val = I2S_MASTER_MODE_ENABLE; val = I2S_MASTER_MODE_ENABLE;
val |= I2S_MODE_ENABLE & BIT(1); if (adata->tdm_mode)
val |= BIT(1);
switch (chip->acp_rev) { switch (chip->acp_rev) {
case ACP63_DEV: case ACP63_DEV:
......
...@@ -356,7 +356,7 @@ static const struct snd_kcontrol_new aw88395_controls[] = { ...@@ -356,7 +356,7 @@ static const struct snd_kcontrol_new aw88395_controls[] = {
aw88395_get_fade_in_time, aw88395_set_fade_in_time), aw88395_get_fade_in_time, aw88395_set_fade_in_time),
SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN, SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN,
aw88395_get_fade_out_time, aw88395_set_fade_out_time), aw88395_get_fade_out_time, aw88395_set_fade_out_time),
SOC_SINGLE_EXT("Calib", 0, 0, 100, 0, SOC_SINGLE_EXT("Calib", 0, 0, AW88395_CALI_RE_MAX, 0,
aw88395_re_get, aw88395_re_set), aw88395_re_get, aw88395_re_set),
AW88395_PROFILE_EXT("Profile Set", aw88395_profile_info, AW88395_PROFILE_EXT("Profile Set", aw88395_profile_info,
aw88395_profile_get, aw88395_profile_set), aw88395_profile_get, aw88395_profile_set),
......
...@@ -438,7 +438,7 @@ static int aw_dev_set_vcalb(struct aw88399 *aw88399) ...@@ -438,7 +438,7 @@ static int aw_dev_set_vcalb(struct aw88399 *aw88399)
if (ret) if (ret)
return ret; return ret;
vsense_select = vsense_select & (~AW88399_VDSEL_MASK); vsense_select = vsense_value & (~AW88399_VDSEL_MASK);
ret = aw88399_dev_get_icalk(aw88399, &icalk); ret = aw88399_dev_get_icalk(aw88399, &icalk);
if (ret) { if (ret) {
...@@ -486,8 +486,8 @@ static int aw_dev_update_cali_re(struct aw_cali_desc *cali_desc) ...@@ -486,8 +486,8 @@ static int aw_dev_update_cali_re(struct aw_cali_desc *cali_desc)
u32 cali_re; u32 cali_re;
int ret; int ret;
if ((aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MAX) || if ((aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MAX) ||
(aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MIN)) (aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MIN))
return -EINVAL; return -EINVAL;
cali_re = AW88399_SHOW_RE_TO_DSP_RE((aw_dev->cali_desc.cali_re + cali_re = AW88399_SHOW_RE_TO_DSP_RE((aw_dev->cali_desc.cali_re +
...@@ -1710,7 +1710,7 @@ static const struct snd_kcontrol_new aw88399_controls[] = { ...@@ -1710,7 +1710,7 @@ static const struct snd_kcontrol_new aw88399_controls[] = {
aw88399_get_fade_in_time, aw88399_set_fade_in_time), aw88399_get_fade_in_time, aw88399_set_fade_in_time),
SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN, SOC_SINGLE_EXT("Volume Ramp Down Step", 0, 0, FADE_TIME_MAX, FADE_TIME_MIN,
aw88399_get_fade_out_time, aw88399_set_fade_out_time), aw88399_get_fade_out_time, aw88399_set_fade_out_time),
SOC_SINGLE_EXT("Calib", 0, 0, 100, 0, SOC_SINGLE_EXT("Calib", 0, 0, AW88399_CALI_RE_MAX, 0,
aw88399_re_get, aw88399_re_set), aw88399_re_get, aw88399_re_set),
AW88399_PROFILE_EXT("AW88399 Profile Set", aw88399_profile_info, AW88399_PROFILE_EXT("AW88399 Profile Set", aw88399_profile_info,
aw88399_profile_get, aw88399_profile_set), aw88399_profile_get, aw88399_profile_set),
......
...@@ -522,7 +522,7 @@ enum { ...@@ -522,7 +522,7 @@ enum {
enum { enum {
AW88399_DEV_VDSEL_DAC = 0, AW88399_DEV_VDSEL_DAC = 0,
AW88399_DEV_VDSEL_VSENSE = 1, AW88399_DEV_VDSEL_VSENSE = 32,
}; };
enum { enum {
......
...@@ -927,10 +927,15 @@ void da7219_aad_suspend(struct snd_soc_component *component) ...@@ -927,10 +927,15 @@ void da7219_aad_suspend(struct snd_soc_component *component)
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
u8 micbias_ctrl; u8 micbias_ctrl;
disable_irq(da7219_aad->irq);
if (da7219_aad->jack) { if (da7219_aad->jack) {
/* Disable jack detection during suspend */ /* Disable jack detection during suspend */
snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1, snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1,
DA7219_ACCDET_EN_MASK, 0); DA7219_ACCDET_EN_MASK, 0);
cancel_delayed_work_sync(&da7219_aad->jack_det_work);
/* Disable ground switch */
snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00);
/* /*
* If we have a 4-pole jack inserted, then micbias will be * If we have a 4-pole jack inserted, then micbias will be
...@@ -947,8 +952,6 @@ void da7219_aad_suspend(struct snd_soc_component *component) ...@@ -947,8 +952,6 @@ void da7219_aad_suspend(struct snd_soc_component *component)
} }
} }
} }
synchronize_irq(da7219_aad->irq);
} }
void da7219_aad_resume(struct snd_soc_component *component) void da7219_aad_resume(struct snd_soc_component *component)
...@@ -971,6 +974,8 @@ void da7219_aad_resume(struct snd_soc_component *component) ...@@ -971,6 +974,8 @@ void da7219_aad_resume(struct snd_soc_component *component)
DA7219_ACCDET_EN_MASK, DA7219_ACCDET_EN_MASK,
DA7219_ACCDET_EN_MASK); DA7219_ACCDET_EN_MASK);
} }
enable_irq(da7219_aad->irq);
} }
......
...@@ -877,18 +877,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component, ...@@ -877,18 +877,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component,
void *data) void *data)
{ {
struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
int ret = -ENOTSUPP;
if (hcp->hcd.ops->hook_plugged_cb) { if (hcp->hcd.ops->hook_plugged_cb) {
hcp->jack = jack; hcp->jack = jack;
ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, return 0;
hcp->hcd.data,
plugged_cb,
component->dev);
if (ret)
hcp->jack = NULL;
} }
return ret;
return -ENOTSUPP;
} }
static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai)
...@@ -982,6 +977,21 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component, ...@@ -982,6 +977,21 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component,
return ret; return ret;
} }
static int hdmi_probe(struct snd_soc_component *component)
{
struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
int ret = 0;
if (hcp->hcd.ops->hook_plugged_cb) {
ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent,
hcp->hcd.data,
plugged_cb,
component->dev);
}
return ret;
}
static void hdmi_remove(struct snd_soc_component *component) static void hdmi_remove(struct snd_soc_component *component)
{ {
struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
...@@ -992,6 +1002,7 @@ static void hdmi_remove(struct snd_soc_component *component) ...@@ -992,6 +1002,7 @@ static void hdmi_remove(struct snd_soc_component *component)
} }
static const struct snd_soc_component_driver hdmi_driver = { static const struct snd_soc_component_driver hdmi_driver = {
.probe = hdmi_probe,
.remove = hdmi_remove, .remove = hdmi_remove,
.dapm_widgets = hdmi_widgets, .dapm_widgets = hdmi_widgets,
.num_dapm_widgets = ARRAY_SIZE(hdmi_widgets), .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
......
...@@ -530,12 +530,61 @@ static int nau8540_set_tdm_slot(struct snd_soc_dai *dai, ...@@ -530,12 +530,61 @@ static int nau8540_set_tdm_slot(struct snd_soc_dai *dai,
return 0; return 0;
} }
static int nau8540_dai_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);
struct regmap *regmap = nau8540->regmap;
unsigned int val;
int ret = 0;
/* Reading the peak data to detect abnormal data in the ADC channel.
* If abnormal data happens, the driver takes recovery actions to
* refresh the ADC channel.
*/
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
regmap_update_bits(regmap, NAU8540_REG_CLOCK_CTRL,
NAU8540_CLK_AGC_EN, NAU8540_CLK_AGC_EN);
regmap_update_bits(regmap, NAU8540_REG_ALC_CONTROL_3,
NAU8540_ALC_CH_ALL_EN, NAU8540_ALC_CH_ALL_EN);
regmap_read(regmap, NAU8540_REG_PEAK_CH1, &val);
dev_dbg(nau8540->dev, "1.ADC CH1 peak data %x", val);
if (!val) {
regmap_update_bits(regmap, NAU8540_REG_MUTE,
NAU8540_PGA_CH_ALL_MUTE, NAU8540_PGA_CH_ALL_MUTE);
regmap_update_bits(regmap, NAU8540_REG_MUTE,
NAU8540_PGA_CH_ALL_MUTE, 0);
regmap_write(regmap, NAU8540_REG_RST, 0x1);
regmap_write(regmap, NAU8540_REG_RST, 0);
regmap_read(regmap, NAU8540_REG_PEAK_CH1, &val);
dev_dbg(nau8540->dev, "2.ADC CH1 peak data %x", val);
if (!val) {
dev_err(nau8540->dev, "Channel recovery failed!!");
ret = -EIO;
}
}
regmap_update_bits(regmap, NAU8540_REG_CLOCK_CTRL,
NAU8540_CLK_AGC_EN, 0);
regmap_update_bits(regmap, NAU8540_REG_ALC_CONTROL_3,
NAU8540_ALC_CH_ALL_EN, 0);
break;
default:
break;
}
return ret;
}
static const struct snd_soc_dai_ops nau8540_dai_ops = { static const struct snd_soc_dai_ops nau8540_dai_ops = {
.startup = nau8540_dai_startup, .startup = nau8540_dai_startup,
.hw_params = nau8540_hw_params, .hw_params = nau8540_hw_params,
.set_fmt = nau8540_set_fmt, .set_fmt = nau8540_set_fmt,
.set_tdm_slot = nau8540_set_tdm_slot, .set_tdm_slot = nau8540_set_tdm_slot,
.trigger = nau8540_dai_trigger,
}; };
#define NAU8540_RATES SNDRV_PCM_RATE_8000_48000 #define NAU8540_RATES SNDRV_PCM_RATE_8000_48000
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
/* CLOCK_CTRL (0x02) */ /* CLOCK_CTRL (0x02) */
#define NAU8540_CLK_ADC_EN (0x1 << 15) #define NAU8540_CLK_ADC_EN (0x1 << 15)
#define NAU8540_CLK_AGC_EN (0x1 << 3)
#define NAU8540_CLK_I2S_EN (0x1 << 1) #define NAU8540_CLK_I2S_EN (0x1 << 1)
/* CLOCK_SRC (0x03) */ /* CLOCK_SRC (0x03) */
...@@ -168,6 +169,13 @@ ...@@ -168,6 +169,13 @@
#define NAU8540_TDM_OFFSET_EN (0x1 << 14) #define NAU8540_TDM_OFFSET_EN (0x1 << 14)
#define NAU8540_TDM_TX_MASK 0xf #define NAU8540_TDM_TX_MASK 0xf
/* ALC_CONTROL_3 (0x22) */
#define NAU8540_ALC_CH1_EN (0x1 << 12)
#define NAU8540_ALC_CH2_EN (0x1 << 13)
#define NAU8540_ALC_CH3_EN (0x1 << 14)
#define NAU8540_ALC_CH4_EN (0x1 << 15)
#define NAU8540_ALC_CH_ALL_EN (0xf << 12)
/* ADC_SAMPLE_RATE (0x3A) */ /* ADC_SAMPLE_RATE (0x3A) */
#define NAU8540_CH_SYNC (0x1 << 14) #define NAU8540_CH_SYNC (0x1 << 14)
#define NAU8540_ADC_OSR_MASK 0x3 #define NAU8540_ADC_OSR_MASK 0x3
...@@ -181,6 +189,13 @@ ...@@ -181,6 +189,13 @@
#define NAU8540_VMID_SEL_SFT 4 #define NAU8540_VMID_SEL_SFT 4
#define NAU8540_VMID_SEL_MASK (0x3 << NAU8540_VMID_SEL_SFT) #define NAU8540_VMID_SEL_MASK (0x3 << NAU8540_VMID_SEL_SFT)
/* MUTE (0x61) */
#define NAU8540_PGA_CH1_MUTE 0x1
#define NAU8540_PGA_CH2_MUTE 0x2
#define NAU8540_PGA_CH3_MUTE 0x4
#define NAU8540_PGA_CH4_MUTE 0x8
#define NAU8540_PGA_CH_ALL_MUTE 0xf
/* MIC_BIAS (0x67) */ /* MIC_BIAS (0x67) */
#define NAU8540_PU_PRE (0x1 << 8) #define NAU8540_PU_PRE (0x1 << 8)
......
...@@ -963,13 +963,6 @@ static int rt712_sdca_probe(struct snd_soc_component *component) ...@@ -963,13 +963,6 @@ static int rt712_sdca_probe(struct snd_soc_component *component)
rt712_sdca_parse_dt(rt712, &rt712->slave->dev); rt712_sdca_parse_dt(rt712, &rt712->slave->dev);
rt712->component = component; rt712->component = component;
if (!rt712->first_hw_init)
return 0;
ret = pm_runtime_resume(component->dev);
if (ret < 0 && ret != -EACCES)
return ret;
/* add SPK route */ /* add SPK route */
if (rt712->hw_id != RT712_DEV_ID_713) { if (rt712->hw_id != RT712_DEV_ID_713) {
snd_soc_add_component_controls(component, snd_soc_add_component_controls(component,
...@@ -980,6 +973,13 @@ static int rt712_sdca_probe(struct snd_soc_component *component) ...@@ -980,6 +973,13 @@ static int rt712_sdca_probe(struct snd_soc_component *component)
rt712_sdca_spk_dapm_routes, ARRAY_SIZE(rt712_sdca_spk_dapm_routes)); rt712_sdca_spk_dapm_routes, ARRAY_SIZE(rt712_sdca_spk_dapm_routes));
} }
if (!rt712->first_hw_init)
return 0;
ret = pm_runtime_resume(component->dev);
if (ret < 0 && ret != -EACCES)
return ret;
return 0; return 0;
} }
......
...@@ -1216,7 +1216,7 @@ static int mt8186_mt6366_rt1019_rt5682s_dev_probe(struct platform_device *pdev) ...@@ -1216,7 +1216,7 @@ static int mt8186_mt6366_rt1019_rt5682s_dev_probe(struct platform_device *pdev)
playback_codec = of_get_child_by_name(pdev->dev.of_node, "playback-codecs"); playback_codec = of_get_child_by_name(pdev->dev.of_node, "playback-codecs");
if (!playback_codec) { if (!playback_codec) {
ret = -EINVAL; ret = -EINVAL;
dev_err_probe(&pdev->dev, ret, "Property 'speaker-codecs' missing or invalid\n"); dev_err_probe(&pdev->dev, ret, "Property 'playback-codecs' missing or invalid\n");
goto err_playback_codec; goto err_playback_codec;
} }
...@@ -1230,7 +1230,7 @@ static int mt8186_mt6366_rt1019_rt5682s_dev_probe(struct platform_device *pdev) ...@@ -1230,7 +1230,7 @@ static int mt8186_mt6366_rt1019_rt5682s_dev_probe(struct platform_device *pdev)
for_each_card_prelinks(card, i, dai_link) { for_each_card_prelinks(card, i, dai_link) {
ret = mt8186_mt6366_card_set_be_link(card, dai_link, playback_codec, "I2S3"); ret = mt8186_mt6366_card_set_be_link(card, dai_link, playback_codec, "I2S3");
if (ret) { if (ret) {
dev_err_probe(&pdev->dev, ret, "%s set speaker_codec fail\n", dev_err_probe(&pdev->dev, ret, "%s set playback_codec fail\n",
dai_link->name); dai_link->name);
goto err_probe; goto err_probe;
} }
......
...@@ -1757,7 +1757,7 @@ static struct platform_driver rockchip_i2s_tdm_driver = { ...@@ -1757,7 +1757,7 @@ static struct platform_driver rockchip_i2s_tdm_driver = {
.remove_new = rockchip_i2s_tdm_remove, .remove_new = rockchip_i2s_tdm_remove,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.of_match_table = of_match_ptr(rockchip_i2s_tdm_match), .of_match_table = rockchip_i2s_tdm_match,
.pm = &rockchip_i2s_tdm_pm_ops, .pm = &rockchip_i2s_tdm_pm_ops,
}, },
}; };
......
...@@ -3670,7 +3670,7 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, ...@@ -3670,7 +3670,7 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
dapm_pinctrl_event(w, NULL, SND_SOC_DAPM_POST_PMD); dapm_pinctrl_event(w, NULL, SND_SOC_DAPM_POST_PMD);
break; break;
case snd_soc_dapm_clock_supply: case snd_soc_dapm_clock_supply:
w->clk = devm_clk_get(dapm->dev, w->name); w->clk = devm_clk_get(dapm->dev, widget->name);
if (IS_ERR(w->clk)) { if (IS_ERR(w->clk)) {
ret = PTR_ERR(w->clk); ret = PTR_ERR(w->clk);
goto request_failed; goto request_failed;
......
...@@ -176,7 +176,7 @@ int sof_register_clients(struct snd_sof_dev *sdev) ...@@ -176,7 +176,7 @@ int sof_register_clients(struct snd_sof_dev *sdev)
goto err_kernel_injector; goto err_kernel_injector;
} }
/* Platform depndent client device registration */ /* Platform dependent client device registration */
if (sof_ops(sdev) && sof_ops(sdev)->register_ipc_clients) if (sof_ops(sdev) && sof_ops(sdev)->register_ipc_clients)
ret = sof_ops(sdev)->register_ipc_clients(sdev); ret = sof_ops(sdev)->register_ipc_clients(sdev);
......
...@@ -73,6 +73,7 @@ static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id) ...@@ -73,6 +73,7 @@ static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id)
return 0; return 0;
} }
if (mcbsp->active)
pm_runtime_put_sync(mcbsp->dev); pm_runtime_put_sync(mcbsp->dev);
r = clk_set_parent(mcbsp->fclk, fck_src); r = clk_set_parent(mcbsp->fclk, fck_src);
...@@ -80,6 +81,7 @@ static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id) ...@@ -80,6 +81,7 @@ static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id)
dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n", dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n",
src); src);
if (mcbsp->active)
pm_runtime_get_sync(mcbsp->dev); pm_runtime_get_sync(mcbsp->dev);
clk_put(fck_src); clk_put(fck_src);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment