Lines Matching +full:0 +full:x240
33 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
36 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */
38 static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */
40 /* 0x300, 0x310, 0x320, 0x330 */
41 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 0 */
42 static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0, 1, 3 */
43 static bool joystick[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = false };
70 #define WRITE_MDIRQ_CFG 0x50 /* Set M&I&DRQ mask (the real config) */
71 #define COMMAND_52 0x52 /* */
72 #define READ_HARD_CFG 0x58 /* Read Hardware Config (I/O base etc) */
73 #define COMMAND_5C 0x5c /* */
74 #define COMMAND_60 0x60 /* */
75 #define COMMAND_66 0x66 /* */
76 #define COMMAND_6C 0x6c /* */
77 #define COMMAND_6E 0x6e /* */
78 #define COMMAND_88 0x88 /* Unknown command */
79 #define DSP_INIT_MSS 0x8c /* Enable Microsoft Sound System mode */
80 #define COMMAND_C5 0xc5 /* */
81 #define GET_DSP_VERSION 0xe1 /* Get DSP Version */
82 #define GET_DSP_COPYRIGHT 0xe3 /* Get DSP Copyright */
93 #define DSP_RESET 0x06 /* offset of DSP RESET (wo) */
94 #define DSP_READ 0x0a /* offset of DSP READ (ro) */
95 #define DSP_WRITE 0x0c /* offset of DSP WRITE (w-) */
96 #define DSP_COMMAND 0x0c /* offset of DSP COMMAND (w-) */
97 #define DSP_STATUS 0x0c /* offset of DSP STATUS (r-) */
98 #define DSP_DATAVAIL 0x0e /* offset of DSP DATA AVAILABLE (ro) */
110 unsigned char val = 0; in sc6000_irq_to_softcfg()
114 val = 0x28; in sc6000_irq_to_softcfg()
117 val = 0x8; in sc6000_irq_to_softcfg()
120 val = 0x10; in sc6000_irq_to_softcfg()
123 val = 0x18; in sc6000_irq_to_softcfg()
126 val = 0x20; in sc6000_irq_to_softcfg()
139 unsigned char val = 0; in sc6000_dma_to_softcfg()
142 case 0: in sc6000_dma_to_softcfg()
162 unsigned char val = 0; in sc6000_mpu_irq_to_softcfg()
169 val = 0x44; in sc6000_mpu_irq_to_softcfg()
172 val = 0x84; in sc6000_mpu_irq_to_softcfg()
175 val = 0xc4; in sc6000_mpu_irq_to_softcfg()
186 unsigned char val = 0; in sc6000_wait_data()
190 if (val & 0x80) in sc6000_wait_data()
191 return 0; in sc6000_wait_data()
215 * DSP ready to receive data if bit 7 of val == 0 in sc6000_write()
217 if (!(val & 0x80)) { in sc6000_write()
219 return 0; in sc6000_write()
224 dev_err(devptr, "DSP Command (0x%x) timeout.\n", cmd); in sc6000_write()
233 int len = 0; in sc6000_dsp_get_answer()
236 dev_err(devptr, "CMD 0x%x: failed!\n", command); in sc6000_dsp_get_answer()
243 if (val < 0) in sc6000_dsp_get_answer()
251 * If no more data available, return to the caller, no error if len>0. in sc6000_dsp_get_answer()
261 iowrite8(0, vport + DSP_RESET); in sc6000_dsp_reset()
263 if (sc6000_read(vport) == 0xaa) in sc6000_dsp_reset()
264 return 0; in sc6000_dsp_reset()
272 if (sc6000_write(devptr, vport, COMMAND_6C) < 0) { in sc6000_hw_cfg_write()
273 dev_warn(devptr, "CMD 0x%x: failed!\n", COMMAND_6C); in sc6000_hw_cfg_write()
276 if (sc6000_write(devptr, vport, COMMAND_5C) < 0) { in sc6000_hw_cfg_write()
277 dev_err(devptr, "CMD 0x%x: failed!\n", COMMAND_5C); in sc6000_hw_cfg_write()
280 if (sc6000_write(devptr, vport, cfg[0]) < 0) { in sc6000_hw_cfg_write()
281 dev_err(devptr, "DATA 0x%x: failed!\n", cfg[0]); in sc6000_hw_cfg_write()
284 if (sc6000_write(devptr, vport, cfg[1]) < 0) { in sc6000_hw_cfg_write()
285 dev_err(devptr, "DATA 0x%x: failed!\n", cfg[1]); in sc6000_hw_cfg_write()
288 if (sc6000_write(devptr, vport, COMMAND_C5) < 0) { in sc6000_hw_cfg_write()
289 dev_err(devptr, "CMD 0x%x: failed!\n", COMMAND_C5); in sc6000_hw_cfg_write()
293 return 0; in sc6000_hw_cfg_write()
301 dev_err(devptr, "CMD 0x%x: failed!\n", WRITE_MDIRQ_CFG); in sc6000_cfg_write()
308 return 0; in sc6000_cfg_write()
318 dev_err(devptr, "CMD 0x%x: failed!\n", in sc6000_setup_board()
322 } while ((sc6000_wait_data(vport) < 0) && loop--); in sc6000_setup_board()
324 if (sc6000_read(vport) < 0) { in sc6000_setup_board()
325 dev_err(devptr, "sc6000_read after CMD 0x%x: failed\n", in sc6000_setup_board()
333 return 0; in sc6000_setup_board()
341 dev_err(devptr, "%s [0x%x]: failed!\n", __func__, in sc6000_init_mss()
353 return 0; in sc6000_init_mss()
361 cfg[0] = 0; in sc6000_hw_cfg_encode()
362 cfg[1] = 0; in sc6000_hw_cfg_encode()
363 if (xport == 0x240) in sc6000_hw_cfg_encode()
364 cfg[0] |= 1; in sc6000_hw_cfg_encode()
366 cfg[0] |= (xmpu & 0x30) >> 2; in sc6000_hw_cfg_encode()
367 cfg[1] |= 0x20; in sc6000_hw_cfg_encode()
369 if (xmss_port == 0xe80) in sc6000_hw_cfg_encode()
370 cfg[0] |= 0x10; in sc6000_hw_cfg_encode()
371 cfg[0] |= 0x40; /* always set */ in sc6000_hw_cfg_encode()
373 cfg[0] |= 0x02; in sc6000_hw_cfg_encode()
374 cfg[1] |= 0x80; /* enable WSS system */ in sc6000_hw_cfg_encode()
375 cfg[1] &= ~0x40; /* disable IDE */ in sc6000_hw_cfg_encode()
376 dev_dbg(devptr, "hw cfg %x, %x\n", cfg[0], cfg[1]); in sc6000_hw_cfg_encode()
390 int old = 0; in sc6000_init_board()
393 if (err < 0) { in sc6000_init_board()
398 memset(answer, 0, sizeof(answer)); in sc6000_init_board()
400 if (err <= 0) { in sc6000_init_board()
416 answer, version[0], version[1]); in sc6000_init_board()
420 if (sc6000_read(vport) < 0) in sc6000_init_board()
426 vport, &cfg[0], port[dev], mpu_port[dev], in sc6000_init_board()
428 if (sc6000_hw_cfg_write(devptr, vport, cfg) < 0) { in sc6000_init_board()
434 if (err < 0) { in sc6000_init_board()
443 sc6000_write(devptr, vport, 0x02); in sc6000_init_board()
448 if (err < 0) { in sc6000_init_board()
453 if (err < 0) { in sc6000_init_board()
458 return 0; in sc6000_init_board()
467 memset(&id1, 0, sizeof(id1)); in snd_sc6000_mixer()
468 memset(&id2, 0, sizeof(id2)); in snd_sc6000_mixer()
475 if (err < 0) in snd_sc6000_mixer()
480 if (err < 0) in snd_sc6000_mixer()
486 if (err < 0) in snd_sc6000_mixer()
491 if (err < 0) in snd_sc6000_mixer()
493 return 0; in snd_sc6000_mixer()
499 return 0; in snd_sc6000_match()
502 return 0; in snd_sc6000_match()
506 return 0; in snd_sc6000_match()
508 if (port[dev] != 0x220 && port[dev] != 0x240) { in snd_sc6000_match()
509 dev_err(devptr, "Port must be 0x220 or 0x240\n"); in snd_sc6000_match()
510 return 0; in snd_sc6000_match()
512 if (mss_port[dev] != 0x530 && mss_port[dev] != 0xe80) { in snd_sc6000_match()
513 dev_err(devptr, "MSS port must be 0x530 or 0xe80\n"); in snd_sc6000_match()
514 return 0; in snd_sc6000_match()
518 return 0; in snd_sc6000_match()
522 return 0; in snd_sc6000_match()
525 (mpu_port[dev] & ~0x30L) != 0x300) { in snd_sc6000_match()
528 return 0; in snd_sc6000_match()
531 mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] != 0 && in snd_sc6000_match()
534 return 0; in snd_sc6000_match()
544 sc6000_setup_board(card->dev, vport, 0); in snd_sc6000_free()
550 static const int possible_dmas[] = { 1, 3, 0, -1 }; in __snd_sc6000_probe()
561 0, &card); in __snd_sc6000_probe()
562 if (err < 0) in __snd_sc6000_probe()
567 if (xirq < 0) { in __snd_sc6000_probe()
575 if (xdma < 0) { in __snd_sc6000_probe()
581 if (!devm_request_region(devptr, port[dev], 0x10, DRV_NAME)) { in __snd_sc6000_probe()
585 vport = devm_ioport_map(devptr, port[dev], 0x10); in __snd_sc6000_probe()
604 dev_dbg(devptr, "Initializing BASE[0x%lx] IRQ[%d] DMA[%d] MIRQ[%d]\n", in __snd_sc6000_probe()
606 mpu_irq[dev] == SNDRV_AUTO_IRQ ? 0 : mpu_irq[dev]); in __snd_sc6000_probe()
609 if (err < 0) in __snd_sc6000_probe()
614 WSS_HW_DETECT, 0, &chip); in __snd_sc6000_probe()
615 if (err < 0) in __snd_sc6000_probe()
618 err = snd_wss_pcm(chip, 0); in __snd_sc6000_probe()
619 if (err < 0) { in __snd_sc6000_probe()
624 if (err < 0) { in __snd_sc6000_probe()
629 if (err < 0) { in __snd_sc6000_probe()
634 0x388, 0x388 + 2, in __snd_sc6000_probe()
635 OPL3_HW_AUTO, 0, &opl3) < 0) { in __snd_sc6000_probe()
636 dev_err(devptr, "no OPL device at 0x%x-0x%x ?\n", in __snd_sc6000_probe()
637 0x388, 0x388 + 2); in __snd_sc6000_probe()
639 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); in __snd_sc6000_probe()
640 if (err < 0) in __snd_sc6000_probe()
647 if (snd_mpu401_uart_new(card, 0, in __snd_sc6000_probe()
649 mpu_port[dev], 0, in __snd_sc6000_probe()
650 mpu_irq[dev], NULL) < 0) in __snd_sc6000_probe()
651 dev_err(devptr, "no MPU-401 device at 0x%lx ?\n", in __snd_sc6000_probe()
657 sprintf(card->longname, "Gallant SC-6000 at 0x%lx, irq %d, dma %d", in __snd_sc6000_probe()
661 if (err < 0) in __snd_sc6000_probe()
665 return 0; in __snd_sc6000_probe()