Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branch 'asoc/for-5.20' into asoc-6.0

+116 -76
+28
sound/soc/amd/yc/acp6x-mach.c
··· 143 143 DMI_MATCH(DMI_PRODUCT_NAME, "21CL"), 144 144 } 145 145 }, 146 + { 147 + .driver_data = &acp6x_card, 148 + .matches = { 149 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 150 + DMI_MATCH(DMI_PRODUCT_NAME, "21EM"), 151 + } 152 + }, 153 + { 154 + .driver_data = &acp6x_card, 155 + .matches = { 156 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 157 + DMI_MATCH(DMI_PRODUCT_NAME, "21EN"), 158 + } 159 + }, 160 + { 161 + .driver_data = &acp6x_card, 162 + .matches = { 163 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 164 + DMI_MATCH(DMI_PRODUCT_NAME, "21J5"), 165 + } 166 + }, 167 + { 168 + .driver_data = &acp6x_card, 169 + .matches = { 170 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 171 + DMI_MATCH(DMI_PRODUCT_NAME, "21J6"), 172 + } 173 + }, 146 174 {} 147 175 }; 148 176
+3 -2
sound/soc/codecs/rt5640.c
··· 1986 1986 snd_soc_component_write(component, RT5640_PWR_MIXER, 0x0000); 1987 1987 if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) 1988 1988 snd_soc_component_write(component, RT5640_PWR_ANLG1, 1989 - 0x0018); 1989 + 0x2818); 1990 1990 else 1991 1991 snd_soc_component_write(component, RT5640_PWR_ANLG1, 1992 1992 0x0000); ··· 2600 2600 snd_soc_component_update_bits(component, RT5640_DUMMY1, 0x400, 0x0); 2601 2601 2602 2602 snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, 2603 - RT5640_PWR_VREF2, RT5640_PWR_VREF2); 2603 + RT5640_PWR_VREF2 | RT5640_PWR_MB | RT5640_PWR_BG, 2604 + RT5640_PWR_VREF2 | RT5640_PWR_MB | RT5640_PWR_BG); 2604 2605 usleep_range(10000, 15000); 2605 2606 snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, 2606 2607 RT5640_PWR_FV2, RT5640_PWR_FV2);
+43 -55
sound/soc/codecs/tas2770.c
··· 46 46 usleep_range(1000, 2000); 47 47 } 48 48 49 - static int tas2770_set_bias_level(struct snd_soc_component *component, 50 - enum snd_soc_bias_level level) 49 + static int tas2770_update_pwr_ctrl(struct tas2770_priv *tas2770) 51 50 { 52 - struct tas2770_priv *tas2770 = 53 - snd_soc_component_get_drvdata(component); 51 + struct snd_soc_component *component = tas2770->component; 52 + unsigned int val; 53 + int ret; 54 54 55 - switch (level) { 56 - case SND_SOC_BIAS_ON: 57 - snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 58 - TAS2770_PWR_CTRL_MASK, 59 - TAS2770_PWR_CTRL_ACTIVE); 60 - break; 61 - case SND_SOC_BIAS_STANDBY: 62 - case SND_SOC_BIAS_PREPARE: 63 - snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 64 - TAS2770_PWR_CTRL_MASK, 65 - TAS2770_PWR_CTRL_MUTE); 66 - break; 67 - case SND_SOC_BIAS_OFF: 68 - snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 69 - TAS2770_PWR_CTRL_MASK, 70 - TAS2770_PWR_CTRL_SHUTDOWN); 71 - break; 55 + if (tas2770->dac_powered) 56 + val = tas2770->unmuted ? 57 + TAS2770_PWR_CTRL_ACTIVE : TAS2770_PWR_CTRL_MUTE; 58 + else 59 + val = TAS2770_PWR_CTRL_SHUTDOWN; 72 60 73 - default: 74 - dev_err(tas2770->dev, "wrong power level setting %d\n", level); 75 - return -EINVAL; 76 - } 61 + ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 62 + TAS2770_PWR_CTRL_MASK, val); 63 + if (ret < 0) 64 + return ret; 77 65 78 66 return 0; 79 67 } ··· 102 114 gpiod_set_value_cansleep(tas2770->sdz_gpio, 1); 103 115 usleep_range(1000, 2000); 104 116 } else { 105 - ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 106 - TAS2770_PWR_CTRL_MASK, 107 - TAS2770_PWR_CTRL_ACTIVE); 117 + ret = tas2770_update_pwr_ctrl(tas2770); 108 118 if (ret < 0) 109 119 return ret; 110 120 } ··· 138 152 139 153 switch (event) { 140 154 case SND_SOC_DAPM_POST_PMU: 141 - ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 142 - TAS2770_PWR_CTRL_MASK, 143 - TAS2770_PWR_CTRL_MUTE); 155 + tas2770->dac_powered = 1; 156 + ret = tas2770_update_pwr_ctrl(tas2770); 144 157 break; 145 158 case SND_SOC_DAPM_PRE_PMD: 146 - ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 147 - TAS2770_PWR_CTRL_MASK, 148 - TAS2770_PWR_CTRL_SHUTDOWN); 159 + tas2770->dac_powered = 0; 160 + ret = tas2770_update_pwr_ctrl(tas2770); 149 161 break; 150 162 default: 151 163 dev_err(tas2770->dev, "Not supported evevt\n"); 152 164 return -EINVAL; 153 165 } 154 166 155 - if (ret < 0) 156 - return ret; 157 - 158 - return 0; 167 + return ret; 159 168 } 160 169 161 170 static const struct snd_kcontrol_new isense_switch = ··· 184 203 static int tas2770_mute(struct snd_soc_dai *dai, int mute, int direction) 185 204 { 186 205 struct snd_soc_component *component = dai->component; 187 - int ret; 206 + struct tas2770_priv *tas2770 = 207 + snd_soc_component_get_drvdata(component); 188 208 189 - if (mute) 190 - ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 191 - TAS2770_PWR_CTRL_MASK, 192 - TAS2770_PWR_CTRL_MUTE); 193 - else 194 - ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 195 - TAS2770_PWR_CTRL_MASK, 196 - TAS2770_PWR_CTRL_ACTIVE); 197 - 198 - if (ret < 0) 199 - return ret; 200 - 201 - return 0; 209 + tas2770->unmuted = !mute; 210 + return tas2770_update_pwr_ctrl(tas2770); 202 211 } 203 212 204 213 static int tas2770_set_bitwidth(struct tas2770_priv *tas2770, int bitwidth) ··· 308 337 struct snd_soc_component *component = dai->component; 309 338 struct tas2770_priv *tas2770 = 310 339 snd_soc_component_get_drvdata(component); 311 - u8 tdm_rx_start_slot = 0, asi_cfg_1 = 0; 340 + u8 tdm_rx_start_slot = 0, invert_fpol = 0, fpol_preinv = 0, asi_cfg_1 = 0; 312 341 int ret; 313 342 314 343 switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { ··· 320 349 } 321 350 322 351 switch (fmt & SND_SOC_DAIFMT_INV_MASK) { 352 + case SND_SOC_DAIFMT_NB_IF: 353 + invert_fpol = 1; 354 + fallthrough; 323 355 case SND_SOC_DAIFMT_NB_NF: 324 356 asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_RSING; 325 357 break; 358 + case SND_SOC_DAIFMT_IB_IF: 359 + invert_fpol = 1; 360 + fallthrough; 326 361 case SND_SOC_DAIFMT_IB_NF: 327 362 asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_FALING; 328 363 break; ··· 346 369 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { 347 370 case SND_SOC_DAIFMT_I2S: 348 371 tdm_rx_start_slot = 1; 372 + fpol_preinv = 0; 349 373 break; 350 374 case SND_SOC_DAIFMT_DSP_A: 351 375 tdm_rx_start_slot = 0; 376 + fpol_preinv = 1; 352 377 break; 353 378 case SND_SOC_DAIFMT_DSP_B: 354 379 tdm_rx_start_slot = 1; 380 + fpol_preinv = 1; 355 381 break; 356 382 case SND_SOC_DAIFMT_LEFT_J: 357 383 tdm_rx_start_slot = 0; 384 + fpol_preinv = 1; 358 385 break; 359 386 default: 360 387 dev_err(tas2770->dev, ··· 369 388 ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG1, 370 389 TAS2770_TDM_CFG_REG1_MASK, 371 390 (tdm_rx_start_slot << TAS2770_TDM_CFG_REG1_51_SHIFT)); 391 + if (ret < 0) 392 + return ret; 393 + 394 + ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG0, 395 + TAS2770_TDM_CFG_REG0_FPOL_MASK, 396 + (fpol_preinv ^ invert_fpol) 397 + ? TAS2770_TDM_CFG_REG0_FPOL_RSING 398 + : TAS2770_TDM_CFG_REG0_FPOL_FALING); 372 399 if (ret < 0) 373 400 return ret; 374 401 ··· 478 489 .id = 0, 479 490 .playback = { 480 491 .stream_name = "ASI1 Playback", 481 - .channels_min = 2, 492 + .channels_min = 1, 482 493 .channels_max = 2, 483 494 .rates = TAS2770_RATES, 484 495 .formats = TAS2770_FORMATS, ··· 526 537 .probe = tas2770_codec_probe, 527 538 .suspend = tas2770_codec_suspend, 528 539 .resume = tas2770_codec_resume, 529 - .set_bias_level = tas2770_set_bias_level, 530 540 .controls = tas2770_snd_controls, 531 541 .num_controls = ARRAY_SIZE(tas2770_snd_controls), 532 542 .dapm_widgets = tas2770_dapm_widgets,
+5
sound/soc/codecs/tas2770.h
··· 41 41 #define TAS2770_TDM_CFG_REG0_31_44_1_48KHZ 0x6 42 42 #define TAS2770_TDM_CFG_REG0_31_88_2_96KHZ 0x8 43 43 #define TAS2770_TDM_CFG_REG0_31_176_4_192KHZ 0xa 44 + #define TAS2770_TDM_CFG_REG0_FPOL_MASK BIT(0) 45 + #define TAS2770_TDM_CFG_REG0_FPOL_RSING 0 46 + #define TAS2770_TDM_CFG_REG0_FPOL_FALING 1 44 47 /* TDM Configuration Reg1 */ 45 48 #define TAS2770_TDM_CFG_REG1 TAS2770_REG(0X0, 0x0B) 46 49 #define TAS2770_TDM_CFG_REG1_MASK GENMASK(5, 1) ··· 138 135 struct device *dev; 139 136 int v_sense_slot; 140 137 int i_sense_slot; 138 + bool dac_powered; 139 + bool unmuted; 141 140 }; 142 141 143 142 #endif /* __TAS2770__ */
+9
sound/soc/codecs/tlv320aic32x4.c
··· 49 49 struct aic32x4_setup_data *setup; 50 50 struct device *dev; 51 51 enum aic32x4_type type; 52 + 53 + unsigned int fmt; 52 54 }; 53 55 54 56 static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w, ··· 613 611 static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) 614 612 { 615 613 struct snd_soc_component *component = codec_dai->component; 614 + struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component); 616 615 u8 iface_reg_1 = 0; 617 616 u8 iface_reg_2 = 0; 618 617 u8 iface_reg_3 = 0; ··· 655 652 printk(KERN_ERR "aic32x4: invalid DAI interface format\n"); 656 653 return -EINVAL; 657 654 } 655 + 656 + aic32x4->fmt = fmt; 658 657 659 658 snd_soc_component_update_bits(component, AIC32X4_IFACE1, 660 659 AIC32X4_IFACE1_DATATYPE_MASK | ··· 761 756 dev_err(component->dev, "Sampling rate not supported\n"); 762 757 return -EINVAL; 763 758 } 759 + 760 + /* PCM over I2S is always 2-channel */ 761 + if ((aic32x4->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) 762 + channels = 2; 764 763 765 764 madc = DIV_ROUND_UP((32 * adc_resource_class), aosr); 766 765 max_dosr = (AIC32X4_MAX_DOSR_FREQ / sample_rate / dosr_increment) *
+2 -2
sound/soc/intel/avs/pcm.c
··· 636 636 char buf[64]; 637 637 size_t len; 638 638 639 - len = snprintf(buf, sizeof(buf), "%s/%s\n", component->driver->topology_name_prefix, 640 - mach->tplg_filename); 639 + len = scnprintf(buf, sizeof(buf), "%s/%s\n", component->driver->topology_name_prefix, 640 + mach->tplg_filename); 641 641 642 642 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 643 643 }
+3 -1
sound/soc/intel/boards/sof_es8336.c
··· 760 760 761 761 static const struct platform_device_id board_ids[] = { 762 762 { 763 + .name = "sof-essx8336", /* default quirk == 0 */ 764 + }, 765 + { 763 766 .name = "adl_es83x6_c1_h02", 764 767 .driver_data = (kernel_ulong_t)(SOF_ES8336_SSP_CODEC(1) | 765 768 SOF_NO_OF_HDMI_CAPTURE_SSP(2) | ··· 789 786 790 787 MODULE_DESCRIPTION("ASoC Intel(R) SOF + ES8336 Machine driver"); 791 788 MODULE_LICENSE("GPL"); 792 - MODULE_ALIAS("platform:sof-essx8336"); 793 789 MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
+15 -11
sound/soc/sh/rz-ssi.c
··· 1017 1017 1018 1018 ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); 1019 1019 if (IS_ERR(ssi->rstc)) { 1020 - rz_ssi_release_dma_channels(ssi); 1021 - return PTR_ERR(ssi->rstc); 1020 + ret = PTR_ERR(ssi->rstc); 1021 + goto err_reset; 1022 1022 } 1023 1023 1024 1024 reset_control_deassert(ssi->rstc); 1025 1025 pm_runtime_enable(&pdev->dev); 1026 1026 ret = pm_runtime_resume_and_get(&pdev->dev); 1027 1027 if (ret < 0) { 1028 - rz_ssi_release_dma_channels(ssi); 1029 - pm_runtime_disable(ssi->dev); 1030 - reset_control_assert(ssi->rstc); 1031 - return dev_err_probe(ssi->dev, ret, "pm_runtime_resume_and_get failed\n"); 1028 + dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n"); 1029 + goto err_pm; 1032 1030 } 1033 1031 1034 1032 ret = devm_snd_soc_register_component(&pdev->dev, &rz_ssi_soc_component, 1035 1033 rz_ssi_soc_dai, 1036 1034 ARRAY_SIZE(rz_ssi_soc_dai)); 1037 1035 if (ret < 0) { 1038 - rz_ssi_release_dma_channels(ssi); 1039 - 1040 - pm_runtime_put(ssi->dev); 1041 - pm_runtime_disable(ssi->dev); 1042 - reset_control_assert(ssi->rstc); 1043 1036 dev_err(&pdev->dev, "failed to register snd component\n"); 1037 + goto err_snd_soc; 1044 1038 } 1039 + 1040 + return 0; 1041 + 1042 + err_snd_soc: 1043 + pm_runtime_put(ssi->dev); 1044 + err_pm: 1045 + pm_runtime_disable(ssi->dev); 1046 + reset_control_assert(ssi->rstc); 1047 + err_reset: 1048 + rz_ssi_release_dma_channels(ssi); 1045 1049 1046 1050 return ret; 1047 1051 }
+3
sound/soc/soc-pcm.c
··· 1317 1317 if (!be->dai_link->no_pcm) 1318 1318 continue; 1319 1319 1320 + if (!snd_soc_dpcm_get_substream(be, stream)) 1321 + continue; 1322 + 1320 1323 for_each_rtd_dais(be, i, dai) { 1321 1324 w = snd_soc_dai_get_widget(dai, stream); 1322 1325
+3 -3
sound/soc/sof/debug.c
··· 252 252 } 253 253 254 254 for (i = 0, len = 0; i < reply->num_elems; i++) { 255 - ret = snprintf(buf + len, buff_size - len, "zone %d.%d used %#8x free %#8x\n", 256 - reply->elems[i].zone, reply->elems[i].id, 257 - reply->elems[i].used, reply->elems[i].free); 255 + ret = scnprintf(buf + len, buff_size - len, "zone %d.%d used %#8x free %#8x\n", 256 + reply->elems[i].zone, reply->elems[i].id, 257 + reply->elems[i].used, reply->elems[i].free); 258 258 if (ret < 0) 259 259 goto error; 260 260 len += ret;
+1 -1
sound/soc/sof/intel/hda.c
··· 574 574 chip = get_chip_info(sdev->pdata); 575 575 for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) { 576 576 value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4); 577 - len += snprintf(msg + len, sizeof(msg) - len, " 0x%x", value); 577 + len += scnprintf(msg + len, sizeof(msg) - len, " 0x%x", value); 578 578 } 579 579 580 580 dev_printk(level, sdev->dev, "extended rom status: %s", msg);
+1 -1
sound/soc/sof/ipc3-topology.c
··· 2338 2338 } 2339 2339 2340 2340 dev_info(scomp->dev, 2341 - "Topology: ABI %d:%d:%d Kernel ABI %hhu:%hhu:%hhu\n", 2341 + "Topology: ABI %d:%d:%d Kernel ABI %d:%d:%d\n", 2342 2342 man->priv.data[0], man->priv.data[1], man->priv.data[2], 2343 2343 SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH); 2344 2344