Commit 4d9e07cc authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis...

Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Small patchset to harden the SoundWire machine driver, change bad
HIDs, update PLL settings and avoid memory leaks. Given that the
SoundWire core parts are not upstream it's probably not necessary to
provide the patches to stable branches.

Bard Liao (1):
  ASoC: Intel: sof_sdw_rt711: remove hard-coded codec name

Kai Vehmanen (2):
  ASoC: Intel: sof_sdw: add support for systems without i915 audio
  ASoC: Intel: sof_sdw: avoid crash if invalid DSP topology loaded

Libin Yang (1):
  ASoC: Intel: common: change match table ehl-rt5660

Pierre-Louis Bossart (1):
  ASoC: Intel: sof_sdw_rt711: remove properties in card remove

Yong Zhi (1):
  ASoC: intel: board: sof_rt5682: Update rt1015 pll input clk freq

 sound/soc/intel/boards/sof_rt5682.c           |  9 +++++-
 sound/soc/intel/boards/sof_sdw.c              | 31 +++++++++++++------
 sound/soc/intel/boards/sof_sdw_common.h       |  2 ++
 sound/soc/intel/boards/sof_sdw_hdmi.c         |  6 ++++
 sound/soc/intel/boards/sof_sdw_rt711.c        | 17 +++++++++-
 .../intel/common/soc-acpi-intel-ehl-match.c   |  2 +-
 6 files changed, 54 insertions(+), 13 deletions(-)

