Lines Matching +full:8 +full:- +full:channel

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
8 * Output fixed at S32_LE, 2 channel to hw:0,0
15 * Use 2 channel output streams instead of 8 channel.
16 * (8 channel output streams might be good for ASIO type output)
17 * Corrected speaker output, so Front -> Front etc.
36 * Merging with snd-emu10k1 driver.
38 * One stereo channel at 24bit now works.
42 * Integrated with snd-emu10k1 driver.
50 * setting HD Capture channel to 0 captures from CDROM digital input.
51 * setting HD Capture channel to 1 captures from SPDIF in.
56 * Some stability problems when unloading the snd-p16v kernel module.
57 * --
64 * --
67 * P16V Chip: CA0151-DBS
68 * Audigy 2 Chip: CA0102-IAT
71 * DAC: CS4382-K (8-channel, 24bit, 192Khz)
92 #define SET_CHANNEL 0 /* Testing channel outputs 0=Front, 1=Center/LFE, 2=Unknown, 3=Rear */
103 * Class 0401: 1102:0004 (rev 04) Subsystem: 1102:2002 -> Audigy2 ZS 7.1 Model:SB0350
104 * Class 0401: 1102:0004 (rev 04) Subsystem: 1102:1007 -> Audigy2 6.1 Model:SB0240
105 …* Class 0401: 1102:0004 (rev 04) Subsystem: 1102:1002 -> Audigy2 Platinum Model:SB msb02402300092…
106 …* Class 0401: 1102:0004 (rev 04) Subsystem: 1102:2007 -> Audigy4 Pro Model:SB0380 M1SB038047200190…
118 .formats = SNDRV_PCM_FMTBIT_S32_LE, /* Only supports 24-bit samples padded to 32 bits. */
122 .channels_min = 8,
123 .channels_max = 8,
124 .buffer_bytes_max = ((65536 - 64) * 8),
126 .period_bytes_max = (65536 - 64),
128 .periods_max = 8,
144 .buffer_bytes_max = (65536 - 64),
146 .period_bytes_max = (65536 - 128) >> 1, /* size has to be N*64 bytes */
154 struct snd_emu10k1_pcm *epcm = runtime->private_data; in snd_p16v_pcm_free_substream()
163 struct snd_emu10k1_voice *channel = &(emu->p16v_voices[channel_id]); in snd_p16v_pcm_open_playback_channel() local
165 struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_open_playback_channel()
169 /* dev_dbg(emu->card->dev, "epcm kcalloc: %p\n", epcm); */ in snd_p16v_pcm_open_playback_channel()
172 return -ENOMEM; in snd_p16v_pcm_open_playback_channel()
173 epcm->emu = emu; in snd_p16v_pcm_open_playback_channel()
174 epcm->substream = substream; in snd_p16v_pcm_open_playback_channel()
176 dev_dbg(emu->card->dev, "epcm device=%d, channel_id=%d\n", in snd_p16v_pcm_open_playback_channel()
177 substream->pcm->device, channel_id); in snd_p16v_pcm_open_playback_channel()
179 runtime->private_data = epcm; in snd_p16v_pcm_open_playback_channel()
180 runtime->private_free = snd_p16v_pcm_free_substream; in snd_p16v_pcm_open_playback_channel()
182 runtime->hw = snd_p16v_playback_hw; in snd_p16v_pcm_open_playback_channel()
184 channel->emu = emu; in snd_p16v_pcm_open_playback_channel()
185 channel->number = channel_id; in snd_p16v_pcm_open_playback_channel()
187 channel->use=1; in snd_p16v_pcm_open_playback_channel()
189 dev_dbg(emu->card->dev, in snd_p16v_pcm_open_playback_channel()
190 "p16v: open channel_id=%d, channel=%p, use=0x%x\n", in snd_p16v_pcm_open_playback_channel()
191 channel_id, channel, channel->use); in snd_p16v_pcm_open_playback_channel()
192 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n", in snd_p16v_pcm_open_playback_channel()
193 channel_id, chip, channel); in snd_p16v_pcm_open_playback_channel()
195 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ in snd_p16v_pcm_open_playback_channel()
196 channel->epcm = epcm; in snd_p16v_pcm_open_playback_channel()
200 runtime->sync.id32[0] = substream->pcm->card->number; in snd_p16v_pcm_open_playback_channel()
201 runtime->sync.id32[1] = 'P'; in snd_p16v_pcm_open_playback_channel()
202 runtime->sync.id32[2] = 16; in snd_p16v_pcm_open_playback_channel()
203 runtime->sync.id32[3] = 'V'; in snd_p16v_pcm_open_playback_channel()
211 struct snd_emu10k1_voice *channel = &(emu->p16v_capture_voice); in snd_p16v_pcm_open_capture_channel() local
213 struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_open_capture_channel()
217 /* dev_dbg(emu->card->dev, "epcm kcalloc: %p\n", epcm); */ in snd_p16v_pcm_open_capture_channel()
220 return -ENOMEM; in snd_p16v_pcm_open_capture_channel()
221 epcm->emu = emu; in snd_p16v_pcm_open_capture_channel()
222 epcm->substream = substream; in snd_p16v_pcm_open_capture_channel()
224 dev_dbg(emu->card->dev, "epcm device=%d, channel_id=%d\n", in snd_p16v_pcm_open_capture_channel()
225 substream->pcm->device, channel_id); in snd_p16v_pcm_open_capture_channel()
227 runtime->private_data = epcm; in snd_p16v_pcm_open_capture_channel()
228 runtime->private_free = snd_p16v_pcm_free_substream; in snd_p16v_pcm_open_capture_channel()
230 runtime->hw = snd_p16v_capture_hw; in snd_p16v_pcm_open_capture_channel()
232 channel->emu = emu; in snd_p16v_pcm_open_capture_channel()
233 channel->number = channel_id; in snd_p16v_pcm_open_capture_channel()
235 channel->use=1; in snd_p16v_pcm_open_capture_channel()
237 dev_dbg(emu->card->dev, in snd_p16v_pcm_open_capture_channel()
238 "p16v: open channel_id=%d, channel=%p, use=0x%x\n", in snd_p16v_pcm_open_capture_channel()
239 channel_id, channel, channel->use); in snd_p16v_pcm_open_capture_channel()
240 dev_dbg(emu->card->dev, "open:channel_id=%d, chip=%p, channel=%p\n", in snd_p16v_pcm_open_capture_channel()
241 channel_id, chip, channel); in snd_p16v_pcm_open_capture_channel()
243 /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */ in snd_p16v_pcm_open_capture_channel()
244 channel->epcm = epcm; in snd_p16v_pcm_open_capture_channel()
256 //struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_close_playback()
257 //struct snd_emu10k1_pcm *epcm = runtime->private_data; in snd_p16v_pcm_close_playback()
258 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0; in snd_p16v_pcm_close_playback()
267 //struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_close_capture()
268 //struct snd_emu10k1_pcm *epcm = runtime->private_data; in snd_p16v_pcm_close_capture()
269 emu->p16v_capture_voice.use = 0; in snd_p16v_pcm_close_capture()
281 // Only using channel 0 for now, but the card has 2 channels. in snd_p16v_pcm_open_capture()
289 struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_prepare_playback()
290 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_playback() local
291 u32 *table_base = (u32 *)(emu->p16v_buffer.area+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
292 u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); in snd_p16v_pcm_prepare_playback()
297 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
301 channel, runtime->rate, runtime->format, runtime->channels, in snd_p16v_pcm_prepare_playback()
302 runtime->buffer_size, runtime->period_size, in snd_p16v_pcm_prepare_playback()
303 runtime->periods, frames_to_bytes(runtime, 1)); in snd_p16v_pcm_prepare_playback()
304 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
306 runtime->dma_addr, runtime->dma_area, table_base); in snd_p16v_pcm_prepare_playback()
307 dev_dbg(emu->card->dev, in snd_p16v_pcm_prepare_playback()
309 emu->p16v_buffer.addr, emu->p16v_buffer.area, in snd_p16v_pcm_prepare_playback()
310 emu->p16v_buffer.bytes); in snd_p16v_pcm_prepare_playback()
312 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_playback()
313 switch (runtime->rate) { in snd_p16v_pcm_prepare_playback()
315 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x8080); in snd_p16v_pcm_prepare_playback()
318 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x4040); in snd_p16v_pcm_prepare_playback()
321 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x2020); in snd_p16v_pcm_prepare_playback()
325 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0xe0e0) | 0x0000); in snd_p16v_pcm_prepare_playback()
328 /* FIXME: Check emu->buffer.size before actually writing to it. */ in snd_p16v_pcm_prepare_playback()
329 for(i = 0; i < runtime->periods; i++) { in snd_p16v_pcm_prepare_playback()
330 table_base[i*2]=runtime->dma_addr+(i*period_size_bytes); in snd_p16v_pcm_prepare_playback()
334 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_ADDR, channel, emu->p16v_buffer.addr+(8*16*channel)); in snd_p16v_pcm_prepare_playback()
335 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); in snd_p16v_pcm_prepare_playback()
336 snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0); in snd_p16v_pcm_prepare_playback()
337 snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_playback()
338 …//snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->pe… in snd_p16v_pcm_prepare_playback()
339 snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes in snd_p16v_pcm_prepare_playback()
340 snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0); in snd_p16v_pcm_prepare_playback()
341 snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0); in snd_p16v_pcm_prepare_playback()
342 snd_emu10k1_ptr20_write(emu, 0x08, channel, 0); in snd_p16v_pcm_prepare_playback()
351 struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_prepare_capture()
352 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_prepare_capture() local
356 dev_dbg(emu->card->dev, "prepare capture:channel_number=%d, rate=%d, " in snd_p16v_pcm_prepare_capture()
359 channel, runtime->rate, runtime->format, runtime->channels, in snd_p16v_pcm_prepare_capture()
360 runtime->buffer_size, runtime->period_size, in snd_p16v_pcm_prepare_capture()
363 tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel); in snd_p16v_pcm_prepare_capture()
364 switch (runtime->rate) { in snd_p16v_pcm_prepare_capture()
366 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0800); in snd_p16v_pcm_prepare_capture()
369 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0400); in snd_p16v_pcm_prepare_capture()
372 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0200); in snd_p16v_pcm_prepare_capture()
376 snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, channel, (tmp & ~0x0e00) | 0x0000); in snd_p16v_pcm_prepare_capture()
379 /* FIXME: Check emu->buffer.size before actually writing to it. */ in snd_p16v_pcm_prepare_capture()
380 snd_emu10k1_ptr20_write(emu, 0x13, channel, 0); in snd_p16v_pcm_prepare_capture()
381 snd_emu10k1_ptr20_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr); in snd_p16v_pcm_prepare_capture()
382 …snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffe… in snd_p16v_pcm_prepare_capture()
383 snd_emu10k1_ptr20_write(emu, CAPTURE_POINTER, channel, 0); in snd_p16v_pcm_prepare_capture()
385 …mu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) | (0x110000<<channel)); in snd_p16v_pcm_prepare_capture()
395 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_enable()
396 enable = inl(emu->port + INTE2) | intrenb; in snd_p16v_intr_enable()
397 outl(enable, emu->port + INTE2); in snd_p16v_intr_enable()
398 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_enable()
406 spin_lock_irqsave(&emu->emu_lock, flags); in snd_p16v_intr_disable()
407 disable = inl(emu->port + INTE2) & (~intrenb); in snd_p16v_intr_disable()
408 outl(disable, emu->port + INTE2); in snd_p16v_intr_disable()
409 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_p16v_intr_disable()
419 int channel; in snd_p16v_pcm_trigger_playback() local
437 s->stream != SNDRV_PCM_STREAM_PLAYBACK) in snd_p16v_pcm_trigger_playback()
439 runtime = s->runtime; in snd_p16v_pcm_trigger_playback()
440 epcm = runtime->private_data; in snd_p16v_pcm_trigger_playback()
441 channel = substream->pcm->device-emu->p16v_device_offset; in snd_p16v_pcm_trigger_playback()
442 /* dev_dbg(emu->card->dev, "p16v channel=%d\n", channel); */ in snd_p16v_pcm_trigger_playback()
443 epcm->running = running; in snd_p16v_pcm_trigger_playback()
444 basic |= (0x1<<channel); in snd_p16v_pcm_trigger_playback()
445 inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel); in snd_p16v_pcm_trigger_playback()
448 /* dev_dbg(emu->card->dev, "basic=0x%x, inte=0x%x\n", basic, inte); */ in snd_p16v_pcm_trigger_playback()
460 result = -EINVAL; in snd_p16v_pcm_trigger_playback()
471 struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_trigger_capture()
472 struct snd_emu10k1_pcm *epcm = runtime->private_data; in snd_p16v_pcm_trigger_capture()
473 int channel = 0; in snd_p16v_pcm_trigger_capture() local
480 …0_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0)|(0x100<<channel)); in snd_p16v_pcm_trigger_capture()
481 epcm->running = 1; in snd_p16v_pcm_trigger_capture()
484 …rite(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) & ~(0x100<<channel)); in snd_p16v_pcm_trigger_capture()
486 …u, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) & ~(0x110000<<channel)); in snd_p16v_pcm_trigger_capture()
487 epcm->running = 0; in snd_p16v_pcm_trigger_capture()
490 result = -EINVAL; in snd_p16v_pcm_trigger_capture()
501 struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_pointer_playback()
502 struct snd_emu10k1_pcm *epcm = runtime->private_data; in snd_p16v_pcm_pointer_playback()
504 int channel = substream->pcm->device - emu->p16v_device_offset; in snd_p16v_pcm_pointer_playback() local
505 if (!epcm->running) in snd_p16v_pcm_pointer_playback()
508 ptr3 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
509 ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
510 ptr4 = snd_emu10k1_ptr20_read(emu, PLAYBACK_LIST_PTR, channel); in snd_p16v_pcm_pointer_playback()
511 if (ptr3 != ptr4) ptr1 = snd_emu10k1_ptr20_read(emu, PLAYBACK_POINTER, channel); in snd_p16v_pcm_pointer_playback()
513 ptr2+= (ptr4 >> 3) * runtime->period_size; in snd_p16v_pcm_pointer_playback()
515 if (ptr >= runtime->buffer_size) in snd_p16v_pcm_pointer_playback()
516 ptr -= runtime->buffer_size; in snd_p16v_pcm_pointer_playback()
526 struct snd_pcm_runtime *runtime = substream->runtime; in snd_p16v_pcm_pointer_capture()
527 struct snd_emu10k1_pcm *epcm = runtime->private_data; in snd_p16v_pcm_pointer_capture()
529 int channel = 0; in snd_p16v_pcm_pointer_capture() local
531 if (!epcm->running) in snd_p16v_pcm_pointer_capture()
534 ptr1 = snd_emu10k1_ptr20_read(emu, CAPTURE_POINTER, channel); in snd_p16v_pcm_pointer_capture()
537 if (ptr >= runtime->buffer_size) { in snd_p16v_pcm_pointer_capture()
538 ptr -= runtime->buffer_size; in snd_p16v_pcm_pointer_capture()
539 dev_warn(emu->card->dev, "buffer capture limited!\n"); in snd_p16v_pcm_pointer_capture()
542 dev_dbg(emu->card->dev, "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, " in snd_p16v_pcm_pointer_capture()
544 ptr1, ptr2, ptr, (int)runtime->buffer_size, in snd_p16v_pcm_pointer_capture()
545 (int)runtime->period_size, (int)runtime->frame_bits, in snd_p16v_pcm_pointer_capture()
546 (int)runtime->rate); in snd_p16v_pcm_pointer_capture()
572 if (chip->p16v_buffer.area) { in snd_p16v_free()
573 snd_dma_free_pages(&chip->p16v_buffer); in snd_p16v_free()
575 dev_dbg(chip->card->dev, "period lables free: %p\n", in snd_p16v_free()
576 &chip->p16v_buffer); in snd_p16v_free()
589 /* dev_dbg(emu->card->dev, "snd_p16v_pcm called. device=%d\n", device); */ in snd_p16v_pcm()
590 emu->p16v_device_offset = device; in snd_p16v_pcm()
592 if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0) in snd_p16v_pcm()
595 pcm->private_data = emu; in snd_p16v_pcm()
596 // Single playback 8 channel device. in snd_p16v_pcm()
597 // Single capture 2 channel device. in snd_p16v_pcm()
601 pcm->info_flags = 0; in snd_p16v_pcm()
602 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX; in snd_p16v_pcm()
603 strcpy(pcm->name, "p16v"); in snd_p16v_pcm()
604 emu->pcm_p16v = pcm; in snd_p16v_pcm()
606 for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; in snd_p16v_pcm()
608 substream = substream->next) { in snd_p16v_pcm()
610 &emu->pci->dev, in snd_p16v_pcm()
611 (65536 - 64) * 8, in snd_p16v_pcm()
612 (65536 - 64) * 8); in snd_p16v_pcm()
614 dev_dbg(emu->card->dev, in snd_p16v_pcm()
619 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; in snd_p16v_pcm()
621 substream = substream->next) { in snd_p16v_pcm()
623 &emu->pci->dev, in snd_p16v_pcm()
624 65536 - 64, 65536 - 64); in snd_p16v_pcm()
626 dev_dbg(emu->card->dev, in snd_p16v_pcm()
637 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_p16v_volume_info()
638 uinfo->count = 2; in snd_p16v_volume_info()
639 uinfo->value.integer.min = 0; in snd_p16v_volume_info()
640 uinfo->value.integer.max = 255; in snd_p16v_volume_info()
648 int high_low = (kcontrol->private_value >> 8) & 0xff; in snd_p16v_volume_get()
649 int reg = kcontrol->private_value & 0xff; in snd_p16v_volume_get()
654 ucontrol->value.integer.value[0] = 0xff - ((value >> 24) & 0xff); /* Left */ in snd_p16v_volume_get()
655 ucontrol->value.integer.value[1] = 0xff - ((value >> 16) & 0xff); /* Right */ in snd_p16v_volume_get()
657 ucontrol->value.integer.value[0] = 0xff - ((value >> 8) & 0xff); /* Left */ in snd_p16v_volume_get()
658 ucontrol->value.integer.value[1] = 0xff - ((value >> 0) & 0xff); /* Right */ in snd_p16v_volume_get()
667 int high_low = (kcontrol->private_value >> 8) & 0xff; in snd_p16v_volume_put()
668 int reg = kcontrol->private_value & 0xff; in snd_p16v_volume_put()
674 value |= ((0xff - ucontrol->value.integer.value[0]) << 24) | in snd_p16v_volume_put()
675 ((0xff - ucontrol->value.integer.value[1]) << 16); in snd_p16v_volume_put()
678 value |= ((0xff - ucontrol->value.integer.value[0]) << 8) | in snd_p16v_volume_put()
679 ((0xff - ucontrol->value.integer.value[1]) ); in snd_p16v_volume_put()
691 static const char * const texts[8] = { in snd_p16v_capture_source_info()
696 return snd_ctl_enum_info(uinfo, 1, 8, texts); in snd_p16v_capture_source_info()
704 ucontrol->value.enumerated.item[0] = emu->p16v_capture_source; in snd_p16v_capture_source_get()
717 val = ucontrol->value.enumerated.item[0] ; in snd_p16v_capture_source_put()
719 return -EINVAL; in snd_p16v_capture_source_put()
720 change = (emu->p16v_capture_source != val); in snd_p16v_capture_source_put()
722 emu->p16v_capture_source = val; in snd_p16v_capture_source_put()
743 ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel; in snd_p16v_capture_channel_get()
755 val = ucontrol->value.enumerated.item[0] ; in snd_p16v_capture_channel_put()
757 return -EINVAL; in snd_p16v_capture_channel_put()
758 change = (emu->p16v_capture_channel != val); in snd_p16v_capture_channel_put()
760 emu->p16v_capture_channel = val; in snd_p16v_capture_channel_put()
766 static const DECLARE_TLV_DB_SCALE(snd_p16v_db_scale1, -5175, 25, 1);
776 .private_value = ((xreg) | ((xhl) << 8)) \
797 .name = "HD channel Capture",
808 struct snd_card *card = emu->card; in snd_p16v_mixer()
820 #define NUM_CHS 1 /* up to 4, but only first channel is used */
824 emu->p16v_saved = vmalloc(array_size(NUM_CHS * 4, 0x80)); in snd_p16v_alloc_pm_buffer()
825 if (! emu->p16v_saved) in snd_p16v_alloc_pm_buffer()
826 return -ENOMEM; in snd_p16v_alloc_pm_buffer()
832 vfree(emu->p16v_saved); in snd_p16v_free_pm_buffer()
840 val = emu->p16v_saved; in snd_p16v_suspend()
851 val = emu->p16v_saved; in snd_p16v_resume()