···553553{554554 struct adau *adau = snd_soc_component_get_drvdata(dai->component);555555 unsigned int ctrl0, ctrl1;556556+ unsigned int ctrl0_mask;556557 int lrclk_pol;557558558559 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {···613612 if (lrclk_pol)614613 ctrl0 |= ADAU17X1_SERIAL_PORT0_LRCLK_POL;615614616616- regmap_write(adau->regmap, ADAU17X1_SERIAL_PORT0, ctrl0);617617- regmap_write(adau->regmap, ADAU17X1_SERIAL_PORT1, ctrl1);615615+ /* Set the mask to update all relevant bits in ADAU17X1_SERIAL_PORT0 */616616+ ctrl0_mask = ADAU17X1_SERIAL_PORT0_MASTER |617617+ ADAU17X1_SERIAL_PORT0_LRCLK_POL |618618+ ADAU17X1_SERIAL_PORT0_BCLK_POL |619619+ ADAU17X1_SERIAL_PORT0_PULSE_MODE;620620+621621+ regmap_update_bits(adau->regmap, ADAU17X1_SERIAL_PORT0, ctrl0_mask,622622+ ctrl0);623623+ regmap_update_bits(adau->regmap, ADAU17X1_SERIAL_PORT1,624624+ ADAU17X1_SERIAL_PORT1_DELAY_MASK, ctrl1);618625619626 adau->dai_fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK;620627
+2-14
sound/soc/codecs/rt1011.c
···22392239 dc_offset |= (value & 0xffff);22402240 dev_info(dev, "Gain1 offset=0x%x\n", dc_offset);2241224122422242- /* check the package info. */22432243- regmap_read(rt1011->regmap, RT1011_EFUSE_MATCH_DONE, &value);22442244- if (value & 0x4)22452245- rt1011->pack_id = 1;22462246-22472242 if (cali_flag) {2248224322492249- if (rt1011->pack_id)22502250- regmap_write(rt1011->regmap, RT1011_ADC_SET_1, 0x292c);22512251- else22522252- regmap_write(rt1011->regmap, RT1011_ADC_SET_1, 0x2925);22532253-22442244+ regmap_write(rt1011->regmap, RT1011_ADC_SET_1, 0x2925);22542245 /* Class D on */22552246 regmap_write(rt1011->regmap, RT1011_CLASS_D_POS, 0x010e);22562247 regmap_write(rt1011->regmap,···23672376 rt1011_r0_load(rt1011);23682377 }2369237823702370- if (rt1011->pack_id)23712371- snd_soc_component_write(component, RT1011_ADC_SET_1, 0x292c);23722372- else23732373- snd_soc_component_write(component, RT1011_ADC_SET_1, 0x2925);23792379+ snd_soc_component_write(component, RT1011_ADC_SET_1, 0x2925);23742380}2375238123762382static int rt1011_parse_dp(struct rt1011_priv *rt1011, struct device *dev)
-1
sound/soc/codecs/rt1011.h
···692692 unsigned int r0_reg, cali_done;693693 unsigned int r0_calib, temperature_calib;694694 int recv_spk_mode;695695- unsigned int pack_id; /* 0: WLCSP; 1: QFN */696695};697696698697#endif /* end of _RT1011_H_ */
+4-1
sound/soc/codecs/rt286.c
···171171 case RT286_PROC_COEF:172172 case RT286_SET_AMP_GAIN_ADC_IN1:173173 case RT286_SET_AMP_GAIN_ADC_IN2:174174+ case RT286_SET_GPIO_MASK:175175+ case RT286_SET_GPIO_DIRECTION:176176+ case RT286_SET_GPIO_DATA:174177 case RT286_SET_POWER(RT286_DAC_OUT1):175178 case RT286_SET_POWER(RT286_DAC_OUT2):176179 case RT286_SET_POWER(RT286_ADC_IN1):···12071204 mdelay(10);1208120512091206 if (!rt286->pdata.gpio2_en)12101210- regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0x4000);12071207+ regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0x40);12111208 else12121209 regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0);12131210
+3-1
sound/soc/codecs/tas2552.c
···730730 ret = devm_snd_soc_register_component(&client->dev,731731 &soc_component_dev_tas2552,732732 tas2552_dai, ARRAY_SIZE(tas2552_dai));733733- if (ret < 0)733733+ if (ret < 0) {734734 dev_err(&client->dev, "Failed to register component: %d\n", ret);735735+ pm_runtime_get_noresume(&client->dev);736736+ }735737736738 return ret;737739}
+6-6
sound/soc/codecs/tlv320aic32x4.c
···577577 .window_start = 0,578578 .window_len = 128,579579 .range_min = 0,580580- .range_max = AIC32X4_RMICPGAVOL,580580+ .range_max = AIC32X4_REFPOWERUP,581581 },582582};583583584584const struct regmap_config aic32x4_regmap_config = {585585- .max_register = AIC32X4_RMICPGAVOL,585585+ .max_register = AIC32X4_REFPOWERUP,586586 .ranges = aic32x4_regmap_pages,587587 .num_ranges = ARRAY_SIZE(aic32x4_regmap_pages),588588};···12431243 if (ret)12441244 goto err_disable_regulators;1245124512461246+ ret = aic32x4_register_clocks(dev, aic32x4->mclk_name);12471247+ if (ret)12481248+ goto err_disable_regulators;12491249+12461250 ret = devm_snd_soc_register_component(dev,12471251 &soc_component_dev_aic32x4, &aic32x4_dai, 1);12481252 if (ret) {12491253 dev_err(dev, "Failed to register component\n");12501254 goto err_disable_regulators;12511255 }12521252-12531253- ret = aic32x4_register_clocks(dev, aic32x4->mclk_name);12541254- if (ret)12551255- goto err_disable_regulators;1256125612571257 return 0;12581258
+30-8
sound/soc/intel/boards/kbl_da7219_max98927.c
···282282 struct snd_interval *chan = hw_param_interval(params,283283 SNDRV_PCM_HW_PARAM_CHANNELS);284284 struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);285285- struct snd_soc_dpcm *dpcm = container_of(286286- params, struct snd_soc_dpcm, hw_params);287287- struct snd_soc_dai_link *fe_dai_link = dpcm->fe->dai_link;288288- struct snd_soc_dai_link *be_dai_link = dpcm->be->dai_link;285285+ struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;289286287287+ /*288288+ * The following loop will be called only for playback stream289289+ * In this platform, there is only one playback device on every SSP290290+ */291291+ for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {292292+ rtd_dpcm = dpcm;293293+ break;294294+ }295295+296296+ /*297297+ * This following loop will be called only for capture stream298298+ * In this platform, there is only one capture device on every SSP299299+ */300300+ for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {301301+ rtd_dpcm = dpcm;302302+ break;303303+ }304304+305305+ if (!rtd_dpcm)306306+ return -EINVAL;307307+308308+ /*309309+ * The above 2 loops are mutually exclusive based on the stream direction,310310+ * thus rtd_dpcm variable will never be overwritten311311+ */290312 /*291313 * Topology for kblda7219m98373 & kblmax98373 supports only S24_LE,292314 * where as kblda7219m98927 & kblmax98927 supports S16_LE by default.···331309 /*332310 * The ADSP will convert the FE rate to 48k, stereo, 24 bit333311 */334334- if (!strcmp(fe_dai_link->name, "Kbl Audio Port") ||335335- !strcmp(fe_dai_link->name, "Kbl Audio Headset Playback") ||336336- !strcmp(fe_dai_link->name, "Kbl Audio Capture Port")) {312312+ if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||313313+ !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||314314+ !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {337315 rate->min = rate->max = 48000;338316 chan->min = chan->max = 2;339317 snd_mask_none(fmt);···344322 * The speaker on the SSP0 supports S16_LE and not S24_LE.345323 * thus changing the mask here346324 */347347- if (!strcmp(be_dai_link->name, "SSP0-Codec"))325325+ if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))348326 snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);349327350328 return 0;
+3-2
sound/soc/intel/keembay/kmb_platform.c
···105105 void *buf = runtime->dma_area;106106 int i;107107108108+ if (kmb_i2s->iec958_fmt)109109+ hdmi_reformat_iec958(runtime, kmb_i2s, tx_ptr);110110+108111 /* KMB i2s uses two separate L/R FIFO */109112 for (i = 0; i < kmb_i2s->fifo_th; i++) {110113 if (kmb_i2s->config.data_width == 16) {111114 writel(((u16(*)[2])buf)[tx_ptr][0], i2s_base + LRBR_LTHR(0));112115 writel(((u16(*)[2])buf)[tx_ptr][1], i2s_base + RRBR_RTHR(0));113116 } else {114114- if (kmb_i2s->iec958_fmt)115115- hdmi_reformat_iec958(runtime, kmb_i2s, tx_ptr);116117 writel(((u32(*)[2])buf)[tx_ptr][0], i2s_base + LRBR_LTHR(0));117118 writel(((u32(*)[2])buf)[tx_ptr][1], i2s_base + RRBR_RTHR(0));118119 }
+21-6
sound/soc/meson/axg-frddr.c
···1111#include <linux/regmap.h>1212#include <linux/module.h>1313#include <linux/of_platform.h>1414+#include <sound/pcm_params.h>1415#include <sound/soc.h>1516#include <sound/soc-dai.h>1617···4746 return 0;4847}49484949+static int axg_frddr_dai_hw_params(struct snd_pcm_substream *substream,5050+ struct snd_pcm_hw_params *params,5151+ struct snd_soc_dai *dai)5252+{5353+ struct axg_fifo *fifo = snd_soc_dai_get_drvdata(dai);5454+ unsigned int period, depth, val;5555+5656+ period = params_period_bytes(params);5757+5858+ /* Trim the FIFO depth if the period is small to improve latency */5959+ depth = min(period, fifo->depth);6060+ val = (depth / AXG_FIFO_BURST) - 1;6161+ regmap_update_bits(fifo->map, FIFO_CTRL1, CTRL1_FRDDR_DEPTH_MASK,6262+ CTRL1_FRDDR_DEPTH(val));6363+6464+ return 0;6565+}6666+5067static int axg_frddr_dai_startup(struct snd_pcm_substream *substream,5168 struct snd_soc_dai *dai)5269{5370 struct axg_fifo *fifo = snd_soc_dai_get_drvdata(dai);5454- unsigned int val;5571 int ret;56725773 /* Enable pclk to access registers and clock the fifo ip */···78607961 /* Apply single buffer mode to the interface */8062 regmap_update_bits(fifo->map, FIFO_CTRL0, CTRL0_FRDDR_PP_MODE, 0);8181-8282- /* Use all fifo depth */8383- val = (fifo->depth / AXG_FIFO_BURST) - 1;8484- regmap_update_bits(fifo->map, FIFO_CTRL1, CTRL1_FRDDR_DEPTH_MASK,8585- CTRL1_FRDDR_DEPTH(val));86638764 return 0;8865}···9784}98859986static const struct snd_soc_dai_ops axg_frddr_ops = {8787+ .hw_params = axg_frddr_dai_hw_params,10088 .startup = axg_frddr_dai_startup,10189 .shutdown = axg_frddr_dai_shutdown,10290};···171157172158static const struct snd_soc_dai_ops g12a_frddr_ops = {173159 .prepare = g12a_frddr_dai_prepare,160160+ .hw_params = axg_frddr_dai_hw_params,174161 .startup = axg_frddr_dai_startup,175162 .shutdown = axg_frddr_dai_shutdown,176163};