base-commit: 22e9b543
--
2.25.1
parents fc926a7c 58ef6002
...@@ -161,6 +161,7 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai); ...@@ -161,6 +161,7 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_compress_new(struct snd_soc_dai *dai, int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
struct snd_soc_pcm_runtime *rtd, int num); struct snd_soc_pcm_runtime *rtd, int num);
bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream); bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream);
void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link);
void snd_soc_dai_action(struct snd_soc_dai *dai, void snd_soc_dai_action(struct snd_soc_dai *dai,
int stream, int action); int stream, int action);
static inline void snd_soc_dai_activate(struct snd_soc_dai *dai, static inline void snd_soc_dai_activate(struct snd_soc_dai *dai,
......
...@@ -331,13 +331,6 @@ static int max98373_probe(struct snd_soc_component *component) ...@@ -331,13 +331,6 @@ static int max98373_probe(struct snd_soc_component *component)
regmap_write(max98373->regmap, regmap_write(max98373->regmap,
MAX98373_R202A_PCM_TO_SPK_MONO_MIX_2, MAX98373_R202A_PCM_TO_SPK_MONO_MIX_2,
0x1); 0x1);
/* Set inital volume (0dB) */
regmap_write(max98373->regmap,
MAX98373_R203D_AMP_DIG_VOL_CTRL,
0x00);
regmap_write(max98373->regmap,
MAX98373_R203E_AMP_PATH_GAIN,
0x00);
/* Enable DC blocker */ /* Enable DC blocker */
regmap_write(max98373->regmap, regmap_write(max98373->regmap,
MAX98373_R203F_AMP_DSP_CFG, MAX98373_R203F_AMP_DSP_CFG,
...@@ -397,7 +390,6 @@ const struct snd_soc_component_driver soc_codec_dev_max98373 = { ...@@ -397,7 +390,6 @@ const struct snd_soc_component_driver soc_codec_dev_max98373 = {
.num_dapm_widgets = ARRAY_SIZE(max98373_dapm_widgets), .num_dapm_widgets = ARRAY_SIZE(max98373_dapm_widgets),
.dapm_routes = max98373_audio_map, .dapm_routes = max98373_audio_map,
.num_dapm_routes = ARRAY_SIZE(max98373_audio_map), .num_dapm_routes = ARRAY_SIZE(max98373_audio_map),
.idle_bias_on = 1,
.use_pmdown_time = 1, .use_pmdown_time = 1,
.endianness = 1, .endianness = 1,
.non_legacy_dai_naming = 1, .non_legacy_dai_naming = 1,
......
...@@ -272,13 +272,13 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic) ...@@ -272,13 +272,13 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic)
regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf); regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf);
*mic = buf & 0x80000000; *mic = buf & 0x80000000;
} }
if (!*mic) {
if (!*hp) {
snd_soc_dapm_disable_pin(dapm, "HV"); snd_soc_dapm_disable_pin(dapm, "HV");
snd_soc_dapm_disable_pin(dapm, "VREF"); snd_soc_dapm_disable_pin(dapm, "VREF");
}
if (!*hp)
snd_soc_dapm_disable_pin(dapm, "LDO1"); snd_soc_dapm_disable_pin(dapm, "LDO1");
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
}
return 0; return 0;
} }
......
...@@ -970,13 +970,12 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert) ...@@ -970,13 +970,12 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
rt5682_enable_push_button_irq(component, false); rt5682_enable_push_button_irq(component, false);
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1, snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
RT5682_TRIG_JD_MASK, RT5682_TRIG_JD_LOW); RT5682_TRIG_JD_MASK, RT5682_TRIG_JD_LOW);
if (snd_soc_dapm_get_pin_status(dapm, "MICBIAS")) if (!snd_soc_dapm_get_pin_status(dapm, "MICBIAS"))
snd_soc_component_update_bits(component, snd_soc_component_update_bits(component,
RT5682_PWR_ANLG_1, RT5682_PWR_VREF2, 0); RT5682_PWR_ANLG_1, RT5682_PWR_MB, 0);
else if (!snd_soc_dapm_get_pin_status(dapm, "Vref2"))
snd_soc_component_update_bits(component, snd_soc_component_update_bits(component,
RT5682_PWR_ANLG_1, RT5682_PWR_ANLG_1, RT5682_PWR_VREF2, 0);
RT5682_PWR_VREF2 | RT5682_PWR_MB, 0);
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3, snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
RT5682_PWR_CBJ, 0); RT5682_PWR_CBJ, 0);
snd_soc_component_update_bits(component, RT5682_MICBIAS_2, snd_soc_component_update_bits(component, RT5682_MICBIAS_2,
...@@ -1088,7 +1087,8 @@ void rt5682_jack_detect_handler(struct work_struct *work) ...@@ -1088,7 +1087,8 @@ void rt5682_jack_detect_handler(struct work_struct *work)
/* jack was out, report jack type */ /* jack was out, report jack type */
rt5682->jack_type = rt5682->jack_type =
rt5682_headset_detect(rt5682->component, 1); rt5682_headset_detect(rt5682->component, 1);
} else { } else if ((rt5682->jack_type & SND_JACK_HEADSET) ==
SND_JACK_HEADSET) {
/* jack is already in, report button event */ /* jack is already in, report button event */
rt5682->jack_type = SND_JACK_HEADSET; rt5682->jack_type = SND_JACK_HEADSET;
btn_type = rt5682_button_detect(rt5682->component); btn_type = rt5682_button_detect(rt5682->component);
...@@ -1614,8 +1614,7 @@ static const struct snd_soc_dapm_widget rt5682_dapm_widgets[] = { ...@@ -1614,8 +1614,7 @@ static const struct snd_soc_dapm_widget rt5682_dapm_widgets[] = {
0, set_filter_clk, SND_SOC_DAPM_PRE_PMU), 0, set_filter_clk, SND_SOC_DAPM_PRE_PMU),
SND_SOC_DAPM_SUPPLY("Vref1", RT5682_PWR_ANLG_1, RT5682_PWR_VREF1_BIT, 0, SND_SOC_DAPM_SUPPLY("Vref1", RT5682_PWR_ANLG_1, RT5682_PWR_VREF1_BIT, 0,
rt5682_set_verf, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), rt5682_set_verf, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
SND_SOC_DAPM_SUPPLY("Vref2", RT5682_PWR_ANLG_1, RT5682_PWR_VREF2_BIT, 0, SND_SOC_DAPM_SUPPLY("Vref2", SND_SOC_NOPM, 0, 0, NULL, 0),
NULL, 0),
SND_SOC_DAPM_SUPPLY("MICBIAS", SND_SOC_NOPM, 0, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("MICBIAS", SND_SOC_NOPM, 0, 0, NULL, 0),
/* ASRC */ /* ASRC */
...@@ -2505,6 +2504,15 @@ static int rt5682_wclk_prepare(struct clk_hw *hw) ...@@ -2505,6 +2504,15 @@ static int rt5682_wclk_prepare(struct clk_hw *hw)
snd_soc_dapm_force_enable_pin_unlocked(dapm, "MICBIAS"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "MICBIAS");
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
RT5682_PWR_MB, RT5682_PWR_MB); RT5682_PWR_MB, RT5682_PWR_MB);
snd_soc_dapm_force_enable_pin_unlocked(dapm, "Vref2");
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
RT5682_PWR_VREF2 | RT5682_PWR_FV2,
RT5682_PWR_VREF2);
usleep_range(55000, 60000);
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
RT5682_PWR_FV2, RT5682_PWR_FV2);
snd_soc_dapm_force_enable_pin_unlocked(dapm, "I2S1"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "I2S1");
snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2F"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2F");
snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2B"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2B");
...@@ -2530,9 +2538,12 @@ static void rt5682_wclk_unprepare(struct clk_hw *hw) ...@@ -2530,9 +2538,12 @@ static void rt5682_wclk_unprepare(struct clk_hw *hw)
snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_mutex_lock(dapm);
snd_soc_dapm_disable_pin_unlocked(dapm, "MICBIAS"); snd_soc_dapm_disable_pin_unlocked(dapm, "MICBIAS");
snd_soc_dapm_disable_pin_unlocked(dapm, "Vref2");
if (!rt5682->jack_type) if (!rt5682->jack_type)
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
RT5682_PWR_VREF2 | RT5682_PWR_FV2 |
RT5682_PWR_MB, 0); RT5682_PWR_MB, 0);
snd_soc_dapm_disable_pin_unlocked(dapm, "I2S1"); snd_soc_dapm_disable_pin_unlocked(dapm, "I2S1");
snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2F"); snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2F");
snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2B"); snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2B");
......
...@@ -186,7 +186,7 @@ SOC_DAPM_SINGLE("PCM Playback Switch", WM8974_MONOMIX, 0, 1, 0), ...@@ -186,7 +186,7 @@ SOC_DAPM_SINGLE("PCM Playback Switch", WM8974_MONOMIX, 0, 1, 0),
/* Boost mixer */ /* Boost mixer */
static const struct snd_kcontrol_new wm8974_boost_mixer[] = { static const struct snd_kcontrol_new wm8974_boost_mixer[] = {
SOC_DAPM_SINGLE("Aux Switch", WM8974_INPPGA, 6, 1, 0), SOC_DAPM_SINGLE("Aux Switch", WM8974_INPPGA, 6, 1, 1),
}; };
/* Input PGA */ /* Input PGA */
...@@ -474,6 +474,10 @@ static int wm8974_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -474,6 +474,10 @@ static int wm8974_set_dai_fmt(struct snd_soc_dai *codec_dai,
iface |= 0x0008; iface |= 0x0008;
break; break;
case SND_SOC_DAIFMT_DSP_A: case SND_SOC_DAIFMT_DSP_A:
if ((fmt & SND_SOC_DAIFMT_INV_MASK) == SND_SOC_DAIFMT_IB_IF ||
(fmt & SND_SOC_DAIFMT_INV_MASK) == SND_SOC_DAIFMT_NB_IF) {
return -EINVAL;
}
iface |= 0x00018; iface |= 0x00018;
break; break;
default: default:
......
...@@ -317,8 +317,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, ...@@ -317,8 +317,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
if (ret < 0) if (ret < 0)
goto out_put_node; goto out_put_node;
dai_link->dpcm_playback = 1; snd_soc_dai_link_set_capabilities(dai_link);
dai_link->dpcm_capture = 1;
dai_link->ops = &graph_ops; dai_link->ops = &graph_ops;
dai_link->init = asoc_simple_dai_init; dai_link->init = asoc_simple_dai_init;
......
...@@ -231,8 +231,8 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, ...@@ -231,8 +231,8 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
if (ret < 0) if (ret < 0)
goto out_put_node; goto out_put_node;
dai_link->dpcm_playback = 1; snd_soc_dai_link_set_capabilities(dai_link);
dai_link->dpcm_capture = 1;
dai_link->ops = &simple_ops; dai_link->ops = &simple_ops;
dai_link->init = asoc_simple_dai_init; dai_link->init = asoc_simple_dai_init;
......
...@@ -367,6 +367,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = { ...@@ -367,6 +367,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
{ {
.name = "Codec DSP", .name = "Codec DSP",
.stream_name = "Wake on Voice", .stream_name = "Wake on Voice",
.capture_only = 1,
.ops = &bdw_rt5677_dsp_ops, .ops = &bdw_rt5677_dsp_ops,
SND_SOC_DAILINK_REG(dsp), SND_SOC_DAILINK_REG(dsp),
}, },
......
...@@ -552,8 +552,10 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) ...@@ -552,8 +552,10 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
if (cnt) { if (cnt) {
ret = device_add_properties(codec_dev, props); ret = device_add_properties(codec_dev, props);
if (ret) if (ret) {
put_device(codec_dev);
return ret; return ret;
}
} }
devm_acpi_dev_add_driver_gpios(codec_dev, byt_cht_es8316_gpios); devm_acpi_dev_add_driver_gpios(codec_dev, byt_cht_es8316_gpios);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[] = { struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[] = {
{ {
.id = "INTC1027", .id = "10EC5660",
.drv_name = "ehl_rt5660", .drv_name = "ehl_rt5660",
.sof_fw_filename = "sof-ehl.ri", .sof_fw_filename = "sof-ehl.ri",
.sof_tplg_filename = "sof-ehl-rt5660.tplg", .sof_tplg_filename = "sof-ehl-rt5660.tplg",
......
...@@ -116,7 +116,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card, ...@@ -116,7 +116,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card,
lb = &card->dai_link[*index + 1]; lb = &card->dai_link[*index + 1];
lb->name = kasprintf(GFP_KERNEL, "%s-lb", pad->name); lb->name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-lb", pad->name);
if (!lb->name) if (!lb->name)
return -ENOMEM; return -ENOMEM;
......
...@@ -393,6 +393,44 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir) ...@@ -393,6 +393,44 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)
return stream->channels_min; return stream->channels_min;
} }
/*
* snd_soc_dai_link_set_capabilities() - set dai_link properties based on its DAIs
*/
void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link)
{
struct snd_soc_dai_link_component *cpu;
struct snd_soc_dai_link_component *codec;
struct snd_soc_dai *dai;
bool supported[SNDRV_PCM_STREAM_LAST + 1];
int direction;
int i;
for_each_pcm_streams(direction) {
supported[direction] = true;
for_each_link_cpus(dai_link, i, cpu) {
dai = snd_soc_find_dai(cpu);
if (!dai || !snd_soc_dai_stream_valid(dai, direction)) {
supported[direction] = false;
break;
}
}
if (!supported[direction])
continue;
for_each_link_codecs(dai_link, i, codec) {
dai = snd_soc_find_dai(codec);
if (!dai || !snd_soc_dai_stream_valid(dai, direction)) {
supported[direction] = false;
break;
}
}
}
dai_link->dpcm_playback = supported[SNDRV_PCM_STREAM_PLAYBACK];
dai_link->dpcm_capture = supported[SNDRV_PCM_STREAM_CAPTURE];
}
EXPORT_SYMBOL_GPL(snd_soc_dai_link_set_capabilities);
void snd_soc_dai_action(struct snd_soc_dai *dai, void snd_soc_dai_action(struct snd_soc_dai *dai,
int stream, int action) int stream, int action)
{ {
......
...@@ -345,15 +345,15 @@ int snd_sof_device_remove(struct device *dev) ...@@ -345,15 +345,15 @@ int snd_sof_device_remove(struct device *dev)
struct snd_sof_pdata *pdata = sdev->pdata; struct snd_sof_pdata *pdata = sdev->pdata;
int ret; int ret;
ret = snd_sof_dsp_power_down_notify(sdev);
if (ret < 0)
dev_warn(dev, "error: %d failed to prepare DSP for device removal",
ret);
if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
cancel_work_sync(&sdev->probe_work); cancel_work_sync(&sdev->probe_work);
if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) { if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) {
ret = snd_sof_dsp_power_down_notify(sdev);
if (ret < 0)
dev_warn(dev, "error: %d failed to prepare DSP for device removal",
ret);
snd_sof_fw_unload(sdev); snd_sof_fw_unload(sdev);
snd_sof_ipc_free(sdev); snd_sof_ipc_free(sdev);
snd_sof_free_debug(sdev); snd_sof_free_debug(sdev);
......
...@@ -375,6 +375,14 @@ static int imx8_ipc_pcm_params(struct snd_sof_dev *sdev, ...@@ -375,6 +375,14 @@ static int imx8_ipc_pcm_params(struct snd_sof_dev *sdev,
static struct snd_soc_dai_driver imx8_dai[] = { static struct snd_soc_dai_driver imx8_dai[] = {
{ {
.name = "esai-port", .name = "esai-port",
.playback = {
.channels_min = 1,
.channels_max = 8,
},
.capture = {
.channels_min = 1,
.channels_max = 8,
},
}, },
}; };
......
...@@ -240,6 +240,14 @@ static int imx8m_ipc_pcm_params(struct snd_sof_dev *sdev, ...@@ -240,6 +240,14 @@ static int imx8m_ipc_pcm_params(struct snd_sof_dev *sdev,
static struct snd_soc_dai_driver imx8m_dai[] = { static struct snd_soc_dai_driver imx8m_dai[] = {
{ {
.name = "sai-port", .name = "sai-port",
.playback = {
.channels_min = 1,
.channels_max = 32,
},
.capture = {
.channels_min = 1,
.channels_max = 32,
},
}, },
}; };
......
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