Commit 5c953a22 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'for-linus' into for-next

Back-merge the 5.11 devel branch for further patching.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parents 9119e566 4841b8e6
...@@ -7,8 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# ...@@ -7,8 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mediatek MT8192 with MT6359, RT1015 and RT5682 ASoC sound card driver title: Mediatek MT8192 with MT6359, RT1015 and RT5682 ASoC sound card driver
maintainers: maintainers:
- Jiaxin Yu <jiaxin.yu@mediatek.com> - Jiaxin Yu <jiaxin.yu@mediatek.com>
- Shane Chien <shane.chien@mediatek.com> - Shane Chien <shane.chien@mediatek.com>
description: description:
This binding describes the MT8192 sound card. This binding describes the MT8192 sound card.
......
...@@ -14504,10 +14504,18 @@ S: Supported ...@@ -14504,10 +14504,18 @@ S: Supported
F: drivers/crypto/qat/ F: drivers/crypto/qat/
QCOM AUDIO (ASoC) DRIVERS QCOM AUDIO (ASoC) DRIVERS
M: Patrick Lai <plai@codeaurora.org> M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
M: Banajit Goswami <bgoswami@codeaurora.org> M: Banajit Goswami <bgoswami@codeaurora.org>
L: alsa-devel@alsa-project.org (moderated for non-subscribers) L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported S: Supported
F: sound/soc/codecs/lpass-va-macro.c
F: sound/soc/codecs/lpass-wsa-macro.*
F: sound/soc/codecs/msm8916-wcd-analog.c
F: sound/soc/codecs/msm8916-wcd-digital.c
F: sound/soc/codecs/wcd9335.*
F: sound/soc/codecs/wcd934x.c
F: sound/soc/codecs/wcd-clsh-v2.*
F: sound/soc/codecs/wsa881x.c
F: sound/soc/qcom/ F: sound/soc/qcom/
QCOM IPA DRIVER QCOM IPA DRIVER
...@@ -16959,7 +16967,7 @@ M: Olivier Moysan <olivier.moysan@st.com> ...@@ -16959,7 +16967,7 @@ M: Olivier Moysan <olivier.moysan@st.com>
M: Arnaud Pouliquen <arnaud.pouliquen@st.com> M: Arnaud Pouliquen <arnaud.pouliquen@st.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers) L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/sound/st,stm32-*.txt F: Documentation/devicetree/bindings/iio/adc/st,stm32-*.yaml
F: sound/soc/stm/ F: sound/soc/stm/
STM32 TIMER/LPTIMER DRIVERS STM32 TIMER/LPTIMER DRIVERS
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
#ifndef __DT_APQ8016_LPASS_H #ifndef __DT_APQ8016_LPASS_H
#define __DT_APQ8016_LPASS_H #define __DT_APQ8016_LPASS_H
#define MI2S_PRIMARY 0 #include <dt-bindings/sound/qcom,lpass.h>
#define MI2S_SECONDARY 1
#define MI2S_TERTIARY 2 /* NOTE: Use qcom,lpass.h to define any AIF ID's for LPASS */
#define MI2S_QUATERNARY 3
#endif /* __DT_APQ8016_LPASS_H */ #endif /* __DT_APQ8016_LPASS_H */
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __DT_QCOM_LPASS_H
#define __DT_QCOM_LPASS_H
#define MI2S_PRIMARY 0
#define MI2S_SECONDARY 1
#define MI2S_TERTIARY 2
#define MI2S_QUATERNARY 3
#define MI2S_QUINARY 4
#define LPASS_DP_RX 5
#define LPASS_MCLK0 0
#endif /* __DT_QCOM_LPASS_H */
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
#ifndef __DT_SC7180_LPASS_H #ifndef __DT_SC7180_LPASS_H
#define __DT_SC7180_LPASS_H #define __DT_SC7180_LPASS_H
#define MI2S_PRIMARY 0 #include <dt-bindings/sound/qcom,lpass.h>
#define MI2S_SECONDARY 1
#define LPASS_DP_RX 2
#define LPASS_MCLK0 0 /* NOTE: Use qcom,lpass.h to define any AIF ID's for LPASS */
#endif /* __DT_APQ8016_LPASS_H */ #endif /* __DT_APQ8016_LPASS_H */
...@@ -229,7 +229,7 @@ typedef int (*snd_pcm_hw_rule_func_t)(struct snd_pcm_hw_params *params, ...@@ -229,7 +229,7 @@ typedef int (*snd_pcm_hw_rule_func_t)(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule { struct snd_pcm_hw_rule {
unsigned int cond; unsigned int cond;
int var; int var;
int deps[4]; int deps[5];
snd_pcm_hw_rule_func_t func; snd_pcm_hw_rule_func_t func;
void *private; void *private;
......
...@@ -382,8 +382,8 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream, ...@@ -382,8 +382,8 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream,
continue; continue;
/* /*
* The 'deps' array includes maximum three dependencies * The 'deps' array includes maximum four dependencies
* to SNDRV_PCM_HW_PARAM_XXXs for this rule. The fourth * to SNDRV_PCM_HW_PARAM_XXXs for this rule. The fifth
* member of this array is a sentinel and should be * member of this array is a sentinel and should be
* negative value. * negative value.
* *
......
...@@ -307,6 +307,10 @@ static const struct config_entry config_table[] = { ...@@ -307,6 +307,10 @@ static const struct config_entry config_table[] = {
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
.device = 0xa0c8, .device = 0xa0c8,
}, },
{
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
.device = 0x43c8,
},
#endif #endif
/* Elkhart Lake */ /* Elkhart Lake */
......
...@@ -2934,7 +2934,7 @@ static void hda_call_codec_resume(struct hda_codec *codec) ...@@ -2934,7 +2934,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
snd_hdac_leave_pm(&codec->core); snd_hdac_leave_pm(&codec->core);
} }
static int hda_codec_suspend(struct device *dev) static int hda_codec_runtime_suspend(struct device *dev)
{ {
struct hda_codec *codec = dev_to_hda_codec(dev); struct hda_codec *codec = dev_to_hda_codec(dev);
unsigned int state; unsigned int state;
...@@ -2953,7 +2953,7 @@ static int hda_codec_suspend(struct device *dev) ...@@ -2953,7 +2953,7 @@ static int hda_codec_suspend(struct device *dev)
return 0; return 0;
} }
static int hda_codec_resume(struct device *dev) static int hda_codec_runtime_resume(struct device *dev)
{ {
struct hda_codec *codec = dev_to_hda_codec(dev); struct hda_codec *codec = dev_to_hda_codec(dev);
...@@ -2968,16 +2968,6 @@ static int hda_codec_resume(struct device *dev) ...@@ -2968,16 +2968,6 @@ static int hda_codec_resume(struct device *dev)
return 0; return 0;
} }
static int hda_codec_runtime_suspend(struct device *dev)
{
return hda_codec_suspend(dev);
}
static int hda_codec_runtime_resume(struct device *dev)
{
return hda_codec_resume(dev);
}
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
...@@ -2998,31 +2988,31 @@ static void hda_codec_pm_complete(struct device *dev) ...@@ -2998,31 +2988,31 @@ static void hda_codec_pm_complete(struct device *dev)
static int hda_codec_pm_suspend(struct device *dev) static int hda_codec_pm_suspend(struct device *dev)
{ {
dev->power.power_state = PMSG_SUSPEND; dev->power.power_state = PMSG_SUSPEND;
return hda_codec_suspend(dev); return pm_runtime_force_suspend(dev);
} }
static int hda_codec_pm_resume(struct device *dev) static int hda_codec_pm_resume(struct device *dev)
{ {
dev->power.power_state = PMSG_RESUME; dev->power.power_state = PMSG_RESUME;
return hda_codec_resume(dev); return pm_runtime_force_resume(dev);
} }
static int hda_codec_pm_freeze(struct device *dev) static int hda_codec_pm_freeze(struct device *dev)
{ {
dev->power.power_state = PMSG_FREEZE; dev->power.power_state = PMSG_FREEZE;
return hda_codec_suspend(dev); return pm_runtime_force_suspend(dev);
} }
static int hda_codec_pm_thaw(struct device *dev) static int hda_codec_pm_thaw(struct device *dev)
{ {
dev->power.power_state = PMSG_THAW; dev->power.power_state = PMSG_THAW;
return hda_codec_resume(dev); return pm_runtime_force_resume(dev);
} }
static int hda_codec_pm_restore(struct device *dev) static int hda_codec_pm_restore(struct device *dev)
{ {
dev->power.power_state = PMSG_RESTORE; dev->power.power_state = PMSG_RESTORE;
return hda_codec_resume(dev); return pm_runtime_force_resume(dev);
} }
#endif /* CONFIG_PM_SLEEP */ #endif /* CONFIG_PM_SLEEP */
......
...@@ -1905,6 +1905,7 @@ enum { ...@@ -1905,6 +1905,7 @@ enum {
ALC889_FIXUP_FRONT_HP_NO_PRESENCE, ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
ALC889_FIXUP_VAIO_TT, ALC889_FIXUP_VAIO_TT,
ALC888_FIXUP_EEE1601, ALC888_FIXUP_EEE1601,
ALC886_FIXUP_EAPD,
ALC882_FIXUP_EAPD, ALC882_FIXUP_EAPD,
ALC883_FIXUP_EAPD, ALC883_FIXUP_EAPD,
ALC883_FIXUP_ACER_EAPD, ALC883_FIXUP_ACER_EAPD,
...@@ -2238,6 +2239,15 @@ static const struct hda_fixup alc882_fixups[] = { ...@@ -2238,6 +2239,15 @@ static const struct hda_fixup alc882_fixups[] = {
{ } { }
} }
}, },
[ALC886_FIXUP_EAPD] = {
.type = HDA_FIXUP_VERBS,
.v.verbs = (const struct hda_verb[]) {
/* change to EAPD mode */
{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
{ 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
{ }
}
},
[ALC882_FIXUP_EAPD] = { [ALC882_FIXUP_EAPD] = {
.type = HDA_FIXUP_VERBS, .type = HDA_FIXUP_VERBS,
.v.verbs = (const struct hda_verb[]) { .v.verbs = (const struct hda_verb[]) {
...@@ -2510,6 +2520,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { ...@@ -2510,6 +2520,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
...@@ -8006,6 +8017,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -8006,6 +8017,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
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),
......
...@@ -1043,7 +1043,7 @@ static const struct hda_fixup via_fixups[] = { ...@@ -1043,7 +1043,7 @@ static const struct hda_fixup via_fixups[] = {
static const struct snd_pci_quirk vt2002p_fixups[] = { static const struct snd_pci_quirk vt2002p_fixups[] = {
SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75), SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75),
SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST),
SND_PCI_QUIRK(0x1558, 0x3501, "Clevo W35xSS_370SS", VIA_FIXUP_POWER_SAVE), SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", VIA_FIXUP_POWER_SAVE),
{} {}
}; };
......
...@@ -165,10 +165,24 @@ static int rn_acp_deinit(void __iomem *acp_base) ...@@ -165,10 +165,24 @@ static int rn_acp_deinit(void __iomem *acp_base)
static const struct dmi_system_id rn_acp_quirk_table[] = { static const struct dmi_system_id rn_acp_quirk_table[] = {
{ {
/* Lenovo IdeaPad Flex 5 14ARE05, IdeaPad 5 15ARE05 */ /* Lenovo IdeaPad S340-14API */
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "LENOVO"), DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "LNVNB161216"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "81NB"),
}
},
{
/* Lenovo IdeaPad Flex 5 14ARE05 */
.matches = {
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "81X2"),
}
},
{
/* Lenovo IdeaPad 5 15ARE05 */
.matches = {
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "81YQ"),
} }
}, },
{ {
......
...@@ -595,18 +595,10 @@ static struct snd_soc_dai_driver ak4497_dai = { ...@@ -595,18 +595,10 @@ static struct snd_soc_dai_driver ak4497_dai = {
.ops = &ak4458_dai_ops, .ops = &ak4458_dai_ops,
}; };
static void ak4458_power_off(struct ak4458_priv *ak4458) static void ak4458_reset(struct ak4458_priv *ak4458, bool active)
{ {
if (ak4458->reset_gpiod) { if (ak4458->reset_gpiod) {
gpiod_set_value_cansleep(ak4458->reset_gpiod, 0); gpiod_set_value_cansleep(ak4458->reset_gpiod, active);
usleep_range(1000, 2000);
}
}
static void ak4458_power_on(struct ak4458_priv *ak4458)
{
if (ak4458->reset_gpiod) {
gpiod_set_value_cansleep(ak4458->reset_gpiod, 1);
usleep_range(1000, 2000); usleep_range(1000, 2000);
} }
} }
...@@ -620,7 +612,7 @@ static int ak4458_init(struct snd_soc_component *component) ...@@ -620,7 +612,7 @@ static int ak4458_init(struct snd_soc_component *component)
if (ak4458->mute_gpiod) if (ak4458->mute_gpiod)
gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); gpiod_set_value_cansleep(ak4458->mute_gpiod, 1);
ak4458_power_on(ak4458); ak4458_reset(ak4458, false);
ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1, ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1,
0x80, 0x80); /* ACKS bit = 1; 10000000 */ 0x80, 0x80); /* ACKS bit = 1; 10000000 */
...@@ -650,7 +642,7 @@ static void ak4458_remove(struct snd_soc_component *component) ...@@ -650,7 +642,7 @@ static void ak4458_remove(struct snd_soc_component *component)
{ {
struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
ak4458_power_off(ak4458); ak4458_reset(ak4458, true);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -660,7 +652,7 @@ static int __maybe_unused ak4458_runtime_suspend(struct device *dev) ...@@ -660,7 +652,7 @@ static int __maybe_unused ak4458_runtime_suspend(struct device *dev)
regcache_cache_only(ak4458->regmap, true); regcache_cache_only(ak4458->regmap, true);
ak4458_power_off(ak4458); ak4458_reset(ak4458, true);
if (ak4458->mute_gpiod) if (ak4458->mute_gpiod)
gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); gpiod_set_value_cansleep(ak4458->mute_gpiod, 0);
...@@ -685,8 +677,8 @@ static int __maybe_unused ak4458_runtime_resume(struct device *dev) ...@@ -685,8 +677,8 @@ static int __maybe_unused ak4458_runtime_resume(struct device *dev)
if (ak4458->mute_gpiod) if (ak4458->mute_gpiod)
gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); gpiod_set_value_cansleep(ak4458->mute_gpiod, 1);
ak4458_power_off(ak4458); ak4458_reset(ak4458, true);
ak4458_power_on(ak4458); ak4458_reset(ak4458, false);
regcache_cache_only(ak4458->regmap, false); regcache_cache_only(ak4458->regmap, false);
regcache_mark_dirty(ak4458->regmap); regcache_mark_dirty(ak4458->regmap);
......
...@@ -717,7 +717,7 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component, ...@@ -717,7 +717,7 @@ 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 = -EOPNOTSUPP; int ret = -ENOTSUPP;
if (hcp->hcd.ops->hook_plugged_cb) { if (hcp->hcd.ops->hook_plugged_cb) {
hcp->jack = jack; hcp->jack = jack;
......
...@@ -2031,11 +2031,14 @@ static struct wm_coeff_ctl *wm_adsp_get_ctl(struct wm_adsp *dsp, ...@@ -2031,11 +2031,14 @@ static struct wm_coeff_ctl *wm_adsp_get_ctl(struct wm_adsp *dsp,
unsigned int alg) unsigned int alg)
{ {
struct wm_coeff_ctl *pos, *rslt = NULL; struct wm_coeff_ctl *pos, *rslt = NULL;
const char *fw_txt = wm_adsp_fw_text[dsp->fw];
list_for_each_entry(pos, &dsp->ctl_list, list) { list_for_each_entry(pos, &dsp->ctl_list, list) {
if (!pos->subname) if (!pos->subname)
continue; continue;
if (strncmp(pos->subname, name, pos->subname_len) == 0 && if (strncmp(pos->subname, name, pos->subname_len) == 0 &&
strncmp(pos->fw_name, fw_txt,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0 &&
pos->alg_region.alg == alg && pos->alg_region.alg == alg &&
pos->alg_region.type == type) { pos->alg_region.type == type) {
rslt = pos; rslt = pos;
......
...@@ -90,7 +90,7 @@ static int imx_hdmi_init(struct snd_soc_pcm_runtime *rtd) ...@@ -90,7 +90,7 @@ static int imx_hdmi_init(struct snd_soc_pcm_runtime *rtd)
} }
ret = snd_soc_component_set_jack(component, &data->hdmi_jack, NULL); ret = snd_soc_component_set_jack(component, &data->hdmi_jack, NULL);
if (ret && ret != -EOPNOTSUPP) { if (ret && ret != -ENOTSUPP) {
dev_err(card->dev, "Can't set HDMI Jack %d\n", ret); dev_err(card->dev, "Can't set HDMI Jack %d\n", ret);
return ret; return ret;
} }
......
...@@ -67,6 +67,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { ...@@ -67,6 +67,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
.driver_data = (void *)(SOF_RT711_JD_SRC_JD2 | .driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
SOF_RT715_DAI_ID_FIX), SOF_RT715_DAI_ID_FIX),
}, },
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E")
},
.driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
SOF_RT715_DAI_ID_FIX |
SOF_SDW_FOUR_SPK),
},
{ {
.callback = sof_sdw_quirk_cb, .callback = sof_sdw_quirk_cb,
.matches = { .matches = {
......
...@@ -3619,19 +3619,20 @@ static void skl_tplg_complete(struct snd_soc_component *component) ...@@ -3619,19 +3619,20 @@ static void skl_tplg_complete(struct snd_soc_component *component)
list_for_each_entry(dobj, &component->dobj_list, list) { list_for_each_entry(dobj, &component->dobj_list, list) {
struct snd_kcontrol *kcontrol = dobj->control.kcontrol; struct snd_kcontrol *kcontrol = dobj->control.kcontrol;
struct soc_enum *se = struct soc_enum *se;
(struct soc_enum *)kcontrol->private_value; char **texts;
char **texts = dobj->control.dtexts;
char chan_text[4]; char chan_text[4];
if (dobj->type != SND_SOC_DOBJ_ENUM || if (dobj->type != SND_SOC_DOBJ_ENUM || !kcontrol ||
dobj->control.kcontrol->put != kcontrol->put != skl_tplg_multi_config_set_dmic)
skl_tplg_multi_config_set_dmic)
continue; continue;
se = (struct soc_enum *)kcontrol->private_value;
texts = dobj->control.dtexts;
sprintf(chan_text, "c%d", mach->mach_params.dmic_num); sprintf(chan_text, "c%d", mach->mach_params.dmic_num);
for (i = 0; i < se->items; i++) { for (i = 0; i < se->items; i++) {
struct snd_ctl_elem_value val; struct snd_ctl_elem_value val = {};
if (strstr(texts[i], chan_text)) { if (strstr(texts[i], chan_text)) {
val.value.enumerated.item[0] = i; val.value.enumerated.item[0] = i;
......
...@@ -532,6 +532,7 @@ static struct snd_soc_dai_link mt8183_da7219_dai_links[] = { ...@@ -532,6 +532,7 @@ static struct snd_soc_dai_link mt8183_da7219_dai_links[] = {
.dpcm_playback = 1, .dpcm_playback = 1,
.ignore_suspend = 1, .ignore_suspend = 1,
.be_hw_params_fixup = mt8183_i2s_hw_params_fixup, .be_hw_params_fixup = mt8183_i2s_hw_params_fixup,
.ignore = 1,
.init = mt8183_da7219_max98357_hdmi_init, .init = mt8183_da7219_max98357_hdmi_init,
SND_SOC_DAILINK_REG(tdm), SND_SOC_DAILINK_REG(tdm),
}, },
...@@ -754,8 +755,10 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) ...@@ -754,8 +755,10 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev)
} }
} }
if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) {
dai_link->codecs->of_node = hdmi_codec; dai_link->codecs->of_node = hdmi_codec;
dai_link->ignore = 0;
}
if (!dai_link->platforms->name) if (!dai_link->platforms->name)
dai_link->platforms->of_node = platform_node; dai_link->platforms->of_node = platform_node;
......
...@@ -515,6 +515,7 @@ static struct snd_soc_dai_link mt8183_mt6358_ts3a227_dai_links[] = { ...@@ -515,6 +515,7 @@ static struct snd_soc_dai_link mt8183_mt6358_ts3a227_dai_links[] = {
.ignore_suspend = 1, .ignore_suspend = 1,
.be_hw_params_fixup = mt8183_i2s_hw_params_fixup, .be_hw_params_fixup = mt8183_i2s_hw_params_fixup,
.ops = &mt8183_mt6358_tdm_ops, .ops = &mt8183_mt6358_tdm_ops,
.ignore = 1,
.init = mt8183_mt6358_ts3a227_max98357_hdmi_init, .init = mt8183_mt6358_ts3a227_max98357_hdmi_init,
SND_SOC_DAILINK_REG(tdm), SND_SOC_DAILINK_REG(tdm),
}, },
...@@ -661,8 +662,10 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) ...@@ -661,8 +662,10 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)
SND_SOC_DAIFMT_CBM_CFM; SND_SOC_DAIFMT_CBM_CFM;
} }
if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) {
dai_link->codecs->of_node = hdmi_codec; dai_link->codecs->of_node = hdmi_codec;
dai_link->ignore = 0;
}
if (!dai_link->platforms->name) if (!dai_link->platforms->name)
dai_link->platforms->of_node = platform_node; dai_link->platforms->of_node = platform_node;
......
...@@ -401,6 +401,53 @@ static const struct snd_soc_ops mt8192_mt6359_rt1015_rt5682_capture1_ops = { ...@@ -401,6 +401,53 @@ static const struct snd_soc_ops mt8192_mt6359_rt1015_rt5682_capture1_ops = {
.startup = mt8192_mt6359_rt1015_rt5682_cap1_startup, .startup = mt8192_mt6359_rt1015_rt5682_cap1_startup,
}; };
static int
mt8192_mt6359_rt5682_startup(struct snd_pcm_substream *substream)
{
static const unsigned int channels[] = {
1, 2
};
static const struct snd_pcm_hw_constraint_list constraints_channels = {
.count = ARRAY_SIZE(channels),
.list = channels,
.mask = 0,
};
static const unsigned int rates[] = {
48000
};
static const struct snd_pcm_hw_constraint_list constraints_rates = {
.count = ARRAY_SIZE(rates),
.list = rates,
.mask = 0,
};
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
ret = snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
if (ret < 0) {
dev_err(rtd->dev, "hw_constraint_list channels failed\n");
return ret;
}
ret = snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
if (ret < 0) {
dev_err(rtd->dev, "hw_constraint_list rate failed\n");
return ret;
}
return 0;
}
static const struct snd_soc_ops mt8192_mt6359_rt5682_ops = {
.startup = mt8192_mt6359_rt5682_startup,
};
/* FE */ /* FE */
SND_SOC_DAILINK_DEFS(playback1, SND_SOC_DAILINK_DEFS(playback1,
DAILINK_COMP_ARRAY(COMP_CPU("DL1")), DAILINK_COMP_ARRAY(COMP_CPU("DL1")),
...@@ -648,6 +695,7 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { ...@@ -648,6 +695,7 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = {
SND_SOC_DPCM_TRIGGER_PRE}, SND_SOC_DPCM_TRIGGER_PRE},
.dynamic = 1, .dynamic = 1,
.dpcm_playback = 1, .dpcm_playback = 1,
.ops = &mt8192_mt6359_rt5682_ops,
SND_SOC_DAILINK_REG(playback3), SND_SOC_DAILINK_REG(playback3),
}, },
{ {
...@@ -721,6 +769,7 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { ...@@ -721,6 +769,7 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = {
SND_SOC_DPCM_TRIGGER_PRE}, SND_SOC_DPCM_TRIGGER_PRE},
.dynamic = 1, .dynamic = 1,
.dpcm_capture = 1, .dpcm_capture = 1,
.ops = &mt8192_mt6359_rt5682_ops,
SND_SOC_DAILINK_REG(capture2), SND_SOC_DAILINK_REG(capture2),
}, },
{ {
......
...@@ -344,8 +344,30 @@ int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai) ...@@ -344,8 +344,30 @@ int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai)
} }
EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_dai_probe); EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_dai_probe);
static int asoc_qcom_of_xlate_dai_name(struct snd_soc_component *component,
struct of_phandle_args *args,
const char **dai_name)
{
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
struct lpass_variant *variant = drvdata->variant;
int id = args->args[0];
int ret = -EINVAL;
int i;
for (i = 0; i < variant->num_dai; i++) {
if (variant->dai_driver[i].id == id) {
*dai_name = variant->dai_driver[i].name;
ret = 0;
break;
}
}
return ret;
}
static const struct snd_soc_component_driver lpass_cpu_comp_driver = { static const struct snd_soc_component_driver lpass_cpu_comp_driver = {
.name = "lpass-cpu", .name = "lpass-cpu",
.of_xlate_dai_name = asoc_qcom_of_xlate_dai_name,
}; };
static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg) static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg)
......
...@@ -131,7 +131,7 @@ static struct lpass_variant ipq806x_data = { ...@@ -131,7 +131,7 @@ static struct lpass_variant ipq806x_data = {
.micmode = REG_FIELD_ID(0x0010, 4, 7, 5, 0x4), .micmode = REG_FIELD_ID(0x0010, 4, 7, 5, 0x4),
.micmono = REG_FIELD_ID(0x0010, 3, 3, 5, 0x4), .micmono = REG_FIELD_ID(0x0010, 3, 3, 5, 0x4),
.wssrc = REG_FIELD_ID(0x0010, 2, 2, 5, 0x4), .wssrc = REG_FIELD_ID(0x0010, 2, 2, 5, 0x4),
.bitwidth = REG_FIELD_ID(0x0010, 0, 0, 5, 0x4), .bitwidth = REG_FIELD_ID(0x0010, 0, 1, 5, 0x4),
.rdma_dyncclk = REG_FIELD_ID(0x6000, 12, 12, 4, 0x1000), .rdma_dyncclk = REG_FIELD_ID(0x6000, 12, 12, 4, 0x1000),
.rdma_bursten = REG_FIELD_ID(0x6000, 11, 11, 4, 0x1000), .rdma_bursten = REG_FIELD_ID(0x6000, 11, 11, 4, 0x1000),
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
#define LPAIF_WRDMAPERCNT_REG(v, chan) LPAIF_WRDMA_REG_ADDR(v, 0x14, (chan)) #define LPAIF_WRDMAPERCNT_REG(v, chan) LPAIF_WRDMA_REG_ADDR(v, 0x14, (chan))
#define LPAIF_INTFDMA_REG(v, chan, reg, dai_id) \ #define LPAIF_INTFDMA_REG(v, chan, reg, dai_id) \
((v->dai_driver[dai_id].id == LPASS_DP_RX) ? \ ((dai_id == LPASS_DP_RX) ? \
LPAIF_HDMI_RDMA##reg##_REG(v, chan) : \ LPAIF_HDMI_RDMA##reg##_REG(v, chan) : \
LPAIF_RDMA##reg##_REG(v, chan)) LPAIF_RDMA##reg##_REG(v, chan))
......
...@@ -257,6 +257,9 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component, ...@@ -257,6 +257,9 @@ static int lpass_platform_pcmops_hw_params(struct snd_soc_component *component,
break; break;
case MI2S_PRIMARY: case MI2S_PRIMARY:
case MI2S_SECONDARY: case MI2S_SECONDARY:
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
ret = regmap_fields_write(dmactl->intf, id, ret = regmap_fields_write(dmactl->intf, id,
LPAIF_DMACTL_AUDINTF(dma_port)); LPAIF_DMACTL_AUDINTF(dma_port));
if (ret) { if (ret) {
...@@ -507,6 +510,9 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, ...@@ -507,6 +510,9 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
break; break;
case MI2S_PRIMARY: case MI2S_PRIMARY:
case MI2S_SECONDARY: case MI2S_SECONDARY:
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
reg_irqclr = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST); reg_irqclr = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
val_irqclr = LPAIF_IRQ_ALL(ch); val_irqclr = LPAIF_IRQ_ALL(ch);
...@@ -559,6 +565,9 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, ...@@ -559,6 +565,9 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
break; break;
case MI2S_PRIMARY: case MI2S_PRIMARY:
case MI2S_SECONDARY: case MI2S_SECONDARY:
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
reg_irqen = LPAIF_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST); reg_irqen = LPAIF_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST);
val_mask = LPAIF_IRQ_ALL(ch); val_mask = LPAIF_IRQ_ALL(ch);
val_irqen = 0; val_irqen = 0;
...@@ -655,6 +664,9 @@ static irqreturn_t lpass_dma_interrupt_handler( ...@@ -655,6 +664,9 @@ static irqreturn_t lpass_dma_interrupt_handler(
break; break;
case MI2S_PRIMARY: case MI2S_PRIMARY:
case MI2S_SECONDARY: case MI2S_SECONDARY:
case MI2S_TERTIARY:
case MI2S_QUATERNARY:
case MI2S_QUINARY:
map = drvdata->lpaif_map; map = drvdata->lpaif_map;
reg = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST); reg = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST);
val = 0; val = 0;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "lpass.h" #include "lpass.h"
static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = { static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = {
[MI2S_PRIMARY] = { {
.id = MI2S_PRIMARY, .id = MI2S_PRIMARY,
.name = "Primary MI2S", .name = "Primary MI2S",
.playback = { .playback = {
...@@ -44,9 +44,7 @@ static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = { ...@@ -44,9 +44,7 @@ static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = {
}, },
.probe = &asoc_qcom_lpass_cpu_dai_probe, .probe = &asoc_qcom_lpass_cpu_dai_probe,
.ops = &asoc_qcom_lpass_cpu_dai_ops, .ops = &asoc_qcom_lpass_cpu_dai_ops,
}, }, {
[MI2S_SECONDARY] = {
.id = MI2S_SECONDARY, .id = MI2S_SECONDARY,
.name = "Secondary MI2S", .name = "Secondary MI2S",
.playback = { .playback = {
...@@ -60,8 +58,7 @@ static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = { ...@@ -60,8 +58,7 @@ static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = {
}, },
.probe = &asoc_qcom_lpass_cpu_dai_probe, .probe = &asoc_qcom_lpass_cpu_dai_probe,
.ops = &asoc_qcom_lpass_cpu_dai_ops, .ops = &asoc_qcom_lpass_cpu_dai_ops,
}, }, {
[LPASS_DP_RX] = {
.id = LPASS_DP_RX, .id = LPASS_DP_RX,
.name = "Hdmi", .name = "Hdmi",
.playback = { .playback = {
...@@ -174,7 +171,7 @@ static struct lpass_variant sc7180_data = { ...@@ -174,7 +171,7 @@ static struct lpass_variant sc7180_data = {
.rdma_channels = 5, .rdma_channels = 5,
.hdmi_rdma_reg_base = 0x64000, .hdmi_rdma_reg_base = 0x64000,
.hdmi_rdma_reg_stride = 0x1000, .hdmi_rdma_reg_stride = 0x1000,
.hdmi_rdma_channels = 4, .hdmi_rdma_channels = 3,
.dmactl_audif_start = 1, .dmactl_audif_start = 1,
.wrdma_reg_base = 0x18000, .wrdma_reg_base = 0x18000,
.wrdma_reg_stride = 0x1000, .wrdma_reg_stride = 0x1000,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <dt-bindings/sound/sc7180-lpass.h> #include <dt-bindings/sound/qcom,lpass.h>
#include "lpass-hdmi.h" #include "lpass-hdmi.h"
#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 #define LPASS_AHBIX_CLOCK_FREQUENCY 131072000
......
...@@ -447,7 +447,7 @@ static void remove_dai(struct snd_soc_component *comp, ...@@ -447,7 +447,7 @@ static void remove_dai(struct snd_soc_component *comp,
{ {
struct snd_soc_dai_driver *dai_drv = struct snd_soc_dai_driver *dai_drv =
container_of(dobj, struct snd_soc_dai_driver, dobj); container_of(dobj, struct snd_soc_dai_driver, dobj);
struct snd_soc_dai *dai; struct snd_soc_dai *dai, *_dai;
if (pass != SOC_TPLG_PASS_PCM_DAI) if (pass != SOC_TPLG_PASS_PCM_DAI)
return; return;
...@@ -455,9 +455,9 @@ static void remove_dai(struct snd_soc_component *comp, ...@@ -455,9 +455,9 @@ static void remove_dai(struct snd_soc_component *comp,
if (dobj->ops && dobj->ops->dai_unload) if (dobj->ops && dobj->ops->dai_unload)
dobj->ops->dai_unload(comp, dobj); dobj->ops->dai_unload(comp, dobj);
for_each_component_dais(comp, dai) for_each_component_dais_safe(comp, dai, _dai)
if (dai->driver == dai_drv) if (dai->driver == dai_drv)
dai->driver = NULL; snd_soc_unregister_dai(dai);
list_del(&dobj->list); list_del(&dobj->list);
} }
...@@ -902,7 +902,7 @@ static int soc_tplg_denum_create_values(struct soc_tplg *tplg, struct soc_enum * ...@@ -902,7 +902,7 @@ static int soc_tplg_denum_create_values(struct soc_tplg *tplg, struct soc_enum *
return -EINVAL; return -EINVAL;
se->dobj.control.dvalues = devm_kcalloc(tplg->dev, le32_to_cpu(ec->items), se->dobj.control.dvalues = devm_kcalloc(tplg->dev, le32_to_cpu(ec->items),
sizeof(u32), sizeof(*se->dobj.control.dvalues),
GFP_KERNEL); GFP_KERNEL);
if (!se->dobj.control.dvalues) if (!se->dobj.control.dvalues)
return -ENOMEM; return -ENOMEM;
...@@ -1742,7 +1742,7 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg, ...@@ -1742,7 +1742,7 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,
list_add(&dai_drv->dobj.list, &tplg->comp->dobj_list); list_add(&dai_drv->dobj.list, &tplg->comp->dobj_list);
/* register the DAI to the component */ /* register the DAI to the component */
dai = devm_snd_soc_register_dai(tplg->dev, tplg->comp, dai_drv, false); dai = snd_soc_register_dai(tplg->comp, dai_drv, false);
if (!dai) if (!dai)
return -ENOMEM; return -ENOMEM;
...@@ -1750,6 +1750,7 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg, ...@@ -1750,6 +1750,7 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,
ret = snd_soc_dapm_new_dai_widgets(dapm, dai); ret = snd_soc_dapm_new_dai_widgets(dapm, dai);
if (ret != 0) { if (ret != 0) {
dev_err(dai->dev, "Failed to create DAI widgets %d\n", ret); dev_err(dai->dev, "Failed to create DAI widgets %d\n", ret);
snd_soc_unregister_dai(dai);
return ret; return ret;
} }
......
...@@ -355,7 +355,7 @@ config SND_SOC_SOF_HDA ...@@ -355,7 +355,7 @@ config SND_SOC_SOF_HDA
config SND_SOC_SOF_INTEL_SOUNDWIRE_LINK config SND_SOC_SOF_INTEL_SOUNDWIRE_LINK
bool "SOF support for SoundWire" bool "SOF support for SoundWire"
depends on SOUNDWIRE && ACPI depends on ACPI
help help
This adds support for SoundWire with Sound Open Firmware This adds support for SoundWire with Sound Open Firmware
for Intel(R) platforms. for Intel(R) platforms.
...@@ -371,6 +371,7 @@ config SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE ...@@ -371,6 +371,7 @@ config SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
config SND_SOC_SOF_INTEL_SOUNDWIRE config SND_SOC_SOF_INTEL_SOUNDWIRE
tristate tristate
select SOUNDWIRE
select SOUNDWIRE_INTEL select SOUNDWIRE_INTEL
help help
This option is not user-selectable but automagically handled by This option is not user-selectable but automagically handled by
......
...@@ -63,16 +63,18 @@ static int hda_codec_load_module(struct hda_codec *codec) ...@@ -63,16 +63,18 @@ static int hda_codec_load_module(struct hda_codec *codec)
} }
/* enable controller wake up event for all codecs with jack connectors */ /* enable controller wake up event for all codecs with jack connectors */
void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable)
{ {
struct hda_bus *hbus = sof_to_hbus(sdev); struct hda_bus *hbus = sof_to_hbus(sdev);
struct hdac_bus *bus = sof_to_bus(sdev); struct hdac_bus *bus = sof_to_bus(sdev);
struct hda_codec *codec; struct hda_codec *codec;
unsigned int mask = 0; unsigned int mask = 0;
list_for_each_codec(codec, hbus) if (enable) {
if (codec->jacktbl.used) list_for_each_codec(codec, hbus)
mask |= BIT(codec->core.addr); if (codec->jacktbl.used)
mask |= BIT(codec->core.addr);
}
snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, mask); snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, mask);
} }
...@@ -81,23 +83,18 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) ...@@ -81,23 +83,18 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev)
void hda_codec_jack_check(struct snd_sof_dev *sdev) void hda_codec_jack_check(struct snd_sof_dev *sdev)
{ {
struct hda_bus *hbus = sof_to_hbus(sdev); struct hda_bus *hbus = sof_to_hbus(sdev);
struct hdac_bus *bus = sof_to_bus(sdev);
struct hda_codec *codec; struct hda_codec *codec;
/* disable controller Wake Up event*/
snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, 0);
list_for_each_codec(codec, hbus) list_for_each_codec(codec, hbus)
/* /*
* Wake up all jack-detecting codecs regardless whether an event * Wake up all jack-detecting codecs regardless whether an event
* has been recorded in STATESTS * has been recorded in STATESTS
*/ */
if (codec->jacktbl.used) if (codec->jacktbl.used)
schedule_delayed_work(&codec->jackpoll_work, pm_request_resume(&codec->core.dev);
codec->jackpoll_interval);
} }
#else #else
void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {} void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable) {}
void hda_codec_jack_check(struct snd_sof_dev *sdev) {} void hda_codec_jack_check(struct snd_sof_dev *sdev) {}
#endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */ #endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */
EXPORT_SYMBOL_NS(hda_codec_jack_wake_enable, SND_SOC_SOF_HDA_AUDIO_CODEC); EXPORT_SYMBOL_NS(hda_codec_jack_wake_enable, SND_SOC_SOF_HDA_AUDIO_CODEC);
...@@ -156,7 +153,8 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, ...@@ -156,7 +153,8 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
if (!hdev->bus->audio_component) { if (!hdev->bus->audio_component) {
dev_dbg(sdev->dev, dev_dbg(sdev->dev,
"iDisp hw present but no driver\n"); "iDisp hw present but no driver\n");
goto error; ret = -ENOENT;
goto out;
} }
hda_priv->need_display_power = true; hda_priv->need_display_power = true;
} }
...@@ -173,24 +171,23 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, ...@@ -173,24 +171,23 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
* other return codes without modification * other return codes without modification
*/ */
if (ret == 0) if (ret == 0)
goto error; ret = -ENOENT;
} }
return ret; out:
if (ret < 0) {
error: snd_hdac_device_unregister(hdev);
snd_hdac_ext_bus_device_exit(hdev); put_device(&hdev->dev);
return -ENOENT; }
#else #else
hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL);
if (!hdev) if (!hdev)
return -ENOMEM; return -ENOMEM;
ret = snd_hdac_ext_bus_device_init(&hbus->core, address, hdev, HDA_DEV_ASOC); ret = snd_hdac_ext_bus_device_init(&hbus->core, address, hdev, HDA_DEV_ASOC);
#endif
return ret; return ret;
#endif
} }
/* Codec initialization */ /* Codec initialization */
......
...@@ -617,7 +617,7 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend) ...@@ -617,7 +617,7 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend)
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
if (runtime_suspend) if (runtime_suspend)
hda_codec_jack_wake_enable(sdev); hda_codec_jack_wake_enable(sdev, true);
/* power down all hda link */ /* power down all hda link */
snd_hdac_ext_bus_link_power_down_all(bus); snd_hdac_ext_bus_link_power_down_all(bus);
...@@ -683,8 +683,11 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume) ...@@ -683,8 +683,11 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
/* check jack status */ /* check jack status */
if (runtime_resume) if (runtime_resume) {
hda_codec_jack_check(sdev); hda_codec_jack_wake_enable(sdev, false);
if (sdev->system_suspend_target == SOF_SUSPEND_NONE)
hda_codec_jack_check(sdev);
}
/* turn off the links that were off before suspend */ /* turn off the links that were off before suspend */
list_for_each_entry(hlink, &bus->hlink_list, list) { list_for_each_entry(hlink, &bus->hlink_list, list) {
......
...@@ -650,7 +650,7 @@ void sof_hda_bus_init(struct hdac_bus *bus, struct device *dev); ...@@ -650,7 +650,7 @@ void sof_hda_bus_init(struct hdac_bus *bus, struct device *dev);
*/ */
void hda_codec_probe_bus(struct snd_sof_dev *sdev, void hda_codec_probe_bus(struct snd_sof_dev *sdev,
bool hda_codec_use_common_hdmi); bool hda_codec_use_common_hdmi);
void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev); void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable);
void hda_codec_jack_check(struct snd_sof_dev *sdev); void hda_codec_jack_check(struct snd_sof_dev *sdev);
#endif /* CONFIG_SND_SOC_SOF_HDA */ #endif /* CONFIG_SND_SOC_SOF_HDA */
......
...@@ -131,12 +131,13 @@ static int sof_acpi_probe(struct platform_device *pdev) ...@@ -131,12 +131,13 @@ static int sof_acpi_probe(struct platform_device *pdev)
if (!id) if (!id)
return -ENODEV; return -ENODEV;
ret = snd_intel_acpi_dsp_driver_probe(dev, id->id); if (IS_REACHABLE(CONFIG_SND_INTEL_DSP_CONFIG)) {
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) { ret = snd_intel_acpi_dsp_driver_probe(dev, id->id);
dev_dbg(dev, "SOF ACPI driver not selected, aborting probe\n"); if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
return -ENODEV; dev_dbg(dev, "SOF ACPI driver not selected, aborting probe\n");
return -ENODEV;
}
} }
dev_dbg(dev, "ACPI DSP detected"); dev_dbg(dev, "ACPI DSP detected");
sof_pdata = devm_kzalloc(dev, sizeof(*sof_pdata), GFP_KERNEL); sof_pdata = devm_kzalloc(dev, sizeof(*sof_pdata), GFP_KERNEL);
......
...@@ -344,10 +344,12 @@ static int sof_pci_probe(struct pci_dev *pci, ...@@ -344,10 +344,12 @@ static int sof_pci_probe(struct pci_dev *pci,
const struct snd_sof_dsp_ops *ops; const struct snd_sof_dsp_ops *ops;
int ret; int ret;
ret = snd_intel_dsp_driver_probe(pci); if (IS_REACHABLE(CONFIG_SND_INTEL_DSP_CONFIG)) {
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) { ret = snd_intel_dsp_driver_probe(pci);
dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n"); if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
return -ENODEV; dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n");
return -ENODEV;
}
} }
dev_dbg(&pci->dev, "PCI DSP detected"); dev_dbg(&pci->dev, "PCI DSP detected");
......
...@@ -466,6 +466,17 @@ static int validate_sample_rate_table_v2v3(struct snd_usb_audio *chip, ...@@ -466,6 +466,17 @@ static int validate_sample_rate_table_v2v3(struct snd_usb_audio *chip,
unsigned int nr_rates; unsigned int nr_rates;
int i, err; int i, err;
/* performing the rate verification may lead to unexpected USB bus
* behavior afterwards by some unknown reason. Do this only for the
* known devices.
*/
switch (USB_ID_VENDOR(chip->usb_id)) {
case 0x07fd: /* MOTU */
break;
default:
return 0; /* don't perform the validation as default */
}
table = kcalloc(fp->nr_rates, sizeof(*table), GFP_KERNEL); table = kcalloc(fp->nr_rates, sizeof(*table), GFP_KERNEL);
if (!table) if (!table)
return -ENOMEM; return -ENOMEM;
......
...@@ -981,6 +981,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre ...@@ -981,6 +981,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate, subs, hw_rule_rate, subs,
SNDRV_PCM_HW_PARAM_RATE,
SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_CHANNELS, SNDRV_PCM_HW_PARAM_CHANNELS,
param_period_time_if_needed, param_period_time_if_needed,
...@@ -990,6 +991,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre ...@@ -990,6 +991,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels, subs, hw_rule_channels, subs,
SNDRV_PCM_HW_PARAM_CHANNELS,
SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_RATE, SNDRV_PCM_HW_PARAM_RATE,
param_period_time_if_needed, param_period_time_if_needed,
...@@ -998,6 +1000,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre ...@@ -998,6 +1000,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
return err; return err;
err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_format, subs, hw_rule_format, subs,
SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_RATE, SNDRV_PCM_HW_PARAM_RATE,
SNDRV_PCM_HW_PARAM_CHANNELS, SNDRV_PCM_HW_PARAM_CHANNELS,
param_period_time_if_needed, param_period_time_if_needed,
......
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