From 11b0b802f8e38d48ca74d520028add81263f003e Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 28 Aug 2023 15:23:16 +0200 Subject: ASoC: codecs: wcd93xx: fix object added to multiple drivers Three Qualcomm audio codecs (WCD9355, WCD934x and WCD938x) use the same object file wcd-clsh-v2.o leading to warnings: Makefile: wcd-clsh-v2.o is added to multiple modules: snd-soc-wcd9335 snd-soc-wcd934x snd-soc-wcd938x Convert the wcd-clsh-v2.o to a module to solve it. Signed-off-by: Krzysztof Kozlowski state; } +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_get_state); struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp, int version) @@ -890,8 +893,13 @@ struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp, return ctrl; } +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_alloc); void wcd_clsh_ctrl_free(struct wcd_clsh_ctrl *ctrl) { kfree(ctrl); } +EXPORT_SYMBOL_GPL(wcd_clsh_ctrl_free); + +MODULE_DESCRIPTION("WCD93XX Class-H driver"); +MODULE_LICENSE("GPL"); -- cgit v1.2.3 From bfd73b601ac880d7cfbafbb770c3d6195e73add3 Mon Sep 17 00:00:00 2001 From: Vlad Karpovich Date: Mon, 28 Aug 2023 12:05:19 -0500 Subject: ASoC: cs35l45: Add support for Chip ID 0x35A460 The 0x35A460 chip is a different variant of the cs35l45. Signed-off-by: Vlad Karpovich dev, "Bad DEVID 0x%x\n", dev_id[0]); -- cgit v1.2.3 From a47f7bf97c9836ff312b421fe392f13401c60c7b Mon Sep 17 00:00:00 2001 From: Vlad Karpovich Date: Mon, 28 Aug 2023 12:05:20 -0500 Subject: ASoC: cs35l45: Fix "Dead assigment" warning Value stored to 'ret' is never read. Remove it. Signed-off-by: Vlad Karpovich regmap, CS35L45_DSP_VIRT2_MBOX_3, &mbox_val); if (!ret && mbox_val) - ret = cs35l45_dsp_virt2_mbox3_irq_handle(cs35l45, mbox_val & CS35L45_MBOX3_CMD_MASK, + cs35l45_dsp_virt2_mbox3_irq_handle(cs35l45, mbox_val & CS35L45_MBOX3_CMD_MASK, (mbox_val & CS35L45_MBOX3_DATA_MASK) >> CS35L45_MBOX3_DATA_SHIFT); /* Handle DSP trace log IRQ */ -- cgit v1.2.3 From e041b85006f40a4f9799c385ec1a7fb8bdb0c228 Mon Sep 17 00:00:00 2001 From: Vlad Karpovich Date: Mon, 28 Aug 2023 12:05:23 -0500 Subject: ASoC: cs35l45: Rename DACPCM1 Source control Rename control to "DACPCM Source" for backward compatibility with previous implementation. Signed-off-by: Vlad Karpovich Date: Tue, 29 Aug 2023 00:36:35 -0700 Subject: ASoC: cs42l43: Fix missing error code in cs42l43_codec_probe() When clk_get_optional() fails, the error handling code does a 'goto err_pm' with ret = 0, which is resturning success on a failure path. Fix this by assigning the PTR_ERR(priv-mclk) to ret variable. Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43") Signed-off-by: Harshit Mogalapalli mclk = clk_get_optional(cs42l43->dev, "mclk"); if (IS_ERR(priv->mclk)) { - dev_err_probe(priv->dev, PTR_ERR(priv->mclk), "Failed to get mclk\n"); + ret = PTR_ERR(priv->mclk); + dev_err_probe(priv->dev, ret, "Failed to get mclk\n"); goto err_pm; } -- cgit v1.2.3 From 06afec5c988acb2c4f566eac2f6ec53d30d3a1b5 Mon Sep 17 00:00:00 2001 From: Simon Trimmer Date: Tue, 29 Aug 2023 17:04:33 +0100 Subject: ASoC: cs35l56: Waiting for firmware to boot must be tolerant of I/O errors Ignore failure to read from the cs35l56 when polling as the device will NAK i2c accesses until it has booted and this would terminate the poll of regmap_read_poll_timeout(). Fixes: 8a731fd37f8b ("ASoC: cs35l56: Move utility functions to shared file") Signed-off-by: Simon Trimmer rev < CS35L56_REVID_B0) reg = CS35L56_DSP1_HALO_STATE_A1; else reg = CS35L56_DSP1_HALO_STATE; - ret = regmap_read_poll_timeout(cs35l56_base->regmap, reg, - val, - (val < 0xFFFF) && (val >= CS35L56_HALO_STATE_BOOT_DONE), - CS35L56_HALO_STATE_POLL_US, - CS35L56_HALO_STATE_TIMEOUT_US); - - if ((ret < 0) && (ret != -ETIMEDOUT)) { - dev_err(cs35l56_base->dev, "Failed to read HALO_STATE: %d\n", ret); - return ret; - } - - if ((ret == -ETIMEDOUT) || (val != CS35L56_HALO_STATE_BOOT_DONE)) { - dev_err(cs35l56_base->dev, "Firmware boot fail: HALO_STATE=%#x\n", val); + /* + * This can't be a regmap_read_poll_timeout() because cs35l56 will NAK + * I2C until it has booted which would terminate the poll + */ + poll_ret = read_poll_timeout(regmap_read, read_ret, + (val < 0xFFFF) && (val >= CS35L56_HALO_STATE_BOOT_DONE), + CS35L56_HALO_STATE_POLL_US, + CS35L56_HALO_STATE_TIMEOUT_US, + false, + cs35l56_base->regmap, reg, &val); + + if (poll_ret) { + dev_err(cs35l56_base->dev, "Firmware boot timed out(%d): HALO_STATE=%#x\n", + read_ret, val); return -EIO; } -- cgit v1.2.3 From d1cf5d30b43f1a331032ebf3e11d9e366ab0f885 Mon Sep 17 00:00:00 2001 From: Shubh Date: Sat, 2 Sep 2023 20:38:07 +0530 Subject: ASoC: amd: yc: Add DMI entries to support Victus by HP Gaming Laptop 15-fb0xxx (8A3E) This model requires an additional detection quirk to enable the internal microphone. Signed-off-by: Shubh Link: https://lore.kernel.org/r/20230902150807.133523-1-shubhisroking@gmail.com Signed-off-by: Mark Brown --- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sound') diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c index a2fe3bd4f9a1..887188650bd6 100644 --- a/sound/soc/amd/yc/acp6x-mach.c +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -318,6 +318,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_BOARD_NAME, "8A22"), } }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A3E"), + } + }, { .driver_data = &acp6x_card, .matches = { -- cgit v1.2.3 From 5366a64033ef46d7fc36db097d4bde12af22c405 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Mon, 4 Sep 2023 18:40:46 +0800 Subject: ASoC: rt5645: NULL pointer access when removing jack Machine driver calls snd_soc_component_set_jack() function with NULL jack and data parameters when removing jack in codec exit function. Do not access data when jack is NULL. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20230904104046.4150208-1-brent.lu@intel.com Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 038d93e20883..1a137ca3f496 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -3269,13 +3269,17 @@ static int rt5645_component_set_jack(struct snd_soc_component *component, { struct snd_soc_jack *mic_jack = NULL; struct snd_soc_jack *btn_jack = NULL; - int *type = (int *)data; + int type; - if (*type & SND_JACK_MICROPHONE) - mic_jack = hs_jack; - if (*type & (SND_JACK_BTN_0 | SND_JACK_BTN_1 | - SND_JACK_BTN_2 | SND_JACK_BTN_3)) - btn_jack = hs_jack; + if (hs_jack) { + type = *(int *)data; + + if (type & SND_JACK_MICROPHONE) + mic_jack = hs_jack; + if (type & (SND_JACK_BTN_0 | SND_JACK_BTN_1 | + SND_JACK_BTN_2 | SND_JACK_BTN_3)) + btn_jack = hs_jack; + } return rt5645_set_jack_detect(component, hs_jack, mic_jack, btn_jack); } -- cgit v1.2.3 From 739c031110da9ba966b0189fa25a2a1c0d42263c Mon Sep 17 00:00:00 2001 From: Amadeusz Sławiński Date: Tue, 5 Sep 2023 11:31:47 +0200 Subject: ASoC: Intel: avs: Provide support for fallback topology MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HDA and HDMI devices are simple enough that in case of user not having topology tailored to their device, they can use fallback topology. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230905093147.1960675-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/intel/avs/pcm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'sound') diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index 1fbb2c2fadb5..8565a530706d 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -796,6 +796,28 @@ static int avs_component_probe(struct snd_soc_component *component) ret = avs_load_topology(component, filename); kfree(filename); + if (ret == -ENOENT && !strncmp(mach->tplg_filename, "hda-", 4)) { + unsigned int vendor_id; + + if (sscanf(mach->tplg_filename, "hda-%08x-tplg.bin", &vendor_id) != 1) + return ret; + + if (((vendor_id >> 16) & 0xFFFF) == 0x8086) + mach->tplg_filename = devm_kasprintf(adev->dev, GFP_KERNEL, + "hda-8086-generic-tplg.bin"); + else + mach->tplg_filename = devm_kasprintf(adev->dev, GFP_KERNEL, + "hda-generic-tplg.bin"); + + filename = kasprintf(GFP_KERNEL, "%s/%s", component->driver->topology_name_prefix, + mach->tplg_filename); + if (!filename) + return -ENOMEM; + + dev_info(card->dev, "trying to load fallback topology %s\n", mach->tplg_filename); + ret = avs_load_topology(component, filename); + kfree(filename); + } if (ret < 0) return ret; -- cgit v1.2.3 From cfff2a7794d23b03a3ddedd318bf1df1876c598f Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 6 Sep 2023 13:22:57 -0500 Subject: ASoC: amd: yc: Fix a non-functional mic on Lenovo 82TL Lenovo 82TL has DMIC connected like 82V2 does. Also match 82TL. Reported-by: wildjim@kiwinet.org Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217063 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20230906182257.45736-1-mario.limonciello@amd.com Signed-off-by: Mark Brown --- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sound') diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c index 887188650bd6..965d222c2443 100644 --- a/sound/soc/amd/yc/acp6x-mach.c +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -213,6 +213,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "21J6"), } }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82TL"), + } + }, { .driver_data = &acp6x_card, .matches = { -- cgit v1.2.3