Lines Matching +full:0 +full:xb2
29 if ((inb(ES1688P(chip, STATUS)) & 0x80) == 0) { in snd_es1688_dsp_command()
33 dev_dbg(chip->card->dev, "%s: timeout (0x%x)\n", __func__, val); in snd_es1688_dsp_command()
34 return 0; in snd_es1688_dsp_command()
42 if (inb(ES1688P(chip, DATA_AVAIL)) & 0x80) in snd_es1688_dsp_get_byte()
44 dev_dbg(chip->card->dev, "es1688 get byte failed: 0x%lx = 0x%x!!!\n", in snd_es1688_dsp_get_byte()
53 return 0; in snd_es1688_write()
60 if (!snd_es1688_dsp_command(chip, 0xc0)) in snd_es1688_read()
93 outb(0, ES1688P(chip, RESET)); in snd_es1688_reset()
95 for (i = 0; i < 1000 && !(inb(ES1688P(chip, DATA_AVAIL)) & 0x80); i++); in snd_es1688_reset()
96 if (inb(ES1688P(chip, READ)) != 0xaa) { in snd_es1688_reset()
97 dev_dbg(chip->card->dev, "ess_reset at 0x%lx: failed!!!\n", 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 dev_dbg(chip->card->dev, "ESS: [0x%lx] reset failed... 0x%x\n", in snd_es1688_probe()
135 snd_es1688_dsp_command(chip, 0xe7); /* return identification */ in snd_es1688_probe()
137 for (i = 1000, major = minor = 0; i; i--) { in snd_es1688_probe()
138 if (inb(ES1688P(chip, DATA_AVAIL)) & 0x80) { in snd_es1688_probe()
139 if (major == 0) { in snd_es1688_probe()
150 "ESS: [0x%lx] found.. major = 0x%x, minor = 0x%x\n", in snd_es1688_probe()
157 switch (chip->version & 0xfff0) { in snd_es1688_probe()
158 case 0x4880: in snd_es1688_probe()
160 "[0x%lx] ESS: AudioDrive ES488 detected, but driver is in another place\n", in snd_es1688_probe()
163 case 0x6880: in snd_es1688_probe()
167 "[0x%lx] ESS: unknown AudioDrive chip with version 0x%x (Jazz16 soundcard?)\n", in snd_es1688_probe()
173 snd_es1688_write(chip, 0xb1, 0x10); /* disable IRQ */ in snd_es1688_probe()
174 snd_es1688_write(chip, 0xb2, 0x00); /* disable DMA */ in snd_es1688_probe()
179 snd_es1688_mixer_write(chip, 0x40, 0x01); in snd_es1688_probe()
182 return 0; in snd_es1688_probe()
187 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()
192 cfg = 0x01; /* enable joystick, but disable OPL3 */ in snd_es1688_init()
193 if (enable && chip->mpu_port >= 0x300 && chip->mpu_irq > 0 && chip->hardware != ES1688_HW_688) { in snd_es1688_init()
194 tmp = (chip->mpu_port & 0x0f0) >> 4; in snd_es1688_init()
210 tmp1 = 0; in snd_es1688_init()
218 snd_es1688_mixer_write(chip, 0x40, cfg); in snd_es1688_init()
222 snd_es1688_read(chip, 0xb1); in snd_es1688_init()
223 snd_es1688_read(chip, 0xb2); in snd_es1688_init()
226 cfg = 0xf0; /* enable only DMA counter interrupt */ in snd_es1688_init()
227 irq_bits = irqs[chip->irq & 0x0f]; in snd_es1688_init()
228 if (irq_bits < 0) { in snd_es1688_init()
230 "[0x%lx] ESS: bad IRQ %d for ES1688 chip!!\n", in snd_es1688_init()
232 #if 0 in snd_es1688_init()
233 irq_bits = 0; in snd_es1688_init()
234 cfg = 0x10; in snd_es1688_init()
239 snd_es1688_write(chip, 0xb1, cfg | (irq_bits << 2)); in snd_es1688_init()
241 cfg = 0xf0; /* extended mode DMA enable */ in snd_es1688_init()
245 "[0x%lx] ESS: bad DMA channel %d for ES1688 chip!!\n", in snd_es1688_init()
247 #if 0 in snd_es1688_init()
248 dma_bits = 0; in snd_es1688_init()
249 cfg = 0x00; /* disable all DMA */ in snd_es1688_init()
258 snd_es1688_write(chip, 0xb2, cfg | (dma_bits << 2)); in snd_es1688_init()
262 snd_es1688_write(chip, 0xb1, 0x10); /* disable IRQ */ in snd_es1688_init()
263 snd_es1688_write(chip, 0xb2, 0x00); /* disable DMA */ in snd_es1688_init()
267 snd_es1688_read(chip, 0xb1); in snd_es1688_init()
268 snd_es1688_read(chip, 0xb2); in snd_es1688_init()
271 return 0; in snd_es1688_init()
303 if (runtime->rate_num == clocks[0].num) in snd_es1688_set_rate()
310 snd_es1688_write(chip, 0xa1, bits); in snd_es1688_set_rate()
311 snd_es1688_write(chip, 0xa2, divider); in snd_es1688_set_rate()
319 value = 0x00; in snd_es1688_trigger()
325 val = snd_es1688_read(chip, 0xb8); in snd_es1688_trigger()
326 if ((val < 0) || (val & 0x0f) == value) { in snd_es1688_trigger()
330 #if 0 in snd_es1688_trigger()
331 dev_dbg(chip->card->dev, "trigger: val = 0x%x, value = 0x%x\n", val, value); in snd_es1688_trigger()
332 dev_dbg(chip->card->dev, "trigger: pointer = 0x%x\n", in snd_es1688_trigger()
335 snd_es1688_write(chip, 0xb8, (val & 0xf0) | value); in snd_es1688_trigger()
337 return 0; in snd_es1688_trigger()
352 snd_es1688_write(chip, 0xb8, 4); /* auto init DMA mode */ in snd_es1688_playback_prepare()
353 snd_es1688_write(chip, 0xa8, (snd_es1688_read(chip, 0xa8) & ~0x03) | (3 - runtime->channels)); in snd_es1688_playback_prepare()
354 snd_es1688_write(chip, 0xb9, 2); /* demand mode (4 bytes/request) */ in snd_es1688_playback_prepare()
358 snd_es1688_write(chip, 0xb6, 0x80); in snd_es1688_playback_prepare()
359 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_playback_prepare()
360 snd_es1688_write(chip, 0xb7, 0xd0); in snd_es1688_playback_prepare()
363 snd_es1688_write(chip, 0xb6, 0x00); in snd_es1688_playback_prepare()
364 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_playback_prepare()
365 snd_es1688_write(chip, 0xb7, 0xf4); in snd_es1688_playback_prepare()
370 snd_es1688_write(chip, 0xb6, 0x80); in snd_es1688_playback_prepare()
371 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_playback_prepare()
372 snd_es1688_write(chip, 0xb7, 0x98); in snd_es1688_playback_prepare()
375 snd_es1688_write(chip, 0xb6, 0x00); in snd_es1688_playback_prepare()
376 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_playback_prepare()
377 snd_es1688_write(chip, 0xb7, 0xbc); in snd_es1688_playback_prepare()
380 snd_es1688_write(chip, 0xb1, (snd_es1688_read(chip, 0xb1) & 0x0f) | 0x50); in snd_es1688_playback_prepare()
381 snd_es1688_write(chip, 0xb2, (snd_es1688_read(chip, 0xb2) & 0x0f) | 0x50); in snd_es1688_playback_prepare()
388 snd_es1688_write(chip, 0xa4, (unsigned char) count); in snd_es1688_playback_prepare()
389 snd_es1688_write(chip, 0xa5, (unsigned char) (count >> 8)); in snd_es1688_playback_prepare()
391 return 0; in snd_es1688_playback_prepare()
398 return snd_es1688_trigger(chip, cmd, 0x05); in snd_es1688_playback_trigger()
414 snd_es1688_write(chip, 0xb8, 0x0e); /* auto init DMA mode */ in snd_es1688_capture_prepare()
415 snd_es1688_write(chip, 0xa8, (snd_es1688_read(chip, 0xa8) & ~0x03) | (3 - runtime->channels)); in snd_es1688_capture_prepare()
416 snd_es1688_write(chip, 0xb9, 2); /* demand mode (4 bytes/request) */ in snd_es1688_capture_prepare()
420 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_capture_prepare()
421 snd_es1688_write(chip, 0xb7, 0xd0); in snd_es1688_capture_prepare()
424 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_capture_prepare()
425 snd_es1688_write(chip, 0xb7, 0xf4); in snd_es1688_capture_prepare()
430 snd_es1688_write(chip, 0xb7, 0x51); in snd_es1688_capture_prepare()
431 snd_es1688_write(chip, 0xb7, 0x98); in snd_es1688_capture_prepare()
434 snd_es1688_write(chip, 0xb7, 0x71); in snd_es1688_capture_prepare()
435 snd_es1688_write(chip, 0xb7, 0xbc); in snd_es1688_capture_prepare()
438 snd_es1688_write(chip, 0xb1, (snd_es1688_read(chip, 0xb1) & 0x0f) | 0x50); in snd_es1688_capture_prepare()
439 snd_es1688_write(chip, 0xb2, (snd_es1688_read(chip, 0xb2) & 0x0f) | 0x50); in snd_es1688_capture_prepare()
445 snd_es1688_write(chip, 0xa4, (unsigned char) count); in snd_es1688_capture_prepare()
446 snd_es1688_write(chip, 0xa5, (unsigned char) (count >> 8)); in snd_es1688_capture_prepare()
448 return 0; in snd_es1688_capture_prepare()
455 return snd_es1688_trigger(chip, cmd, 0x0f); in snd_es1688_capture_trigger()
462 if (chip->trigger_value == 0x05) /* ok.. playback is active */ in snd_es1688_interrupt()
464 if (chip->trigger_value == 0x0f) /* ok.. capture is active */ in snd_es1688_interrupt()
476 if (chip->trigger_value != 0x05) in snd_es1688_playback_pointer()
477 return 0; in snd_es1688_playback_pointer()
487 if (chip->trigger_value != 0x0f) in snd_es1688_capture_pointer()
488 return 0; in snd_es1688_capture_pointer()
512 .fifo_size = 0,
530 .fifo_size = 0,
546 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in snd_es1688_playback_open()
548 return 0; in snd_es1688_playback_open()
560 snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in snd_es1688_capture_open()
562 return 0; in snd_es1688_capture_open()
570 return 0; in snd_es1688_playback_close()
578 return 0; in snd_es1688_capture_close()
584 snd_es1688_init(chip, 0); in snd_es1688_free()
586 if (chip->irq >= 0) in snd_es1688_free()
588 if (chip->dma8 >= 0) { in snd_es1688_free()
592 return 0; in snd_es1688_free()
604 sprintf(tmp, "ES%s688 rev %i", chip->hardware == ES1688_HW_688 ? "" : "1", chip->version & 0x0f); in snd_es1688_chip_id()
632 dev_err(card->dev, "es1688: can't grab port 0x%lx\n", port + 4); in snd_es1688_create()
637 err = request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip); in snd_es1688_create()
638 if (err < 0) { in snd_es1688_create()
647 if (err < 0) { in snd_es1688_create()
656 mpu_port &= ~0x000f; in snd_es1688_create()
657 if (mpu_port < 0x300 || mpu_port > 0x330) in snd_es1688_create()
658 mpu_port = 0; in snd_es1688_create()
664 if (err < 0) in snd_es1688_create()
668 if (err < 0) in snd_es1688_create()
701 if (err < 0) in snd_es1688_pcm()
714 return 0; in snd_es1688_pcm()
734 ucontrol->value.enumerated.item[0] = snd_es1688_mixer_read(chip, ES1688_REC_DEV) & 7; in snd_es1688_get_mux()
735 return 0; in snd_es1688_get_mux()
745 if (ucontrol->value.enumerated.item[0] > 8) in snd_es1688_put_mux()
749 nval = (ucontrol->value.enumerated.item[0] & 7) | (oval & ~15); in snd_es1688_put_mux()
765 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_es1688_info_single()
769 uinfo->value.integer.min = 0; in snd_es1688_info_single()
771 return 0; in snd_es1688_info_single()
778 int reg = kcontrol->private_value & 0xff; in snd_es1688_get_single()
779 int shift = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_get_single()
780 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_es1688_get_single()
781 int invert = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_get_single()
784 ucontrol->value.integer.value[0] = (snd_es1688_mixer_read(chip, reg) >> shift) & mask; in snd_es1688_get_single()
787 ucontrol->value.integer.value[0] = mask - ucontrol->value.integer.value[0]; in snd_es1688_get_single()
788 return 0; in snd_es1688_get_single()
795 int reg = kcontrol->private_value & 0xff; in snd_es1688_put_single()
796 int shift = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_put_single()
797 int mask = (kcontrol->private_value >> 16) & 0xff; in snd_es1688_put_single()
798 int invert = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_put_single()
802 nval = (ucontrol->value.integer.value[0] & mask); in snd_es1688_put_single()
824 int mask = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_info_double()
828 uinfo->value.integer.min = 0; in snd_es1688_info_double()
830 return 0; in snd_es1688_info_double()
837 int left_reg = kcontrol->private_value & 0xff; in snd_es1688_get_double()
838 int right_reg = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_get_double()
839 int shift_left = (kcontrol->private_value >> 16) & 0x07; in snd_es1688_get_double()
840 int shift_right = (kcontrol->private_value >> 19) & 0x07; in snd_es1688_get_double()
841 int mask = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_get_double()
846 if (left_reg < 0xa0) in snd_es1688_get_double()
851 if (right_reg < 0xa0) in snd_es1688_get_double()
858 ucontrol->value.integer.value[0] = (left >> shift_left) & mask; in snd_es1688_get_double()
861 ucontrol->value.integer.value[0] = mask - ucontrol->value.integer.value[0]; in snd_es1688_get_double()
864 return 0; in snd_es1688_get_double()
871 int left_reg = kcontrol->private_value & 0xff; in snd_es1688_put_double()
872 int right_reg = (kcontrol->private_value >> 8) & 0xff; in snd_es1688_put_double()
873 int shift_left = (kcontrol->private_value >> 16) & 0x07; in snd_es1688_put_double()
874 int shift_right = (kcontrol->private_value >> 19) & 0x07; in snd_es1688_put_double()
875 int mask = (kcontrol->private_value >> 24) & 0xff; in snd_es1688_put_double()
880 val1 = ucontrol->value.integer.value[0] & mask; in snd_es1688_put_double()
890 if (left_reg < 0xa0) in snd_es1688_put_double()
894 if (right_reg < 0xa0) in snd_es1688_put_double()
902 if (left_reg < 0xa0) in snd_es1688_put_double()
906 if (right_reg < 0xa0) in snd_es1688_put_double()
912 if (left_reg < 0xa0) in snd_es1688_put_double()
919 if (left_reg < 0xa0) in snd_es1688_put_double()
931 ES1688_DOUBLE("Master Playback Volume", 0, ES1688_MASTER_DEV, ES1688_MASTER_DEV, 4, 0, 15, 0),
932 ES1688_DOUBLE("PCM Playback Volume", 0, ES1688_PCM_DEV, ES1688_PCM_DEV, 4, 0, 15, 0),
933 ES1688_DOUBLE("Line Playback Volume", 0, ES1688_LINE_DEV, ES1688_LINE_DEV, 4, 0, 15, 0),
934 ES1688_DOUBLE("CD Playback Volume", 0, ES1688_CD_DEV, ES1688_CD_DEV, 4, 0, 15, 0),
935 ES1688_DOUBLE("FM Playback Volume", 0, ES1688_FM_DEV, ES1688_FM_DEV, 4, 0, 15, 0),
936 ES1688_DOUBLE("Mic Playback Volume", 0, ES1688_MIC_DEV, ES1688_MIC_DEV, 4, 0, 15, 0),
937 ES1688_DOUBLE("Aux Playback Volume", 0, ES1688_AUX_DEV, ES1688_AUX_DEV, 4, 0, 15, 0),
938 ES1688_SINGLE("Beep Playback Volume", 0, ES1688_SPEAKER_DEV, 0, 7, 0),
939 ES1688_DOUBLE("Capture Volume", 0, ES1688_RECLEV_DEV, ES1688_RECLEV_DEV, 4, 0, 15, 0),
940 ES1688_SINGLE("Capture Switch", 0, ES1688_REC_DEV, 4, 1, 1),
953 { ES1688_MASTER_DEV, 0 },
954 { ES1688_PCM_DEV, 0 },
955 { ES1688_LINE_DEV, 0 },
956 { ES1688_CD_DEV, 0 },
957 { ES1688_FM_DEV, 0 },
958 { ES1688_MIC_DEV, 0 },
959 { ES1688_AUX_DEV, 0 },
960 { ES1688_SPEAKER_DEV, 0 },
961 { ES1688_RECLEV_DEV, 0 },
962 { ES1688_REC_DEV, 0x17 }
976 for (idx = 0; idx < ARRAY_SIZE(snd_es1688_controls); idx++) { in snd_es1688_mixer()
978 if (err < 0) in snd_es1688_mixer()
981 for (idx = 0; idx < ES1688_INIT_TABLE_SIZE; idx++) { in snd_es1688_mixer()
982 reg = snd_es1688_init_table[idx][0]; in snd_es1688_mixer()
984 if (reg < 0xa0) in snd_es1688_mixer()
989 return 0; in snd_es1688_mixer()