···452452 if ((aw_bin->all_bin_parse_num != 1) ||453453 (aw_bin->header_info[0].bin_data_type != DATA_TYPE_REGISTER)) {454454 dev_err(aw_dev->dev, "bin num or type error");455455+ ret = -EINVAL;455456 goto parse_bin_failed;456457 }457458458459 if (aw_bin->header_info[0].valid_data_len % 4) {459460 dev_err(aw_dev->dev, "bin data len get error!");461461+ ret = -EINVAL;460462 goto parse_bin_failed;461463 }462464
···706706707707 mutex_lock(&cs35l56->base.irq_lock);708708709709- init_completion(&cs35l56->init_completion);709709+ reinit_completion(&cs35l56->init_completion);710710711711 cs35l56->soft_resetting = true;712712 cs35l56_system_reset(&cs35l56->base, !!cs35l56->sdw_peripheral);···11861186 /* Registers could be dirty after soft reset or SoundWire enumeration */11871187 regcache_sync(cs35l56->base.regmap);1188118811891189+ /* Set ASP1 DOUT to high-impedance when it is not transmitting audio data. */11901190+ ret = regmap_set_bits(cs35l56->base.regmap, CS35L56_ASP1_CONTROL3,11911191+ CS35L56_ASP1_DOUT_HIZ_CTRL_MASK);11921192+ if (ret)11931193+ return dev_err_probe(cs35l56->base.dev, ret, "Failed to write ASP1_CONTROL3\n");11941194+11891195 cs35l56->base.init_done = true;11901196 complete(&cs35l56->init_completion);11911197···12131207 flush_workqueue(cs35l56->dsp_wq);12141208 destroy_workqueue(cs35l56->dsp_wq);1215120912101210+ pm_runtime_dont_use_autosuspend(cs35l56->base.dev);12161211 pm_runtime_suspend(cs35l56->base.dev);12171212 pm_runtime_disable(cs35l56->base.dev);12181213
+21
sound/soc/codecs/cs42l42-sdw.c
···6677#include <linux/acpi.h>88#include <linux/device.h>99+#include <linux/gpio/consumer.h>910#include <linux/iopoll.h>1011#include <linux/module.h>1112#include <linux/mod_devicetable.h>···345344 switch (status) {346345 case SDW_SLAVE_ATTACHED:347346 dev_dbg(cs42l42->dev, "ATTACHED\n");347347+348348+ /*349349+ * The SoundWire core can report stale ATTACH notifications350350+ * if we hard-reset CS42L42 in probe() but it had already been351351+ * enumerated. Reject the ATTACH if we haven't yet seen an352352+ * UNATTACH report for the device being in reset.353353+ */354354+ if (cs42l42->sdw_waiting_first_unattach)355355+ break;356356+348357 /*349358 * Initialise codec, this only needs to be done once.350359 * When resuming from suspend, resume callback will handle re-init of codec,···365354 break;366355 case SDW_SLAVE_UNATTACHED:367356 dev_dbg(cs42l42->dev, "UNATTACHED\n");357357+358358+ if (cs42l42->sdw_waiting_first_unattach) {359359+ /*360360+ * SoundWire core has seen that CS42L42 is not on361361+ * the bus so release RESET and wait for ATTACH.362362+ */363363+ cs42l42->sdw_waiting_first_unattach = false;364364+ gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);365365+ }366366+368367 break;369368 default:370369 break;
+20-1
sound/soc/codecs/cs42l42.c
···2320232023212321 if (cs42l42->reset_gpio) {23222322 dev_dbg(cs42l42->dev, "Found reset GPIO\n");23232323- gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);23232323+23242324+ /*23252325+ * ACPI can override the default GPIO state we requested23262326+ * so ensure that we start with RESET low.23272327+ */23282328+ gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);23292329+23302330+ /* Ensure minimum reset pulse width */23312331+ usleep_range(10, 500);23322332+23332333+ /*23342334+ * On SoundWire keep the chip in reset until we get an UNATTACH23352335+ * notification from the SoundWire core. This acts as a23362336+ * synchronization point to reject stale ATTACH notifications23372337+ * if the chip was already enumerated before we reset it.23382338+ */23392339+ if (cs42l42->sdw_peripheral)23402340+ cs42l42->sdw_waiting_first_unattach = true;23412341+ else23422342+ gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);23242343 }23252344 usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2);23262345
···157157 return ret;158158 }159159160160- ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators,161161- rt5682);162162- if (ret)163163- return ret;164164-165160 ret = regulator_bulk_enable(ARRAY_SIZE(rt5682->supplies),166161 rt5682->supplies);167162 if (ret) {168163 dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret);169164 return ret;170165 }166166+167167+ ret = devm_add_action_or_reset(&i2c->dev, rt5682_i2c_disable_regulators,168168+ rt5682);169169+ if (ret)170170+ return ret;171171172172 ret = rt5682_get_ldo1(rt5682, &i2c->dev);173173 if (ret)
+1-1
sound/soc/codecs/tas2780.c
···3939 usleep_range(2000, 2050);4040 }41414242- snd_soc_component_write(tas2780->component, TAS2780_SW_RST,4242+ ret = snd_soc_component_write(tas2780->component, TAS2780_SW_RST,4343 TAS2780_RST);4444 if (ret)4545 dev_err(tas2780->dev, "%s:errCode:0x%x Reset error!\n",
+2-2
sound/soc/codecs/tlv320adc3xxx.c
···293293#define ADC3XXX_BYPASS_RPGA 0x80294294295295/* MICBIAS control bits */296296-#define ADC3XXX_MICBIAS_MASK 0x2296296+#define ADC3XXX_MICBIAS_MASK 0x3297297#define ADC3XXX_MICBIAS1_SHIFT 5298298#define ADC3XXX_MICBIAS2_SHIFT 3299299···10991099 unsigned int val;1100110011011101 if (!of_property_read_u32(np, propname, &val)) {11021102- if (val >= ADC3XXX_MICBIAS_AVDD) {11021102+ if (val > ADC3XXX_MICBIAS_AVDD) {11031103 dev_err(dev, "Invalid property value for '%s'\n", propname);11041104 return -EINVAL;11051105 }
···5252 unsigned long mclk_freq;5353 unsigned long free_freq;5454 u32 mclk_id;5555- u32 fll_id;5656- u32 pll_id;5555+ int fll_id;5656+ int pll_id;5757};58585959/**···206206 }207207208208 /* Specific configuration for PLL */209209- if (codec_priv->pll_id && codec_priv->fll_id) {209209+ if (codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) {210210 if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE)211211 pll_out = priv->sample_rate * 384;212212 else···248248249249 priv->streams &= ~BIT(substream->stream);250250251251- if (!priv->streams && codec_priv->pll_id && codec_priv->fll_id) {251251+ if (!priv->streams && codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) {252252 /* Force freq to be free_freq to avoid error message in codec */253253 ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0),254254 codec_priv->mclk_id,···621621 priv->card.dapm_routes = audio_map;622622 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map);623623 priv->card.driver_name = DRIVER_NAME;624624+625625+ priv->codec_priv.fll_id = -1;626626+ priv->codec_priv.pll_id = -1;627627+624628 /* Diversify the card configurations */625629 if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) {626630 codec_dai_name = "cs42888";
+7-2
sound/soc/fsl/fsl_sai.c
···710710{711711 unsigned int ofs = sai->soc_data->reg_offset;712712 bool tx = dir == TX;713713- u32 xcsr, count = 100;713713+ u32 xcsr, count = 100, mask;714714+715715+ if (sai->soc_data->mclk_with_tere && sai->mclk_direction_output)716716+ mask = FSL_SAI_CSR_TERE;717717+ else718718+ mask = FSL_SAI_CSR_TERE | FSL_SAI_CSR_BCE;714719715720 regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs),716716- FSL_SAI_CSR_TERE | FSL_SAI_CSR_BCE, 0);721721+ mask, 0);717722718723 /* TERE will remain set till the end of current frame */719724 do {
+1-1
sound/soc/fsl/imx-audmix.c
···315315 if (IS_ERR(priv->cpu_mclk)) {316316 ret = PTR_ERR(priv->cpu_mclk);317317 dev_err(&cpu_pdev->dev, "failed to get DAI mclk1: %d\n", ret);318318- return -EINVAL;318318+ return ret;319319 }320320321321 priv->audmix_pdev = audmix_pdev;
···8989 SND_SOC_DAIFMT_NB_NF |9090 SND_SOC_DAIFMT_CBC_CFC;91919292+ /*9393+ * i.MX rpmsg sound cards work on codec slave mode. MCLK will be9494+ * disabled by CPU DAI driver in hw_free(). Some codec requires MCLK9595+ * present at power up/down sequence. So need to set ignore_pmdown_time9696+ * to power down codec immediately before MCLK is turned off.9797+ */9898+ data->dai.ignore_pmdown_time = 1;9999+92100 /* Optional codec node */93101 ret = of_parse_phandle_with_fixed_args(np, "audio-codec", 0, 0, &args);94102 if (ret) {
+2-1
sound/soc/generic/simple-card-utils.c
···310310 if (fixed_sysclk % props->mclk_fs) {311311 dev_err(rtd->dev, "fixed sysclk %u not divisible by mclk_fs %u\n",312312 fixed_sysclk, props->mclk_fs);313313- return -EINVAL;313313+ ret = -EINVAL;314314+ goto codec_err;314315 }315316 ret = snd_pcm_hw_constraint_minmax(substream->runtime, SNDRV_PCM_HW_PARAM_RATE,316317 fixed_rate, fixed_rate);
+4-2
sound/soc/generic/simple-card.c
···759759 struct snd_soc_dai_link *dai_link = priv->dai_link;760760 struct simple_dai_props *dai_props = priv->dai_props;761761762762+ ret = -EINVAL;763763+762764 cinfo = dev->platform_data;763765 if (!cinfo) {764766 dev_err(dev, "no info for asoc-simple-card\n");765765- return -EINVAL;767767+ goto err;766768 }767769768770 if (!cinfo->name ||···773771 !cinfo->platform ||774772 !cinfo->cpu_dai.name) {775773 dev_err(dev, "insufficient asoc_simple_card_info settings\n");776776- return -EINVAL;774774+ goto err;777775 }778776779777 cpus = dai_link->cpus;
···242242 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];243243 struct snd_kcontrol *kctl;244244245245+ /* When updating, change also snd_soc_dapm_widget_name_cmp() */245246 if (component->name_prefix)246247 snprintf(name, ARRAY_SIZE(name), "%s %s", component->name_prefix, ctl);247248 else
+17-7
sound/soc/soc-core.c
···13471347 snd_soc_runtime_get_dai_fmt(rtd);13481348 ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt);13491349 if (ret)13501350- return ret;13501350+ goto err;1351135113521352 /* add DPCM sysfs entries */13531353 soc_dpcm_debugfs_add(rtd);···13721372 /* create compress_device if possible */13731373 ret = snd_soc_dai_compress_new(cpu_dai, rtd, num);13741374 if (ret != -ENOTSUPP)13751375- return ret;13751375+ goto err;1376137613771377 /* create the pcm */13781378 ret = soc_new_pcm(rtd, num);13791379 if (ret < 0) {13801380 dev_err(card->dev, "ASoC: can't create pcm %s :%d\n",13811381 dai_link->stream_name, ret);13821382- return ret;13821382+ goto err;13831383 }1384138413851385- return snd_soc_pcm_dai_new(rtd);13851385+ ret = snd_soc_pcm_dai_new(rtd);13861386+ if (ret < 0)13871387+ goto err;13881388+13891389+ rtd->initialized = true;13901390+13911391+ return 0;13921392+err:13931393+ snd_soc_link_exit(rtd);13941394+ return ret;13861395}1387139613881397static void soc_set_name_prefix(struct snd_soc_card *card,···14541445 if (component->card) {14551446 if (component->card != card) {14561447 dev_err(component->dev,14571457- "Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",14581458- card->name, component->card->name);14481448+ "Trying to bind component \"%s\" to card \"%s\" but is already bound to card \"%s\"\n",14491449+ component->name, card->name, component->card->name);14591450 return -ENODEV;14601451 }14611452 return 0;···1989198019901981 /* release machine specific resources */19911982 for_each_card_rtds(card, rtd)19921992- snd_soc_link_exit(rtd);19831983+ if (rtd->initialized)19841984+ snd_soc_link_exit(rtd);19931985 /* remove and free each DAI */19941986 soc_remove_link_dais(card);19951987 soc_remove_link_components(card);
+12
sound/soc/soc-dapm.c
···27282728}27292729EXPORT_SYMBOL_GPL(snd_soc_dapm_update_dai);2730273027312731+int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s)27322732+{27332733+ struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm);27342734+ const char *wname = widget->name;27352735+27362736+ if (component->name_prefix)27372737+ wname += strlen(component->name_prefix) + 1; /* plus space */27382738+27392739+ return strcmp(wname, s);27402740+}27412741+EXPORT_SYMBOL_GPL(snd_soc_dapm_widget_name_cmp);27422742+27312743/*27322744 * dapm_update_widget_flags() - Re-compute widget sink and source flags27332745 * @w: The widget for which to update the flags
+2-2
sound/soc/soc-generic-dmaengine-pcm.c
···4444 * platforms which make use of the snd_dmaengine_dai_dma_data struct for their4545 * DAI DMA data. Internally the function will first call4646 * snd_hwparams_to_dma_slave_config to fill in the slave config based on the4747- * hw_params, followed by snd_dmaengine_set_config_from_dai_data to fill in the4848- * remaining fields based on the DAI DMA data.4747+ * hw_params, followed by snd_dmaengine_pcm_set_config_from_dai_data to fill in4848+ * the remaining fields based on the DAI DMA data.4949 */5050int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,5151 struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config)
+11-12
sound/soc/soc-pcm.c
···985985{986986 struct snd_soc_dai *cpu_dai;987987 struct snd_soc_dai *codec_dai;988988+ struct snd_pcm_hw_params tmp_params;988989 int i, ret = 0;989990990991 snd_soc_dpcm_mutex_assert_held(rtd);···999998 goto out;100099910011000 for_each_rtd_codec_dais(rtd, i, codec_dai) {10021002- struct snd_pcm_hw_params codec_params;10031001 unsigned int tdm_mask = snd_soc_dai_tdm_mask_get(codec_dai, substream->stream);1004100210051003 /*···10191019 continue;1020102010211021 /* copy params for each codec */10221022- codec_params = *params;10221022+ tmp_params = *params;1023102310241024 /* fixup params based on TDM slot masks */10251025 if (tdm_mask)10261026- soc_pcm_codec_params_fixup(&codec_params, tdm_mask);10261026+ soc_pcm_codec_params_fixup(&tmp_params, tdm_mask);1027102710281028 ret = snd_soc_dai_hw_params(codec_dai, substream,10291029- &codec_params);10291029+ &tmp_params);10301030 if(ret < 0)10311031 goto out;1032103210331033- soc_pcm_set_dai_params(codec_dai, &codec_params);10341034- snd_soc_dapm_update_dai(substream, &codec_params, codec_dai);10331033+ soc_pcm_set_dai_params(codec_dai, &tmp_params);10341034+ snd_soc_dapm_update_dai(substream, &tmp_params, codec_dai);10351035 }1036103610371037 for_each_rtd_cpu_dais(rtd, i, cpu_dai) {10381038- struct snd_pcm_hw_params cpu_params;10391038 unsigned int ch_mask = 0;10401039 int j;10411040···10461047 continue;1047104810481049 /* copy params for each cpu */10491049- cpu_params = *params;10501050+ tmp_params = *params;1050105110511052 if (!rtd->dai_link->codec_ch_maps)10521053 goto hw_params;···1061106210621063 /* fixup cpu channel number */10631064 if (ch_mask)10641064- soc_pcm_codec_params_fixup(&cpu_params, ch_mask);10651065+ soc_pcm_codec_params_fixup(&tmp_params, ch_mask);1065106610661067hw_params:10671067- ret = snd_soc_dai_hw_params(cpu_dai, substream, &cpu_params);10681068+ ret = snd_soc_dai_hw_params(cpu_dai, substream, &tmp_params);10681069 if (ret < 0)10691070 goto out;1070107110711072 /* store the parameters for each DAI */10721072- soc_pcm_set_dai_params(cpu_dai, &cpu_params);10731073- snd_soc_dapm_update_dai(substream, &cpu_params, cpu_dai);10731073+ soc_pcm_set_dai_params(cpu_dai, &tmp_params);10741074+ snd_soc_dapm_update_dai(substream, &tmp_params, cpu_dai);10741075 }1075107610761077 ret = snd_soc_pcm_component_hw_params(substream, params);
···460460 /* step 3: wait for IPC DONE bit from ROM */461461 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, chip->ipc_ack, status,462462 ((status & chip->ipc_ack_mask) == chip->ipc_ack_mask),463463- HDA_DSP_REG_POLL_INTERVAL_US, MTL_DSP_PURGE_TIMEOUT_US);463463+ HDA_DSP_REG_POLL_INTERVAL_US, HDA_DSP_INIT_TIMEOUT_US);464464 if (ret < 0) {465465 if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)466466 dev_err(sdev->dev, "timeout waiting for purge IPC done\n");
-1
sound/soc/sof/intel/mtl.h
···6262#define MTL_DSP_IRQSTS_IPC BIT(0)6363#define MTL_DSP_IRQSTS_SDW BIT(6)64646565-#define MTL_DSP_PURGE_TIMEOUT_US 20000000 /* 20s */6665#define MTL_DSP_REG_POLL_INTERVAL_US 10 /* 10 us */67666867/* Memory windows */
+1-1
sound/soc/sof/ipc4-topology.c
···231231232232 ret = sof_update_ipc_object(scomp, available_fmt,233233 SOF_AUDIO_FMT_NUM_TOKENS, swidget->tuples,234234- swidget->num_tuples, sizeof(available_fmt), 1);234234+ swidget->num_tuples, sizeof(*available_fmt), 1);235235 if (ret) {236236 dev_err(scomp->dev, "Failed to parse audio format token count\n");237237 return ret;
+2-1
sound/soc/sof/sof-audio.c
···212212 sof_widget_free_unlocked(sdev, swidget);213213 use_count_decremented = true;214214core_put:215215- snd_sof_dsp_core_put(sdev, swidget->core);215215+ if (!use_count_decremented)216216+ snd_sof_dsp_core_put(sdev, swidget->core);216217pipe_widget_free:217218 if (swidget->id != snd_soc_dapm_scheduler)218219 sof_widget_free_unlocked(sdev, swidget->spipe->pipe_widget);
+17-13
sound/soc/tegra/tegra_audio_graph_card.c
···1010#include <linux/platform_device.h>1111#include <sound/graph_card.h>1212#include <sound/pcm_params.h>1313+#include <sound/soc-dai.h>13141415#define MAX_PLLA_OUT0_DIV 1281516···4443 unsigned int plla_rates[NUM_RATE_TYPE];4544 unsigned int plla_out0_rates[NUM_RATE_TYPE];4645};4646+4747+static bool need_clk_update(struct snd_soc_dai *dai)4848+{4949+ if (snd_soc_dai_is_dummy(dai) ||5050+ !dai->driver->ops ||5151+ !dai->driver->name)5252+ return false;5353+5454+ if (strstr(dai->driver->name, "I2S") ||5555+ strstr(dai->driver->name, "DMIC") ||5656+ strstr(dai->driver->name, "DSPK"))5757+ return true;5858+5959+ return false;6060+}47614862/* Setup PLL clock as per the given sample rate */4963static int tegra_audio_graph_update_pll(struct snd_pcm_substream *substream,···156140 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);157141 int err;158142159159- /*160160- * This gets called for each DAI link (FE or BE) when DPCM is used.161161- * We may not want to update PLLA rate for each call. So PLLA update162162- * must be restricted to external I/O links (I2S, DMIC or DSPK) since163163- * they actually depend on it. I/O modules update their clocks in164164- * hw_param() of their respective component driver and PLLA rate165165- * update here helps them to derive appropriate rates.166166- *167167- * TODO: When more HW accelerators get added (like sample rate168168- * converter, volume gain controller etc., which don't really169169- * depend on PLLA) we need a better way to filter here.170170- */171171- if (cpu_dai->driver->ops && rtd->dai_link->no_pcm) {143143+ if (need_clk_update(cpu_dai)) {172144 err = tegra_audio_graph_update_pll(substream, params);173145 if (err)174146 return err;
···32943294 /* Add input phantom controls */32953295 if (info->inputs_per_phantom == 1) {32963296 for (i = 0; i < info->phantom_count; i++) {32973297- snprintf(s, sizeof(s), fmt, i + 1,32983298- "Phantom Power", "Switch");32973297+ scnprintf(s, sizeof(s), fmt, i + 1,32983298+ "Phantom Power", "Switch");32993299 err = scarlett2_add_new_ctl(33003300 mixer, &scarlett2_phantom_ctl,33013301 i, 1, s, &private->phantom_ctls[i]);
+7-1
sound/usb/quirks.c
···19941994 /* mic works only when ep packet size is set to wMaxPacketSize */19951995 fp->attributes |= UAC_EP_CS_ATTR_FILL_MAX;19961996 break;19971997-19971997+ case USB_ID(0x3511, 0x2b1e): /* Opencomm2 UC USB Bluetooth dongle */19981998+ /* mic works only when ep pitch control is not set */19991999+ if (stream == SNDRV_PCM_STREAM_CAPTURE)20002000+ fp->attributes &= ~UAC_EP_CS_ATTR_PITCH_CONTROL;20012001+ break;19982002 }19992003}20002004···21772173 QUIRK_FLAG_FIXED_RATE),21782174 DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */21792175 QUIRK_FLAG_FIXED_RATE),21762176+ DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */21772177+ QUIRK_FLAG_GET_SAMPLE_RATE),2180217821812179 /* Vendor matches */21822180 VENDOR_FLG(0x045e, /* MS Lifecam */