Lines Matching refs:chip

24 static int snd_es1688_dsp_command(struct snd_es1688 *chip, unsigned char val)  in snd_es1688_dsp_command()  argument
29 if ((inb(ES1688P(chip, STATUS)) & 0x80) == 0) { in snd_es1688_dsp_command()
30 outb(val, ES1688P(chip, COMMAND)); in snd_es1688_dsp_command()
33 dev_dbg(chip->card->dev, "%s: timeout (0x%x)\n", __func__, val); in snd_es1688_dsp_command()
37 static int snd_es1688_dsp_get_byte(struct snd_es1688 *chip) in snd_es1688_dsp_get_byte() argument
42 if (inb(ES1688P(chip, DATA_AVAIL)) & 0x80) in snd_es1688_dsp_get_byte()
43 return inb(ES1688P(chip, READ)); 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()
45 ES1688P(chip, DATA_AVAIL), inb(ES1688P(chip, DATA_AVAIL))); in snd_es1688_dsp_get_byte()
49 static int snd_es1688_write(struct snd_es1688 *chip, in snd_es1688_write() argument
52 if (!snd_es1688_dsp_command(chip, reg)) in snd_es1688_write()
54 return snd_es1688_dsp_command(chip, data); in snd_es1688_write()
57 static int snd_es1688_read(struct snd_es1688 *chip, unsigned char reg) in snd_es1688_read() argument
60 if (!snd_es1688_dsp_command(chip, 0xc0)) in snd_es1688_read()
62 if (!snd_es1688_dsp_command(chip, reg)) in snd_es1688_read()
64 return snd_es1688_dsp_get_byte(chip); in snd_es1688_read()
67 void snd_es1688_mixer_write(struct snd_es1688 *chip, in snd_es1688_mixer_write() argument
70 outb(reg, ES1688P(chip, MIXER_ADDR)); in snd_es1688_mixer_write()
72 outb(data, ES1688P(chip, MIXER_DATA)); in snd_es1688_mixer_write()
76 static unsigned char snd_es1688_mixer_read(struct snd_es1688 *chip, unsigned char reg) in snd_es1688_mixer_read() argument
80 outb(reg, ES1688P(chip, MIXER_ADDR)); in snd_es1688_mixer_read()
82 result = inb(ES1688P(chip, MIXER_DATA)); in snd_es1688_mixer_read()
87 int snd_es1688_reset(struct snd_es1688 *chip) in snd_es1688_reset() argument
91 outb(3, ES1688P(chip, RESET)); /* valid only for ESS chips, SB -> 1 */ in snd_es1688_reset()
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()
98 chip->port); in snd_es1688_reset()
101 snd_es1688_dsp_command(chip, 0xc6); /* enable extended mode */ in snd_es1688_reset()
106 static int snd_es1688_probe(struct snd_es1688 *chip) in snd_es1688_probe() argument
116 spin_lock_irqsave(&chip->reg_lock, flags); /* Some ESS1688 cards need this */ in snd_es1688_probe()
117 inb(ES1688P(chip, ENABLE1)); /* ENABLE1 */ in snd_es1688_probe()
118 inb(ES1688P(chip, ENABLE1)); /* ENABLE1 */ in snd_es1688_probe()
119 inb(ES1688P(chip, ENABLE1)); /* ENABLE1 */ in snd_es1688_probe()
120 inb(ES1688P(chip, ENABLE2)); /* ENABLE2 */ in snd_es1688_probe()
121 inb(ES1688P(chip, ENABLE1)); /* ENABLE1 */ in snd_es1688_probe()
122 inb(ES1688P(chip, ENABLE2)); /* ENABLE2 */ in snd_es1688_probe()
123 inb(ES1688P(chip, ENABLE1)); /* ENABLE1 */ in snd_es1688_probe()
124 inb(ES1688P(chip, ENABLE1)); /* ENABLE1 */ in snd_es1688_probe()
125 inb(ES1688P(chip, ENABLE2)); /* ENABLE2 */ in snd_es1688_probe()
126 inb(ES1688P(chip, ENABLE1)); /* ENABLE1 */ in snd_es1688_probe()
127 inb(ES1688P(chip, ENABLE0)); /* ENABLE0 */ in snd_es1688_probe()
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()
131 chip->port, inb(ES1688P(chip, READ))); in snd_es1688_probe()
132 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_probe()
135 snd_es1688_dsp_command(chip, 0xe7); /* return identification */ in snd_es1688_probe()
138 if (inb(ES1688P(chip, DATA_AVAIL)) & 0x80) { in snd_es1688_probe()
140 major = inb(ES1688P(chip, READ)); in snd_es1688_probe()
142 minor = inb(ES1688P(chip, READ)); in snd_es1688_probe()
147 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_probe()
149 dev_dbg(chip->card->dev, in snd_es1688_probe()
151 chip->port, major, minor); in snd_es1688_probe()
153 chip->version = (major << 8) | minor; in snd_es1688_probe()
154 if (!chip->version) in snd_es1688_probe()
157 switch (chip->version & 0xfff0) { in snd_es1688_probe()
159 dev_err(chip->card->dev, in snd_es1688_probe()
161 chip->port); in snd_es1688_probe()
166 dev_err(chip->card->dev, in snd_es1688_probe()
168 chip->port, chip->version); in snd_es1688_probe()
172 spin_lock_irqsave(&chip->reg_lock, flags); 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()
175 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_probe()
178 spin_lock_irqsave(&chip->mixer_lock, flags); in snd_es1688_probe()
179 snd_es1688_mixer_write(chip, 0x40, 0x01); in snd_es1688_probe()
180 spin_unlock_irqrestore(&chip->mixer_lock, flags); in snd_es1688_probe()
185 static int snd_es1688_init(struct snd_es1688 * chip, int enable) in snd_es1688_init() argument
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()
196 switch (chip->mpu_irq) { in snd_es1688_init()
217 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_init()
218 snd_es1688_mixer_write(chip, 0x40, cfg); in snd_es1688_init()
219 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_init()
221 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_init()
222 snd_es1688_read(chip, 0xb1); in snd_es1688_init()
223 snd_es1688_read(chip, 0xb2); in snd_es1688_init()
224 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_init()
227 irq_bits = irqs[chip->irq & 0x0f]; in snd_es1688_init()
229 dev_err(chip->card->dev, in snd_es1688_init()
231 chip->port, chip->irq); in snd_es1688_init()
238 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_init()
239 snd_es1688_write(chip, 0xb1, cfg | (irq_bits << 2)); in snd_es1688_init()
240 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_init()
242 dma = chip->dma8; in snd_es1688_init()
244 dev_err(chip->card->dev, in snd_es1688_init()
246 chip->port, dma); in snd_es1688_init()
257 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_init()
258 snd_es1688_write(chip, 0xb2, cfg | (dma_bits << 2)); in snd_es1688_init()
259 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_init()
261 spin_lock_irqsave(&chip->reg_lock, flags); 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()
264 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_init()
266 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_init()
267 snd_es1688_read(chip, 0xb1); in snd_es1688_init()
268 snd_es1688_read(chip, 0xb2); in snd_es1688_init()
269 snd_es1688_reset(chip); in snd_es1688_init()
270 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_init()
298 static void snd_es1688_set_rate(struct snd_es1688 *chip, struct snd_pcm_substream *substream) in snd_es1688_set_rate() argument
310 snd_es1688_write(chip, 0xa1, bits); in snd_es1688_set_rate()
311 snd_es1688_write(chip, 0xa2, divider); in snd_es1688_set_rate()
314 static int snd_es1688_trigger(struct snd_es1688 *chip, int cmd, unsigned char value) in snd_es1688_trigger() argument
323 spin_lock(&chip->reg_lock); in snd_es1688_trigger()
324 chip->trigger_value = value; in snd_es1688_trigger()
325 val = snd_es1688_read(chip, 0xb8); in snd_es1688_trigger()
327 spin_unlock(&chip->reg_lock); 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()
333 snd_dma_pointer(chip->dma8, chip->dma_size)); in snd_es1688_trigger()
335 snd_es1688_write(chip, 0xb8, (val & 0xf0) | value); in snd_es1688_trigger()
336 spin_unlock(&chip->reg_lock); in snd_es1688_trigger()
343 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_playback_prepare() local
348 chip->dma_size = size; in snd_es1688_playback_prepare()
349 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_playback_prepare()
350 snd_es1688_reset(chip); in snd_es1688_playback_prepare()
351 snd_es1688_set_rate(chip, substream); in snd_es1688_playback_prepare()
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()
382 snd_es1688_dsp_command(chip, ES1688_DSP_CMD_SPKON); in snd_es1688_playback_prepare()
383 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_playback_prepare()
386 snd_dma_program(chip->dma8, runtime->dma_addr, size, DMA_MODE_WRITE | DMA_AUTOINIT); in snd_es1688_playback_prepare()
387 spin_lock_irqsave(&chip->reg_lock, flags); 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()
390 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_playback_prepare()
397 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_playback_trigger() local
398 return snd_es1688_trigger(chip, cmd, 0x05); in snd_es1688_playback_trigger()
404 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_capture_prepare() local
409 chip->dma_size = size; in snd_es1688_capture_prepare()
410 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_capture_prepare()
411 snd_es1688_reset(chip); in snd_es1688_capture_prepare()
412 snd_es1688_set_rate(chip, substream); in snd_es1688_capture_prepare()
413 snd_es1688_dsp_command(chip, ES1688_DSP_CMD_SPKOFF); in snd_es1688_capture_prepare()
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()
440 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_capture_prepare()
443 snd_dma_program(chip->dma8, runtime->dma_addr, size, DMA_MODE_READ | DMA_AUTOINIT); in snd_es1688_capture_prepare()
444 spin_lock_irqsave(&chip->reg_lock, flags); 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()
447 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_capture_prepare()
454 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_capture_trigger() local
455 return snd_es1688_trigger(chip, cmd, 0x0f); in snd_es1688_capture_trigger()
460 struct snd_es1688 *chip = dev_id; in snd_es1688_interrupt() local
462 if (chip->trigger_value == 0x05) /* ok.. playback is active */ in snd_es1688_interrupt()
463 snd_pcm_period_elapsed(chip->playback_substream); in snd_es1688_interrupt()
464 if (chip->trigger_value == 0x0f) /* ok.. capture is active */ in snd_es1688_interrupt()
465 snd_pcm_period_elapsed(chip->capture_substream); in snd_es1688_interrupt()
467 inb(ES1688P(chip, DATA_AVAIL)); /* ack interrupt */ in snd_es1688_interrupt()
473 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_playback_pointer() local
476 if (chip->trigger_value != 0x05) in snd_es1688_playback_pointer()
478 ptr = snd_dma_pointer(chip->dma8, chip->dma_size); in snd_es1688_playback_pointer()
484 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_capture_pointer() local
487 if (chip->trigger_value != 0x0f) in snd_es1688_capture_pointer()
489 ptr = snd_dma_pointer(chip->dma8, chip->dma_size); in snd_es1688_capture_pointer()
539 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_playback_open() local
542 if (chip->capture_substream != NULL) in snd_es1688_playback_open()
544 chip->playback_substream = substream; in snd_es1688_playback_open()
553 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_capture_open() local
556 if (chip->playback_substream != NULL) in snd_es1688_capture_open()
558 chip->capture_substream = substream; in snd_es1688_capture_open()
567 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_playback_close() local
569 chip->playback_substream = NULL; in snd_es1688_playback_close()
575 struct snd_es1688 *chip = snd_pcm_substream_chip(substream); in snd_es1688_capture_close() local
577 chip->capture_substream = NULL; in snd_es1688_capture_close()
581 static int snd_es1688_free(struct snd_es1688 *chip) in snd_es1688_free() argument
583 if (chip->hardware != ES1688_HW_UNDEF) in snd_es1688_free()
584 snd_es1688_init(chip, 0); in snd_es1688_free()
585 release_and_free_resource(chip->res_port); in snd_es1688_free()
586 if (chip->irq >= 0) in snd_es1688_free()
587 free_irq(chip->irq, (void *) chip); in snd_es1688_free()
588 if (chip->dma8 >= 0) { in snd_es1688_free()
589 disable_dma(chip->dma8); in snd_es1688_free()
590 free_dma(chip->dma8); in snd_es1688_free()
597 struct snd_es1688 *chip = device->device_data; in snd_es1688_dev_free() local
598 return snd_es1688_free(chip); in snd_es1688_dev_free()
601 static const char *snd_es1688_chip_id(struct snd_es1688 *chip) in snd_es1688_chip_id() argument
604 sprintf(tmp, "ES%s688 rev %i", chip->hardware == ES1688_HW_688 ? "" : "1", chip->version & 0x0f); in snd_es1688_chip_id()
609 struct snd_es1688 *chip, in snd_es1688_create() argument
623 if (chip == NULL) in snd_es1688_create()
625 chip->card = card; in snd_es1688_create()
626 chip->irq = -1; in snd_es1688_create()
627 chip->dma8 = -1; in snd_es1688_create()
628 chip->hardware = ES1688_HW_UNDEF; in snd_es1688_create()
630 chip->res_port = request_region(port + 4, 12, "ES1688"); in snd_es1688_create()
631 if (chip->res_port == NULL) { in snd_es1688_create()
637 err = request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip); in snd_es1688_create()
643 chip->irq = irq; in snd_es1688_create()
644 card->sync_irq = chip->irq; in snd_es1688_create()
651 chip->dma8 = dma8; in snd_es1688_create()
653 spin_lock_init(&chip->reg_lock); in snd_es1688_create()
654 spin_lock_init(&chip->mixer_lock); in snd_es1688_create()
655 chip->port = port; in snd_es1688_create()
659 chip->mpu_port = mpu_port; in snd_es1688_create()
660 chip->mpu_irq = mpu_irq; in snd_es1688_create()
661 chip->hardware = hardware; in snd_es1688_create()
663 err = snd_es1688_probe(chip); in snd_es1688_create()
667 err = snd_es1688_init(chip, 1); in snd_es1688_create()
672 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); in snd_es1688_create()
675 snd_es1688_free(chip); in snd_es1688_create()
695 int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device) in snd_es1688_pcm() argument
707 pcm->private_data = chip; in snd_es1688_pcm()
709 strcpy(pcm->name, snd_es1688_chip_id(chip)); in snd_es1688_pcm()
710 chip->pcm = pcm; in snd_es1688_pcm()
733 struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); in snd_es1688_get_mux() local
734 ucontrol->value.enumerated.item[0] = snd_es1688_mixer_read(chip, ES1688_REC_DEV) & 7; in snd_es1688_get_mux()
740 struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); in snd_es1688_put_mux() local
747 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_put_mux()
748 oval = snd_es1688_mixer_read(chip, ES1688_REC_DEV); in snd_es1688_put_mux()
752 snd_es1688_mixer_write(chip, ES1688_REC_DEV, nval); in snd_es1688_put_mux()
753 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_put_mux()
776 struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); in snd_es1688_get_single() local
783 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_get_single()
784 ucontrol->value.integer.value[0] = (snd_es1688_mixer_read(chip, reg) >> shift) & mask; in snd_es1688_get_single()
785 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_get_single()
793 struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); in snd_es1688_put_single() local
806 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_put_single()
807 oval = snd_es1688_mixer_read(chip, reg); in snd_es1688_put_single()
811 snd_es1688_mixer_write(chip, reg, nval); in snd_es1688_put_single()
812 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_put_single()
835 struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); in snd_es1688_get_double() local
845 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_get_double()
847 left = snd_es1688_mixer_read(chip, left_reg); in snd_es1688_get_double()
849 left = snd_es1688_read(chip, left_reg); in snd_es1688_get_double()
852 right = snd_es1688_mixer_read(chip, right_reg); in snd_es1688_get_double()
854 right = snd_es1688_read(chip, right_reg); in snd_es1688_get_double()
857 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_get_double()
869 struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); in snd_es1688_put_double() local
888 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1688_put_double()
891 oval1 = snd_es1688_mixer_read(chip, left_reg); in snd_es1688_put_double()
893 oval1 = snd_es1688_read(chip, left_reg); in snd_es1688_put_double()
895 oval2 = snd_es1688_mixer_read(chip, right_reg); in snd_es1688_put_double()
897 oval2 = snd_es1688_read(chip, right_reg); in snd_es1688_put_double()
903 snd_es1688_mixer_write(chip, left_reg, val1); in snd_es1688_put_double()
905 snd_es1688_write(chip, left_reg, val1); in snd_es1688_put_double()
907 snd_es1688_mixer_write(chip, right_reg, val1); in snd_es1688_put_double()
909 snd_es1688_write(chip, right_reg, val1); in snd_es1688_put_double()
913 oval1 = snd_es1688_mixer_read(chip, left_reg); in snd_es1688_put_double()
915 oval1 = snd_es1688_read(chip, left_reg); in snd_es1688_put_double()
920 snd_es1688_mixer_write(chip, left_reg, val1); in snd_es1688_put_double()
922 snd_es1688_write(chip, left_reg, val1); in snd_es1688_put_double()
926 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1688_put_double()
965 int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip) in snd_es1688_mixer() argument
971 if (snd_BUG_ON(!chip || !card)) in snd_es1688_mixer()
974 strcpy(card->mixername, snd_es1688_chip_id(chip)); in snd_es1688_mixer()
977 err = snd_ctl_add(card, snd_ctl_new1(&snd_es1688_controls[idx], chip)); in snd_es1688_mixer()
985 snd_es1688_mixer_write(chip, reg, val); in snd_es1688_mixer()
987 snd_es1688_write(chip, reg, val); in snd_es1688_mixer()