Lines Matching +full:0 +full:xb2

29 		if ((inb(ES1688P(chip, STATUS)) & 0x80) == 0) {  in snd_es1688_dsp_command()
34 printk(KERN_DEBUG "snd_es1688_dsp_command: timeout (0x%x)\n", val); in snd_es1688_dsp_command()
36 return 0; in snd_es1688_dsp_command()
44 if (inb(ES1688P(chip, DATA_AVAIL)) & 0x80) in snd_es1688_dsp_get_byte()
46 …snd_printd("es1688 get byte failed: 0x%lx = 0x%x!!!\n", ES1688P(chip, DATA_AVAIL), inb(ES1688P(chi… in snd_es1688_dsp_get_byte()
54 return 0; in snd_es1688_write()
61 if (!snd_es1688_dsp_command(chip, 0xc0)) in snd_es1688_read()
94 outb(0, ES1688P(chip, RESET)); in snd_es1688_reset()
96 for (i = 0; i < 1000 && !(inb(ES1688P(chip, DATA_AVAIL)) & 0x80); i++); in snd_es1688_reset()
97 if (inb(ES1688P(chip, READ)) != 0xaa) { in snd_es1688_reset()
98 snd_printd("ess_reset at 0x%lx: failed!!!\n", chip->port); in snd_es1688_reset()
101 snd_es1688_dsp_command(chip, 0xc6); /* enable extended mode */ in snd_es1688_reset()
102 return 0; in snd_es1688_reset()
129 if (snd_es1688_reset(chip) < 0) { in snd_es1688_probe()
130 snd_printdd("ESS: [0x%lx] reset failed... 0x%x\n", chip->port, inb(ES1688P(chip, READ))); in snd_es1688_probe()
134 snd_es1688_dsp_command(chip, 0xe7); /* return identification */ in snd_es1688_probe()
136 for (i = 1000, major = minor = 0; i; i--) { in snd_es1688_probe()
137 if (inb(ES1688P(chip, DATA_AVAIL)) & 0x80) { in snd_es1688_probe()
138 if (major == 0) { in snd_es1688_probe()
148 snd_printdd("ESS: [0x%lx] found.. major = 0x%x, minor = 0x%x\n", chip->port, major, minor); in snd_es1688_probe()
154 switch (chip->version & 0xfff0) { in snd_es1688_probe()
155 case 0x4880: in snd_es1688_probe()
156 snd_printk(KERN_ERR "[0x%lx] ESS: AudioDrive ES488 detected, " in snd_es1688_probe()
159 case 0x6880: in snd_es1688_probe()
162 snd_printk(KERN_ERR "[0x%lx] ESS: unknown AudioDrive chip " in snd_es1688_probe()
163 "with version 0x%x (Jazz16 soundcard?)\n", in snd_es1688_probe()
169 snd_es1688_write(chip, 0xb1, 0x10); /* disable IRQ */ in snd_es1688_probe()
170 snd_es1688_write(chip, 0xb2, 0x00); /* disable DMA */ in snd_es1688_probe()
175 snd_es1688_mixer_write(chip, 0x40, 0x01); in snd_es1688_probe()
178 return 0; in snd_es1688_probe()
183 static const int irqs[16] = {-1, -1, 0, -1, -1, 1, -1, 2, -1, 0, 3, -1, -1, -1, -1, -1}; in snd_es1688_init()
188 cfg = 0x01; /* enable joystick, but disable OPL3 */ in snd_es1688_init()
189 if (enable && chip->mpu_port >= 0x300 && chip->mpu_irq > 0 && chip->hardware != ES1688_HW_688) { in snd_es1688_init()
190 tmp = (chip->mpu_port & 0x0f0) >> 4; in snd_es1688_init()
206 tmp1 = 0; in snd_es1688_init()
213 #if 0 in snd_es1688_init()
214 snd_printk(KERN_DEBUG "mpu cfg = 0x%x\n", cfg); in snd_es1688_init()
217 snd_es1688_mixer_write(chip, 0x40, cfg); in snd_es1688_init()
221 snd_es1688_read(chip, 0xb1); in snd_es1688_init()
222 snd_es1688_read(chip, 0xb2); in snd_es1688_init()
225 cfg = 0xf0; /* enable only DMA counter interrupt */ in snd_es1688_init()
226 irq_bits = irqs[chip->irq & 0x0f]; in snd_es1688_init()
227 if (irq_bits < 0) { in snd_es1688_init()
228 snd_printk(KERN_ERR "[0x%lx] ESS: bad IRQ %d " in snd_es1688_init()
231 #if 0 in snd_es1688_init()
232 irq_bits = 0; in snd_es1688_init()
233 cfg = 0x10; in snd_es1688_init()
238 snd_es1688_write(chip, 0xb1, cfg | (irq_bits << 2)); in snd_es1688_init()
240 cfg = 0xf0; /* extended mode DMA enable */ in snd_es1688_init()
243 snd_printk(KERN_ERR "[0x%lx] ESS: bad DMA channel %d " in snd_es1688_init()
245 #if 0 in snd_es1688_init()
246 dma_bits = 0; in snd_es1688_init()
247 cfg = 0x00; /* disable all DMA */ in snd_es1688_init()
256 snd_es1688_write(chip, 0xb2, cfg | (dma_bits << 2)); in snd_es1688_init()
260 snd_es1688_write(chip, 0xb1, 0x10); /* disable IRQ */ in snd_es1688_init()
261 snd_es1688_write(chip, 0xb2, 0x00); /* disable DMA */ in snd_es1688_init()
265 snd_es1688_read(chip, 0xb1); in snd_es1688_init()
266 snd_es1688_read(chip, 0xb2); in snd_es1688_init()
269 return 0; in snd_es1688_init()
301 if (runtime->rate_num == clocks[0].num) in snd_es1688_set_rate()
308 snd_es1688_write(chip, 0xa1, bits); in snd_es1688_set_rate()
309 snd_es1688_write(chip, 0xa2, divider); in snd_es1688_set_rate()
317 value = 0x00; in snd_es1688_trigger()
323 val = snd_es1688_read(chip, 0xb8); in snd_es1688_trigger()
324 if ((val < 0) || (val & 0x0f) == value) { in snd_es1688_trigger()
328 #if 0 in snd_es1688_trigger()
329 printk(KERN_DEBUG "trigger: val = 0x%x, value = 0x%x\n", val, value); in snd_es1688_trigger()
330 printk(KERN_DEBUG "trigger: pointer = 0x%x\n", in snd_es1688_trigger()
333 snd_es1688_write(chip, 0xb8, (val & 0xf0) | value); in snd_es1688_trigger()
335 return 0; in snd_es1688_trigger()
350 snd_es1688_write(chip, 0xb8, 4); /* auto init DMA mode */ in snd_es1688_playback_prepare()
351 snd_es1688_write(chip, 0xa8, (snd_es1688_read(chip, 0xa8) & ~0x03) | (3 - runtime->channels)); in snd_es1688_playback_prepare()
352 snd_es1688_write(chip, 0xb9, 2); /* demand mode (4 bytes/request) */ in snd_es1688_playback_prepare()
356 snd_es1688_write(chip, 0xb6, 0x80); in snd_es1688_playback_prepare()
357 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_playback_prepare()
358 snd_es1688_write(chip, 0xb7, 0xd0); in snd_es1688_playback_prepare()
361 snd_es1688_write(chip, 0xb6, 0x00); in snd_es1688_playback_prepare()
362 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_playback_prepare()
363 snd_es1688_write(chip, 0xb7, 0xf4); in snd_es1688_playback_prepare()
368 snd_es1688_write(chip, 0xb6, 0x80); in snd_es1688_playback_prepare()
369 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_playback_prepare()
370 snd_es1688_write(chip, 0xb7, 0x98); in snd_es1688_playback_prepare()
373 snd_es1688_write(chip, 0xb6, 0x00); in snd_es1688_playback_prepare()
374 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_playback_prepare()
375 snd_es1688_write(chip, 0xb7, 0xbc); in snd_es1688_playback_prepare()
378 snd_es1688_write(chip, 0xb1, (snd_es1688_read(chip, 0xb1) & 0x0f) | 0x50); in snd_es1688_playback_prepare()
379 snd_es1688_write(chip, 0xb2, (snd_es1688_read(chip, 0xb2) & 0x0f) | 0x50); in snd_es1688_playback_prepare()
386 snd_es1688_write(chip, 0xa4, (unsigned char) count); in snd_es1688_playback_prepare()
387 snd_es1688_write(chip, 0xa5, (unsigned char) (count >> 8)); in snd_es1688_playback_prepare()
389 return 0; in snd_es1688_playback_prepare()
396 return snd_es1688_trigger(chip, cmd, 0x05); in snd_es1688_playback_trigger()
412 snd_es1688_write(chip, 0xb8, 0x0e); /* auto init DMA mode */ in snd_es1688_capture_prepare()
413 snd_es1688_write(chip, 0xa8, (snd_es1688_read(chip, 0xa8) & ~0x03) | (3 - runtime->channels)); in snd_es1688_capture_prepare()
414 snd_es1688_write(chip, 0xb9, 2); /* demand mode (4 bytes/request) */ in snd_es1688_capture_prepare()
418 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_capture_prepare()
419 snd_es1688_write(chip, 0xb7, 0xd0); in snd_es1688_capture_prepare()
422 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_capture_prepare()
423 snd_es1688_write(chip, 0xb7, 0xf4); in snd_es1688_capture_prepare()
428 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_capture_prepare()
429 snd_es1688_write(chip, 0xb7, 0x98); in snd_es1688_capture_prepare()
432 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_capture_prepare()
433 snd_es1688_write(chip, 0xb7, 0xbc); in snd_es1688_capture_prepare()
436 snd_es1688_write(chip, 0xb1, (snd_es1688_read(chip, 0xb1) & 0x0f) | 0x50); in snd_es1688_capture_prepare()
437 snd_es1688_write(chip, 0xb2, (snd_es1688_read(chip, 0xb2) & 0x0f) | 0x50); in snd_es1688_capture_prepare()
443 snd_es1688_write(chip, 0xa4, (unsigned char) count); in snd_es1688_capture_prepare()
444 snd_es1688_write(chip, 0xa5, (unsigned char) (count >> 8)); in snd_es1688_capture_prepare()
446 return 0; in snd_es1688_capture_prepare()
453 return snd_es1688_trigger(chip, cmd, 0x0f); in snd_es1688_capture_trigger()
460 if (chip->trigger_value == 0x05) /* ok.. playback is active */ in snd_es1688_interrupt()
462 if (chip->trigger_value == 0x0f) /* ok.. capture is active */ in snd_es1688_interrupt()
474 if (chip->trigger_value != 0x05) in snd_es1688_playback_pointer()
475 return 0; in snd_es1688_playback_pointer()
485 if (chip->trigger_value != 0x0f) in snd_es1688_capture_pointer()
486 return 0; in snd_es1688_capture_pointer()
510 .fifo_size = 0,
528 .fifo_size = 0,
544 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in snd_es1688_playback_open()
546 return 0; in snd_es1688_playback_open()
558 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in snd_es1688_capture_open()
560 return 0; in snd_es1688_capture_open()
568 return 0; in snd_es1688_playback_close()
576 return 0; in snd_es1688_capture_close()
582 snd_es1688_init(chip, 0); in snd_es1688_free()
584 if (chip->irq >= 0) in snd_es1688_free()
586 if (chip->dma8 >= 0) { in snd_es1688_free()
590 return 0; in snd_es1688_free()
602 sprintf(tmp, "ES%s688 rev %i", chip->hardware == ES1688_HW_688 ? "" : "1", chip->version & 0x0f); in snd_es1688_chip_id()
629 snd_printk(KERN_ERR "es1688: can't grab port 0x%lx\n", port + 4); in snd_es1688_create()
634 err = request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip); in snd_es1688_create()
635 if (err < 0) { in snd_es1688_create()
644 if (err < 0) { in snd_es1688_create()
653 mpu_port &= ~0x000f; in snd_es1688_create()
654 if (mpu_port < 0x300 || mpu_port > 0x330) in snd_es1688_create()
655 mpu_port = 0; in snd_es1688_create()
661 if (err < 0) in snd_es1688_create()
665 if (err < 0) in snd_es1688_create()
698 if (err < 0) in snd_es1688_pcm()
711 return 0; in snd_es1688_pcm()
731 ucontrol->value.enumerated.item[0] = snd_es1688_mixer_read(chip, ES1688_REC_DEV) & 7; in snd_es1688_get_mux()
732 return 0; in snd_es1688_get_mux()
742 if (ucontrol->value.enumerated.item[0] > 8) in snd_es1688_put_mux()
746 nval = (ucontrol->value.enumerated.item[0] & 7) | (oval & ~15); in snd_es1688_put_mux()
762 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_es1688_info_single()
766 uinfo->value.integer.min = 0; in snd_es1688_info_single()
768 return 0; in snd_es1688_info_single()
775 int reg = kcontrol->private_value & 0xff; in snd_es1688_get_single()
776 int shift = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_get_single()
777 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_es1688_get_single()
778 int invert = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_get_single()
781 ucontrol->value.integer.value[0] = (snd_es1688_mixer_read(chip, reg) >> shift) & mask; in snd_es1688_get_single()
784 ucontrol->value.integer.value[0] = mask - ucontrol->value.integer.value[0]; in snd_es1688_get_single()
785 return 0; in snd_es1688_get_single()
792 int reg = kcontrol->private_value & 0xff; in snd_es1688_put_single()
793 int shift = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_put_single()
794 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_es1688_put_single()
795 int invert = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_put_single()
799 nval = (ucontrol->value.integer.value[0] & mask); in snd_es1688_put_single()
821 int mask = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_info_double()
825 uinfo->value.integer.min = 0; in snd_es1688_info_double()
827 return 0; in snd_es1688_info_double()
834 int left_reg = kcontrol->private_value & 0xff; in snd_es1688_get_double()
835 int right_reg = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_get_double()
836 int shift_left = (kcontrol->private_value >> 16) & 0x07; in snd_es1688_get_double()
837 int shift_right = (kcontrol->private_value >> 19) & 0x07; in snd_es1688_get_double()
838 int mask = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_get_double()
843 if (left_reg < 0xa0) in snd_es1688_get_double()
848 if (right_reg < 0xa0) in snd_es1688_get_double()
855 ucontrol->value.integer.value[0] = (left >> shift_left) & mask; in snd_es1688_get_double()
858 ucontrol->value.integer.value[0] = mask - ucontrol->value.integer.value[0]; in snd_es1688_get_double()
861 return 0; in snd_es1688_get_double()
868 int left_reg = kcontrol->private_value & 0xff; in snd_es1688_put_double()
869 int right_reg = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_put_double()
870 int shift_left = (kcontrol->private_value >> 16) & 0x07; in snd_es1688_put_double()
871 int shift_right = (kcontrol->private_value >> 19) & 0x07; in snd_es1688_put_double()
872 int mask = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_put_double()
877 val1 = ucontrol->value.integer.value[0] & mask; in snd_es1688_put_double()
887 if (left_reg < 0xa0) in snd_es1688_put_double()
891 if (right_reg < 0xa0) in snd_es1688_put_double()
899 if (left_reg < 0xa0) in snd_es1688_put_double()
903 if (right_reg < 0xa0) in snd_es1688_put_double()
909 if (left_reg < 0xa0) in snd_es1688_put_double()
916 if (left_reg < 0xa0) in snd_es1688_put_double()
928 ES1688_DOUBLE("Master Playback Volume", 0, ES1688_MASTER_DEV, ES1688_MASTER_DEV, 4, 0, 15, 0),
929 ES1688_DOUBLE("PCM Playback Volume", 0, ES1688_PCM_DEV, ES1688_PCM_DEV, 4, 0, 15, 0),
930 ES1688_DOUBLE("Line Playback Volume", 0, ES1688_LINE_DEV, ES1688_LINE_DEV, 4, 0, 15, 0),
931 ES1688_DOUBLE("CD Playback Volume", 0, ES1688_CD_DEV, ES1688_CD_DEV, 4, 0, 15, 0),
932 ES1688_DOUBLE("FM Playback Volume", 0, ES1688_FM_DEV, ES1688_FM_DEV, 4, 0, 15, 0),
933 ES1688_DOUBLE("Mic Playback Volume", 0, ES1688_MIC_DEV, ES1688_MIC_DEV, 4, 0, 15, 0),
934 ES1688_DOUBLE("Aux Playback Volume", 0, ES1688_AUX_DEV, ES1688_AUX_DEV, 4, 0, 15, 0),
935 ES1688_SINGLE("Beep Playback Volume", 0, ES1688_SPEAKER_DEV, 0, 7, 0),
936 ES1688_DOUBLE("Capture Volume", 0, ES1688_RECLEV_DEV, ES1688_RECLEV_DEV, 4, 0, 15, 0),
937 ES1688_SINGLE("Capture Switch", 0, ES1688_REC_DEV, 4, 1, 1),
950 { ES1688_MASTER_DEV, 0 },
951 { ES1688_PCM_DEV, 0 },
952 { ES1688_LINE_DEV, 0 },
953 { ES1688_CD_DEV, 0 },
954 { ES1688_FM_DEV, 0 },
955 { ES1688_MIC_DEV, 0 },
956 { ES1688_AUX_DEV, 0 },
957 { ES1688_SPEAKER_DEV, 0 },
958 { ES1688_RECLEV_DEV, 0 },
959 { ES1688_REC_DEV, 0x17 }
973 for (idx = 0; idx < ARRAY_SIZE(snd_es1688_controls); idx++) { in snd_es1688_mixer()
975 if (err < 0) in snd_es1688_mixer()
978 for (idx = 0; idx < ES1688_INIT_TABLE_SIZE; idx++) { in snd_es1688_mixer()
979 reg = snd_es1688_init_table[idx][0]; in snd_es1688_mixer()
981 if (reg < 0xa0) in snd_es1688_mixer()
986 return 0; in snd_es1688_mixer()