mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
sound fixes for 4.13-rc1
Small last-minute fixes for 4.13-rc1: a couple of PCM fixes for m68k, a cleanup work for legacy ISA msnd driver, and a few HD-audio new IDs and quirks. -----BEGIN PGP SIGNATURE----- iQJCBAABCAAsFiEECxfAB4MH3rD5mfB6bDGAVD0pKaQFAllohicOHHRpd2FpQHN1 c2UuZGUACgkQbDGAVD0pKaTI+g/9GUZDsSLf8EIMhyJqcR0kpMXi4oMC3H/7fCCg MEkGc4C8lG9ZpXpRthGWBwwIujIfH+QXdRpXZeHqV8yias80Ryi1rBd2BCk0eVuF hQXbCXAyhN7E6OXvgjIi7eQKwzGrwhV9OFTpChqcEIu2Oym8lD91DOU+hHtFGX56 5VM4zZ+KzDa11L3cYzWKP/PlsqBp9eGNfamf5Q5wb2SnaVYcxLSQWkgsTQloRK/b YOFMNvgUQV7XB23t8ouxPIo5YYCnX7xSyP1nkt9mL7z1CYn1q8hgG0yWw5lPK/6E tnjm2H2X6fcT+zSVxYKOn6WHcK2aER7PJZOaqkmmFp4cN31AqdkToT/fNWTELaaM pZe2fY0vfwtpvaVhonv70GEWcGyi9oa4CanOmDPNgti/V1Em0rBpoFa+FTlF4SWc VJsi5645b9ieQ/LvXsAHlVEflSWuRtdUxen1Hx1rVhUBKnDPRifIeClycjcqddNY uttMuQjzMs8S53G7bILHwLe0zyGEDFE/UH8/xooM9IiPr8Dd18wCu04Rlf/8dK5S VFjn1VKhcc0HVtWCUPlHGW+RxsLWwI26CUH15sAH6v08ci8BsqPjF3IHyfLy+vXb XbuMiBeKIOCNRHADHaTXodIr6O35mVI3HRqSAV3mYZlUX8Nd7CkpcsMYotwEihUL MGnGV+g= =tGl3 -----END PGP SIGNATURE----- Merge tag 'sound-fix-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Small last-minute fixes for 4.13-rc1: a couple of PCM fixes for m68k, a cleanup work for legacy ISA msnd driver, and a few HD-audio new IDs and quirks" * tag 'sound-fix-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Add hdmi id for a Geminilake variant ALSA: hda/realtek - New codec device ID for ALC1220 ALSA: pcm: Simplify check for dma_mmap_coherent() availability ALSA: pcm: Protect call to dma_mmap_coherent() by check for HAS_DMA ALSA: msnd: Optimize / harden DSP and MIDI loops ALSA: hda/realtek - change the location for one of two front microphones ALSA: opl4: Move inline before return type
This commit is contained in:
commit
0a264b6db7
6 changed files with 51 additions and 33 deletions
|
|
@ -120,24 +120,24 @@ void snd_msndmidi_input_read(void *mpuv)
|
|||
unsigned long flags;
|
||||
struct snd_msndmidi *mpu = mpuv;
|
||||
void *pwMIDQData = mpu->dev->mappedbase + MIDQ_DATA_BUFF;
|
||||
u16 head, tail, size;
|
||||
|
||||
spin_lock_irqsave(&mpu->input_lock, flags);
|
||||
while (readw(mpu->dev->MIDQ + JQS_wTail) !=
|
||||
readw(mpu->dev->MIDQ + JQS_wHead)) {
|
||||
u16 wTmp, val;
|
||||
val = readw(pwMIDQData + 2 * readw(mpu->dev->MIDQ + JQS_wHead));
|
||||
head = readw(mpu->dev->MIDQ + JQS_wHead);
|
||||
tail = readw(mpu->dev->MIDQ + JQS_wTail);
|
||||
size = readw(mpu->dev->MIDQ + JQS_wSize);
|
||||
if (head > size || tail > size)
|
||||
goto out;
|
||||
while (head != tail) {
|
||||
unsigned char val = readw(pwMIDQData + 2 * head);
|
||||
|
||||
if (test_bit(MSNDMIDI_MODE_BIT_INPUT_TRIGGER,
|
||||
&mpu->mode))
|
||||
snd_rawmidi_receive(mpu->substream_input,
|
||||
(unsigned char *)&val, 1);
|
||||
|
||||
wTmp = readw(mpu->dev->MIDQ + JQS_wHead) + 1;
|
||||
if (wTmp > readw(mpu->dev->MIDQ + JQS_wSize))
|
||||
writew(0, mpu->dev->MIDQ + JQS_wHead);
|
||||
else
|
||||
writew(wTmp, mpu->dev->MIDQ + JQS_wHead);
|
||||
if (test_bit(MSNDMIDI_MODE_BIT_INPUT_TRIGGER, &mpu->mode))
|
||||
snd_rawmidi_receive(mpu->substream_input, &val, 1);
|
||||
if (++head > size)
|
||||
head = 0;
|
||||
writew(head, mpu->dev->MIDQ + JQS_wHead);
|
||||
}
|
||||
out:
|
||||
spin_unlock_irqrestore(&mpu->input_lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL(snd_msndmidi_input_read);
|
||||
|
|
|
|||
|
|
@ -170,23 +170,24 @@ static irqreturn_t snd_msnd_interrupt(int irq, void *dev_id)
|
|||
{
|
||||
struct snd_msnd *chip = dev_id;
|
||||
void *pwDSPQData = chip->mappedbase + DSPQ_DATA_BUFF;
|
||||
u16 head, tail, size;
|
||||
|
||||
/* Send ack to DSP */
|
||||
/* inb(chip->io + HP_RXL); */
|
||||
|
||||
/* Evaluate queued DSP messages */
|
||||
while (readw(chip->DSPQ + JQS_wTail) != readw(chip->DSPQ + JQS_wHead)) {
|
||||
u16 wTmp;
|
||||
|
||||
snd_msnd_eval_dsp_msg(chip,
|
||||
readw(pwDSPQData + 2 * readw(chip->DSPQ + JQS_wHead)));
|
||||
|
||||
wTmp = readw(chip->DSPQ + JQS_wHead) + 1;
|
||||
if (wTmp > readw(chip->DSPQ + JQS_wSize))
|
||||
writew(0, chip->DSPQ + JQS_wHead);
|
||||
else
|
||||
writew(wTmp, chip->DSPQ + JQS_wHead);
|
||||
head = readw(chip->DSPQ + JQS_wHead);
|
||||
tail = readw(chip->DSPQ + JQS_wTail);
|
||||
size = readw(chip->DSPQ + JQS_wSize);
|
||||
if (head > size || tail > size)
|
||||
goto out;
|
||||
while (head != tail) {
|
||||
snd_msnd_eval_dsp_msg(chip, readw(pwDSPQData + 2 * head));
|
||||
if (++head > size)
|
||||
head = 0;
|
||||
writew(head, chip->DSPQ + JQS_wHead);
|
||||
}
|
||||
out:
|
||||
/* Send ack to DSP */
|
||||
inb(chip->io + HP_RXL);
|
||||
return IRQ_HANDLED;
|
||||
|
|
|
|||
Loading…
Reference in a new issue