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 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/soc/codecs') 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