409 |
dma_addr_t bugbuf_addr; |
dma_addr_t bugbuf_addr; |
410 |
#endif |
#endif |
411 |
|
|
412 |
#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) |
413 |
struct gameport gameport; |
struct gameport gameport; |
414 |
struct semaphore joy_sem; // gameport configuration semaphore |
struct semaphore joy_sem; // gameport configuration semaphore |
415 |
#endif |
#endif |
1559 |
#endif /* CHIP1371 */ |
#endif /* CHIP1371 */ |
1560 |
|
|
1561 |
/* generic control callbacks for ens1370 and for joystick */ |
/* generic control callbacks for ens1370 and for joystick */ |
1562 |
#if defined(CHIP1370) || defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
#if defined(CHIP1370) || defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) |
1563 |
#define ENSONIQ_CONTROL(xname, mask) \ |
#define ENSONIQ_CONTROL(xname, mask) \ |
1564 |
{ .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_ensoniq_control_info, \ |
{ .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_ensoniq_control_info, \ |
1565 |
.get = snd_ensoniq_control_get, .put = snd_ensoniq_control_put, \ |
.get = snd_ensoniq_control_get, .put = snd_ensoniq_control_put, \ |
1634 |
|
|
1635 |
/* try reset AK4531 */ |
/* try reset AK4531 */ |
1636 |
outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x02), ES_REG(ensoniq, 1370_CODEC)); |
outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x02), ES_REG(ensoniq, 1370_CODEC)); |
1637 |
|
inw(ES_REG(ensoniq, 1370_CODEC)); |
1638 |
udelay(100); |
udelay(100); |
1639 |
outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x03), ES_REG(ensoniq, 1370_CODEC)); |
outw(ES_1370_CODEC_WRITE(AK4531_RESET, 0x03), ES_REG(ensoniq, 1370_CODEC)); |
1640 |
|
inw(ES_REG(ensoniq, 1370_CODEC)); |
1641 |
udelay(100); |
udelay(100); |
1642 |
|
|
1643 |
memset(&ak4531, 0, sizeof(ak4531)); |
memset(&ak4531, 0, sizeof(ak4531)); |
1657 |
* General Switches... |
* General Switches... |
1658 |
*/ |
*/ |
1659 |
|
|
1660 |
#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) |
1661 |
/* MQ: gameport driver connectivity */ |
/* MQ: gameport driver connectivity */ |
1662 |
#define ENSONIQ_JOY_CONTROL(xname, mask) \ |
#define ENSONIQ_JOY_CONTROL(xname, mask) \ |
1663 |
{ .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_ensoniq_control_info, \ |
{ .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_ensoniq_control_info, \ |
1814 |
|
|
1815 |
static int snd_ensoniq_free(ensoniq_t *ensoniq) |
static int snd_ensoniq_free(ensoniq_t *ensoniq) |
1816 |
{ |
{ |
1817 |
#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) |
1818 |
if (ensoniq->ctrl & ES_JYSTK_EN) |
if (ensoniq->ctrl & ES_JYSTK_EN) |
1819 |
snd_ensoniq_joy_disable(ensoniq); |
snd_ensoniq_joy_disable(ensoniq); |
1820 |
#endif |
#endif |
1977 |
} |
} |
1978 |
/* AC'97 warm reset to start the bitclk */ |
/* AC'97 warm reset to start the bitclk */ |
1979 |
outl(ensoniq->ctrl | ES_1371_SYNC_RES, ES_REG(ensoniq, CONTROL)); |
outl(ensoniq->ctrl | ES_1371_SYNC_RES, ES_REG(ensoniq, CONTROL)); |
1980 |
|
inl(ES_REG(ensoniq, CONTROL)); |
1981 |
udelay(20); |
udelay(20); |
1982 |
outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL)); |
outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL)); |
1983 |
/* Init the sample rate converter */ |
/* Init the sample rate converter */ |
2012 |
outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL)); |
outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL)); |
2013 |
outb(0x00, ES_REG(ensoniq, UART_RES)); |
outb(0x00, ES_REG(ensoniq, UART_RES)); |
2014 |
outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); |
outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); |
2015 |
#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) |
2016 |
init_MUTEX(&ensoniq->joy_sem); |
init_MUTEX(&ensoniq->joy_sem); |
2017 |
#ifdef CHIP1371 |
#ifdef CHIP1371 |
2018 |
snd_ctl_add(card, snd_ctl_new1(&snd_es1371_joystick_addr, ensoniq)); |
snd_ctl_add(card, snd_ctl_new1(&snd_es1371_joystick_addr, ensoniq)); |