Lines Matching refs:dummy

544 	struct snd_dummy *dummy = snd_pcm_substream_chip(substream);  in dummy_pcm_open()  local
545 const struct dummy_model *model = dummy->model; in dummy_pcm_open()
561 runtime->hw = dummy->pcm_hw; in dummy_pcm_open()
668 static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device, in snd_card_dummy_pcm() argument
675 err = snd_pcm_new(dummy->card, "Dummy PCM", device, in snd_card_dummy_pcm()
679 dummy->pcm = pcm; in snd_card_dummy_pcm()
686 pcm->private_data = dummy; in snd_card_dummy_pcm()
724 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol); in snd_dummy_volume_get() local
727 spin_lock_irq(&dummy->mixer_lock); in snd_dummy_volume_get()
728 ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0]; in snd_dummy_volume_get()
729 ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1]; in snd_dummy_volume_get()
730 spin_unlock_irq(&dummy->mixer_lock); in snd_dummy_volume_get()
737 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol); in snd_dummy_volume_put() local
751 spin_lock_irq(&dummy->mixer_lock); in snd_dummy_volume_put()
752 change = dummy->mixer_volume[addr][0] != left || in snd_dummy_volume_put()
753 dummy->mixer_volume[addr][1] != right; in snd_dummy_volume_put()
754 dummy->mixer_volume[addr][0] = left; in snd_dummy_volume_put()
755 dummy->mixer_volume[addr][1] = right; in snd_dummy_volume_put()
756 spin_unlock_irq(&dummy->mixer_lock); in snd_dummy_volume_put()
773 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol); in snd_dummy_capsrc_get() local
776 spin_lock_irq(&dummy->mixer_lock); in snd_dummy_capsrc_get()
777 ucontrol->value.integer.value[0] = dummy->capture_source[addr][0]; in snd_dummy_capsrc_get()
778 ucontrol->value.integer.value[1] = dummy->capture_source[addr][1]; in snd_dummy_capsrc_get()
779 spin_unlock_irq(&dummy->mixer_lock); in snd_dummy_capsrc_get()
785 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol); in snd_dummy_capsrc_put() local
791 spin_lock_irq(&dummy->mixer_lock); in snd_dummy_capsrc_put()
792 change = dummy->capture_source[addr][0] != left && in snd_dummy_capsrc_put()
793 dummy->capture_source[addr][1] != right; in snd_dummy_capsrc_put()
794 dummy->capture_source[addr][0] = left; in snd_dummy_capsrc_put()
795 dummy->capture_source[addr][1] = right; in snd_dummy_capsrc_put()
796 spin_unlock_irq(&dummy->mixer_lock); in snd_dummy_capsrc_put()
811 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol); in snd_dummy_iobox_get() local
813 value->value.enumerated.item[0] = dummy->iobox; in snd_dummy_iobox_get()
820 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol); in snd_dummy_iobox_put() local
826 changed = value->value.enumerated.item[0] != dummy->iobox; in snd_dummy_iobox_put()
828 dummy->iobox = value->value.enumerated.item[0]; in snd_dummy_iobox_put()
830 if (dummy->iobox) { in snd_dummy_iobox_put()
831 dummy->cd_volume_ctl->vd[0].access &= in snd_dummy_iobox_put()
833 dummy->cd_switch_ctl->vd[0].access &= in snd_dummy_iobox_put()
836 dummy->cd_volume_ctl->vd[0].access |= in snd_dummy_iobox_put()
838 dummy->cd_switch_ctl->vd[0].access |= in snd_dummy_iobox_put()
842 snd_ctl_notify(dummy->card, SNDRV_CTL_EVENT_MASK_INFO, in snd_dummy_iobox_put()
843 &dummy->cd_volume_ctl->id); in snd_dummy_iobox_put()
844 snd_ctl_notify(dummy->card, SNDRV_CTL_EVENT_MASK_INFO, in snd_dummy_iobox_put()
845 &dummy->cd_switch_ctl->id); in snd_dummy_iobox_put()
871 static int snd_card_dummy_new_mixer(struct snd_dummy *dummy) in snd_card_dummy_new_mixer() argument
873 struct snd_card *card = dummy->card; in snd_card_dummy_new_mixer()
878 spin_lock_init(&dummy->mixer_lock); in snd_card_dummy_new_mixer()
880 dummy->iobox = 1; in snd_card_dummy_new_mixer()
883 kcontrol = snd_ctl_new1(&snd_dummy_controls[idx], dummy); in snd_card_dummy_new_mixer()
888 dummy->cd_volume_ctl = kcontrol; in snd_card_dummy_new_mixer()
890 dummy->cd_switch_ctl = kcontrol; in snd_card_dummy_new_mixer()
900 static void print_formats(struct snd_dummy *dummy, in print_formats() argument
906 if (dummy->pcm_hw.formats & pcm_format_to_bits(i)) in print_formats()
911 static void print_rates(struct snd_dummy *dummy, in print_rates() argument
920 if (dummy->pcm_hw.rates & SNDRV_PCM_RATE_CONTINUOUS) in print_rates()
922 if (dummy->pcm_hw.rates & SNDRV_PCM_RATE_KNOT) in print_rates()
925 if (dummy->pcm_hw.rates & (1 << i)) in print_rates()
929 #define get_dummy_int_ptr(dummy, ofs) \ argument
930 (unsigned int *)((char *)&((dummy)->pcm_hw) + (ofs))
931 #define get_dummy_ll_ptr(dummy, ofs) \ argument
932 (unsigned long long *)((char *)&((dummy)->pcm_hw) + (ofs))
963 struct snd_dummy *dummy = entry->private_data; in dummy_proc_read() local
970 *get_dummy_int_ptr(dummy, fields[i].offset)); in dummy_proc_read()
973 *get_dummy_ll_ptr(dummy, fields[i].offset)); in dummy_proc_read()
975 print_formats(dummy, buffer); in dummy_proc_read()
977 print_rates(dummy, buffer); in dummy_proc_read()
985 struct snd_dummy *dummy = entry->private_data; in dummy_proc_write() local
1005 *get_dummy_int_ptr(dummy, fields[i].offset) = val; in dummy_proc_write()
1007 *get_dummy_ll_ptr(dummy, fields[i].offset) = val; in dummy_proc_write()
1023 struct snd_dummy *dummy; in snd_dummy_probe() local
1032 dummy = card->private_data; in snd_dummy_probe()
1033 dummy->card = card; in snd_dummy_probe()
1039 m = dummy->model = *mdl; in snd_dummy_probe()
1048 err = snd_card_dummy_pcm(dummy, idx, pcm_substreams[dev]); in snd_dummy_probe()
1053 dummy->pcm_hw = dummy_pcm_hardware; in snd_dummy_probe()
1056 dummy->pcm_hw.formats = m->formats; in snd_dummy_probe()
1058 dummy->pcm_hw.buffer_bytes_max = m->buffer_bytes_max; in snd_dummy_probe()
1060 dummy->pcm_hw.period_bytes_min = m->period_bytes_min; in snd_dummy_probe()
1062 dummy->pcm_hw.period_bytes_max = m->period_bytes_max; in snd_dummy_probe()
1064 dummy->pcm_hw.periods_min = m->periods_min; in snd_dummy_probe()
1066 dummy->pcm_hw.periods_max = m->periods_max; in snd_dummy_probe()
1068 dummy->pcm_hw.rates = m->rates; in snd_dummy_probe()
1070 dummy->pcm_hw.rate_min = m->rate_min; in snd_dummy_probe()
1072 dummy->pcm_hw.rate_max = m->rate_max; in snd_dummy_probe()
1074 dummy->pcm_hw.channels_min = m->channels_min; in snd_dummy_probe()
1076 dummy->pcm_hw.channels_max = m->channels_max; in snd_dummy_probe()
1085 err = snd_card_dummy_new_mixer(dummy); in snd_dummy_probe()
1092 dummy_proc_init(dummy); in snd_dummy_probe()