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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"Just a few small fixes:

- A regression fix for HDMI audio on HD-audio AMD codecs

- Fixes for LINE6 MIDI handling

- HD-audio quirk for Dell laptops"

* tag 'sound-6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/hdmi: Static PCM mapping again with AMD HDMI codecs
ALSA: hda/realtek: Apply dual codec fixup for Dell Latitude laptops
ALSA: line6: fix stack overflow in line6_midi_transmit
ALSA: line6: correct midi status byte when receiving data from podxt

+61 -21
+19 -8
sound/pci/hda/patch_hdmi.c
··· 167 167 struct hdmi_ops ops; 168 168 169 169 bool dyn_pin_out; 170 + bool static_pcm_mapping; 170 171 /* hdmi interrupt trigger control flag for Nvidia codec */ 171 172 bool hdmi_intr_trig_ctrl; 172 173 bool nv_dp_workaround; /* workaround DP audio infoframe for Nvidia */ ··· 1526 1525 */ 1527 1526 pcm_jack = pin_idx_to_pcm_jack(codec, per_pin); 1528 1527 1529 - if (eld->eld_valid) { 1530 - hdmi_attach_hda_pcm(spec, per_pin); 1531 - hdmi_pcm_setup_pin(spec, per_pin); 1532 - } else { 1533 - hdmi_pcm_reset_pin(spec, per_pin); 1534 - hdmi_detach_hda_pcm(spec, per_pin); 1528 + if (!spec->static_pcm_mapping) { 1529 + if (eld->eld_valid) { 1530 + hdmi_attach_hda_pcm(spec, per_pin); 1531 + hdmi_pcm_setup_pin(spec, per_pin); 1532 + } else { 1533 + hdmi_pcm_reset_pin(spec, per_pin); 1534 + hdmi_detach_hda_pcm(spec, per_pin); 1535 + } 1535 1536 } 1537 + 1536 1538 /* if pcm_idx == -1, it means this is in monitor connection event 1537 1539 * we can get the correct pcm_idx now. 1538 1540 */ ··· 2285 2281 struct hdmi_spec *spec = codec->spec; 2286 2282 int idx, pcm_num; 2287 2283 2288 - /* limit the PCM devices to the codec converters */ 2289 - pcm_num = spec->num_cvts; 2284 + /* limit the PCM devices to the codec converters or available PINs */ 2285 + pcm_num = min(spec->num_cvts, spec->num_pins); 2290 2286 codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num); 2291 2287 2292 2288 for (idx = 0; idx < pcm_num; idx++) { ··· 2382 2378 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { 2383 2379 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); 2384 2380 struct hdmi_eld *pin_eld = &per_pin->sink_eld; 2381 + 2382 + if (spec->static_pcm_mapping) { 2383 + hdmi_attach_hda_pcm(spec, per_pin); 2384 + hdmi_pcm_setup_pin(spec, per_pin); 2385 + } 2385 2386 2386 2387 pin_eld->eld_valid = false; 2387 2388 hdmi_present_sense(per_pin, 0); ··· 4427 4418 codec->patch_ops.init = atihdmi_init; 4428 4419 4429 4420 spec = codec->spec; 4421 + 4422 + spec->static_pcm_mapping = true; 4430 4423 4431 4424 spec->ops.pin_get_eld = atihdmi_pin_get_eld; 4432 4425 spec->ops.pin_setup_infoframe = atihdmi_pin_setup_infoframe;
+13
sound/pci/hda/patch_realtek.c
··· 7175 7175 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK, 7176 7176 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, 7177 7177 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS, 7178 + ALC236_FIXUP_DELL_DUAL_CODECS, 7178 7179 }; 7179 7180 7180 7181 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 9131 9130 .chained = true, 9132 9131 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 9133 9132 }, 9133 + [ALC236_FIXUP_DELL_DUAL_CODECS] = { 9134 + .type = HDA_FIXUP_PINS, 9135 + .v.func = alc1220_fixup_gb_dual_codecs, 9136 + .chained = true, 9137 + .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 9138 + }, 9134 9139 }; 9135 9140 9136 9141 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 9239 9232 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK), 9240 9233 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 9241 9234 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 9235 + SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 9236 + SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 9237 + SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 9238 + SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 9239 + SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 9240 + SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 9242 9241 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 9243 9242 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 9244 9243 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
+2 -1
sound/usb/line6/driver.c
··· 304 304 for (;;) { 305 305 done = 306 306 line6_midibuf_read(mb, line6->buffer_message, 307 - LINE6_MIDI_MESSAGE_MAXLEN); 307 + LINE6_MIDI_MESSAGE_MAXLEN, 308 + LINE6_MIDIBUF_READ_RX); 308 309 309 310 if (done <= 0) 310 311 break;
+4 -2
sound/usb/line6/midi.c
··· 44 44 int req, done; 45 45 46 46 for (;;) { 47 - req = min(line6_midibuf_bytes_free(mb), line6->max_packet_size); 47 + req = min3(line6_midibuf_bytes_free(mb), line6->max_packet_size, 48 + LINE6_FALLBACK_MAXPACKETSIZE); 48 49 done = snd_rawmidi_transmit_peek(substream, chunk, req); 49 50 50 51 if (done == 0) ··· 57 56 58 57 for (;;) { 59 58 done = line6_midibuf_read(mb, chunk, 60 - LINE6_FALLBACK_MAXPACKETSIZE); 59 + LINE6_FALLBACK_MAXPACKETSIZE, 60 + LINE6_MIDIBUF_READ_TX); 61 61 62 62 if (done == 0) 63 63 break;
+17 -8
sound/usb/line6/midibuf.c
··· 9 9 10 10 #include "midibuf.h" 11 11 12 + 12 13 static int midibuf_message_length(unsigned char code) 13 14 { 14 15 int message_length; ··· 21 20 22 21 message_length = length[(code >> 4) - 8]; 23 22 } else { 24 - /* 25 - Note that according to the MIDI specification 0xf2 is 26 - the "Song Position Pointer", but this is used by Line 6 27 - to send sysex messages to the host. 28 - */ 29 - static const int length[] = { -1, 2, -1, 2, -1, -1, 1, 1, 1, 1, 23 + static const int length[] = { -1, 2, 2, 2, -1, -1, 1, 1, 1, -1, 30 24 1, 1, 1, -1, 1, 1 31 25 }; 32 26 message_length = length[code & 0x0f]; ··· 121 125 } 122 126 123 127 int line6_midibuf_read(struct midi_buffer *this, unsigned char *data, 124 - int length) 128 + int length, int read_type) 125 129 { 126 130 int bytes_used; 127 131 int length1, length2; ··· 144 148 145 149 length1 = this->size - this->pos_read; 146 150 147 - /* check MIDI command length */ 148 151 command = this->buf[this->pos_read]; 152 + /* 153 + PODxt always has status byte lower nibble set to 0010, 154 + when it means to send 0000, so we correct if here so 155 + that control/program changes come on channel 1 and 156 + sysex message status byte is correct 157 + */ 158 + if (read_type == LINE6_MIDIBUF_READ_RX) { 159 + if (command == 0xb2 || command == 0xc2 || command == 0xf2) { 160 + unsigned char fixed = command & 0xf0; 161 + this->buf[this->pos_read] = fixed; 162 + command = fixed; 163 + } 164 + } 149 165 166 + /* check MIDI command length */ 150 167 if (command & 0x80) { 151 168 midi_length = midibuf_message_length(command); 152 169 this->command_prev = command;
+4 -1
sound/usb/line6/midibuf.h
··· 8 8 #ifndef MIDIBUF_H 9 9 #define MIDIBUF_H 10 10 11 + #define LINE6_MIDIBUF_READ_TX 0 12 + #define LINE6_MIDIBUF_READ_RX 1 13 + 11 14 struct midi_buffer { 12 15 unsigned char *buf; 13 16 int size; ··· 26 23 extern int line6_midibuf_ignore(struct midi_buffer *mb, int length); 27 24 extern int line6_midibuf_init(struct midi_buffer *mb, int size, int split); 28 25 extern int line6_midibuf_read(struct midi_buffer *mb, unsigned char *data, 29 - int length); 26 + int length, int read_type); 30 27 extern void line6_midibuf_reset(struct midi_buffer *mb); 31 28 extern int line6_midibuf_write(struct midi_buffer *mb, unsigned char *data, 32 29 int length);
+2 -1
sound/usb/line6/pod.c
··· 159 159 .bytes_per_channel = 3 /* SNDRV_PCM_FMTBIT_S24_3LE */ 160 160 }; 161 161 162 + 162 163 static const char pod_version_header[] = { 163 - 0xf2, 0x7e, 0x7f, 0x06, 0x02 164 + 0xf0, 0x7e, 0x7f, 0x06, 0x02 164 165 }; 165 166 166 167 static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code,