Lines Matching refs:chip

135 	struct oxygen *chip = snd_pcm_substream_chip(substream);  in oxygen_open()  local
140 if (channel == PCM_B && chip->has_ac97_1 && in oxygen_open()
141 (chip->model.device_config & CAPTURE_2_FROM_AC97_1)) in oxygen_open()
147 if (chip->model.device_config & CAPTURE_1_FROM_SPDIF) { in oxygen_open()
158 runtime->hw.channels_max = chip->model.dac_channels_pcm; in oxygen_open()
161 if (chip->model.pcm_hardware_filter) in oxygen_open()
162 chip->model.pcm_hardware_filter(channel, &runtime->hw); in oxygen_open()
184 chip->streams[channel] = substream; in oxygen_open()
186 mutex_lock(&chip->mutex); in oxygen_open()
187 chip->pcm_active |= 1 << channel; in oxygen_open()
189 chip->spdif_pcm_bits = chip->spdif_bits; in oxygen_open()
190 chip->controls[CONTROL_SPDIF_PCM]->vd[0].access &= in oxygen_open()
192 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE | in oxygen_open()
194 &chip->controls[CONTROL_SPDIF_PCM]->id); in oxygen_open()
196 mutex_unlock(&chip->mutex); in oxygen_open()
233 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_close() local
236 mutex_lock(&chip->mutex); in oxygen_close()
237 chip->pcm_active &= ~(1 << channel); in oxygen_close()
239 chip->controls[CONTROL_SPDIF_PCM]->vd[0].access |= in oxygen_close()
241 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE | in oxygen_close()
243 &chip->controls[CONTROL_SPDIF_PCM]->id); in oxygen_close()
246 oxygen_update_spdif_source(chip); in oxygen_close()
247 mutex_unlock(&chip->mutex); in oxygen_close()
249 chip->streams[channel] = NULL; in oxygen_close()
317 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_hw_params() local
326 oxygen_write32(chip, channel_base_registers[channel], in oxygen_hw_params()
329 oxygen_write32(chip, OXYGEN_DMA_MULTICH_COUNT, in oxygen_hw_params()
331 oxygen_write32(chip, OXYGEN_DMA_MULTICH_TCOUNT, in oxygen_hw_params()
334 oxygen_write16(chip, channel_base_registers[channel] + 4, in oxygen_hw_params()
336 oxygen_write16(chip, channel_base_registers[channel] + 6, in oxygen_hw_params()
342 static u16 get_mclk(struct oxygen *chip, unsigned int channel, in get_mclk() argument
348 mclks = chip->model.dac_mclks; in get_mclk()
350 mclks = chip->model.adc_mclks; in get_mclk()
365 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_rec_a_hw_params() local
372 spin_lock_irq(&chip->reg_lock); in oxygen_rec_a_hw_params()
373 oxygen_write8_masked(chip, OXYGEN_REC_FORMAT, in oxygen_rec_a_hw_params()
376 oxygen_write16_masked(chip, OXYGEN_I2S_A_FORMAT, in oxygen_rec_a_hw_params()
378 chip->model.adc_i2s_format | in oxygen_rec_a_hw_params()
379 get_mclk(chip, PCM_A, hw_params) | in oxygen_rec_a_hw_params()
385 spin_unlock_irq(&chip->reg_lock); in oxygen_rec_a_hw_params()
387 mutex_lock(&chip->mutex); in oxygen_rec_a_hw_params()
388 chip->model.set_adc_params(chip, hw_params); in oxygen_rec_a_hw_params()
389 mutex_unlock(&chip->mutex); in oxygen_rec_a_hw_params()
396 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_rec_b_hw_params() local
404 is_ac97 = chip->has_ac97_1 && in oxygen_rec_b_hw_params()
405 (chip->model.device_config & CAPTURE_2_FROM_AC97_1); in oxygen_rec_b_hw_params()
407 spin_lock_irq(&chip->reg_lock); in oxygen_rec_b_hw_params()
408 oxygen_write8_masked(chip, OXYGEN_REC_FORMAT, in oxygen_rec_b_hw_params()
412 oxygen_write16_masked(chip, OXYGEN_I2S_B_FORMAT, in oxygen_rec_b_hw_params()
414 chip->model.adc_i2s_format | in oxygen_rec_b_hw_params()
415 get_mclk(chip, PCM_B, hw_params) | in oxygen_rec_b_hw_params()
421 spin_unlock_irq(&chip->reg_lock); in oxygen_rec_b_hw_params()
424 mutex_lock(&chip->mutex); in oxygen_rec_b_hw_params()
425 chip->model.set_adc_params(chip, hw_params); in oxygen_rec_b_hw_params()
426 mutex_unlock(&chip->mutex); in oxygen_rec_b_hw_params()
434 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_rec_c_hw_params() local
442 is_spdif = chip->model.device_config & CAPTURE_1_FROM_SPDIF; in oxygen_rec_c_hw_params()
444 spin_lock_irq(&chip->reg_lock); in oxygen_rec_c_hw_params()
445 oxygen_write8_masked(chip, OXYGEN_REC_FORMAT, in oxygen_rec_c_hw_params()
449 oxygen_write16_masked(chip, OXYGEN_I2S_C_FORMAT, in oxygen_rec_c_hw_params()
451 chip->model.adc_i2s_format | in oxygen_rec_c_hw_params()
452 get_mclk(chip, PCM_B, hw_params) | in oxygen_rec_c_hw_params()
458 spin_unlock_irq(&chip->reg_lock); in oxygen_rec_c_hw_params()
461 mutex_lock(&chip->mutex); in oxygen_rec_c_hw_params()
462 chip->model.set_adc_params(chip, hw_params); in oxygen_rec_c_hw_params()
463 mutex_unlock(&chip->mutex); in oxygen_rec_c_hw_params()
471 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_spdif_hw_params() local
478 mutex_lock(&chip->mutex); in oxygen_spdif_hw_params()
479 spin_lock_irq(&chip->reg_lock); in oxygen_spdif_hw_params()
480 oxygen_clear_bits32(chip, OXYGEN_SPDIF_CONTROL, in oxygen_spdif_hw_params()
482 oxygen_write8_masked(chip, OXYGEN_PLAY_FORMAT, in oxygen_spdif_hw_params()
485 oxygen_write32_masked(chip, OXYGEN_SPDIF_CONTROL, in oxygen_spdif_hw_params()
488 oxygen_update_spdif_source(chip); in oxygen_spdif_hw_params()
489 spin_unlock_irq(&chip->reg_lock); in oxygen_spdif_hw_params()
490 mutex_unlock(&chip->mutex); in oxygen_spdif_hw_params()
497 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_multich_hw_params() local
504 mutex_lock(&chip->mutex); in oxygen_multich_hw_params()
505 spin_lock_irq(&chip->reg_lock); in oxygen_multich_hw_params()
506 oxygen_write8_masked(chip, OXYGEN_PLAY_CHANNELS, in oxygen_multich_hw_params()
509 oxygen_write8_masked(chip, OXYGEN_PLAY_FORMAT, in oxygen_multich_hw_params()
512 oxygen_write16_masked(chip, OXYGEN_I2S_MULTICH_FORMAT, in oxygen_multich_hw_params()
514 chip->model.dac_i2s_format | in oxygen_multich_hw_params()
515 get_mclk(chip, PCM_MULTICH, hw_params) | in oxygen_multich_hw_params()
521 oxygen_update_spdif_source(chip); in oxygen_multich_hw_params()
522 spin_unlock_irq(&chip->reg_lock); in oxygen_multich_hw_params()
524 chip->model.set_dac_params(chip, hw_params); in oxygen_multich_hw_params()
525 oxygen_update_dac_routing(chip); in oxygen_multich_hw_params()
526 mutex_unlock(&chip->mutex); in oxygen_multich_hw_params()
532 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_hw_free() local
536 spin_lock_irq(&chip->reg_lock); in oxygen_hw_free()
537 chip->interrupt_mask &= ~channel_mask; in oxygen_hw_free()
538 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, chip->interrupt_mask); in oxygen_hw_free()
540 oxygen_set_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask); in oxygen_hw_free()
541 oxygen_clear_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask); in oxygen_hw_free()
542 spin_unlock_irq(&chip->reg_lock); in oxygen_hw_free()
549 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_spdif_hw_free() local
551 spin_lock_irq(&chip->reg_lock); in oxygen_spdif_hw_free()
552 oxygen_clear_bits32(chip, OXYGEN_SPDIF_CONTROL, in oxygen_spdif_hw_free()
554 spin_unlock_irq(&chip->reg_lock); in oxygen_spdif_hw_free()
560 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_prepare() local
564 spin_lock_irq(&chip->reg_lock); in oxygen_prepare()
565 oxygen_set_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask); in oxygen_prepare()
566 oxygen_clear_bits8(chip, OXYGEN_DMA_FLUSH, channel_mask); in oxygen_prepare()
569 chip->interrupt_mask &= ~channel_mask; in oxygen_prepare()
571 chip->interrupt_mask |= channel_mask; in oxygen_prepare()
572 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, chip->interrupt_mask); in oxygen_prepare()
573 spin_unlock_irq(&chip->reg_lock); in oxygen_prepare()
579 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_trigger() local
599 if (snd_pcm_substream_chip(s) == chip) { in oxygen_trigger()
605 spin_lock(&chip->reg_lock); in oxygen_trigger()
608 chip->pcm_running |= mask; in oxygen_trigger()
610 chip->pcm_running &= ~mask; in oxygen_trigger()
611 oxygen_write8(chip, OXYGEN_DMA_STATUS, chip->pcm_running); in oxygen_trigger()
614 oxygen_set_bits8(chip, OXYGEN_DMA_PAUSE, mask); in oxygen_trigger()
616 oxygen_clear_bits8(chip, OXYGEN_DMA_PAUSE, mask); in oxygen_trigger()
618 spin_unlock(&chip->reg_lock); in oxygen_trigger()
624 struct oxygen *chip = snd_pcm_substream_chip(substream); in oxygen_pointer() local
630 curr_addr = oxygen_read32(chip, channel_base_registers[channel]); in oxygen_pointer()
700 int oxygen_pcm_init(struct oxygen *chip) in oxygen_pcm_init() argument
706 outs = !!(chip->model.device_config & PLAYBACK_0_TO_I2S); in oxygen_pcm_init()
707 ins = !!(chip->model.device_config & (CAPTURE_0_FROM_I2S_1 | in oxygen_pcm_init()
710 err = snd_pcm_new(chip->card, "Multichannel", in oxygen_pcm_init()
717 if (chip->model.device_config & CAPTURE_0_FROM_I2S_1) in oxygen_pcm_init()
720 else if (chip->model.device_config & CAPTURE_0_FROM_I2S_2) in oxygen_pcm_init()
723 pcm->private_data = chip; in oxygen_pcm_init()
728 snd_dma_pci_data(chip->pci), in oxygen_pcm_init()
734 snd_dma_pci_data(chip->pci), in oxygen_pcm_init()
739 outs = !!(chip->model.device_config & PLAYBACK_1_TO_SPDIF); in oxygen_pcm_init()
740 ins = !!(chip->model.device_config & CAPTURE_1_FROM_SPDIF); in oxygen_pcm_init()
742 err = snd_pcm_new(chip->card, "Digital", 1, outs, ins, &pcm); in oxygen_pcm_init()
751 pcm->private_data = chip; in oxygen_pcm_init()
754 snd_dma_pci_data(chip->pci), in oxygen_pcm_init()
759 if (chip->has_ac97_1) { in oxygen_pcm_init()
760 outs = !!(chip->model.device_config & PLAYBACK_2_TO_AC97_1); in oxygen_pcm_init()
761 ins = !!(chip->model.device_config & CAPTURE_2_FROM_AC97_1); in oxygen_pcm_init()
764 ins = !!(chip->model.device_config & CAPTURE_2_FROM_I2S_2); in oxygen_pcm_init()
767 err = snd_pcm_new(chip->card, outs ? "AC97" : "Analog2", in oxygen_pcm_init()
774 oxygen_write8_masked(chip, OXYGEN_REC_ROUTING, in oxygen_pcm_init()
781 pcm->private_data = chip; in oxygen_pcm_init()
784 snd_dma_pci_data(chip->pci), in oxygen_pcm_init()
789 ins = !!(chip->model.device_config & CAPTURE_3_FROM_I2S_3); in oxygen_pcm_init()
791 err = snd_pcm_new(chip->card, "Analog3", 3, 0, ins, &pcm); in oxygen_pcm_init()
796 oxygen_write8_masked(chip, OXYGEN_REC_ROUTING, in oxygen_pcm_init()
799 pcm->private_data = chip; in oxygen_pcm_init()
802 snd_dma_pci_data(chip->pci), in oxygen_pcm_init()