Skip to content

Commit 2137397

Browse files
committed
Merge tag 'sound-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Here are a few last-minute fixes for 5.0. The most significant one is the OF-node refcount fix for ASoC simple-card, which could be triggered on many boards. Another fix for ASoC core is for the error handling in topology, while others are device-specific fixes for Samsung and HD-audio" * tag 'sound-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: simple-card: fixup refcount_t underflow ASoC: topology: free created components in tplg load error ALSA: hda/realtek: Disable PC beep in passthrough on alc285 ALSA: hda/realtek - Headset microphone and internal speaker support for System76 oryp5 ASoC: samsung: i2s: Fix prescaler setting for the secondary DAI
2 parents fb83f15 + 2688366 commit 2137397

File tree

4 files changed

+56
-4
lines changed

4 files changed

+56
-4
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,6 +1855,8 @@ enum {
18551855
ALC887_FIXUP_BASS_CHMAP,
18561856
ALC1220_FIXUP_GB_DUAL_CODECS,
18571857
ALC1220_FIXUP_CLEVO_P950,
1858+
ALC1220_FIXUP_SYSTEM76_ORYP5,
1859+
ALC1220_FIXUP_SYSTEM76_ORYP5_PINS,
18581860
};
18591861

18601862
static void alc889_fixup_coef(struct hda_codec *codec,
@@ -2056,6 +2058,17 @@ static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
20562058
snd_hda_override_conn_list(codec, 0x1b, 1, conn1);
20572059
}
20582060

2061+
static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2062+
const struct hda_fixup *fix, int action);
2063+
2064+
static void alc1220_fixup_system76_oryp5(struct hda_codec *codec,
2065+
const struct hda_fixup *fix,
2066+
int action)
2067+
{
2068+
alc1220_fixup_clevo_p950(codec, fix, action);
2069+
alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2070+
}
2071+
20592072
static const struct hda_fixup alc882_fixups[] = {
20602073
[ALC882_FIXUP_ABIT_AW9D_MAX] = {
20612074
.type = HDA_FIXUP_PINS,
@@ -2300,6 +2313,19 @@ static const struct hda_fixup alc882_fixups[] = {
23002313
.type = HDA_FIXUP_FUNC,
23012314
.v.func = alc1220_fixup_clevo_p950,
23022315
},
2316+
[ALC1220_FIXUP_SYSTEM76_ORYP5] = {
2317+
.type = HDA_FIXUP_FUNC,
2318+
.v.func = alc1220_fixup_system76_oryp5,
2319+
},
2320+
[ALC1220_FIXUP_SYSTEM76_ORYP5_PINS] = {
2321+
.type = HDA_FIXUP_PINS,
2322+
.v.pins = (const struct hda_pintbl[]) {
2323+
{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2324+
{}
2325+
},
2326+
.chained = true,
2327+
.chain_id = ALC1220_FIXUP_SYSTEM76_ORYP5,
2328+
},
23032329
};
23042330

23052331
static const struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -2376,6 +2402,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
23762402
SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
23772403
SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
23782404
SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2405+
SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS),
2406+
SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS),
23792407
SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
23802408
SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
23812409
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
@@ -5632,6 +5660,7 @@ enum {
56325660
ALC294_FIXUP_ASUS_SPK,
56335661
ALC225_FIXUP_HEADSET_JACK,
56345662
ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
5663+
ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
56355664
};
56365665

56375666
static const struct hda_fixup alc269_fixups[] = {
@@ -6587,6 +6616,17 @@ static const struct hda_fixup alc269_fixups[] = {
65876616
.chained = true,
65886617
.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
65896618
},
6619+
[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
6620+
.type = HDA_FIXUP_VERBS,
6621+
.v.verbs = (const struct hda_verb[]) {
6622+
/* Disable PCBEEP-IN passthrough */
6623+
{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6624+
{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6625+
{ }
6626+
},
6627+
.chained = true,
6628+
.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6629+
},
65906630
};
65916631

65926632
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7272,7 +7312,7 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
72727312
{0x12, 0x90a60130},
72737313
{0x19, 0x03a11020},
72747314
{0x21, 0x0321101f}),
7275-
SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7315+
SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
72767316
{0x12, 0x90a60130},
72777317
{0x14, 0x90170110},
72787318
{0x19, 0x04a11040},

sound/soc/generic/simple-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
462462
conf_idx = 0;
463463
node = of_get_child_by_name(top, PREFIX "dai-link");
464464
if (!node) {
465-
node = dev->of_node;
465+
node = of_node_get(top);
466466
loop = 0;
467467
}
468468

sound/soc/samsung/i2s.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
604604
unsigned int fmt)
605605
{
606606
struct i2s_dai *i2s = to_info(dai);
607+
struct i2s_dai *other = get_other_dai(i2s);
607608
int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave;
608609
u32 mod, tmp = 0;
609610
unsigned long flags;
@@ -661,7 +662,8 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
661662
* CLK_I2S_RCLK_SRC clock is not exposed so we ensure any
662663
* clock configuration assigned in DT is not overwritten.
663664
*/
664-
if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL)
665+
if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL &&
666+
other->clk_data.clks == NULL)
665667
i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0,
666668
0, SND_SOC_CLOCK_IN);
667669
break;
@@ -699,6 +701,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
699701
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
700702
{
701703
struct i2s_dai *i2s = to_info(dai);
704+
struct i2s_dai *other = get_other_dai(i2s);
702705
u32 mod, mask = 0, val = 0;
703706
struct clk *rclksrc;
704707
unsigned long flags;
@@ -784,6 +787,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
784787
i2s->frmclk = params_rate(params);
785788

786789
rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC];
790+
if (!rclksrc || IS_ERR(rclksrc))
791+
rclksrc = other->clk_table[CLK_I2S_RCLK_SRC];
792+
787793
if (rclksrc && !IS_ERR(rclksrc))
788794
i2s->rclk_srcrate = clk_get_rate(rclksrc);
789795

sound/soc/soc-topology.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,7 @@ int snd_soc_tplg_component_load(struct snd_soc_component *comp,
24872487
struct snd_soc_tplg_ops *ops, const struct firmware *fw, u32 id)
24882488
{
24892489
struct soc_tplg tplg;
2490+
int ret;
24902491

24912492
/* setup parsing context */
24922493
memset(&tplg, 0, sizeof(tplg));
@@ -2500,7 +2501,12 @@ int snd_soc_tplg_component_load(struct snd_soc_component *comp,
25002501
tplg.bytes_ext_ops = ops->bytes_ext_ops;
25012502
tplg.bytes_ext_ops_count = ops->bytes_ext_ops_count;
25022503

2503-
return soc_tplg_load(&tplg);
2504+
ret = soc_tplg_load(&tplg);
2505+
/* free the created components if fail to load topology */
2506+
if (ret)
2507+
snd_soc_tplg_component_remove(comp, SND_SOC_TPLG_INDEX_ALL);
2508+
2509+
return ret;
25042510
}
25052511
EXPORT_SYMBOL_GPL(snd_soc_tplg_component_load);
25062512

0 commit comments

Comments
 (0)