···1212 - Baojun Xu <baojun.xu@ti.com>13131414description: >1515- The TAS2552 can receive its reference clock via MCLK, BCLK, IVCLKIN pin or 1616- use the internal 1.8MHz. This CLKIN is used by the PLL. In addition to PLL, 1515+ The TAS2552 can receive its reference clock via MCLK, BCLK, IVCLKIN pin or1616+ use the internal 1.8MHz. This CLKIN is used by the PLL. In addition to PLL,1717 the PDM reference clock is also selectable: PLL, IVCLKIN, BCLK or MCLK.18181919 For system integration the dt-bindings/sound/tas2552.h header file provides···3434 maxItems: 13535 description: gpio pin to enable/disable the device36363737+ '#sound-dai-cells':3838+ const: 03939+3740required:3841 - compatible3942 - reg···4441 - iovdd-supply4542 - avdd-supply46434747-additionalProperties: false4444+allOf:4545+ - $ref: dai-common.yaml#4646+4747+unevaluatedProperties: false48484949examples:5050 - |···6054 audio-codec@41 {6155 compatible = "ti,tas2552";6256 reg = <0x41>;5757+ #sound-dai-cells = <0>;6358 vbat-supply = <®_vbat>;6459 iovdd-supply = <®_iovdd>;6560 avdd-supply = <®_avdd>;
···117117118118 status = val;119119 for_each_set_bit(mask, &status, BITS_PER_BYTE) {120120- mask = 1 << mask;121121-122122- switch (mask) {120120+ switch (BIT(mask)) {123121 case SDCA_CTL_ENTITY_0_FUNCTION_NEEDS_INITIALIZATION:124122 //FIXME: Add init writes125123 break;···138140 }139141 }140142141141- ret = regmap_write(interrupt->function_regmap, reg, val);143143+ ret = regmap_write(interrupt->function_regmap, reg, val & 0x7F);142144 if (ret < 0) {143145 dev_err(dev, "failed to clear function status: %d\n", ret);144146 goto error;···250252 if (irq < 0)251253 return irq;252254253253- ret = devm_request_threaded_irq(dev, irq, NULL, handler,254254- IRQF_ONESHOT, name, data);255255+ ret = request_threaded_irq(irq, NULL, handler, IRQF_ONESHOT, name, data);255256 if (ret)256257 return ret;257258···259262 dev_dbg(dev, "requested irq %d for %s\n", irq, name);260263261264 return 0;265265+}266266+267267+static void sdca_irq_free_locked(struct device *dev, struct sdca_interrupt_info *info,268268+ int sdca_irq, const char *name, void *data)269269+{270270+ int irq;271271+272272+ irq = regmap_irq_get_virq(info->irq_data, sdca_irq);273273+ if (irq < 0)274274+ return;275275+276276+ free_irq(irq, data);277277+278278+ info->irqs[sdca_irq].irq = 0;279279+280280+ dev_dbg(dev, "freed irq %d for %s\n", irq, name);262281}263282264283/**···316303EXPORT_SYMBOL_NS_GPL(sdca_irq_request, "SND_SOC_SDCA");317304318305/**306306+ * sdca_irq_free - free an individual SDCA interrupt307307+ * @dev: Pointer to the struct device.308308+ * @info: Pointer to the interrupt information structure.309309+ * @sdca_irq: SDCA interrupt position.310310+ * @name: Name to be given to the IRQ.311311+ * @data: Private data pointer that will be passed to the handler.312312+ *313313+ * Typically this is handled internally by sdca_irq_cleanup, however if314314+ * a device requires custom IRQ handling this can be called manually before315315+ * calling sdca_irq_cleanup, which will then skip that IRQ whilst processing.316316+ */317317+void sdca_irq_free(struct device *dev, struct sdca_interrupt_info *info,318318+ int sdca_irq, const char *name, void *data)319319+{320320+ if (sdca_irq < 0 || sdca_irq >= SDCA_MAX_INTERRUPTS)321321+ return;322322+323323+ guard(mutex)(&info->irq_lock);324324+325325+ sdca_irq_free_locked(dev, info, sdca_irq, name, data);326326+}327327+EXPORT_SYMBOL_NS_GPL(sdca_irq_free, "SND_SOC_SDCA");328328+329329+/**319330 * sdca_irq_data_populate - Populate common interrupt data320331 * @dev: Pointer to the Function device.321332 * @regmap: Pointer to the Function regmap.···365328 if (!dev)366329 return -ENODEV;367330368368- name = devm_kasprintf(dev, GFP_KERNEL, "%s %s %s", function->desc->name,369369- entity->label, control->label);331331+ name = kasprintf(GFP_KERNEL, "%s %s %s", function->desc->name,332332+ entity->label, control->label);370333 if (!name)371334 return -ENOMEM;372335···554517EXPORT_SYMBOL_NS_GPL(sdca_irq_populate, "SND_SOC_SDCA");555518556519/**520520+ * sdca_irq_cleanup - Free all the individual IRQs for an SDCA Function521521+ * @dev: Device pointer against which the sdca_interrupt_info was allocated.522522+ * @function: Pointer to the SDCA Function.523523+ * @info: Pointer to the SDCA interrupt info for this device.524524+ *525525+ * Typically this would be called from the driver for a single SDCA Function.526526+ */527527+void sdca_irq_cleanup(struct device *dev,528528+ struct sdca_function_data *function,529529+ struct sdca_interrupt_info *info)530530+{531531+ int i;532532+533533+ guard(mutex)(&info->irq_lock);534534+535535+ for (i = 0; i < SDCA_MAX_INTERRUPTS; i++) {536536+ struct sdca_interrupt *interrupt = &info->irqs[i];537537+538538+ if (interrupt->function != function || !interrupt->irq)539539+ continue;540540+541541+ sdca_irq_free_locked(dev, info, i, interrupt->name, interrupt);542542+543543+ kfree(interrupt->name);544544+ }545545+}546546+EXPORT_SYMBOL_NS_GPL(sdca_irq_cleanup, "SND_SOC_SDCA");547547+548548+/**557549 * sdca_irq_allocate - allocate an SDCA interrupt structure for a device558550 * @sdev: Device pointer against which things should be allocated.559551 * @regmap: regmap to be used for accessing the SDCA IRQ registers.···630564static void irq_enable_flags(struct sdca_function_data *function,631565 struct sdca_interrupt_info *info, bool early)632566{633633- struct sdca_interrupt *interrupt;634567 int i;635568636569 for (i = 0; i < SDCA_MAX_INTERRUPTS; i++) {637637- interrupt = &info->irqs[i];570570+ struct sdca_interrupt *interrupt = &info->irqs[i];638571639639- if (!interrupt || interrupt->function != function)572572+ if (!interrupt->irq || interrupt->function != function)640573 continue;641574642575 switch (SDCA_CTL_TYPE(interrupt->entity->type,···688623void sdca_irq_disable(struct sdca_function_data *function,689624 struct sdca_interrupt_info *info)690625{691691- struct sdca_interrupt *interrupt;692626 int i;693627694628 for (i = 0; i < SDCA_MAX_INTERRUPTS; i++) {695695- interrupt = &info->irqs[i];629629+ struct sdca_interrupt *interrupt = &info->irqs[i];696630697697- if (!interrupt || interrupt->function != function)631631+ if (!interrupt->irq || interrupt->function != function)698632 continue;699633700634 disable_irq(interrupt->irq);
+12-2
sound/soc/sof/intel/hda-pcm.c
···219219int hda_dsp_pcm_open(struct snd_sof_dev *sdev,220220 struct snd_pcm_substream *substream)221221{222222+ const struct sof_intel_dsp_desc *chip_info = get_chip_info(sdev->pdata);222223 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);223224 struct snd_pcm_runtime *runtime = substream->runtime;224225 struct snd_soc_component *scomp = sdev->component;···269268 return -ENODEV;270269 }271270272272- /* minimum as per HDA spec */273273- snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);271271+ /*272272+ * Set period size constraint to ensure BDLE buffer length and273273+ * start address alignment requirements are met. Align to 128274274+ * bytes for newer Intel platforms, with older ones using 4 byte alignment.275275+ */276276+ if (chip_info->hw_ip_version >= SOF_INTEL_ACE_4_0)277277+ snd_pcm_hw_constraint_step(substream->runtime, 0,278278+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);279279+ else280280+ snd_pcm_hw_constraint_step(substream->runtime, 0,281281+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);274282275283 /* avoid circular buffer wrap in middle of period */276284 snd_pcm_hw_constraint_integer(substream->runtime,
+4-6
sound/soc/sof/intel/hda.c
···1133113311341134#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)1135113511361136-static bool is_endpoint_present(struct sdw_slave *sdw_device,11371137- struct asoc_sdw_codec_info *dai_info, int dai_type)11361136+static bool is_endpoint_present(struct sdw_slave *sdw_device, int dai_type)11381137{11391138 int i;11401139···11441145 }1145114611461147 for (i = 0; i < sdw_device->sdca_data.num_functions; i++) {11471147- if (dai_type == dai_info->dais[i].dai_type)11481148+ if (dai_type == asoc_sdw_get_dai_type(sdw_device->sdca_data.function[i].type))11481149 return true;11491150 }11501151 dev_dbg(&sdw_device->dev, "Endpoint DAI type %d not found\n", dai_type);···12011202 }12021203 for (j = 0; j < codec_info_list[i].dai_num; j++) {12031204 /* Check if the endpoint is present by the SDCA DisCo table */12041204- if (!is_endpoint_present(sdw_device, &codec_info_list[i],12051205- codec_info_list[i].dais[j].dai_type))12051205+ if (!is_endpoint_present(sdw_device, codec_info_list[i].dais[j].dai_type))12061206 continue;1207120712081208- endpoints[ep_index].num = ep_index;12081208+ endpoints[ep_index].num = j;12091209 if (codec_info_list[i].dais[j].dai_type == SOC_SDW_DAI_TYPE_AMP) {12101210 /* Assume all amp are aggregated */12111211 endpoints[ep_index].aggregated = 1;
+3
sound/soc/stm/stm32_sai_sub.c
···802802 break;803803 /* Left justified */804804 case SND_SOC_DAIFMT_MSB:805805+ cr1 |= SAI_XCR1_CKSTR;805806 frcr |= SAI_XFRCR_FSPOL | SAI_XFRCR_FSDEF;806807 break;807808 /* Right justified */···810809 frcr |= SAI_XFRCR_FSPOL | SAI_XFRCR_FSDEF;811810 break;812811 case SND_SOC_DAIFMT_DSP_A:812812+ cr1 |= SAI_XCR1_CKSTR;813813 frcr |= SAI_XFRCR_FSPOL | SAI_XFRCR_FSOFF;814814 break;815815 case SND_SOC_DAIFMT_DSP_B:816816+ cr1 |= SAI_XCR1_CKSTR;816817 frcr |= SAI_XFRCR_FSPOL;817818 break;818819 default: