summaryrefslogtreecommitdiff
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-10-19 18:37:01 +0300
committerMark Brown <broonie@kernel.org>2022-10-19 18:37:01 +0300
commit008f05a72d32dcc14038801649ec67af765fcc3c (patch)
treec958a2ab7039ea3e03621b1cbae4fcad41ee947c /sound/soc/intel
parent32def55d237e8507d4eb8442628fc2e59a899ea0 (diff)
parentdf496157a5afa1b6d1f4c46ad6549c2c346d1e59 (diff)
downloadlinux-008f05a72d32dcc14038801649ec67af765fcc3c.tar.xz
ASoC: jz4752b: Capture fixes
Merge series from Siarhei Volkau <lis8215@gmail.com>: The patchset fixes: - Line In path stays powered off during capturing or bypass to mixer. - incorrectly represented dB values in alsamixer, et al. - incorrect represented Capture input selector in alsamixer in Playback tab. - wrong control selected as Capture Master
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/atom/sst-mfld-platform-pcm.c7
-rw-r--r--sound/soc/intel/avs/core.c4
-rw-r--r--sound/soc/intel/boards/hda_dsp_common.c2
-rw-r--r--sound/soc/intel/boards/skl_hda_dsp_generic.c2
-rw-r--r--sound/soc/intel/boards/sof_sdw.c10
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c4
-rw-r--r--sound/soc/intel/skylake/skl.c55
7 files changed, 59 insertions, 25 deletions
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index a56dd48c045f..c75616a5fd0a 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -676,10 +676,9 @@ static int sst_soc_pcm_new(struct snd_soc_component *component,
if (dai->driver->playback.channels_min ||
dai->driver->capture.channels_min) {
- snd_pcm_set_managed_buffer_all(pcm,
- SNDRV_DMA_TYPE_CONTINUOUS,
- snd_dma_continuous_data(GFP_DMA),
- SST_MIN_BUFFER, SST_MAX_BUFFER);
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
+ pcm->card->dev,
+ SST_MIN_BUFFER, SST_MAX_BUFFER);
}
return 0;
}
diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c
index c50c20fd681a..bb0719c58ca4 100644
--- a/sound/soc/intel/avs/core.c
+++ b/sound/soc/intel/avs/core.c
@@ -466,7 +466,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
err_acquire_irq:
snd_hdac_bus_free_stream_pages(bus);
- snd_hdac_stream_free_all(bus);
+ snd_hdac_ext_stream_free_all(bus);
err_init_streams:
iounmap(adev->dsp_ba);
err_remap_bar4:
@@ -502,7 +502,7 @@ static void avs_pci_remove(struct pci_dev *pci)
snd_hda_codec_unregister(hdac_to_hda_codec(hdev));
snd_hdac_bus_free_stream_pages(bus);
- snd_hdac_stream_free_all(bus);
+ snd_hdac_ext_stream_free_all(bus);
/* reverse ml_capabilities */
snd_hdac_link_free_all(bus);
snd_hdac_ext_bus_exit(bus);
diff --git a/sound/soc/intel/boards/hda_dsp_common.c b/sound/soc/intel/boards/hda_dsp_common.c
index 83c7dfbccd9d..04b7d4f7f9e2 100644
--- a/sound/soc/intel/boards/hda_dsp_common.c
+++ b/sound/soc/intel/boards/hda_dsp_common.c
@@ -54,7 +54,7 @@ int hda_dsp_hdmi_build_controls(struct snd_soc_card *card,
return -EINVAL;
hda_pvt = snd_soc_component_get_drvdata(comp);
- hcodec = &hda_pvt->codec;
+ hcodec = hda_pvt->codec;
list_for_each_entry(hpcm, &hcodec->pcm_list_head, list) {
spcm = hda_dsp_hdmi_pcm_handle(card, i);
diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c
index 81144efb4b44..879ebba52832 100644
--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c
+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c
@@ -190,7 +190,7 @@ static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card)
* all codecs are on the same bus, so it's sufficient
* to look up only the first one
*/
- snd_hda_set_power_save(hda_pvt->codec.bus,
+ snd_hda_set_power_save(hda_pvt->codec->bus,
HDA_CODEC_AUTOSUSPEND_DELAY_MS);
break;
}
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 5223089c3426..ee9857dc3135 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -281,6 +281,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFF")
+ },
+ .driver_data = (void *)(SOF_SDW_TGL_HDMI |
+ RT711_JD2 |
+ SOF_SDW_FOUR_SPK),
+ },
+ {
+ .callback = sof_sdw_quirk_cb,
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B00")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 9d72ebd812af..1015716f9336 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -275,7 +275,7 @@ static int skl_pcm_prepare(struct snd_pcm_substream *substream,
* calls prepare another time, reset the FW pipe to clean state
*/
if (mconfig &&
- (substream->runtime->status->state == SNDRV_PCM_STATE_XRUN ||
+ (substream->runtime->state == SNDRV_PCM_STATE_XRUN ||
mconfig->pipe->state == SKL_PIPE_CREATED ||
mconfig->pipe->state == SKL_PIPE_PAUSED)) {
@@ -593,7 +593,7 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,
/* In case of XRUN recovery, reset the FW pipe to clean state */
mconfig = skl_tplg_be_get_cpr_module(dai, substream->stream);
if (mconfig && !mconfig->pipe->passthru &&
- (substream->runtime->status->state == SNDRV_PCM_STATE_XRUN))
+ (substream->runtime->state == SNDRV_PCM_STATE_XRUN))
skl_reset_pipe(skl, mconfig->pipe);
return 0;
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 5707dfee603f..bbba2df33aaf 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -444,7 +444,7 @@ static int skl_free(struct hdac_bus *bus)
if (bus->irq >= 0)
free_irq(bus->irq, (void *)bus);
snd_hdac_bus_free_stream_pages(bus);
- snd_hdac_stream_free_all(bus);
+ snd_hdac_ext_stream_free_all(bus);
snd_hdac_link_free_all(bus);
if (bus->remap_addr)
@@ -689,6 +689,35 @@ static void load_codec_module(struct hda_codec *codec)
#endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */
+static void skl_codec_device_exit(struct device *dev)
+{
+ snd_hdac_device_exit(dev_to_hdac_dev(dev));
+}
+
+static struct hda_codec *skl_codec_device_init(struct hdac_bus *bus, int addr)
+{
+ struct hda_codec *codec;
+ int ret;
+
+ codec = snd_hda_codec_device_init(to_hda_bus(bus), addr, "ehdaudio%dD%d", bus->idx, addr);
+ if (IS_ERR(codec)) {
+ dev_err(bus->dev, "device init failed for hdac device\n");
+ return codec;
+ }
+
+ codec->core.type = HDA_DEV_ASOC;
+ codec->core.dev.release = skl_codec_device_exit;
+
+ ret = snd_hdac_device_register(&codec->core);
+ if (ret) {
+ dev_err(bus->dev, "failed to register hdac device\n");
+ snd_hdac_device_exit(&codec->core);
+ return ERR_PTR(ret);
+ }
+
+ return codec;
+}
+
/*
* Probe the given codec address
*/
@@ -700,9 +729,8 @@ static int probe_codec(struct hdac_bus *bus, int addr)
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
struct skl_dev *skl = bus_to_skl(bus);
struct hdac_hda_priv *hda_codec;
- int err;
#endif
- struct hdac_device *hdev;
+ struct hda_codec *codec;
mutex_lock(&bus->cmd_mutex);
snd_hdac_bus_send_cmd(bus, cmd);
@@ -718,25 +746,22 @@ static int probe_codec(struct hdac_bus *bus, int addr)
if (!hda_codec)
return -ENOMEM;
- hda_codec->codec.bus = skl_to_hbus(skl);
- hdev = &hda_codec->codec.core;
+ codec = skl_codec_device_init(bus, addr);
+ if (IS_ERR(codec))
+ return PTR_ERR(codec);
- err = snd_hdac_ext_bus_device_init(bus, addr, hdev, HDA_DEV_ASOC);
- if (err < 0)
- return err;
+ hda_codec->codec = codec;
+ dev_set_drvdata(&codec->core.dev, hda_codec);
/* use legacy bus only for HDA codecs, idisp uses ext bus */
if ((res & 0xFFFF0000) != IDISP_INTEL_VENDOR_ID) {
- hdev->type = HDA_DEV_LEGACY;
- load_codec_module(&hda_codec->codec);
+ codec->core.type = HDA_DEV_LEGACY;
+ load_codec_module(hda_codec->codec);
}
return 0;
#else
- hdev = devm_kzalloc(&skl->pci->dev, sizeof(*hdev), GFP_KERNEL);
- if (!hdev)
- return -ENOMEM;
-
- return snd_hdac_ext_bus_device_init(bus, addr, hdev, HDA_DEV_ASOC);
+ codec = skl_codec_device_init(bus, addr);
+ return PTR_ERR_OR_ZERO(codec);
#endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */
}