Lines Matching +full:aux +full:- +full:devs
1 // SPDX-License-Identifier: GPL-2.0-or-later
35 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
39 static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
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) */
51 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
55 #define PFX "interwave-stb: "
57 #define INTERWAVE_PNP_DRIVER "interwave-stb"
78 MODULE_PARM_DESC(port_tc, "Tone control (TEA6330T - i2c bus) port # for InterWave driver.");
87 MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for InterWave driver…
121 { .id = "GRV0001", .devs = { { .id = "GRV0000" } } },
123 { .id = "STB011a", .devs = { { .id = "STB0010" } } },
125 { .id = "DXP3201", .devs = { { .id = "DXP0010" } } },
128 { .id = "CDC1111", .devs = { { .id = "CDC1112" } } },
130 { .id = "ADV55ff", .devs = { { .id = "ADV0010" } } },
132 { .id = "ADV550a", .devs = { { .id = "ADV0010" } } },
135 { .id = "ADV550a", .devs = { { .id = "ADV0010" }, { .id = "ADV0015" } } },
148 unsigned long port = bus->private_value; in snd_interwave_i2c_setlines()
151 printk(KERN_DEBUG "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data); in snd_interwave_i2c_setlines()
159 unsigned long port = bus->private_value; in snd_interwave_i2c_getclockline()
164 printk(KERN_DEBUG "i2c_getclockline - 0x%lx -> %i\n", port, res); in snd_interwave_i2c_getclockline()
171 unsigned long port = bus->private_value; in snd_interwave_i2c_getdataline()
178 printk(KERN_DEBUG "i2c_getdataline - 0x%lx -> %i\n", port, res); in snd_interwave_i2c_getdataline()
195 struct snd_card *card = iwcard->card; in snd_interwave_detect_stb()
203 if (gus->gf1.port == 0x250) { in snd_interwave_detect_stb()
207 iwcard->i2c_res = devm_request_region(card->dev, port, 1, in snd_interwave_detect_stb()
209 if (iwcard->i2c_res) in snd_interwave_detect_stb()
214 iwcard->i2c_res = devm_request_region(card->dev, port, 1, in snd_interwave_detect_stb()
217 if (iwcard->i2c_res == NULL) { in snd_interwave_detect_stb()
219 return -ENODEV; in snd_interwave_detect_stb()
222 sprintf(name, "InterWave-%i", card->number); in snd_interwave_detect_stb()
226 bus->private_value = port; in snd_interwave_detect_stb()
227 bus->hw_ops.bit = &snd_interwave_i2c_bit_ops; in snd_interwave_detect_stb()
251 snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
252 return -ENODEV; in snd_interwave_detect()
259 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
260 return -ENODEV; in snd_interwave_detect()
262 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_detect()
267 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_detect()
268 snd_printdd("[0x%lx] InterWave check - rev1=0x%x, rev2=0x%x\n", gus->gf1.port, rev1, rev2); in snd_interwave_detect()
271 snd_printdd("[0x%lx] InterWave check - passed\n", gus->gf1.port); in snd_interwave_detect()
272 gus->interwave = 1; in snd_interwave_detect()
273 strcpy(gus->card->shortname, "AMD InterWave"); in snd_interwave_detect()
274 gus->revision = rev1 >> 4; in snd_interwave_detect()
281 snd_printdd("[0x%lx] InterWave check - failed\n", gus->gf1.port); in snd_interwave_detect()
282 return -ENODEV; in snd_interwave_detect()
293 if (inb(iwcard->gus_status_reg)) { in snd_interwave_interrupt()
295 snd_gus_interrupt(irq, iwcard->gus); in snd_interwave_interrupt()
298 if (inb(iwcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ in snd_interwave_interrupt()
300 snd_wss_interrupt(irq, iwcard->wss); in snd_interwave_interrupt()
303 } while (loop && --max > 0); in snd_interwave_interrupt()
411 if (i >= ARRAY_SIZE(lmc) && !gus->gf1.enh_mode) in snd_interwave_detect_memory()
414 gus->gf1.mem_alloc.banks_8[i].address = in snd_interwave_detect_memory()
415 gus->gf1.mem_alloc.banks_16[i].address = i << 22; in snd_interwave_detect_memory()
416 gus->gf1.mem_alloc.banks_8[i].size = in snd_interwave_detect_memory()
417 gus->gf1.mem_alloc.banks_16[i].size = psizes[i] << 18; in snd_interwave_detect_memory()
422 gus->gf1.memory = pages; in snd_interwave_detect_memory()
426 gus->gf1.rom_banks = 0; in snd_interwave_detect_memory()
427 gus->gf1.rom_memory = 0; in snd_interwave_detect_memory()
438 gus->gf1.rom_banks++; in snd_interwave_detect_memory()
439 gus->gf1.rom_present |= 1 << (bank_pos >> 22); in snd_interwave_detect_memory()
440 gus->gf1.rom_memory = snd_gf1_peek(gus, bank_pos + 40) | in snd_interwave_detect_memory()
446 if (gus->gf1.rom_memory > 0) { in snd_interwave_detect_memory()
447 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_detect_memory()
448 gus->card->type = SNDRV_CARD_TYPE_IW_DYNASONIC; in snd_interwave_detect_memory()
453 if (!gus->gf1.enh_mode) in snd_interwave_detect_memory()
462 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_init()
470 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_init()
471 gus->equal_irq = 1; in snd_interwave_init()
472 gus->codec_flag = 1; in snd_interwave_init()
473 gus->interwave = 1; in snd_interwave_init()
474 gus->max_flag = 1; in snd_interwave_init()
475 gus->joystick_dac = joystick_dac[dev]; in snd_interwave_init()
492 struct snd_card *card = chip->card; in snd_interwave_mixer()
522 strcpy(id1.name, "Aux Playback Switch"); in snd_interwave_mixer()
527 strcpy(id1.name, "Aux Playback Volume"); in snd_interwave_mixer()
533 strcpy(id1.name, "Aux Playback Switch"); id1.index = 1; in snd_interwave_mixer()
538 strcpy(id1.name, "Aux Playback Volume"); in snd_interwave_mixer()
555 iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); in snd_interwave_pnp()
556 if (iwcard->dev == NULL) in snd_interwave_pnp()
557 return -EBUSY; in snd_interwave_pnp()
560 iwcard->devtc = pnp_request_card_device(card, id->devs[1].id, NULL); in snd_interwave_pnp()
561 if (iwcard->devtc == NULL) in snd_interwave_pnp()
562 return -EBUSY; in snd_interwave_pnp()
565 pdev = iwcard->dev; in snd_interwave_pnp()
575 return -ENOENT; in snd_interwave_pnp()
589 pdev = iwcard->devtc; in snd_interwave_pnp()
614 iwcard = card->private_data; in snd_interwave_card_new()
615 iwcard->card = card; in snd_interwave_card_new()
616 iwcard->irq = -1; in snd_interwave_card_new()
624 return snd_gus_create(card, port[dev], -irq[dev], dma1[dev], dma2[dev], in snd_interwave_probe_gus()
632 struct snd_interwave *iwcard = card->private_data; in snd_interwave_probe()
652 iwcard->gus_status_reg = gus->gf1.reg_irqstat; in snd_interwave_probe()
653 iwcard->pcm_status_reg = gus->gf1.port + 0x10c + 2; in snd_interwave_probe()
661 if (devm_request_irq(card->dev, xirq, snd_interwave_interrupt, 0, in snd_interwave_probe()
664 return -EBUSY; in snd_interwave_probe()
666 iwcard->irq = xirq; in snd_interwave_probe()
667 card->sync_irq = iwcard->irq; in snd_interwave_probe()
670 gus->gf1.port + 0x10c, -1, xirq, in snd_interwave_probe()
684 sprintf(wss->pcm->name + strlen(wss->pcm->name), " rev %c", in snd_interwave_probe()
685 gus->revision + 'A'); in snd_interwave_probe()
686 strcat(wss->pcm->name, " (codec)"); in snd_interwave_probe()
728 gus->uart_enable = midi[dev]; in snd_interwave_probe()
735 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_probe()
736 str = "Dynasonic 3-D"; in snd_interwave_probe()
740 strcpy(card->driver, str); in snd_interwave_probe()
741 strcpy(card->shortname, str); in snd_interwave_probe()
742 sprintf(card->longname, "%s at 0x%lx, irq %i, dma %d", in snd_interwave_probe()
744 gus->gf1.port, in snd_interwave_probe()
748 sprintf(card->longname + strlen(card->longname), "&%d", xdma2); in snd_interwave_probe()
754 iwcard->wss = wss; in snd_interwave_probe()
755 iwcard->gus = gus; in snd_interwave_probe()
777 static const int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; in snd_interwave_isa_probe()
778 static const int possible_dmas[] = {0, 1, 3, 5, 6, 7, -1}; in snd_interwave_isa_probe()
784 return -EBUSY; in snd_interwave_isa_probe()
791 return -EBUSY; in snd_interwave_isa_probe()
798 return -EBUSY; in snd_interwave_isa_probe()
852 return -ENODEV; in snd_interwave_pnp_detect()
854 res = snd_interwave_card_new(&pcard->card->dev, dev, &card); in snd_interwave_pnp_detect()
858 res = snd_interwave_pnp(dev, card->private_data, pcard, pid); in snd_interwave_pnp_detect()