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

ASoC: Merge up fixes

Needed for the Rockchip driver.

+149 -114
+4 -4
Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml
··· 25 25 - qcom,sc7280-lpass-cpu 26 26 27 27 reg: 28 - minItems: 2 28 + minItems: 1 29 29 maxItems: 6 30 30 description: LPAIF core registers 31 31 32 32 reg-names: 33 - minItems: 2 33 + minItems: 1 34 34 maxItems: 6 35 35 36 36 clocks: ··· 42 42 maxItems: 10 43 43 44 44 interrupts: 45 - minItems: 2 45 + minItems: 1 46 46 maxItems: 4 47 47 description: LPAIF DMA buffer interrupt 48 48 49 49 interrupt-names: 50 - minItems: 2 50 + minItems: 1 51 51 maxItems: 4 52 52 53 53 qcom,adsp:
+1 -1
Documentation/sound/soc/dai.rst
··· 10 10 ==== 11 11 12 12 AC97 is a five wire interface commonly found on many PC sound cards. It is 13 - now also popular in many portable devices. This DAI has a reset line and time 13 + now also popular in many portable devices. This DAI has a RESET line and time 14 14 multiplexes its data on its SDATA_OUT (playback) and SDATA_IN (capture) lines. 15 15 The bit clock (BCLK) is always driven by the CODEC (usually 12.288MHz) and the 16 16 frame (FRAME) (usually 48kHz) is always driven by the controller. Each AC97
+2 -2
sound/soc/codecs/arizona.c
··· 1760 1760 if (bclk != (val & ARIZONA_AIF1_BCLK_FREQ_MASK)) 1761 1761 return true; 1762 1762 1763 - val = snd_soc_component_read(component, base + ARIZONA_AIF_TX_BCLK_RATE); 1764 - if (lrclk != (val & ARIZONA_AIF1TX_BCPF_MASK)) 1763 + val = snd_soc_component_read(component, base + ARIZONA_AIF_RX_BCLK_RATE); 1764 + if (lrclk != (val & ARIZONA_AIF1RX_BCPF_MASK)) 1765 1765 return true; 1766 1766 1767 1767 val = snd_soc_component_read(component, base + ARIZONA_AIF_FRAME_CTRL_1);
+7 -1
sound/soc/codecs/cs47l92.c
··· 119 119 end: 120 120 snd_soc_dapm_mutex_unlock(dapm); 121 121 122 - return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 122 + ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 123 + if (ret < 0) { 124 + dev_err(madera->dev, "Failed to update demux power state: %d\n", ret); 125 + return ret; 126 + } 127 + 128 + return change; 123 129 } 124 130 125 131 static SOC_ENUM_SINGLE_DECL(cs47l92_outdemux_enum,
+22 -8
sound/soc/codecs/rt5640.c
··· 1984 1984 snd_soc_component_write(component, RT5640_PWR_DIG2, 0x0000); 1985 1985 snd_soc_component_write(component, RT5640_PWR_VOL, 0x0000); 1986 1986 snd_soc_component_write(component, RT5640_PWR_MIXER, 0x0000); 1987 - snd_soc_component_write(component, RT5640_PWR_ANLG1, 0x0000); 1987 + if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) 1988 + snd_soc_component_write(component, RT5640_PWR_ANLG1, 1989 + 0x0018); 1990 + else 1991 + snd_soc_component_write(component, RT5640_PWR_ANLG1, 1992 + 0x0000); 1988 1993 snd_soc_component_write(component, RT5640_PWR_ANLG2, 0x0000); 1989 1994 break; 1990 1995 ··· 2398 2393 static irqreturn_t rt5640_irq(int irq, void *data) 2399 2394 { 2400 2395 struct rt5640_priv *rt5640 = data; 2396 + int delay = 0; 2397 + 2398 + if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) { 2399 + cancel_delayed_work_sync(&rt5640->jack_work); 2400 + delay = 100; 2401 + } 2401 2402 2402 2403 if (rt5640->jack) 2403 - queue_delayed_work(system_long_wq, &rt5640->jack_work, 0); 2404 + queue_delayed_work(system_long_wq, &rt5640->jack_work, delay); 2404 2405 2405 2406 return IRQ_HANDLED; 2406 2407 } ··· 2599 2588 2600 2589 snd_soc_component_update_bits(component, RT5640_DUMMY1, 0x400, 0x0); 2601 2590 2591 + snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, 2592 + RT5640_PWR_VREF2, RT5640_PWR_VREF2); 2593 + usleep_range(10000, 15000); 2594 + snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, 2595 + RT5640_PWR_FV2, RT5640_PWR_FV2); 2596 + 2602 2597 rt5640->jack = jack; 2603 2598 2604 2599 ret = request_irq(rt5640->irq, rt5640_irq, ··· 2724 2707 2725 2708 if (device_property_read_u32(component->dev, 2726 2709 "realtek,jack-detect-source", &val) == 0) { 2727 - if (val <= RT5640_JD_SRC_GPIO4) { 2710 + if (val <= RT5640_JD_SRC_GPIO4) 2728 2711 rt5640->jd_src = val << RT5640_JD_SFT; 2729 - } else if (val == RT5640_JD_SRC_HDA_HEADER) { 2712 + else if (val == RT5640_JD_SRC_HDA_HEADER) 2730 2713 rt5640->jd_src = RT5640_JD_SRC_HDA_HEADER; 2731 - snd_soc_component_update_bits(component, RT5640_DUMMY1, 2732 - 0x0300, 0x0); 2733 - } else { 2714 + else 2734 2715 dev_warn(component->dev, "Warning: Invalid jack-detect-source value: %d, leaving jack-detect disabled\n", 2735 2716 val); 2736 - } 2737 2717 } 2738 2718 2739 2719 if (!device_property_read_bool(component->dev, "realtek,jack-detect-not-inverted"))
+28 -18
sound/soc/codecs/tas2764.c
··· 42 42 gpiod_set_value_cansleep(tas2764->reset_gpio, 0); 43 43 msleep(20); 44 44 gpiod_set_value_cansleep(tas2764->reset_gpio, 1); 45 + usleep_range(1000, 2000); 45 46 } 46 47 47 48 snd_soc_component_write(tas2764->component, TAS2764_SW_RST, 48 49 TAS2764_RST); 50 + usleep_range(1000, 2000); 49 51 } 50 52 51 53 static int tas2764_set_bias_level(struct snd_soc_component *component, ··· 109 107 struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component); 110 108 int ret; 111 109 112 - if (tas2764->sdz_gpio) 110 + if (tas2764->sdz_gpio) { 113 111 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); 112 + usleep_range(1000, 2000); 113 + } 114 114 115 115 ret = snd_soc_component_update_bits(component, TAS2764_PWR_CTRL, 116 116 TAS2764_PWR_CTRL_MASK, ··· 135 131 }; 136 132 137 133 static SOC_ENUM_SINGLE_DECL( 138 - tas2764_ASI1_src_enum, TAS2764_TDM_CFG2, 4, tas2764_ASI1_src); 134 + tas2764_ASI1_src_enum, TAS2764_TDM_CFG2, TAS2764_TDM_CFG2_SCFG_SHIFT, 135 + tas2764_ASI1_src); 139 136 140 137 static const struct snd_kcontrol_new tas2764_asi1_mux = 141 138 SOC_DAPM_ENUM("ASI1 Source", tas2764_ASI1_src_enum); ··· 334 329 { 335 330 struct snd_soc_component *component = dai->component; 336 331 struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component); 337 - u8 tdm_rx_start_slot = 0, asi_cfg_1 = 0; 338 - int iface; 332 + u8 tdm_rx_start_slot = 0, asi_cfg_0 = 0, asi_cfg_1 = 0; 339 333 int ret; 340 334 341 335 switch (fmt & SND_SOC_DAIFMT_INV_MASK) { 336 + case SND_SOC_DAIFMT_NB_IF: 337 + asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START; 338 + fallthrough; 342 339 case SND_SOC_DAIFMT_NB_NF: 343 340 asi_cfg_1 = TAS2764_TDM_CFG1_RX_RISING; 344 341 break; 342 + case SND_SOC_DAIFMT_IB_IF: 343 + asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START; 344 + fallthrough; 345 345 case SND_SOC_DAIFMT_IB_NF: 346 346 asi_cfg_1 = TAS2764_TDM_CFG1_RX_FALLING; 347 347 break; 348 - default: 349 - dev_err(tas2764->dev, "ASI format Inverse is not found\n"); 350 - return -EINVAL; 351 348 } 352 349 353 350 ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG1, ··· 360 353 361 354 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { 362 355 case SND_SOC_DAIFMT_I2S: 356 + asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START; 357 + fallthrough; 363 358 case SND_SOC_DAIFMT_DSP_A: 364 - iface = TAS2764_TDM_CFG2_SCFG_I2S; 365 359 tdm_rx_start_slot = 1; 366 360 break; 367 361 case SND_SOC_DAIFMT_DSP_B: 368 362 case SND_SOC_DAIFMT_LEFT_J: 369 - iface = TAS2764_TDM_CFG2_SCFG_LEFT_J; 370 363 tdm_rx_start_slot = 0; 371 364 break; 372 365 default: ··· 375 368 return -EINVAL; 376 369 } 377 370 378 - ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG1, 379 - TAS2764_TDM_CFG1_MASK, 380 - (tdm_rx_start_slot << TAS2764_TDM_CFG1_51_SHIFT)); 371 + ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG0, 372 + TAS2764_TDM_CFG0_FRAME_START, 373 + asi_cfg_0); 381 374 if (ret < 0) 382 375 return ret; 383 376 384 - ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG2, 385 - TAS2764_TDM_CFG2_SCFG_MASK, iface); 377 + ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG1, 378 + TAS2764_TDM_CFG1_MASK, 379 + (tdm_rx_start_slot << TAS2764_TDM_CFG1_51_SHIFT)); 386 380 if (ret < 0) 387 381 return ret; 388 382 ··· 509 501 510 502 tas2764->component = component; 511 503 512 - if (tas2764->sdz_gpio) 504 + if (tas2764->sdz_gpio) { 513 505 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); 506 + usleep_range(1000, 2000); 507 + } 514 508 515 509 tas2764_reset(tas2764); 516 510 ··· 536 526 } 537 527 538 528 static DECLARE_TLV_DB_SCALE(tas2764_digital_tlv, 1100, 50, 0); 539 - static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10000, 50, 0); 529 + static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10050, 50, 1); 540 530 541 531 static const struct snd_kcontrol_new tas2764_snd_controls[] = { 542 532 SOC_SINGLE_TLV("Speaker Volume", TAS2764_DVC, 0, 543 533 TAS2764_DVC_MAX, 1, tas2764_playback_volume), 544 - SOC_SINGLE_TLV("Amp Gain Volume", TAS2764_CHNL_0, 0, 0x14, 0, 534 + SOC_SINGLE_TLV("Amp Gain Volume", TAS2764_CHNL_0, 1, 0x14, 0, 545 535 tas2764_digital_tlv), 546 536 }; 547 537 ··· 565 555 { TAS2764_SW_RST, 0x00 }, 566 556 { TAS2764_PWR_CTRL, 0x1a }, 567 557 { TAS2764_DVC, 0x00 }, 568 - { TAS2764_CHNL_0, 0x00 }, 558 + { TAS2764_CHNL_0, 0x28 }, 569 559 { TAS2764_TDM_CFG0, 0x09 }, 570 560 { TAS2764_TDM_CFG1, 0x02 }, 571 561 { TAS2764_TDM_CFG2, 0x0a },
+2 -4
sound/soc/codecs/tas2764.h
··· 47 47 #define TAS2764_TDM_CFG0_MASK GENMASK(3, 1) 48 48 #define TAS2764_TDM_CFG0_44_1_48KHZ BIT(3) 49 49 #define TAS2764_TDM_CFG0_88_2_96KHZ (BIT(3) | BIT(1)) 50 + #define TAS2764_TDM_CFG0_FRAME_START BIT(0) 50 51 51 52 /* TDM Configuration Reg1 */ 52 53 #define TAS2764_TDM_CFG1 TAS2764_REG(0X0, 0x09) ··· 67 66 #define TAS2764_TDM_CFG2_RXS_16BITS 0x0 68 67 #define TAS2764_TDM_CFG2_RXS_24BITS BIT(0) 69 68 #define TAS2764_TDM_CFG2_RXS_32BITS BIT(1) 70 - #define TAS2764_TDM_CFG2_SCFG_MASK GENMASK(5, 4) 71 - #define TAS2764_TDM_CFG2_SCFG_I2S 0x0 72 - #define TAS2764_TDM_CFG2_SCFG_LEFT_J BIT(4) 73 - #define TAS2764_TDM_CFG2_SCFG_RIGHT_J BIT(5) 69 + #define TAS2764_TDM_CFG2_SCFG_SHIFT 4 74 70 75 71 /* TDM Configuration Reg3 */ 76 72 #define TAS2764_TDM_CFG3 TAS2764_REG(0X0, 0x0c)
+6 -7
sound/soc/codecs/tlv320adcx140.c
··· 33 33 bool micbias_vg; 34 34 35 35 unsigned int dai_fmt; 36 - unsigned int tdm_delay; 37 36 unsigned int slot_width; 38 37 }; 39 38 ··· 789 790 { 790 791 struct snd_soc_component *component = codec_dai->component; 791 792 struct adcx140_priv *adcx140 = snd_soc_component_get_drvdata(component); 792 - unsigned int lsb; 793 793 794 - /* TDM based on DSP mode requires slots to be adjacent */ 795 - lsb = __ffs(tx_mask); 796 - if ((lsb + 1) != __fls(tx_mask)) { 797 - dev_err(component->dev, "Invalid mask, slots must be adjacent\n"); 794 + /* 795 + * The chip itself supports arbitrary masks, but the driver currently 796 + * only supports adjacent slots beginning at the first slot. 797 + */ 798 + if (tx_mask != GENMASK(__fls(tx_mask), 0)) { 799 + dev_err(component->dev, "Only lower adjacent slots are supported\n"); 798 800 return -EINVAL; 799 801 } 800 802 ··· 810 810 return -EINVAL; 811 811 } 812 812 813 - adcx140->tdm_delay = lsb; 814 813 adcx140->slot_width = slot_width; 815 814 816 815 return 0;
+11 -6
sound/soc/codecs/wcd9335.c
··· 333 333 struct regulator_bulk_data supplies[WCD9335_MAX_SUPPLY]; 334 334 335 335 unsigned int rx_port_value[WCD9335_RX_MAX]; 336 - unsigned int tx_port_value; 336 + unsigned int tx_port_value[WCD9335_TX_MAX]; 337 337 int hph_l_gain; 338 338 int hph_r_gain; 339 339 u32 rx_bias_count; ··· 1325 1325 1326 1326 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kc); 1327 1327 struct wcd9335_codec *wcd = dev_get_drvdata(dapm->dev); 1328 + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kc); 1329 + struct soc_mixer_control *mixer = 1330 + (struct soc_mixer_control *)kc->private_value; 1331 + int dai_id = widget->shift; 1332 + int port_id = mixer->shift; 1328 1333 1329 - ucontrol->value.integer.value[0] = wcd->tx_port_value; 1334 + ucontrol->value.integer.value[0] = wcd->tx_port_value[port_id] == dai_id; 1330 1335 1331 1336 return 0; 1332 1337 } ··· 1354 1349 case AIF2_CAP: 1355 1350 case AIF3_CAP: 1356 1351 /* only add to the list if value not set */ 1357 - if (enable && !(wcd->tx_port_value & BIT(port_id))) { 1358 - wcd->tx_port_value |= BIT(port_id); 1352 + if (enable && wcd->tx_port_value[port_id] != dai_id) { 1353 + wcd->tx_port_value[port_id] = dai_id; 1359 1354 list_add_tail(&wcd->tx_chs[port_id].list, 1360 1355 &wcd->dai[dai_id].slim_ch_list); 1361 - } else if (!enable && (wcd->tx_port_value & BIT(port_id))) { 1362 - wcd->tx_port_value &= ~BIT(port_id); 1356 + } else if (!enable && wcd->tx_port_value[port_id] == dai_id) { 1357 + wcd->tx_port_value[port_id] = -1; 1363 1358 list_del_init(&wcd->tx_chs[port_id].list); 1364 1359 } 1365 1360 break;
+17 -4
sound/soc/codecs/wm5102.c
··· 680 680 { 681 681 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 682 682 struct arizona *arizona = dev_get_drvdata(component->dev->parent); 683 + uint16_t dac_comp_coeff = get_unaligned_be16(ucontrol->value.bytes.data); 684 + int ret = 0; 683 685 684 686 mutex_lock(&arizona->dac_comp_lock); 685 - arizona->dac_comp_coeff = get_unaligned_be16(ucontrol->value.bytes.data); 687 + if (arizona->dac_comp_coeff != dac_comp_coeff) { 688 + arizona->dac_comp_coeff = dac_comp_coeff; 689 + ret = 1; 690 + } 686 691 mutex_unlock(&arizona->dac_comp_lock); 687 692 688 - return 0; 693 + return ret; 689 694 } 690 695 691 696 static int wm5102_out_comp_switch_get(struct snd_kcontrol *kcontrol, ··· 711 706 { 712 707 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 713 708 struct arizona *arizona = dev_get_drvdata(component->dev->parent); 709 + struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; 710 + int ret = 0; 711 + 712 + if (ucontrol->value.integer.value[0] > mc->max) 713 + return -EINVAL; 714 714 715 715 mutex_lock(&arizona->dac_comp_lock); 716 - arizona->dac_comp_enabled = ucontrol->value.integer.value[0]; 716 + if (arizona->dac_comp_enabled != ucontrol->value.integer.value[0]) { 717 + arizona->dac_comp_enabled = ucontrol->value.integer.value[0]; 718 + ret = 1; 719 + } 717 720 mutex_unlock(&arizona->dac_comp_lock); 718 721 719 - return 0; 722 + return ret; 720 723 } 721 724 722 725 static const char * const wm5102_osr_text[] = {
+14 -7
sound/soc/codecs/wm8998.c
··· 108 108 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 109 109 unsigned int mode_reg, mode_index; 110 110 unsigned int mux, inmode, src_val, mode_val; 111 + int change, ret; 111 112 112 113 mux = ucontrol->value.enumerated.item[0]; 113 114 if (mux > 1) ··· 138 137 snd_soc_component_update_bits(component, mode_reg, 139 138 ARIZONA_IN1_MODE_MASK, mode_val); 140 139 141 - snd_soc_component_update_bits(component, e->reg, 142 - ARIZONA_IN1L_SRC_MASK | 143 - ARIZONA_IN1L_SRC_SE_MASK, 144 - src_val); 140 + change = snd_soc_component_update_bits(component, e->reg, 141 + ARIZONA_IN1L_SRC_MASK | 142 + ARIZONA_IN1L_SRC_SE_MASK, 143 + src_val); 145 144 146 - return snd_soc_dapm_mux_update_power(dapm, kcontrol, 147 - ucontrol->value.enumerated.item[0], 148 - e, NULL); 145 + ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, 146 + ucontrol->value.enumerated.item[0], 147 + e, NULL); 148 + if (ret < 0) { 149 + dev_err(arizona->dev, "Failed to update demux power state: %d\n", ret); 150 + return ret; 151 + } 152 + 153 + return change; 149 154 } 150 155 151 156 static const char * const wm8998_inmux_texts[] = {
+3 -7
sound/soc/intel/boards/sof_rt5682.c
··· 69 69 70 70 static int is_legacy_cpu; 71 71 72 - static struct snd_soc_jack sof_hdmi[3]; 73 - 74 72 struct sof_hdmi_pcm { 75 73 struct list_head head; 76 74 struct snd_soc_dai *codec_dai; 75 + struct snd_soc_jack hdmi_jack; 77 76 int device; 78 77 }; 79 78 ··· 446 447 char jack_name[NAME_SIZE]; 447 448 struct sof_hdmi_pcm *pcm; 448 449 int err; 449 - int i = 0; 450 450 451 451 /* HDMI is not supported by SOF on Baytrail/CherryTrail */ 452 452 if (is_legacy_cpu || !ctx->idisp_codec) ··· 466 468 snprintf(jack_name, sizeof(jack_name), 467 469 "HDMI/DP, pcm=%d Jack", pcm->device); 468 470 err = snd_soc_card_jack_new(card, jack_name, 469 - SND_JACK_AVOUT, &sof_hdmi[i]); 471 + SND_JACK_AVOUT, &pcm->hdmi_jack); 470 472 471 473 if (err) 472 474 return err; 473 475 474 476 err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, 475 - &sof_hdmi[i]); 477 + &pcm->hdmi_jack); 476 478 if (err < 0) 477 479 return err; 478 - 479 - i++; 480 480 } 481 481 482 482 if (sof_rt5682_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT) {
+27 -13
sound/soc/intel/skylake/skl-nhlt.c
··· 99 99 struct nhlt_fmt_cfg *fmt_cfg; 100 100 struct wav_fmt_ext *wav_fmt; 101 101 unsigned long rate; 102 - bool present = false; 103 102 int rate_index = 0; 104 103 u16 channels, bps; 105 104 u8 clk_src; ··· 111 112 if (fmt->fmt_count == 0) 112 113 return; 113 114 115 + fmt_cfg = (struct nhlt_fmt_cfg *)fmt->fmt_config; 114 116 for (i = 0; i < fmt->fmt_count; i++) { 115 - fmt_cfg = &fmt->fmt_config[i]; 116 - wav_fmt = &fmt_cfg->fmt_ext; 117 + struct nhlt_fmt_cfg *saved_fmt_cfg = fmt_cfg; 118 + bool present = false; 119 + 120 + wav_fmt = &saved_fmt_cfg->fmt_ext; 117 121 118 122 channels = wav_fmt->fmt.channels; 119 123 bps = wav_fmt->fmt.bits_per_sample; ··· 134 132 * derive the rate. 135 133 */ 136 134 for (j = i; j < fmt->fmt_count; j++) { 137 - fmt_cfg = &fmt->fmt_config[j]; 138 - wav_fmt = &fmt_cfg->fmt_ext; 135 + struct nhlt_fmt_cfg *tmp_fmt_cfg = fmt_cfg; 136 + 137 + wav_fmt = &tmp_fmt_cfg->fmt_ext; 139 138 if ((fs == wav_fmt->fmt.samples_per_sec) && 140 - (bps == wav_fmt->fmt.bits_per_sample)) 139 + (bps == wav_fmt->fmt.bits_per_sample)) { 141 140 channels = max_t(u16, channels, 142 141 wav_fmt->fmt.channels); 142 + saved_fmt_cfg = tmp_fmt_cfg; 143 + } 144 + /* Move to the next nhlt_fmt_cfg */ 145 + tmp_fmt_cfg = (struct nhlt_fmt_cfg *)(tmp_fmt_cfg->config.caps + 146 + tmp_fmt_cfg->config.size); 143 147 } 144 148 145 149 rate = channels * bps * fs; ··· 161 153 162 154 /* Fill rate and parent for sclk/sclkfs */ 163 155 if (!present) { 156 + struct nhlt_fmt_cfg *first_fmt_cfg; 157 + 158 + first_fmt_cfg = (struct nhlt_fmt_cfg *)fmt->fmt_config; 164 159 i2s_config_ext = (struct skl_i2s_config_blob_ext *) 165 - fmt->fmt_config[0].config.caps; 160 + first_fmt_cfg->config.caps; 166 161 167 162 /* MCLK Divider Source Select */ 168 163 if (is_legacy_blob(i2s_config_ext->hdr.sig)) { ··· 179 168 180 169 parent = skl_get_parent_clk(clk_src); 181 170 171 + /* Move to the next nhlt_fmt_cfg */ 172 + fmt_cfg = (struct nhlt_fmt_cfg *)(fmt_cfg->config.caps + 173 + fmt_cfg->config.size); 182 174 /* 183 175 * Do not copy the config data if there is no parent 184 176 * clock available for this clock source select ··· 190 176 continue; 191 177 192 178 sclk[id].rate_cfg[rate_index].rate = rate; 193 - sclk[id].rate_cfg[rate_index].config = fmt_cfg; 179 + sclk[id].rate_cfg[rate_index].config = saved_fmt_cfg; 194 180 sclkfs[id].rate_cfg[rate_index].rate = rate; 195 - sclkfs[id].rate_cfg[rate_index].config = fmt_cfg; 181 + sclkfs[id].rate_cfg[rate_index].config = saved_fmt_cfg; 196 182 sclk[id].parent_name = parent->name; 197 183 sclkfs[id].parent_name = parent->name; 198 184 ··· 206 192 { 207 193 struct skl_i2s_config_blob_ext *i2s_config_ext; 208 194 struct skl_i2s_config_blob_legacy *i2s_config; 209 - struct nhlt_specific_cfg *fmt_cfg; 195 + struct nhlt_fmt_cfg *fmt_cfg; 210 196 struct skl_clk_parent_src *parent; 211 197 u32 clkdiv, div_ratio; 212 198 u8 clk_src; 213 199 214 - fmt_cfg = &fmt->fmt_config[0].config; 215 - i2s_config_ext = (struct skl_i2s_config_blob_ext *)fmt_cfg->caps; 200 + fmt_cfg = (struct nhlt_fmt_cfg *)fmt->fmt_config; 201 + i2s_config_ext = (struct skl_i2s_config_blob_ext *)fmt_cfg->config.caps; 216 202 217 203 /* MCLK Divider Source Select and divider */ 218 204 if (is_legacy_blob(i2s_config_ext->hdr.sig)) { ··· 241 227 return; 242 228 243 229 mclk[id].rate_cfg[0].rate = parent->rate/div_ratio; 244 - mclk[id].rate_cfg[0].config = &fmt->fmt_config[0]; 230 + mclk[id].rate_cfg[0].config = fmt_cfg; 245 231 mclk[id].parent_name = parent->name; 246 232 } 247 233
+1
sound/soc/qcom/qdsp6/q6apm.c
··· 75 75 id = idr_alloc(&apm->graph_idr, graph, graph_id, graph_id + 1, GFP_KERNEL); 76 76 if (id < 0) { 77 77 dev_err(apm->dev, "Unable to allocate graph id (%d)\n", graph_id); 78 + kfree(graph->graph); 78 79 kfree(graph); 79 80 mutex_unlock(&apm->lock); 80 81 return ERR_PTR(id);
-1
sound/soc/rockchip/rockchip_i2s.c
··· 803 803 804 804 i2s->bclk_ratio = 64; 805 805 i2s->pinctrl = devm_pinctrl_get(&pdev->dev); 806 - 807 806 if (!IS_ERR(i2s->pinctrl)) { 808 807 i2s->bclk_on = pinctrl_lookup_state(i2s->pinctrl, "bclk_on"); 809 808 if (!IS_ERR_OR_NULL(i2s->bclk_on)) {
-2
sound/soc/ti/omap-mcbsp-priv.h
··· 316 316 317 317 /* Sidetone specific API */ 318 318 int omap_mcbsp_st_init(struct platform_device *pdev); 319 - void omap_mcbsp_st_cleanup(struct platform_device *pdev); 320 - 321 319 int omap_mcbsp_st_start(struct omap_mcbsp *mcbsp); 322 320 int omap_mcbsp_st_stop(struct omap_mcbsp *mcbsp); 323 321
+2 -12
sound/soc/ti/omap-mcbsp-st.c
··· 347 347 if (!st_data) 348 348 return -ENOMEM; 349 349 350 - st_data->mcbsp_iclk = clk_get(mcbsp->dev, "ick"); 350 + st_data->mcbsp_iclk = devm_clk_get(mcbsp->dev, "ick"); 351 351 if (IS_ERR(st_data->mcbsp_iclk)) { 352 352 dev_warn(mcbsp->dev, 353 353 "Failed to get ick, sidetone might be broken\n"); ··· 359 359 if (!st_data->io_base_st) 360 360 return -ENOMEM; 361 361 362 - ret = sysfs_create_group(&mcbsp->dev->kobj, &sidetone_attr_group); 362 + ret = devm_device_add_group(mcbsp->dev, &sidetone_attr_group); 363 363 if (ret) 364 364 return ret; 365 365 366 366 mcbsp->st_data = st_data; 367 367 368 368 return 0; 369 - } 370 - 371 - void omap_mcbsp_st_cleanup(struct platform_device *pdev) 372 - { 373 - struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); 374 - 375 - if (mcbsp->st_data) { 376 - sysfs_remove_group(&mcbsp->dev->kobj, &sidetone_attr_group); 377 - clk_put(mcbsp->st_data->mcbsp_iclk); 378 - } 379 369 } 380 370 381 371 static int omap_mcbsp_st_info_volsw(struct snd_kcontrol *kcontrol,
+2 -17
sound/soc/ti/omap-mcbsp.c
··· 702 702 mcbsp->max_tx_thres = max_thres(mcbsp) - 0x10; 703 703 mcbsp->max_rx_thres = max_thres(mcbsp) - 0x10; 704 704 705 - ret = sysfs_create_group(&mcbsp->dev->kobj, 706 - &additional_attr_group); 705 + ret = devm_device_add_group(mcbsp->dev, &additional_attr_group); 707 706 if (ret) { 708 707 dev_err(mcbsp->dev, 709 708 "Unable to create additional controls\n"); ··· 710 711 } 711 712 } 712 713 713 - ret = omap_mcbsp_st_init(pdev); 714 - if (ret) 715 - goto err_st; 716 - 717 - return 0; 718 - 719 - err_st: 720 - if (mcbsp->pdata->buffer_size) 721 - sysfs_remove_group(&mcbsp->dev->kobj, &additional_attr_group); 722 - return ret; 714 + return omap_mcbsp_st_init(pdev); 723 715 } 724 716 725 717 /* ··· 1421 1431 1422 1432 if (cpu_latency_qos_request_active(&mcbsp->pm_qos_req)) 1423 1433 cpu_latency_qos_remove_request(&mcbsp->pm_qos_req); 1424 - 1425 - if (mcbsp->pdata->buffer_size) 1426 - sysfs_remove_group(&mcbsp->dev->kobj, &additional_attr_group); 1427 - 1428 - omap_mcbsp_st_cleanup(pdev); 1429 1434 1430 1435 return 0; 1431 1436 }