| 1 |
// SPDX-License-Identifier: GPL-2.0-or-later |
| 2 |
/* |
| 3 |
* Driver for AMD InterWave soundcard |
| 4 |
* Copyright (c) by Jaroslav Kysela <[email protected]> |
| 5 |
* |
| 6 |
* 1999/07/22 Erik Inge Bolso <[email protected]> |
| 7 |
* * mixer group handlers |
| 8 |
*/ |
| 9 |
|
| 10 |
#include <linux/init.h> |
| 11 |
#include <linux/err.h> |
| 12 |
#include <linux/isa.h> |
| 13 |
#include <linux/delay.h> |
| 14 |
#include <linux/pnp.h> |
| 15 |
#include <linux/module.h> |
| 16 |
#include <asm/dma.h> |
| 17 |
#include <sound/core.h> |
| 18 |
#include <sound/gus.h> |
| 19 |
#include <sound/wss.h> |
| 20 |
#ifdef SNDRV_STB |
| 21 |
#include <sound/tea6330t.h> |
| 22 |
#endif |
| 23 |
#define SNDRV_LEGACY_FIND_FREE_IRQ |
| 24 |
#define SNDRV_LEGACY_FIND_FREE_DMA |
| 25 |
#include <sound/initval.h> |
| 26 |
|
| 27 |
MODULE_AUTHOR("Jaroslav Kysela <[email protected]>"); |
| 28 |
MODULE_LICENSE("GPL"); |
| 29 |
#ifndef SNDRV_STB |
| 30 |
MODULE_DESCRIPTION("AMD InterWave"); |
| 31 |
#else |
| 32 |
MODULE_DESCRIPTION("AMD InterWave STB with TEA6330T"); |
| 33 |
#endif |
| 34 |
|
| 35 |
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 36 |
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| 37 |
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
| 38 |
#ifdef CONFIG_PNP |
| 39 |
static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
| 40 |
#endif |
| 41 |
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x210,0x220,0x230,0x240,0x250,0x260 */ |
| 42 |
#ifdef SNDRV_STB |
| 43 |
static long port_tc[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x350,0x360,0x370,0x380 */ |
| 44 |
#endif |
| 45 |
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */ |
| 46 |
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ |
| 47 |
static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ |
| 48 |
static int joystick_dac[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 29}; |
| 49 |
/* 0 to 31, (0.59V-4.52V or 0.389V-2.98V) */ |
| 50 |
static int midi[SNDRV_CARDS]; |
| 51 |
static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; |
| 52 |
static int effect[SNDRV_CARDS]; |
| 53 |
|
| 54 |
#ifdef SNDRV_STB |
| 55 |
#define INTERWAVE_DRIVER "snd_interwave_stb" |
| 56 |
#define INTERWAVE_PNP_DRIVER "interwave-stb" |
| 57 |
#else |
| 58 |
#define INTERWAVE_DRIVER "snd_interwave" |
| 59 |
#define INTERWAVE_PNP_DRIVER "interwave" |
| 60 |
#endif |
| 61 |
|
| 62 |
module_param_array(index, int, NULL, 0444); |
| 63 |
MODULE_PARM_DESC(index, "Index value for InterWave soundcard."); |
| 64 |
module_param_array(id, charp, NULL, 0444); |
| 65 |
MODULE_PARM_DESC(id, "ID string for InterWave soundcard."); |
| 66 |
module_param_array(enable, bool, NULL, 0444); |
| 67 |
MODULE_PARM_DESC(enable, "Enable InterWave soundcard."); |
| 68 |
#ifdef CONFIG_PNP |
| 69 |
module_param_array(isapnp, bool, NULL, 0444); |
| 70 |
MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard."); |
| 71 |
#endif |
| 72 |
module_param_hw_array(port, long, ioport, NULL, 0444); |
| 73 |
MODULE_PARM_DESC(port, "Port # for InterWave driver."); |
| 74 |
#ifdef SNDRV_STB |
| 75 |
module_param_hw_array(port_tc, long, ioport, NULL, 0444); |
| 76 |
MODULE_PARM_DESC(port_tc, "Tone control (TEA6330T - i2c bus) port # for InterWave driver."); |
| 77 |
#endif |
| 78 |
module_param_hw_array(irq, int, irq, NULL, 0444); |
| 79 |
MODULE_PARM_DESC(irq, "IRQ # for InterWave driver."); |
| 80 |
module_param_hw_array(dma1, int, dma, NULL, 0444); |
| 81 |
MODULE_PARM_DESC(dma1, "DMA1 # for InterWave driver."); |
| 82 |
module_param_hw_array(dma2, int, dma, NULL, 0444); |
| 83 |
MODULE_PARM_DESC(dma2, "DMA2 # for InterWave driver."); |
| 84 |
module_param_array(joystick_dac, int, NULL, 0444); |
| 85 |
MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for InterWave driver."); |
| 86 |
module_param_array(midi, int, NULL, 0444); |
| 87 |
MODULE_PARM_DESC(midi, "MIDI UART enable for InterWave driver."); |
| 88 |
module_param_array(pcm_channels, int, NULL, 0444); |
| 89 |
MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for InterWave driver."); |
| 90 |
module_param_array(effect, int, NULL, 0444); |
| 91 |
MODULE_PARM_DESC(effect, "Effects enable for InterWave driver."); |
| 92 |
|
| 93 |
struct snd_interwave { |
| 94 |
int irq; |
| 95 |
struct snd_card *card; |
| 96 |
struct snd_gus_card *gus; |
| 97 |
struct snd_wss *wss; |
| 98 |
#ifdef SNDRV_STB |
| 99 |
struct resource *i2c_res; |
| 100 |
#endif |
| 101 |
unsigned short gus_status_reg; |
| 102 |
unsigned short pcm_status_reg; |
| 103 |
#ifdef CONFIG_PNP |
| 104 |
struct pnp_dev *dev; |
| 105 |
#ifdef SNDRV_STB |
| 106 |
struct pnp_dev *devtc; |
| 107 |
#endif |
| 108 |
#endif |
| 109 |
}; |
| 110 |
|
| 111 |
|
| 112 |
#ifdef CONFIG_PNP |
| 113 |
static int isa_registered; |
| 114 |
static int pnp_registered; |
| 115 |
|
| 116 |
static const struct pnp_card_device_id snd_interwave_pnpids[] = { |
| 117 |
#ifndef SNDRV_STB |
| 118 |
/* Gravis UltraSound Plug & Play */ |
| 119 |
{ .id = "GRV0001", .devs = { { .id = "GRV0000" } } }, |
| 120 |
/* STB SoundRage32 */ |
| 121 |
{ .id = "STB011a", .devs = { { .id = "STB0010" } } }, |
| 122 |
/* MED3210 */ |
| 123 |
{ .id = "DXP3201", .devs = { { .id = "DXP0010" } } }, |
| 124 |
/* Dynasonic Pro */ |
| 125 |
/* This device also have CDC1117:DynaSonix Pro Audio Effects Processor */ |
| 126 |
{ .id = "CDC1111", .devs = { { .id = "CDC1112" } } }, |
| 127 |
/* Panasonic PCA761AW Audio Card */ |
| 128 |
{ .id = "ADV55ff", .devs = { { .id = "ADV0010" } } }, |
| 129 |
/* InterWave STB without TEA6330T */ |
| 130 |
{ .id = "ADV550a", .devs = { { .id = "ADV0010" } } }, |
| 131 |
#else |
| 132 |
/* InterWave STB with TEA6330T */ |
| 133 |
{ .id = "ADV550a", .devs = { { .id = "ADV0010" }, { .id = "ADV0015" } } }, |
| 134 |
#endif |
| 135 |
{ .id = "" } |
| 136 |
}; |
| 137 |
|
| 138 |
MODULE_DEVICE_TABLE(pnp_card, snd_interwave_pnpids); |
| 139 |
|
| 140 |
#endif /* CONFIG_PNP */ |
| 141 |
|
| 142 |
|
| 143 |
#ifdef SNDRV_STB |
| 144 |
static void snd_interwave_i2c_setlines(struct snd_i2c_bus *bus, int ctrl, int data) |
| 145 |
{ |
| 146 |
unsigned long port = bus->private_value; |
| 147 |
|
| 148 |
#if 0 |
| 149 |
dev_dbg(bus->card->dev, "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data); |
| 150 |
#endif |
| 151 |
outb((data << 1) | ctrl, port); |
| 152 |
udelay(10); |
| 153 |
} |
| 154 |
|
| 155 |
static int snd_interwave_i2c_getclockline(struct snd_i2c_bus *bus) |
| 156 |
{ |
| 157 |
unsigned long port = bus->private_value; |
| 158 |
unsigned char res; |
| 159 |
|
| 160 |
res = inb(port) & 1; |
| 161 |
#if 0 |
| 162 |
dev_dbg(bus->card->dev, "i2c_getclockline - 0x%lx -> %i\n", port, res); |
| 163 |
#endif |
| 164 |
return res; |
| 165 |
} |
| 166 |
|
| 167 |
static int snd_interwave_i2c_getdataline(struct snd_i2c_bus *bus, int ack) |
| 168 |
{ |
| 169 |
unsigned long port = bus->private_value; |
| 170 |
unsigned char res; |
| 171 |
|
| 172 |
if (ack) |
| 173 |
udelay(10); |
| 174 |
res = (inb(port) & 2) >> 1; |
| 175 |
#if 0 |
| 176 |
dev_dbg(bus->card->dev, "i2c_getdataline - 0x%lx -> %i\n", port, res); |
| 177 |
#endif |
| 178 |
return res; |
| 179 |
} |
| 180 |
|
| 181 |
static struct snd_i2c_bit_ops snd_interwave_i2c_bit_ops = { |
| 182 |
.setlines = snd_interwave_i2c_setlines, |
| 183 |
.getclock = snd_interwave_i2c_getclockline, |
| 184 |
.getdata = snd_interwave_i2c_getdataline, |
| 185 |
}; |
| 186 |
|
| 187 |
static int snd_interwave_detect_stb(struct snd_interwave *iwcard, |
| 188 |
struct snd_gus_card *gus, int dev, |
| 189 |
struct snd_i2c_bus **rbus) |
| 190 |
{ |
| 191 |
unsigned long port; |
| 192 |
struct snd_i2c_bus *bus; |
| 193 |
struct snd_card *card = iwcard->card; |
| 194 |
char name[32]; |
| 195 |
int err; |
| 196 |
|
| 197 |
*rbus = NULL; |
| 198 |
port = port_tc[dev]; |
| 199 |
if (port == SNDRV_AUTO_PORT) { |
| 200 |
port = 0x350; |
| 201 |
if (gus->gf1.port == 0x250) { |
| 202 |
port = 0x360; |
| 203 |
} |
| 204 |
while (port <= 0x380) { |
| 205 |
iwcard->i2c_res = devm_request_region(card->dev, port, 1, |
| 206 |
"InterWave (I2C bus)"); |
| 207 |
if (iwcard->i2c_res) |
| 208 |
break; |
| 209 |
port += 0x10; |
| 210 |
} |
| 211 |
} else { |
| 212 |
iwcard->i2c_res = devm_request_region(card->dev, port, 1, |
| 213 |
"InterWave (I2C bus)"); |
| 214 |
} |
| 215 |
if (iwcard->i2c_res == NULL) { |
| 216 |
dev_err(card->dev, "interwave: can't grab i2c bus port\n"); |
| 217 |
return -ENODEV; |
| 218 |
} |
| 219 |
|
| 220 |
sprintf(name, "InterWave-%i", card->number); |
| 221 |
err = snd_i2c_bus_create(card, name, NULL, &bus); |
| 222 |
if (err < 0) |
| 223 |
return err; |
| 224 |
bus->private_value = port; |
| 225 |
bus->hw_ops.bit = &snd_interwave_i2c_bit_ops; |
| 226 |
err = snd_tea6330t_detect(bus, 0); |
| 227 |
if (err < 0) |
| 228 |
return err; |
| 229 |
*rbus = bus; |
| 230 |
return 0; |
| 231 |
} |
| 232 |
#endif |
| 233 |
|
| 234 |
static int snd_interwave_detect(struct snd_interwave *iwcard, |
| 235 |
struct snd_gus_card *gus, |
| 236 |
int dev |
| 237 |
#ifdef SNDRV_STB |
| 238 |
, struct snd_i2c_bus **rbus |
| 239 |
#endif |
| 240 |
) |
| 241 |
{ |
| 242 |
unsigned char rev1, rev2; |
| 243 |
int d; |
| 244 |
|
| 245 |
snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ |
| 246 |
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); |
| 247 |
if ((d & 0x07) != 0) { |
| 248 |
dev_dbg(gus->card->dev, "[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); |
| 249 |
return -ENODEV; |
| 250 |
} |
| 251 |
udelay(160); |
| 252 |
snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 1); /* release reset */ |
| 253 |
udelay(160); |
| 254 |
d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET); |
| 255 |
if ((d & 0x07) != 1) { |
| 256 |
dev_dbg(gus->card->dev, "[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); |
| 257 |
return -ENODEV; |
| 258 |
} |
| 259 |
scoped_guard(spinlock_irqsave, &gus->reg_lock) { |
| 260 |
rev1 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER); |
| 261 |
snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, ~rev1); |
| 262 |
rev2 = snd_gf1_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER); |
| 263 |
snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, rev1); |
| 264 |
} |
| 265 |
dev_dbg(gus->card->dev, |
| 266 |
"[0x%lx] InterWave check - rev1=0x%x, rev2=0x%x\n", |
| 267 |
gus->gf1.port, rev1, rev2); |
| 268 |
if ((rev1 & 0xf0) == (rev2 & 0xf0) && |
| 269 |
(rev1 & 0x0f) != (rev2 & 0x0f)) { |
| 270 |
dev_dbg(gus->card->dev, |
| 271 |
"[0x%lx] InterWave check - passed\n", gus->gf1.port); |
| 272 |
gus->interwave = 1; |
| 273 |
strscpy(gus->card->shortname, "AMD InterWave"); |
| 274 |
gus->revision = rev1 >> 4; |
| 275 |
#ifndef SNDRV_STB |
| 276 |
return 0; /* ok.. We have an InterWave board */ |
| 277 |
#else |
| 278 |
return snd_interwave_detect_stb(iwcard, gus, dev, rbus); |
| 279 |
#endif |
| 280 |
} |
| 281 |
dev_dbg(gus->card->dev, "[0x%lx] InterWave check - failed\n", gus->gf1.port); |
| 282 |
return -ENODEV; |
| 283 |
} |
| 284 |
|
| 285 |
static irqreturn_t snd_interwave_interrupt(int irq, void *dev_id) |
| 286 |
{ |
| 287 |
struct snd_interwave *iwcard = dev_id; |
| 288 |
int loop, max = 5; |
| 289 |
int handled = 0; |
| 290 |
|
| 291 |
do { |
| 292 |
loop = 0; |
| 293 |
if (inb(iwcard->gus_status_reg)) { |
| 294 |
handled = 1; |
| 295 |
snd_gus_interrupt(irq, iwcard->gus); |
| 296 |
loop++; |
| 297 |
} |
| 298 |
if (inb(iwcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ |
| 299 |
handled = 1; |
| 300 |
snd_wss_interrupt(irq, iwcard->wss); |
| 301 |
loop++; |
| 302 |
} |
| 303 |
} while (loop && --max > 0); |
| 304 |
return IRQ_RETVAL(handled); |
| 305 |
} |
| 306 |
|
| 307 |
static void snd_interwave_reset(struct snd_gus_card *gus) |
| 308 |
{ |
| 309 |
snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x00); |
| 310 |
udelay(160); |
| 311 |
snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x01); |
| 312 |
udelay(160); |
| 313 |
} |
| 314 |
|
| 315 |
static void snd_interwave_bank_sizes(struct snd_gus_card *gus, int *sizes) |
| 316 |
{ |
| 317 |
unsigned int idx; |
| 318 |
unsigned int local; |
| 319 |
unsigned char d; |
| 320 |
|
| 321 |
for (idx = 0; idx < 4; idx++) { |
| 322 |
sizes[idx] = 0; |
| 323 |
d = 0x55; |
| 324 |
for (local = idx << 22; |
| 325 |
local < (idx << 22) + 0x400000; |
| 326 |
local += 0x40000, d++) { |
| 327 |
snd_gf1_poke(gus, local, d); |
| 328 |
snd_gf1_poke(gus, local + 1, d + 1); |
| 329 |
#if 0 |
| 330 |
dev_dbg(gus->card->dev, "d = 0x%x, local = 0x%x, " |
| 331 |
"local + 1 = 0x%x, idx << 22 = 0x%x\n", |
| 332 |
d, |
| 333 |
snd_gf1_peek(gus, local), |
| 334 |
snd_gf1_peek(gus, local + 1), |
| 335 |
snd_gf1_peek(gus, idx << 22)); |
| 336 |
#endif |
| 337 |
if (snd_gf1_peek(gus, local) != d || |
| 338 |
snd_gf1_peek(gus, local + 1) != d + 1 || |
| 339 |
snd_gf1_peek(gus, idx << 22) != 0x55) |
| 340 |
break; |
| 341 |
sizes[idx]++; |
| 342 |
} |
| 343 |
} |
| 344 |
#if 0 |
| 345 |
dev_dbg(gus->card->dev, "sizes: %i %i %i %i\n", |
| 346 |
sizes[0], sizes[1], sizes[2], sizes[3]); |
| 347 |
#endif |
| 348 |
} |
| 349 |
|
| 350 |
struct rom_hdr { |
| 351 |
/* 000 */ unsigned char iwave[8]; |
| 352 |
/* 008 */ unsigned char rom_hdr_revision; |
| 353 |
/* 009 */ unsigned char series_number; |
| 354 |
/* 010 */ unsigned char series_name[16]; |
| 355 |
/* 026 */ unsigned char date[10]; |
| 356 |
/* 036 */ unsigned short vendor_revision_major; |
| 357 |
/* 038 */ unsigned short vendor_revision_minor; |
| 358 |
/* 040 */ unsigned int rom_size; |
| 359 |
/* 044 */ unsigned char copyright[128]; |
| 360 |
/* 172 */ unsigned char vendor_name[64]; |
| 361 |
/* 236 */ unsigned char rom_description[128]; |
| 362 |
/* 364 */ unsigned char pad[147]; |
| 363 |
/* 511 */ unsigned char csum; |
| 364 |
}; |
| 365 |
|
| 366 |
static void snd_interwave_detect_memory(struct snd_gus_card *gus) |
| 367 |
{ |
| 368 |
static const unsigned int lmc[13] = |
| 369 |
{ |
| 370 |
0x00000001, 0x00000101, 0x01010101, 0x00000401, |
| 371 |
0x04040401, 0x00040101, 0x04040101, 0x00000004, |
| 372 |
0x00000404, 0x04040404, 0x00000010, 0x00001010, |
| 373 |
0x10101010 |
| 374 |
}; |
| 375 |
|
| 376 |
int bank_pos, pages; |
| 377 |
unsigned int i, lmct; |
| 378 |
int psizes[4]; |
| 379 |
unsigned char iwave[8]; |
| 380 |
unsigned char csum; |
| 381 |
|
| 382 |
snd_interwave_reset(gus); |
| 383 |
snd_gf1_write8(gus, SNDRV_GF1_GB_GLOBAL_MODE, snd_gf1_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE) | 0x01); /* enhanced mode */ |
| 384 |
snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x01); /* DRAM I/O cycles selected */ |
| 385 |
snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xff10) | 0x004c); |
| 386 |
/* ok.. simple test of memory size */ |
| 387 |
pages = 0; |
| 388 |
snd_gf1_poke(gus, 0, 0x55); |
| 389 |
snd_gf1_poke(gus, 1, 0xaa); |
| 390 |
#if 1 |
| 391 |
if (snd_gf1_peek(gus, 0) == 0x55 && snd_gf1_peek(gus, 1) == 0xaa) |
| 392 |
#else |
| 393 |
if (0) /* ok.. for testing of 0k RAM */ |
| 394 |
#endif |
| 395 |
{ |
| 396 |
snd_interwave_bank_sizes(gus, psizes); |
| 397 |
lmct = (psizes[3] << 24) | (psizes[2] << 16) | |
| 398 |
(psizes[1] << 8) | psizes[0]; |
| 399 |
#if 0 |
| 400 |
dev_dbg(gus->card->dev, "lmct = 0x%08x\n", lmct); |
| 401 |
#endif |
| 402 |
for (i = 0; i < ARRAY_SIZE(lmc); i++) |
| 403 |
if (lmct == lmc[i]) { |
| 404 |
#if 0 |
| 405 |
dev_dbg(gus->card->dev, "found !!! %i\n", i); |
| 406 |
#endif |
| 407 |
snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i); |
| 408 |
snd_interwave_bank_sizes(gus, psizes); |
| 409 |
break; |
| 410 |
} |
| 411 |
if (i >= ARRAY_SIZE(lmc) && !gus->gf1.enh_mode) |
| 412 |
snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | 2); |
| 413 |
for (i = 0; i < 4; i++) { |
| 414 |
gus->gf1.mem_alloc.banks_8[i].address = |
| 415 |
gus->gf1.mem_alloc.banks_16[i].address = i << 22; |
| 416 |
gus->gf1.mem_alloc.banks_8[i].size = |
| 417 |
gus->gf1.mem_alloc.banks_16[i].size = psizes[i] << 18; |
| 418 |
pages += psizes[i]; |
| 419 |
} |
| 420 |
} |
| 421 |
pages <<= 18; |
| 422 |
gus->gf1.memory = pages; |
| 423 |
|
| 424 |
snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x03); /* select ROM */ |
| 425 |
snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xff1f) | (4 << 5)); |
| 426 |
gus->gf1.rom_banks = 0; |
| 427 |
gus->gf1.rom_memory = 0; |
| 428 |
for (bank_pos = 0; bank_pos < 16L * 1024L * 1024L; bank_pos += 4L * 1024L * 1024L) { |
| 429 |
for (i = 0; i < 8; ++i) |
| 430 |
iwave[i] = snd_gf1_peek(gus, bank_pos + i); |
| 431 |
if (strncmp(iwave, "INTRWAVE", 8)) |
| 432 |
continue; /* first check */ |
| 433 |
csum = 0; |
| 434 |
for (i = 0; i < sizeof(struct rom_hdr); i++) |
| 435 |
csum += snd_gf1_peek(gus, bank_pos + i); |
| 436 |
if (csum != 0) |
| 437 |
continue; /* not valid rom */ |
| 438 |
gus->gf1.rom_banks++; |
| 439 |
gus->gf1.rom_present |= 1 << (bank_pos >> 22); |
| 440 |
gus->gf1.rom_memory = snd_gf1_peek(gus, bank_pos + 40) | |
| 441 |
(snd_gf1_peek(gus, bank_pos + 41) << 8) | |
| 442 |
(snd_gf1_peek(gus, bank_pos + 42) << 16) | |
| 443 |
(snd_gf1_peek(gus, bank_pos + 43) << 24); |
| 444 |
} |
| 445 |
#if 0 |
| 446 |
if (gus->gf1.rom_memory > 0) { |
| 447 |
if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) |
| 448 |
gus->card->type = SNDRV_CARD_TYPE_IW_DYNASONIC; |
| 449 |
} |
| 450 |
#endif |
| 451 |
snd_gf1_write8(gus, SNDRV_GF1_GB_MEMORY_CONTROL, 0x00); /* select RAM */ |
| 452 |
|
| 453 |
if (!gus->gf1.enh_mode) |
| 454 |
snd_interwave_reset(gus); |
| 455 |
} |
| 456 |
|
| 457 |
static void snd_interwave_init(int dev, struct snd_gus_card *gus) |
| 458 |
{ |
| 459 |
/* ok.. some InterWave specific initialization */ |
| 460 |
scoped_guard(spinlock_irqsave, &gus->reg_lock) { |
| 461 |
snd_gf1_write8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL, 0x00); |
| 462 |
snd_gf1_write8(gus, SNDRV_GF1_GB_COMPATIBILITY, 0x1f); |
| 463 |
snd_gf1_write8(gus, SNDRV_GF1_GB_DECODE_CONTROL, 0x49); |
| 464 |
snd_gf1_write8(gus, SNDRV_GF1_GB_VERSION_NUMBER, 0x11); |
| 465 |
snd_gf1_write8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A, 0x00); |
| 466 |
snd_gf1_write8(gus, SNDRV_GF1_GB_MPU401_CONTROL_B, 0x30); |
| 467 |
snd_gf1_write8(gus, SNDRV_GF1_GB_EMULATION_IRQ, 0x00); |
| 468 |
} |
| 469 |
gus->equal_irq = 1; |
| 470 |
gus->codec_flag = 1; |
| 471 |
gus->interwave = 1; |
| 472 |
gus->max_flag = 1; |
| 473 |
gus->joystick_dac = joystick_dac[dev]; |
| 474 |
|
| 475 |
} |
| 476 |
|
| 477 |
static const struct snd_kcontrol_new snd_interwave_controls[] = { |
| 478 |
WSS_DOUBLE("Master Playback Switch", 0, |
| 479 |
CS4231_LINE_LEFT_OUTPUT, CS4231_LINE_RIGHT_OUTPUT, 7, 7, 1, 1), |
| 480 |
WSS_DOUBLE("Master Playback Volume", 0, |
| 481 |
CS4231_LINE_LEFT_OUTPUT, CS4231_LINE_RIGHT_OUTPUT, 0, 0, 31, 1), |
| 482 |
WSS_DOUBLE("Mic Playback Switch", 0, |
| 483 |
CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 7, 7, 1, 1), |
| 484 |
WSS_DOUBLE("Mic Playback Volume", 0, |
| 485 |
CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 0, 0, 31, 1) |
| 486 |
}; |
| 487 |
|
| 488 |
static int snd_interwave_mixer(struct snd_wss *chip) |
| 489 |
{ |
| 490 |
struct snd_card *card = chip->card; |
| 491 |
struct snd_ctl_elem_id id1, id2; |
| 492 |
unsigned int idx; |
| 493 |
int err; |
| 494 |
|
| 495 |
memset(&id1, 0, sizeof(id1)); |
| 496 |
memset(&id2, 0, sizeof(id2)); |
| 497 |
id1.iface = id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER; |
| 498 |
#if 0 |
| 499 |
/* remove mono microphone controls */ |
| 500 |
strscpy(id1.name, "Mic Playback Switch"); |
| 501 |
err = snd_ctl_remove_id(card, &id1); |
| 502 |
if (err < 0) |
| 503 |
return err; |
| 504 |
strscpy(id1.name, "Mic Playback Volume"); |
| 505 |
err = snd_ctl_remove_id(card, &id1); |
| 506 |
if (err < 0) |
| 507 |
return err; |
| 508 |
#endif |
| 509 |
/* add new master and mic controls */ |
| 510 |
for (idx = 0; idx < ARRAY_SIZE(snd_interwave_controls); idx++) { |
| 511 |
err = snd_ctl_add(card, snd_ctl_new1(&snd_interwave_controls[idx], chip)); |
| 512 |
if (err < 0) |
| 513 |
return err; |
| 514 |
} |
| 515 |
snd_wss_out(chip, CS4231_LINE_LEFT_OUTPUT, 0x9f); |
| 516 |
snd_wss_out(chip, CS4231_LINE_RIGHT_OUTPUT, 0x9f); |
| 517 |
snd_wss_out(chip, CS4231_LEFT_MIC_INPUT, 0x9f); |
| 518 |
snd_wss_out(chip, CS4231_RIGHT_MIC_INPUT, 0x9f); |
| 519 |
/* reassign AUXA to SYNTHESIZER */ |
| 520 |
strscpy(id1.name, "Aux Playback Switch"); |
| 521 |
strscpy(id2.name, "Synth Playback Switch"); |
| 522 |
err = snd_ctl_rename_id(card, &id1, &id2); |
| 523 |
if (err < 0) |
| 524 |
return err; |
| 525 |
strscpy(id1.name, "Aux Playback Volume"); |
| 526 |
strscpy(id2.name, "Synth Playback Volume"); |
| 527 |
err = snd_ctl_rename_id(card, &id1, &id2); |
| 528 |
if (err < 0) |
| 529 |
return err; |
| 530 |
/* reassign AUXB to CD */ |
| 531 |
strscpy(id1.name, "Aux Playback Switch"); id1.index = 1; |
| 532 |
strscpy(id2.name, "CD Playback Switch"); |
| 533 |
err = snd_ctl_rename_id(card, &id1, &id2); |
| 534 |
if (err < 0) |
| 535 |
return err; |
| 536 |
strscpy(id1.name, "Aux Playback Volume"); |
| 537 |
strscpy(id2.name, "CD Playback Volume"); |
| 538 |
err = snd_ctl_rename_id(card, &id1, &id2); |
| 539 |
if (err < 0) |
| 540 |
return err; |
| 541 |
return 0; |
| 542 |
} |
| 543 |
|
| 544 |
#ifdef CONFIG_PNP |
| 545 |
|
| 546 |
static int snd_interwave_pnp(int dev, struct snd_interwave *iwcard, |
| 547 |
struct pnp_card_link *card, |
| 548 |
const struct pnp_card_device_id *id) |
| 549 |
{ |
| 550 |
struct pnp_dev *pdev; |
| 551 |
int err; |
| 552 |
|
| 553 |
iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); |
| 554 |
if (iwcard->dev == NULL) |
| 555 |
return -EBUSY; |
| 556 |
|
| 557 |
#ifdef SNDRV_STB |
| 558 |
iwcard->devtc = pnp_request_card_device(card, id->devs[1].id, NULL); |
| 559 |
if (iwcard->devtc == NULL) |
| 560 |
return -EBUSY; |
| 561 |
#endif |
| 562 |
/* Synth & Codec initialization */ |
| 563 |
pdev = iwcard->dev; |
| 564 |
|
| 565 |
err = pnp_activate_dev(pdev); |
| 566 |
if (err < 0) { |
| 567 |
dev_err(&pdev->dev, "InterWave PnP configure failure (out of resources?)\n"); |
| 568 |
return err; |
| 569 |
} |
| 570 |
if (pnp_port_start(pdev, 0) + 0x100 != pnp_port_start(pdev, 1) || |
| 571 |
pnp_port_start(pdev, 0) + 0x10c != pnp_port_start(pdev, 2)) { |
| 572 |
dev_err(&pdev->dev, "PnP configure failure (wrong ports)\n"); |
| 573 |
return -ENOENT; |
| 574 |
} |
| 575 |
port[dev] = pnp_port_start(pdev, 0); |
| 576 |
dma1[dev] = pnp_dma(pdev, 0); |
| 577 |
if (dma2[dev] >= 0) |
| 578 |
dma2[dev] = pnp_dma(pdev, 1); |
| 579 |
irq[dev] = pnp_irq(pdev, 0); |
| 580 |
dev_dbg(&pdev->dev, |
| 581 |
"isapnp IW: sb port=0x%llx, gf1 port=0x%llx, codec port=0x%llx\n", |
| 582 |
(unsigned long long)pnp_port_start(pdev, 0), |
| 583 |
(unsigned long long)pnp_port_start(pdev, 1), |
| 584 |
(unsigned long long)pnp_port_start(pdev, 2)); |
| 585 |
dev_dbg(&pdev->dev, |
| 586 |
"isapnp IW: dma1=%i, dma2=%i, irq=%i\n", |
| 587 |
dma1[dev], dma2[dev], irq[dev]); |
| 588 |
#ifdef SNDRV_STB |
| 589 |
/* Tone Control initialization */ |
| 590 |
pdev = iwcard->devtc; |
| 591 |
|
| 592 |
err = pnp_activate_dev(pdev); |
| 593 |
if (err < 0) { |
| 594 |
dev_err(&pdev->dev, |
| 595 |
"InterWave ToneControl PnP configure failure (out of resources?)\n"); |
| 596 |
return err; |
| 597 |
} |
| 598 |
port_tc[dev] = pnp_port_start(pdev, 0); |
| 599 |
dev_dbg(&pdev->dev, "isapnp IW: tone control port=0x%lx\n", port_tc[dev]); |
| 600 |
#endif |
| 601 |
return 0; |
| 602 |
} |
| 603 |
#endif /* CONFIG_PNP */ |
| 604 |
|
| 605 |
static int snd_interwave_card_new(struct device *pdev, int dev, |
| 606 |
struct snd_card **cardp) |
| 607 |
{ |
| 608 |
struct snd_card *card; |
| 609 |
struct snd_interwave *iwcard; |
| 610 |
int err; |
| 611 |
|
| 612 |
err = snd_devm_card_new(pdev, index[dev], id[dev], THIS_MODULE, |
| 613 |
sizeof(struct snd_interwave), &card); |
| 614 |
if (err < 0) |
| 615 |
return err; |
| 616 |
iwcard = card->private_data; |
| 617 |
iwcard->card = card; |
| 618 |
iwcard->irq = -1; |
| 619 |
*cardp = card; |
| 620 |
return 0; |
| 621 |
} |
| 622 |
|
| 623 |
static int snd_interwave_probe_gus(struct snd_card *card, int dev, |
| 624 |
struct snd_gus_card **gusp) |
| 625 |
{ |
| 626 |
return snd_gus_create(card, port[dev], -irq[dev], dma1[dev], dma2[dev], |
| 627 |
0, 32, pcm_channels[dev], effect[dev], gusp); |
| 628 |
} |
| 629 |
|
| 630 |
static int snd_interwave_probe(struct snd_card *card, int dev, |
| 631 |
struct snd_gus_card *gus) |
| 632 |
{ |
| 633 |
int xirq, xdma1, xdma2; |
| 634 |
struct snd_interwave *iwcard = card->private_data; |
| 635 |
struct snd_wss *wss; |
| 636 |
#ifdef SNDRV_STB |
| 637 |
struct snd_i2c_bus *i2c_bus; |
| 638 |
#endif |
| 639 |
char *str; |
| 640 |
int err; |
| 641 |
|
| 642 |
xirq = irq[dev]; |
| 643 |
xdma1 = dma1[dev]; |
| 644 |
xdma2 = dma2[dev]; |
| 645 |
|
| 646 |
err = snd_interwave_detect(iwcard, gus, dev |
| 647 |
#ifdef SNDRV_STB |
| 648 |
, &i2c_bus |
| 649 |
#endif |
| 650 |
); |
| 651 |
if (err < 0) |
| 652 |
return err; |
| 653 |
|
| 654 |
iwcard->gus_status_reg = gus->gf1.reg_irqstat; |
| 655 |
iwcard->pcm_status_reg = gus->gf1.port + 0x10c + 2; |
| 656 |
|
| 657 |
snd_interwave_init(dev, gus); |
| 658 |
snd_interwave_detect_memory(gus); |
| 659 |
err = snd_gus_initialize(gus); |
| 660 |
if (err < 0) |
| 661 |
return err; |
| 662 |
|
| 663 |
if (devm_request_irq(card->dev, xirq, snd_interwave_interrupt, 0, |
| 664 |
"InterWave", iwcard)) { |
| 665 |
dev_err(card->dev, "unable to grab IRQ %d\n", xirq); |
| 666 |
return -EBUSY; |
| 667 |
} |
| 668 |
iwcard->irq = xirq; |
| 669 |
card->sync_irq = iwcard->irq; |
| 670 |
|
| 671 |
err = snd_wss_create(card, |
| 672 |
gus->gf1.port + 0x10c, -1, xirq, |
| 673 |
xdma2 < 0 ? xdma1 : xdma2, xdma1, |
| 674 |
WSS_HW_INTERWAVE, |
| 675 |
WSS_HWSHARE_IRQ | |
| 676 |
WSS_HWSHARE_DMA1 | |
| 677 |
WSS_HWSHARE_DMA2, |
| 678 |
&wss); |
| 679 |
if (err < 0) |
| 680 |
return err; |
| 681 |
|
| 682 |
err = snd_wss_pcm(wss, 0); |
| 683 |
if (err < 0) |
| 684 |
return err; |
| 685 |
|
| 686 |
sprintf(wss->pcm->name + strlen(wss->pcm->name), " rev %c", |
| 687 |
gus->revision + 'A'); |
| 688 |
strcat(wss->pcm->name, " (codec)"); |
| 689 |
|
| 690 |
err = snd_wss_timer(wss, 2); |
| 691 |
if (err < 0) |
| 692 |
return err; |
| 693 |
|
| 694 |
err = snd_wss_mixer(wss); |
| 695 |
if (err < 0) |
| 696 |
return err; |
| 697 |
|
| 698 |
if (pcm_channels[dev] > 0) { |
| 699 |
err = snd_gf1_pcm_new(gus, 1, 1); |
| 700 |
if (err < 0) |
| 701 |
return err; |
| 702 |
} |
| 703 |
err = snd_interwave_mixer(wss); |
| 704 |
if (err < 0) |
| 705 |
return err; |
| 706 |
|
| 707 |
#ifdef SNDRV_STB |
| 708 |
{ |
| 709 |
struct snd_ctl_elem_id id1, id2; |
| 710 |
memset(&id1, 0, sizeof(id1)); |
| 711 |
memset(&id2, 0, sizeof(id2)); |
| 712 |
id1.iface = id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER; |
| 713 |
strscpy(id1.name, "Master Playback Switch"); |
| 714 |
strscpy(id2.name, id1.name); |
| 715 |
id2.index = 1; |
| 716 |
err = snd_ctl_rename_id(card, &id1, &id2); |
| 717 |
if (err < 0) |
| 718 |
return err; |
| 719 |
strscpy(id1.name, "Master Playback Volume"); |
| 720 |
strscpy(id2.name, id1.name); |
| 721 |
err = snd_ctl_rename_id(card, &id1, &id2); |
| 722 |
if (err < 0) |
| 723 |
return err; |
| 724 |
err = snd_tea6330t_update_mixer(card, i2c_bus, 0, 1); |
| 725 |
if (err < 0) |
| 726 |
return err; |
| 727 |
} |
| 728 |
#endif |
| 729 |
|
| 730 |
gus->uart_enable = midi[dev]; |
| 731 |
err = snd_gf1_rawmidi_new(gus, 0); |
| 732 |
if (err < 0) |
| 733 |
return err; |
| 734 |
|
| 735 |
#ifndef SNDRV_STB |
| 736 |
str = "AMD InterWave"; |
| 737 |
if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) |
| 738 |
str = "Dynasonic 3-D"; |
| 739 |
#else |
| 740 |
str = "InterWave STB"; |
| 741 |
#endif |
| 742 |
strscpy(card->driver, str); |
| 743 |
strscpy(card->shortname, str); |
| 744 |
sprintf(card->longname, "%s at 0x%lx, irq %i, dma %d", |
| 745 |
str, |
| 746 |
gus->gf1.port, |
| 747 |
xirq, |
| 748 |
xdma1); |
| 749 |
if (xdma2 >= 0) |
| 750 |
sprintf(card->longname + strlen(card->longname), "&%d", xdma2); |
| 751 |
|
| 752 |
err = snd_card_register(card); |
| 753 |
if (err < 0) |
| 754 |
return err; |
| 755 |
|
| 756 |
iwcard->wss = wss; |
| 757 |
iwcard->gus = gus; |
| 758 |
return 0; |
| 759 |
} |
| 760 |
|
| 761 |
static int snd_interwave_isa_match(struct device *pdev, |
| 762 |
unsigned int dev) |
| 763 |
{ |
| 764 |
if (!enable[dev]) |
| 765 |
return 0; |
| 766 |
#ifdef CONFIG_PNP |
| 767 |
if (isapnp[dev]) |
| 768 |
return 0; |
| 769 |
#endif |
| 770 |
return 1; |
| 771 |
} |
| 772 |
|
| 773 |
static int snd_interwave_isa_probe(struct device *pdev, |
| 774 |
unsigned int dev) |
| 775 |
{ |
| 776 |
struct snd_card *card; |
| 777 |
struct snd_gus_card *gus; |
| 778 |
int err; |
| 779 |
static const int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; |
| 780 |
static const int possible_dmas[] = {0, 1, 3, 5, 6, 7, -1}; |
| 781 |
|
| 782 |
if (irq[dev] == SNDRV_AUTO_IRQ) { |
| 783 |
irq[dev] = snd_legacy_find_free_irq(possible_irqs); |
| 784 |
if (irq[dev] < 0) { |
| 785 |
dev_err(pdev, "unable to find a free IRQ\n"); |
| 786 |
return -EBUSY; |
| 787 |
} |
| 788 |
} |
| 789 |
if (dma1[dev] == SNDRV_AUTO_DMA) { |
| 790 |
dma1[dev] = snd_legacy_find_free_dma(possible_dmas); |
| 791 |
if (dma1[dev] < 0) { |
| 792 |
dev_err(pdev, "unable to find a free DMA1\n"); |
| 793 |
return -EBUSY; |
| 794 |
} |
| 795 |
} |
| 796 |
if (dma2[dev] == SNDRV_AUTO_DMA) { |
| 797 |
dma2[dev] = snd_legacy_find_free_dma(possible_dmas); |
| 798 |
if (dma2[dev] < 0) { |
| 799 |
dev_err(pdev, "unable to find a free DMA2\n"); |
| 800 |
return -EBUSY; |
| 801 |
} |
| 802 |
} |
| 803 |
|
| 804 |
err = snd_interwave_card_new(pdev, dev, &card); |
| 805 |
if (err < 0) |
| 806 |
return err; |
| 807 |
|
| 808 |
if (port[dev] != SNDRV_AUTO_PORT) |
| 809 |
err = snd_interwave_probe_gus(card, dev, &gus); |
| 810 |
else { |
| 811 |
static const long possible_ports[] = {0x210, 0x220, 0x230, 0x240, 0x250, 0x260}; |
| 812 |
int i; |
| 813 |
for (i = 0; i < ARRAY_SIZE(possible_ports); i++) { |
| 814 |
port[dev] = possible_ports[i]; |
| 815 |
err = snd_interwave_probe_gus(card, dev, &gus); |
| 816 |
if (! err) |
| 817 |
return 0; |
| 818 |
} |
| 819 |
} |
| 820 |
if (err < 0) |
| 821 |
return err; |
| 822 |
|
| 823 |
err = snd_interwave_probe(card, dev, gus); |
| 824 |
if (err < 0) |
| 825 |
return err; |
| 826 |
|
| 827 |
dev_set_drvdata(pdev, card); |
| 828 |
return 0; |
| 829 |
} |
| 830 |
|
| 831 |
static struct isa_driver snd_interwave_driver = { |
| 832 |
.match = snd_interwave_isa_match, |
| 833 |
.probe = snd_interwave_isa_probe, |
| 834 |
/* FIXME: suspend,resume */ |
| 835 |
.driver = { |
| 836 |
.name = INTERWAVE_DRIVER |
| 837 |
}, |
| 838 |
}; |
| 839 |
|
| 840 |
#ifdef CONFIG_PNP |
| 841 |
static int snd_interwave_pnp_detect(struct pnp_card_link *pcard, |
| 842 |
const struct pnp_card_device_id *pid) |
| 843 |
{ |
| 844 |
static int dev; |
| 845 |
struct snd_card *card; |
| 846 |
struct snd_gus_card *gus; |
| 847 |
int res; |
| 848 |
|
| 849 |
for ( ; dev < SNDRV_CARDS; dev++) { |
| 850 |
if (enable[dev] && isapnp[dev]) |
| 851 |
break; |
| 852 |
} |
| 853 |
if (dev >= SNDRV_CARDS) |
| 854 |
return -ENODEV; |
| 855 |
|
| 856 |
res = snd_interwave_card_new(&pcard->card->dev, dev, &card); |
| 857 |
if (res < 0) |
| 858 |
return res; |
| 859 |
|
| 860 |
res = snd_interwave_pnp(dev, card->private_data, pcard, pid); |
| 861 |
if (res < 0) |
| 862 |
return res; |
| 863 |
res = snd_interwave_probe_gus(card, dev, &gus); |
| 864 |
if (res < 0) |
| 865 |
return res; |
| 866 |
res = snd_interwave_probe(card, dev, gus); |
| 867 |
if (res < 0) |
| 868 |
return res; |
| 869 |
pnp_set_card_drvdata(pcard, card); |
| 870 |
dev++; |
| 871 |
return 0; |
| 872 |
} |
| 873 |
|
| 874 |
static struct pnp_card_driver interwave_pnpc_driver = { |
| 875 |
.flags = PNP_DRIVER_RES_DISABLE, |
| 876 |
.name = INTERWAVE_PNP_DRIVER, |
| 877 |
.id_table = snd_interwave_pnpids, |
| 878 |
.probe = snd_interwave_pnp_detect, |
| 879 |
/* FIXME: suspend,resume */ |
| 880 |
}; |
| 881 |
|
| 882 |
#endif /* CONFIG_PNP */ |
| 883 |
|
| 884 |
static int __init alsa_card_interwave_init(void) |
| 885 |
{ |
| 886 |
int err; |
| 887 |
|
| 888 |
err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); |
| 889 |
#ifdef CONFIG_PNP |
| 890 |
if (!err) |
| 891 |
isa_registered = 1; |
| 892 |
|
| 893 |
err = pnp_register_card_driver(&interwave_pnpc_driver); |
| 894 |
if (!err) |
| 895 |
pnp_registered = 1; |
| 896 |
|
| 897 |
if (isa_registered) |
| 898 |
err = 0; |
| 899 |
#endif |
| 900 |
return err; |
| 901 |
} |
| 902 |
|
| 903 |
static void __exit alsa_card_interwave_exit(void) |
| 904 |
{ |
| 905 |
#ifdef CONFIG_PNP |
| 906 |
if (pnp_registered) |
| 907 |
pnp_unregister_card_driver(&interwave_pnpc_driver); |
| 908 |
if (isa_registered) |
| 909 |
#endif |
| 910 |
isa_unregister_driver(&snd_interwave_driver); |
| 911 |
} |
| 912 |
|
| 913 |
module_init(alsa_card_interwave_init) |
| 914 |
module_exit(alsa_card_interwave_exit) |