20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
*/ |
*/ |
23 |
|
|
24 |
#include <sound/driver.h> |
#include <sound/driver.h> |
25 |
#include <linux/time.h> |
#include <linux/time.h> |
26 |
#include <linux/init.h> |
#include <linux/init.h> |
47 |
int temp, mode; |
int temp, mode; |
48 |
mpu401_t *mpu; |
mpu401_t *mpu; |
49 |
int port; |
int port; |
50 |
|
|
51 |
#ifdef VORTEX_MPU401_LEGACY |
#ifdef VORTEX_MPU401_LEGACY |
52 |
/* EnableHardCodedMPU401Port() */ |
/* EnableHardCodedMPU401Port() */ |
53 |
port = (0x03 << 5); /* FIXME: static address. 0x330,0x331 */ |
port = (0x03 << 5); /* FIXME: static address. 0x330,0x331 */ |
56 |
#else |
#else |
57 |
/* Enable MIDI Interface. */ |
/* Enable MIDI Interface. */ |
58 |
temp = (hwread(vortex->mmio, VORTEX_CTRL) & ~CTRL_MIDI_PORT) | CTRL_MIDI_EN; |
temp = (hwread(vortex->mmio, VORTEX_CTRL) & ~CTRL_MIDI_PORT) | CTRL_MIDI_EN; |
59 |
hwwrite(vortex->mmio, VORTEX_CTRL, temp); |
hwwrite(vortex->mmio, VORTEX_CTRL, temp); |
60 |
#endif |
#endif |
61 |
|
|
62 |
/* Mpu401UartInit() */ |
/* Mpu401UartInit() */ |
63 |
mode = 1; |
mode = 1; |
64 |
temp = hwread(vortex->mmio, VORTEX_CTRL2) & 0xffff00cf; |
temp = hwread(vortex->mmio, VORTEX_CTRL2) & 0xffff00cf; |
68 |
/* Set some kind of mode */ |
/* Set some kind of mode */ |
69 |
if (mode) |
if (mode) |
70 |
hwwrite(vortex->mmio, VORTEX_MIDI_CMD, MPU401_ENTER_UART); |
hwwrite(vortex->mmio, VORTEX_MIDI_CMD, MPU401_ENTER_UART); |
71 |
|
|
72 |
/* Check if anything is OK. */ |
/* Check if anything is OK. */ |
73 |
temp = hwread(vortex->mmio, VORTEX_MIDI_DATA); |
temp = hwread(vortex->mmio, VORTEX_MIDI_DATA); |
74 |
if (temp != MPU401_ACK /*0xfe*/) { |
if (temp != MPU401_ACK /*0xfe*/) { |
77 |
} |
} |
78 |
/* Enable MPU401 interrupts. */ |
/* Enable MPU401 interrupts. */ |
79 |
hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, hwread(vortex->mmio, VORTEX_IRQ_CTRL) | IRQ_MIDI); |
hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, hwread(vortex->mmio, VORTEX_IRQ_CTRL) | IRQ_MIDI); |
80 |
|
|
81 |
/* Create MPU401 instance. */ |
/* Create MPU401 instance. */ |
82 |
#ifdef VORTEX_MPU401_LEGACY |
#ifdef VORTEX_MPU401_LEGACY |
83 |
if ((temp = snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_MPU401, 0x330, 0, 0, 0, &rmidi)) != 0) { |
if ((temp = snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_MPU401, 0x330, 0, 0, 0, &rmidi)) != 0) { |
95 |
#endif |
#endif |
96 |
return 0; |
return 0; |
97 |
} |
} |
|
|
|
|
/* End of file */ |
|