Lines Matching +full:0 +full:x240
36 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
39 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */
41 static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */
43 /* 0x300, 0x310, 0x320, 0x330 */
44 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 0 */
45 static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0, 1, 3 */
46 static bool joystick[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = false };
73 #define WRITE_MDIRQ_CFG 0x50 /* Set M&I&DRQ mask (the real config) */
74 #define COMMAND_52 0x52 /* */
75 #define READ_HARD_CFG 0x58 /* Read Hardware Config (I/O base etc) */
76 #define COMMAND_5C 0x5c /* */
77 #define COMMAND_60 0x60 /* */
78 #define COMMAND_66 0x66 /* */
79 #define COMMAND_6C 0x6c /* */
80 #define COMMAND_6E 0x6e /* */
81 #define COMMAND_88 0x88 /* Unknown command */
82 #define DSP_INIT_MSS 0x8c /* Enable Microsoft Sound System mode */
83 #define COMMAND_C5 0xc5 /* */
84 #define GET_DSP_VERSION 0xe1 /* Get DSP Version */
85 #define GET_DSP_COPYRIGHT 0xe3 /* Get DSP Copyright */
96 #define DSP_RESET 0x06 /* offset of DSP RESET (wo) */
97 #define DSP_READ 0x0a /* offset of DSP READ (ro) */
98 #define DSP_WRITE 0x0c /* offset of DSP WRITE (w-) */
99 #define DSP_COMMAND 0x0c /* offset of DSP COMMAND (w-) */
100 #define DSP_STATUS 0x0c /* offset of DSP STATUS (r-) */
101 #define DSP_DATAVAIL 0x0e /* offset of DSP DATA AVAILABLE (ro) */
113 unsigned char val = 0; in sc6000_irq_to_softcfg()
117 val = 0x28; in sc6000_irq_to_softcfg()
120 val = 0x8; in sc6000_irq_to_softcfg()
123 val = 0x10; in sc6000_irq_to_softcfg()
126 val = 0x18; in sc6000_irq_to_softcfg()
129 val = 0x20; in sc6000_irq_to_softcfg()
142 unsigned char val = 0; in sc6000_dma_to_softcfg()
145 case 0: in sc6000_dma_to_softcfg()
165 unsigned char val = 0; in sc6000_mpu_irq_to_softcfg()
172 val = 0x44; in sc6000_mpu_irq_to_softcfg()
175 val = 0x84; in sc6000_mpu_irq_to_softcfg()
178 val = 0xc4; in sc6000_mpu_irq_to_softcfg()
189 unsigned char val = 0; in sc6000_wait_data()
193 if (val & 0x80) in sc6000_wait_data()
194 return 0; in sc6000_wait_data()
218 * DSP ready to receive data if bit 7 of val == 0 in sc6000_write()
220 if (!(val & 0x80)) { in sc6000_write()
222 return 0; in sc6000_write()
227 snd_printk(KERN_ERR "DSP Command (0x%x) timeout.\n", cmd); in sc6000_write()
235 int len = 0; in sc6000_dsp_get_answer()
238 snd_printk(KERN_ERR "CMD 0x%x: failed!\n", command); in sc6000_dsp_get_answer()
245 if (val < 0) in sc6000_dsp_get_answer()
253 * If no more data available, return to the caller, no error if len>0. in sc6000_dsp_get_answer()
263 iowrite8(0, vport + DSP_RESET); in sc6000_dsp_reset()
265 if (sc6000_read(vport) == 0xaa) in sc6000_dsp_reset()
266 return 0; in sc6000_dsp_reset()
273 if (sc6000_write(vport, COMMAND_6C) < 0) { in sc6000_hw_cfg_write()
274 snd_printk(KERN_WARNING "CMD 0x%x: failed!\n", COMMAND_6C); in sc6000_hw_cfg_write()
277 if (sc6000_write(vport, COMMAND_5C) < 0) { in sc6000_hw_cfg_write()
278 snd_printk(KERN_ERR "CMD 0x%x: failed!\n", COMMAND_5C); in sc6000_hw_cfg_write()
281 if (sc6000_write(vport, cfg[0]) < 0) { in sc6000_hw_cfg_write()
282 snd_printk(KERN_ERR "DATA 0x%x: failed!\n", cfg[0]); in sc6000_hw_cfg_write()
285 if (sc6000_write(vport, cfg[1]) < 0) { in sc6000_hw_cfg_write()
286 snd_printk(KERN_ERR "DATA 0x%x: failed!\n", cfg[1]); in sc6000_hw_cfg_write()
289 if (sc6000_write(vport, COMMAND_C5) < 0) { in sc6000_hw_cfg_write()
290 snd_printk(KERN_ERR "CMD 0x%x: failed!\n", COMMAND_C5); in sc6000_hw_cfg_write()
294 return 0; in sc6000_hw_cfg_write()
301 snd_printk(KERN_ERR "CMD 0x%x: failed!\n", WRITE_MDIRQ_CFG); in sc6000_cfg_write()
308 return 0; in sc6000_cfg_write()
317 snd_printk(KERN_ERR "CMD 0x%x: failed!\n", in sc6000_setup_board()
321 } while ((sc6000_wait_data(vport) < 0) && loop--); in sc6000_setup_board()
323 if (sc6000_read(vport) < 0) { in sc6000_setup_board()
324 snd_printk(KERN_ERR "sc6000_read after CMD 0x%x: failed\n", in sc6000_setup_board()
332 return 0; in sc6000_setup_board()
339 snd_printk(KERN_ERR "sc6000_init_mss [0x%x]: failed!\n", in sc6000_init_mss()
351 return 0; in sc6000_init_mss()
358 cfg[0] = 0; in sc6000_hw_cfg_encode()
359 cfg[1] = 0; in sc6000_hw_cfg_encode()
360 if (xport == 0x240) in sc6000_hw_cfg_encode()
361 cfg[0] |= 1; in sc6000_hw_cfg_encode()
363 cfg[0] |= (xmpu & 0x30) >> 2; in sc6000_hw_cfg_encode()
364 cfg[1] |= 0x20; in sc6000_hw_cfg_encode()
366 if (xmss_port == 0xe80) in sc6000_hw_cfg_encode()
367 cfg[0] |= 0x10; in sc6000_hw_cfg_encode()
368 cfg[0] |= 0x40; /* always set */ in sc6000_hw_cfg_encode()
370 cfg[0] |= 0x02; in sc6000_hw_cfg_encode()
371 cfg[1] |= 0x80; /* enable WSS system */ in sc6000_hw_cfg_encode()
372 cfg[1] &= ~0x40; /* disable IDE */ in sc6000_hw_cfg_encode()
373 snd_printd("hw cfg %x, %x\n", cfg[0], cfg[1]); in sc6000_hw_cfg_encode()
386 int old = 0; in sc6000_init_board()
389 if (err < 0) { in sc6000_init_board()
394 memset(answer, 0, sizeof(answer)); in sc6000_init_board()
396 if (err <= 0) { in sc6000_init_board()
412 answer, version[0], version[1]); in sc6000_init_board()
416 if (sc6000_read(vport) < 0) in sc6000_init_board()
421 sc6000_hw_cfg_encode(vport, &cfg[0], port[dev], mpu_port[dev], in sc6000_init_board()
423 if (sc6000_hw_cfg_write(vport, cfg) < 0) { in sc6000_init_board()
429 if (err < 0) { in sc6000_init_board()
438 sc6000_write(vport, 0x02); in sc6000_init_board()
443 if (err < 0) { in sc6000_init_board()
448 if (err < 0) { in sc6000_init_board()
454 return 0; in sc6000_init_board()
463 memset(&id1, 0, sizeof(id1)); in snd_sc6000_mixer()
464 memset(&id2, 0, sizeof(id2)); in snd_sc6000_mixer()
471 if (err < 0) in snd_sc6000_mixer()
476 if (err < 0) in snd_sc6000_mixer()
482 if (err < 0) in snd_sc6000_mixer()
487 if (err < 0) in snd_sc6000_mixer()
489 return 0; in snd_sc6000_mixer()
495 return 0; in snd_sc6000_match()
498 return 0; in snd_sc6000_match()
502 return 0; in snd_sc6000_match()
504 if (port[dev] != 0x220 && port[dev] != 0x240) { in snd_sc6000_match()
505 printk(KERN_ERR PFX "Port must be 0x220 or 0x240\n"); in snd_sc6000_match()
506 return 0; in snd_sc6000_match()
508 if (mss_port[dev] != 0x530 && mss_port[dev] != 0xe80) { in snd_sc6000_match()
509 printk(KERN_ERR PFX "MSS port must be 0x530 or 0xe80\n"); in snd_sc6000_match()
510 return 0; in snd_sc6000_match()
514 return 0; in snd_sc6000_match()
518 return 0; in snd_sc6000_match()
521 (mpu_port[dev] & ~0x30L) != 0x300) { in snd_sc6000_match()
524 return 0; in snd_sc6000_match()
527 mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] != 0 && in snd_sc6000_match()
530 return 0; in snd_sc6000_match()
538 static const int possible_dmas[] = { 1, 3, 0, -1 }; in snd_sc6000_probe()
551 if (err < 0) in snd_sc6000_probe()
557 if (xirq < 0) { in snd_sc6000_probe()
566 if (xdma < 0) { in snd_sc6000_probe()
573 if (!request_region(port[dev], 0x10, DRV_NAME)) { in snd_sc6000_probe()
579 *vport = devm_ioport_map(devptr, port[dev], 0x10); in snd_sc6000_probe()
602 snd_printd("Initializing BASE[0x%lx] IRQ[%d] DMA[%d] MIRQ[%d]\n", in snd_sc6000_probe()
604 mpu_irq[dev] == SNDRV_AUTO_IRQ ? 0 : mpu_irq[dev]); in snd_sc6000_probe()
607 if (err < 0) in snd_sc6000_probe()
611 WSS_HW_DETECT, 0, &chip); in snd_sc6000_probe()
612 if (err < 0) in snd_sc6000_probe()
615 err = snd_wss_pcm(chip, 0); in snd_sc6000_probe()
616 if (err < 0) { in snd_sc6000_probe()
622 if (err < 0) { in snd_sc6000_probe()
627 if (err < 0) { in snd_sc6000_probe()
632 0x388, 0x388 + 2, in snd_sc6000_probe()
633 OPL3_HW_AUTO, 0, &opl3) < 0) { in snd_sc6000_probe()
634 snd_printk(KERN_ERR PFX "no OPL device at 0x%x-0x%x ?\n", in snd_sc6000_probe()
635 0x388, 0x388 + 2); in snd_sc6000_probe()
637 err = snd_opl3_hwdep_new(opl3, 0, 1, NULL); in snd_sc6000_probe()
638 if (err < 0) in snd_sc6000_probe()
645 if (snd_mpu401_uart_new(card, 0, in snd_sc6000_probe()
647 mpu_port[dev], 0, in snd_sc6000_probe()
648 mpu_irq[dev], NULL) < 0) in snd_sc6000_probe()
649 snd_printk(KERN_ERR "no MPU-401 device at 0x%lx ?\n", in snd_sc6000_probe()
655 sprintf(card->longname, "Gallant SC-6000 at 0x%lx, irq %d, dma %d", in snd_sc6000_probe()
659 if (err < 0) in snd_sc6000_probe()
663 return 0; in snd_sc6000_probe()
666 sc6000_setup_board(*vport, 0); in snd_sc6000_probe()
669 release_region(port[dev], 0x10); in snd_sc6000_probe()
680 if (sc6000_setup_board(*vport, 0) < 0) in snd_sc6000_remove()
683 release_region(port[dev], 0x10); in snd_sc6000_remove()
687 return 0; in snd_sc6000_remove()