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};
56 #define INTERWAVE_PNP_DRIVER "interwave-stb"
76 MODULE_PARM_DESC(port_tc, "Tone control (TEA6330T - i2c bus) port # for InterWave driver.");
85 MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for InterWave driver…
119 { .id = "GRV0001", .devs = { { .id = "GRV0000" } } },
121 { .id = "STB011a", .devs = { { .id = "STB0010" } } },
123 { .id = "DXP3201", .devs = { { .id = "DXP0010" } } },
126 { .id = "CDC1111", .devs = { { .id = "CDC1112" } } },
128 { .id = "ADV55ff", .devs = { { .id = "ADV0010" } } },
130 { .id = "ADV550a", .devs = { { .id = "ADV0010" } } },
133 { .id = "ADV550a", .devs = { { .id = "ADV0010" }, { .id = "ADV0015" } } },
146 unsigned long port = bus->private_value; in snd_interwave_i2c_setlines()
149 dev_dbg(bus->card->dev, "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data); in snd_interwave_i2c_setlines()
157 unsigned long port = bus->private_value; in snd_interwave_i2c_getclockline()
162 dev_dbg(bus->card->dev, "i2c_getclockline - 0x%lx -> %i\n", port, res); in snd_interwave_i2c_getclockline()
169 unsigned long port = bus->private_value; in snd_interwave_i2c_getdataline()
176 dev_dbg(bus->card->dev, "i2c_getdataline - 0x%lx -> %i\n", port, res); in snd_interwave_i2c_getdataline()
193 struct snd_card *card = iwcard->card; in snd_interwave_detect_stb()
201 if (gus->gf1.port == 0x250) { in snd_interwave_detect_stb()
205 iwcard->i2c_res = devm_request_region(card->dev, port, 1, in snd_interwave_detect_stb()
207 if (iwcard->i2c_res) in snd_interwave_detect_stb()
212 iwcard->i2c_res = devm_request_region(card->dev, port, 1, in snd_interwave_detect_stb()
215 if (iwcard->i2c_res == NULL) { in snd_interwave_detect_stb()
216 dev_err(card->dev, "interwave: can't grab i2c bus port\n"); in snd_interwave_detect_stb()
217 return -ENODEV; in snd_interwave_detect_stb()
220 sprintf(name, "InterWave-%i", card->number); in snd_interwave_detect_stb()
224 bus->private_value = port; in snd_interwave_detect_stb()
225 bus->hw_ops.bit = &snd_interwave_i2c_bit_ops; in snd_interwave_detect_stb()
249 dev_dbg(gus->card->dev, "[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
250 return -ENODEV; in snd_interwave_detect()
257 dev_dbg(gus->card->dev, "[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d); in snd_interwave_detect()
258 return -ENODEV; in snd_interwave_detect()
260 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_detect()
265 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_detect()
266 dev_dbg(gus->card->dev, in snd_interwave_detect()
267 "[0x%lx] InterWave check - rev1=0x%x, rev2=0x%x\n", in snd_interwave_detect()
268 gus->gf1.port, rev1, rev2); in snd_interwave_detect()
271 dev_dbg(gus->card->dev, in snd_interwave_detect()
272 "[0x%lx] InterWave check - passed\n", gus->gf1.port); in snd_interwave_detect()
273 gus->interwave = 1; in snd_interwave_detect()
274 strcpy(gus->card->shortname, "AMD InterWave"); in snd_interwave_detect()
275 gus->revision = rev1 >> 4; in snd_interwave_detect()
282 dev_dbg(gus->card->dev, "[0x%lx] InterWave check - failed\n", gus->gf1.port); in snd_interwave_detect()
283 return -ENODEV; in snd_interwave_detect()
294 if (inb(iwcard->gus_status_reg)) { in snd_interwave_interrupt()
296 snd_gus_interrupt(irq, iwcard->gus); in snd_interwave_interrupt()
299 if (inb(iwcard->pcm_status_reg) & 0x01) { /* IRQ bit is set? */ in snd_interwave_interrupt()
301 snd_wss_interrupt(irq, iwcard->wss); in snd_interwave_interrupt()
304 } while (loop && --max > 0); in snd_interwave_interrupt()
331 dev_dbg(gus->card->dev, "d = 0x%x, local = 0x%x, " in snd_interwave_bank_sizes()
346 dev_dbg(gus->card->dev, "sizes: %i %i %i %i\n", in snd_interwave_bank_sizes()
401 dev_dbg(gus->card->dev, "lmct = 0x%08x\n", lmct); in snd_interwave_detect_memory()
406 dev_dbg(gus->card->dev, "found !!! %i\n", i); in snd_interwave_detect_memory()
412 if (i >= ARRAY_SIZE(lmc) && !gus->gf1.enh_mode) in snd_interwave_detect_memory()
415 gus->gf1.mem_alloc.banks_8[i].address = in snd_interwave_detect_memory()
416 gus->gf1.mem_alloc.banks_16[i].address = i << 22; in snd_interwave_detect_memory()
417 gus->gf1.mem_alloc.banks_8[i].size = in snd_interwave_detect_memory()
418 gus->gf1.mem_alloc.banks_16[i].size = psizes[i] << 18; in snd_interwave_detect_memory()
423 gus->gf1.memory = pages; in snd_interwave_detect_memory()
427 gus->gf1.rom_banks = 0; in snd_interwave_detect_memory()
428 gus->gf1.rom_memory = 0; in snd_interwave_detect_memory()
439 gus->gf1.rom_banks++; in snd_interwave_detect_memory()
440 gus->gf1.rom_present |= 1 << (bank_pos >> 22); in snd_interwave_detect_memory()
441 gus->gf1.rom_memory = snd_gf1_peek(gus, bank_pos + 40) | in snd_interwave_detect_memory()
447 if (gus->gf1.rom_memory > 0) { in snd_interwave_detect_memory()
448 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_detect_memory()
449 gus->card->type = SNDRV_CARD_TYPE_IW_DYNASONIC; in snd_interwave_detect_memory()
454 if (!gus->gf1.enh_mode) in snd_interwave_detect_memory()
463 spin_lock_irqsave(&gus->reg_lock, flags); in snd_interwave_init()
471 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_interwave_init()
472 gus->equal_irq = 1; in snd_interwave_init()
473 gus->codec_flag = 1; in snd_interwave_init()
474 gus->interwave = 1; in snd_interwave_init()
475 gus->max_flag = 1; in snd_interwave_init()
476 gus->joystick_dac = joystick_dac[dev]; in snd_interwave_init()
493 struct snd_card *card = chip->card; in snd_interwave_mixer()
523 strcpy(id1.name, "Aux Playback Switch"); in snd_interwave_mixer()
528 strcpy(id1.name, "Aux Playback Volume"); in snd_interwave_mixer()
534 strcpy(id1.name, "Aux Playback Switch"); id1.index = 1; in snd_interwave_mixer()
539 strcpy(id1.name, "Aux Playback Volume"); in snd_interwave_mixer()
556 iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); in snd_interwave_pnp()
557 if (iwcard->dev == NULL) in snd_interwave_pnp()
558 return -EBUSY; in snd_interwave_pnp()
561 iwcard->devtc = pnp_request_card_device(card, id->devs[1].id, NULL); in snd_interwave_pnp()
562 if (iwcard->devtc == NULL) in snd_interwave_pnp()
563 return -EBUSY; in snd_interwave_pnp()
566 pdev = iwcard->dev; in snd_interwave_pnp()
570 dev_err(&pdev->dev, "InterWave PnP configure failure (out of resources?)\n"); in snd_interwave_pnp()
575 dev_err(&pdev->dev, "PnP configure failure (wrong ports)\n"); in snd_interwave_pnp()
576 return -ENOENT; in snd_interwave_pnp()
583 dev_dbg(&pdev->dev, in snd_interwave_pnp()
588 dev_dbg(&pdev->dev, in snd_interwave_pnp()
593 pdev = iwcard->devtc; in snd_interwave_pnp()
597 dev_err(&pdev->dev, in snd_interwave_pnp()
602 dev_dbg(&pdev->dev, "isapnp IW: tone control port=0x%lx\n", port_tc[dev]); in snd_interwave_pnp()
619 iwcard = card->private_data; in snd_interwave_card_new()
620 iwcard->card = card; in snd_interwave_card_new()
621 iwcard->irq = -1; in snd_interwave_card_new()
629 return snd_gus_create(card, port[dev], -irq[dev], dma1[dev], dma2[dev], in snd_interwave_probe_gus()
637 struct snd_interwave *iwcard = card->private_data; in snd_interwave_probe()
657 iwcard->gus_status_reg = gus->gf1.reg_irqstat; in snd_interwave_probe()
658 iwcard->pcm_status_reg = gus->gf1.port + 0x10c + 2; in snd_interwave_probe()
666 if (devm_request_irq(card->dev, xirq, snd_interwave_interrupt, 0, in snd_interwave_probe()
668 dev_err(card->dev, "unable to grab IRQ %d\n", xirq); in snd_interwave_probe()
669 return -EBUSY; in snd_interwave_probe()
671 iwcard->irq = xirq; in snd_interwave_probe()
672 card->sync_irq = iwcard->irq; in snd_interwave_probe()
675 gus->gf1.port + 0x10c, -1, xirq, in snd_interwave_probe()
689 sprintf(wss->pcm->name + strlen(wss->pcm->name), " rev %c", in snd_interwave_probe()
690 gus->revision + 'A'); in snd_interwave_probe()
691 strcat(wss->pcm->name, " (codec)"); in snd_interwave_probe()
733 gus->uart_enable = midi[dev]; in snd_interwave_probe()
740 if (gus->gf1.rom_banks == 1 && gus->gf1.rom_present == 8) in snd_interwave_probe()
741 str = "Dynasonic 3-D"; in snd_interwave_probe()
745 strcpy(card->driver, str); in snd_interwave_probe()
746 strcpy(card->shortname, str); in snd_interwave_probe()
747 sprintf(card->longname, "%s at 0x%lx, irq %i, dma %d", in snd_interwave_probe()
749 gus->gf1.port, in snd_interwave_probe()
753 sprintf(card->longname + strlen(card->longname), "&%d", xdma2); in snd_interwave_probe()
759 iwcard->wss = wss; in snd_interwave_probe()
760 iwcard->gus = gus; in snd_interwave_probe()
782 static const int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; in snd_interwave_isa_probe()
783 static const int possible_dmas[] = {0, 1, 3, 5, 6, 7, -1}; in snd_interwave_isa_probe()
789 return -EBUSY; in snd_interwave_isa_probe()
796 return -EBUSY; in snd_interwave_isa_probe()
803 return -EBUSY; in snd_interwave_isa_probe()
857 return -ENODEV; in snd_interwave_pnp_detect()
859 res = snd_interwave_card_new(&pcard->card->dev, dev, &card); in snd_interwave_pnp_detect()
863 res = snd_interwave_pnp(dev, card->private_data, pcard, pid); in snd_interwave_pnp_detect()