From: Takashi Iwai Date: Wed, 23 Apr 2008 15:47:28 +0000 (+0200) Subject: [ALSA] Define MPU401 registers in sound/mpu401_uart.h X-Git-Tag: v2.6.26-rc1~1087^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b415ed45f4db9f8365daac84cf2518642a174dc0;p=linux-2.6 [ALSA] Define MPU401 registers in sound/mpu401_uart.h Define some MPU401 registers in sound/mpu401_uart.h so that other drivers can refer to them. Signed-off-by: Takashi Iwai --- diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h index d45218b44d..68b634b750 100644 --- a/include/sound/mpu401.h +++ b/include/sound/mpu401.h @@ -102,6 +102,21 @@ struct snd_mpu401 { #define MPU401C(mpu) (mpu)->cport #define MPU401D(mpu) (mpu)->port +/* + * control register bits + */ +/* read MPU401C() */ +#define MPU401_RX_EMPTY 0x80 +#define MPU401_TX_FULL 0x40 + +/* write MPU401C() */ +#define MPU401_RESET 0xff +#define MPU401_ENTER_UART 0x3f + +/* read MPU401D() */ +#define MPU401_ACK 0xfe + + /* */ diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c index dd6ec42667..18cca2457d 100644 --- a/sound/drivers/mpu401/mpu401_uart.c +++ b/sound/drivers/mpu401/mpu401_uart.c @@ -49,12 +49,10 @@ static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu); */ -#define snd_mpu401_input_avail(mpu) (!(mpu->read(mpu, MPU401C(mpu)) & 0x80)) -#define snd_mpu401_output_ready(mpu) (!(mpu->read(mpu, MPU401C(mpu)) & 0x40)) - -#define MPU401_RESET 0xff -#define MPU401_ENTER_UART 0x3f -#define MPU401_ACK 0xfe +#define snd_mpu401_input_avail(mpu) \ + (!(mpu->read(mpu, MPU401C(mpu)) & MPU401_RX_EMPTY)) +#define snd_mpu401_output_ready(mpu) \ + (!(mpu->read(mpu, MPU401C(mpu)) & MPU401_TX_FULL)) /* Build in lowlevel io */ static void mpu401_write_port(struct snd_mpu401 *mpu, unsigned char data,