···14021402#define snd_pcm_lib_mmap_iomem NULL14031403#endif1404140414051405-void snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime);14051405+int snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime);1406140614071407/**14081408 * snd_pcm_limit_isa_dma_size - Get the max size fitting with ISA DMA transfer
+4-1
include/sound/soc-acpi.h
···203203 * @mach: the pointer of the machine driver204204 * @prefix: the prefix of the topology file name. Typically, it is the path.205205 * @tplg_files: the pointer of the array of the topology file names.206206+ * @best_effort: ignore non supported links and try to build the card in best effort207207+ * with supported links206208 */207209/* Descriptor for SST ASoC machine driver */208210struct snd_soc_acpi_mach {···226224 const u32 tplg_quirk_mask;227225 int (*get_function_tplg_files)(struct snd_soc_card *card,228226 const struct snd_soc_acpi_mach *mach,229229- const char *prefix, const char ***tplg_files);227227+ const char *prefix, const char ***tplg_files,228228+ bool best_effort);230229};231230232231#define SND_SOC_ACPI_MAX_CODECS 3
+5-5
sound/ac97/bus.c
···298298 idr_remove(&ac97_adapter_idr, ac97_ctrl->nr);299299 dev_dbg(&ac97_ctrl->adap, "adapter unregistered by %s\n",300300 dev_name(ac97_ctrl->parent));301301+ kfree(ac97_ctrl);301302}302303303304static const struct device_type ac97_adapter_type = {···320319 ret = device_register(&ac97_ctrl->adap);321320 if (ret)322321 put_device(&ac97_ctrl->adap);323323- }322322+ } else323323+ kfree(ac97_ctrl);324324+324325 if (!ret) {325326 list_add(&ac97_ctrl->controllers, &ac97_controllers);326327 dev_dbg(&ac97_ctrl->adap, "adapter registered by %s\n",···364361 ret = ac97_add_adapter(ac97_ctrl);365362366363 if (ret)367367- goto err;364364+ return ERR_PTR(ret);368365 ac97_bus_reset(ac97_ctrl);369366 ac97_bus_scan(ac97_ctrl);370367371368 return ac97_ctrl;372372-err:373373- kfree(ac97_ctrl);374374- return ERR_PTR(ret);375369}376370EXPORT_SYMBOL_GPL(snd_ac97_controller_register);377371
···730730}731731732732/* fill the PCM buffer with the current silence format; called from pcm_oss.c */733733-void snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime)733733+int snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime)734734{735735- snd_pcm_buffer_access_lock(runtime);735735+ int err;736736+737737+ err = snd_pcm_buffer_access_lock(runtime);738738+ if (err < 0)739739+ return err;736740 if (runtime->dma_area)737741 snd_pcm_format_set_silence(runtime->format, runtime->dma_area,738742 bytes_to_samples(runtime, runtime->dma_bytes));739743 snd_pcm_buffer_access_unlock(runtime);744744+ return 0;740745}741746EXPORT_SYMBOL_GPL(snd_pcm_runtime_buffer_set_silence);742747
···6060 int (*save_calibration)(struct tas2781_hda *h);61616262 int hda_chip_id;6363+ bool skip_calibration;6364};64656566static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data)···112111 sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));113112 if (IS_ERR(sub)) {114113 /* No subsys id in older tas2563 projects. */115115- if (!strncmp(hid, "INT8866", sizeof("INT8866")))114114+ if (!strncmp(hid, "INT8866", sizeof("INT8866"))) {115115+ p->speaker_id = -1;116116 goto end_2563;117117+ }117118 dev_err(p->dev, "Failed to get SUBSYS ID.\n");118119 ret = PTR_ERR(sub);119120 goto err;···492489 /* If calibrated data occurs error, dsp will still works with default493490 * calibrated data inside algo.494491 */495495- hda_priv->save_calibration(tas_hda);492492+ if (!hda_priv->skip_calibration)493493+ hda_priv->save_calibration(tas_hda);496494}497495498496static void tasdev_fw_ready(const struct firmware *fmw, void *context)···548544 void *master_data)549545{550546 struct tas2781_hda *tas_hda = dev_get_drvdata(dev);547547+ struct tas2781_hda_i2c_priv *hda_priv = tas_hda->hda_priv;551548 struct hda_component_parent *parent = master_data;552549 struct hda_component *comp;553550 struct hda_codec *codec;···573568 tas_hda->catlog_id = LENOVO;574569 break;575570 }571571+572572+ /*573573+ * Using ASUS ROG Xbox Ally X (RC73XA) UEFI calibration data574574+ * causes audio dropouts during playback, use fallback data575575+ * from DSP firmware as a workaround.576576+ */577577+ if (codec->core.subsystem_id == 0x10431384)578578+ hda_priv->skip_calibration = true;576579577580 guard(pm_runtime_active_auto)(dev);578581
···15051505 struct device_link *devlink;15061506 int ret;1507150715081508- /* Initialize device pointers to NULL for safe cleanup */15091509- pm4125->rxdev = NULL;15101510- pm4125->txdev = NULL;15111511-15121508 /* Give the soundwire subdevices some more time to settle */15131509 usleep_range(15000, 15010);15141510···1533153715341538 pm4125->sdw_priv[AIF1_CAP] = dev_get_drvdata(pm4125->txdev);15351539 pm4125->sdw_priv[AIF1_CAP]->pm4125 = pm4125;15361536-15371540 pm4125->tx_sdw_dev = dev_to_sdw_dev(pm4125->txdev);15381538- if (!pm4125->tx_sdw_dev) {15391539- dev_err(dev, "could not get txslave with matching of dev\n");15401540- ret = -EINVAL;15411541- goto error_put_tx;15421542- }1543154115441542 /*15451543 * As TX is the main CSR reg interface, which should not be suspended first.···16141624 device_link_remove(dev, pm4125->rxdev);16151625 device_link_remove(pm4125->rxdev, pm4125->txdev);1616162616171617- /* Release device references acquired in bind */16181618- if (pm4125->txdev)16191619- put_device(pm4125->txdev);16201620- if (pm4125->rxdev)16211621- put_device(pm4125->rxdev);16271627+ put_device(pm4125->txdev);16281628+ put_device(pm4125->rxdev);1622162916231630 component_unbind_all(dev, pm4125);16241631}
···27632763 wcd937x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd937x->txdev);27642764 wcd937x->sdw_priv[AIF1_CAP]->wcd937x = wcd937x;27652765 wcd937x->tx_sdw_dev = dev_to_sdw_dev(wcd937x->txdev);27662766- if (!wcd937x->tx_sdw_dev) {27672767- dev_err(dev, "could not get txslave with matching of dev\n");27682768- ret = -EINVAL;27692769- goto err_put_txdev;27702770- }2771276627722767 /*27732768 * As TX is the main CSR reg interface, which should not be suspended first.
+4-4
sound/soc/fsl/fsl-asoc-card.c
···10451045 * The notifier is initialized in snd_soc_card_jack_new(), then10461046 * snd_soc_jack_notifier_register can be called.10471047 */10481048- if (of_property_read_bool(np, "hp-det-gpios") ||10491049- of_property_read_bool(np, "hp-det-gpio") /* deprecated */) {10481048+ if (of_property_present(np, "hp-det-gpios") ||10491049+ of_property_present(np, "hp-det-gpio") /* deprecated */) {10501050 ret = simple_util_init_jack(&priv->card, &priv->hp_jack,10511051 1, NULL, "Headphone Jack");10521052 if (ret)···10551055 snd_soc_jack_notifier_register(&priv->hp_jack.jack, &hp_jack_nb);10561056 }1057105710581058- if (of_property_read_bool(np, "mic-det-gpios") ||10591059- of_property_read_bool(np, "mic-det-gpio") /* deprecated */) {10581058+ if (of_property_present(np, "mic-det-gpios") ||10591059+ of_property_present(np, "mic-det-gpio") /* deprecated */) {10601060 ret = simple_util_init_jack(&priv->card, &priv->mic_jack,10611061 0, NULL, "Mic Jack");10621062 if (ret)
···17521752 channel_count = params_channels(params);17531753 sample_rate = params_rate(params);17541754 bit_depth = params_width(params);17551755- /*17561756- * Look for 32-bit blob first instead of 16-bit if copier17571757- * supports multiple formats17581758- */17591759- if (bit_depth == 16 && !single_bitdepth) {17551755+17561756+ /* Prefer 32-bit blob if copier supports multiple formats */17571757+ if (bit_depth <= 16 && !single_bitdepth) {17601758 dev_dbg(sdev->dev, "Looking for 32-bit blob first for DMIC\n");17611759 format_change = true;17621760 bit_depth = 32;···17971799 if (format_change) {17981800 /*17991801 * The 32-bit blob was not found in NHLT table, try to18001800- * look for one based on the params18021802+ * look for 16-bit for DMIC or based on the params for18031803+ * SSP18011804 */18021802- bit_depth = params_width(params);18031803- format_change = false;18051805+ if (linktype == SOF_DAI_INTEL_DMIC) {18061806+ bit_depth = 16;18071807+ if (params_width(params) == 16)18081808+ format_change = false;18091809+ } else {18101810+ bit_depth = params_width(params);18111811+ format_change = false;18121812+ }18131813+18041814 get_new_blob = true;18051815 } else if (linktype == SOF_DAI_INTEL_DMIC && !single_bitdepth) {18061816 /*···18431837 *len = cfg->size >> 2;18441838 *dst = (u32 *)cfg->caps;1845183918461846- if (format_change) {18401840+ if (format_change || params_format(params) == SNDRV_PCM_FORMAT_FLOAT_LE) {18471841 /*18481842 * Update the params to reflect that different blob was loaded18491843 * instead of the requested bit depth (16 -> 32 or 32 -> 16).···22862280 ch_map >>= 4;22872281 }2288228222892289- step = ch_count / blob->alh_cfg.device_count;22902290- mask = GENMASK(step - 1, 0);22832283+ if (swidget->id == snd_soc_dapm_dai_in && ch_count == out_ref_channels) {22842284+ /*22852285+ * For playback DAI widgets where the channel number is equal to22862286+ * the output reference channels, set the step = 0 to ensure all22872287+ * the ch_mask is applied to all alh mappings.22882288+ */22892289+ mask = ch_mask;22902290+ step = 0;22912291+ } else {22922292+ step = ch_count / blob->alh_cfg.device_count;22932293+ mask = GENMASK(step - 1, 0);22942294+ }22952295+22912296 /*22922297 * Set each gtw_cfg.node_id to blob->alh_cfg.mapping[]22932298 * for all widgets with the same stream name···23332316 }2334231723352318 /*23362336- * Set the same channel mask for playback as the audio data is23372337- * duplicated for all speakers. For capture, split the channels23192319+ * Set the same channel mask if the widget channel count is the same23202320+ * as the FE channels for playback as the audio data is duplicated23212321+ * for all speakers in this case. Otherwise, split the channels23382322 * among the aggregated DAIs. For example, with 4 channels on 223392323 * aggregated DAIs, the channel_mask should be 0x3 and 0xc for the23402324 * two DAI's.···23442326 * the tables in soc_acpi files depending on the _ADR and devID23452327 * registers for each codec.23462328 */23472347- if (w->id == snd_soc_dapm_dai_in)23482348- blob->alh_cfg.mapping[i].channel_mask = ch_mask;23492349- else23502350- blob->alh_cfg.mapping[i].channel_mask = mask << (step * i);23292329+ blob->alh_cfg.mapping[i].channel_mask = mask << (step * i);2351233023522331 i++;23532332 }
+21-5
sound/soc/sof/topology.c
···21062106 /* source component */21072107 source_swidget = snd_sof_find_swidget(scomp, (char *)route->source);21082108 if (!source_swidget) {21092109- dev_err(scomp->dev, "error: source %s not found\n",21102110- route->source);21092109+ dev_err(scomp->dev, "source %s for sink %s is not found\n",21102110+ route->source, route->sink);21112111 ret = -EINVAL;21122112 goto err;21132113 }···21252125 /* sink component */21262126 sink_swidget = snd_sof_find_swidget(scomp, (char *)route->sink);21272127 if (!sink_swidget) {21282128- dev_err(scomp->dev, "error: sink %s not found\n",21292129- route->sink);21282128+ dev_err(scomp->dev, "sink %s for source %s is not found\n",21292129+ route->sink, route->source);21302130 ret = -EINVAL;21312131 goto err;21322132 }···25062506 if (!tplg_files)25072507 return -ENOMEM;2508250825092509+ /* Try to use function topologies if possible */25092510 if (!sof_pdata->disable_function_topology && !disable_function_topology &&25102511 sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {25122512+ /*25132513+ * When the topology name contains 'dummy' word, it means that25142514+ * there is no fallback option to monolithic topology in case25152515+ * any of the function topologies might be missing.25162516+ * In this case we should use best effort to form the card,25172517+ * ignoring functionalities that we are missing a fragment for.25182518+ *25192519+ * Note: monolithic topologies also ignore these possibly25202520+ * missing functions, so the functionality of the card would be25212521+ * identical to the case if there would be a fallback monolithic25222522+ * topology created for the configuration.25232523+ */25242524+ bool no_fallback = strstr(file, "dummy");25252525+25112526 tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,25122527 sof_pdata->machine,25132528 tplg_filename_prefix,25142514- &tplg_files);25292529+ &tplg_files,25302530+ no_fallback);25152531 if (tplg_cnt < 0) {25162532 kfree(tplg_files);25172533 return tplg_cnt;
+2
sound/soc/sunxi/sun4i-spdif.c
···171171 * @reg_dac_txdata: TX FIFO offset for DMA config.172172 * @has_reset: SoC needs reset deasserted.173173 * @val_fctl_ftx: TX FIFO flush bitmask.174174+ * @mclk_multiplier: ratio of internal MCLK divider175175+ * @tx_clk_name: name of TX module clock if split clock design174176 */175177struct sun4i_spdif_quirks {176178 unsigned int reg_dac_txdata;