/* Tx FIFO sizes: CS4237B - 16 bytes AudioDrive ES1688 - 12 bytes S3 SonicVibes - 8 bytes SoundBlaster AWE 64 - 2 bytes (ugly hardware) write output pending bytes call with output_lock spinlock held  */
static void snd_mpu401_uart_output_write(struct snd_mpu401 *mpu)
/* Tx FIFO sizes: CS4237B - 16 bytes AudioDrive ES1688 - 12 bytes S3 SonicVibes - 8 bytes SoundBlaster AWE 64 - 2 bytes (ugly hardware) write output pending bytes call with output_lock spinlock held  */
static void snd_mpu401_uart_output_write(struct snd_mpu401 *mpu)
{
	unsigned char byte;
	int max = 256;
	do {
		if (snd_rawmidi_transmit_peek(mpu->substream_output,
					      &byte, 1) == 1) {
			if (!snd_mpu401_output_ready(mpu) &&
			    !snd_mpu401_output_ready(mpu))
				break;
			mpu->write(mpu, byte, MPU401D(mpu));
			snd_rawmidi_transmit_ack(mpu->substream_output, 1);
		} else {
			snd_mpu401_uart_remove_timer (mpu, 0);
			break;
		}
	} while (--max > 0);
}