Lines Matching refs:us122l
97 struct us122l *us122l = area->vm_private_data; in usb_stream_hwdep_vm_open() local
99 atomic_inc(&us122l->mmap_count); in usb_stream_hwdep_vm_open()
100 snd_printdd(KERN_DEBUG "%i\n", atomic_read(&us122l->mmap_count)); in usb_stream_hwdep_vm_open()
108 struct us122l *us122l = vmf->vma->vm_private_data; in usb_stream_hwdep_vm_fault() local
111 mutex_lock(&us122l->mutex); in usb_stream_hwdep_vm_fault()
112 s = us122l->sk.s; in usb_stream_hwdep_vm_fault()
124 vaddr = us122l->sk.write_page + offset; in usb_stream_hwdep_vm_fault()
129 mutex_unlock(&us122l->mutex); in usb_stream_hwdep_vm_fault()
135 mutex_unlock(&us122l->mutex); in usb_stream_hwdep_vm_fault()
141 struct us122l *us122l = area->vm_private_data; in usb_stream_hwdep_vm_close() local
143 atomic_dec(&us122l->mmap_count); in usb_stream_hwdep_vm_close()
144 snd_printdd(KERN_DEBUG "%i\n", atomic_read(&us122l->mmap_count)); in usb_stream_hwdep_vm_close()
155 struct us122l *us122l = hw->private_data; in usb_stream_hwdep_open() local
162 if (!us122l->first) in usb_stream_hwdep_open()
163 us122l->first = file; in usb_stream_hwdep_open()
165 if (us122l->is_us144) { in usb_stream_hwdep_open()
166 iface = usb_ifnum_to_if(us122l->dev, 0); in usb_stream_hwdep_open()
169 iface = usb_ifnum_to_if(us122l->dev, 1); in usb_stream_hwdep_open()
176 struct us122l *us122l = hw->private_data; in usb_stream_hwdep_release() local
181 if (us122l->is_us144) { in usb_stream_hwdep_release()
182 iface = usb_ifnum_to_if(us122l->dev, 0); in usb_stream_hwdep_release()
185 iface = usb_ifnum_to_if(us122l->dev, 1); in usb_stream_hwdep_release()
187 if (us122l->first == file) in usb_stream_hwdep_release()
188 us122l->first = NULL; in usb_stream_hwdep_release()
189 mutex_lock(&us122l->mutex); in usb_stream_hwdep_release()
190 if (us122l->master == file) in usb_stream_hwdep_release()
191 us122l->master = us122l->slave; in usb_stream_hwdep_release()
193 us122l->slave = NULL; in usb_stream_hwdep_release()
194 mutex_unlock(&us122l->mutex); in usb_stream_hwdep_release()
202 struct us122l *us122l = hw->private_data; in usb_stream_hwdep_mmap() local
209 mutex_lock(&us122l->mutex); in usb_stream_hwdep_mmap()
210 s = us122l->sk.s; in usb_stream_hwdep_mmap()
230 area->vm_private_data = us122l; in usb_stream_hwdep_mmap()
231 atomic_inc(&us122l->mmap_count); in usb_stream_hwdep_mmap()
233 mutex_unlock(&us122l->mutex); in usb_stream_hwdep_mmap()
240 struct us122l *us122l = hw->private_data; in usb_stream_hwdep_poll() local
244 poll_wait(file, &us122l->sk.sleep, wait); in usb_stream_hwdep_poll()
247 if (mutex_trylock(&us122l->mutex)) { in usb_stream_hwdep_poll()
248 struct usb_stream *s = us122l->sk.s; in usb_stream_hwdep_poll()
251 if (us122l->first == file) in usb_stream_hwdep_poll()
254 polled = &us122l->second_periods_polled; in usb_stream_hwdep_poll()
262 mutex_unlock(&us122l->mutex); in usb_stream_hwdep_poll()
267 static void us122l_stop(struct us122l *us122l) in us122l_stop() argument
271 list_for_each(p, &us122l->midi_list) in us122l_stop()
274 usb_stream_stop(&us122l->sk); in us122l_stop()
275 usb_stream_free(&us122l->sk); in us122l_stop()
297 static bool us122l_start(struct us122l *us122l, in us122l_start() argument
305 if (us122l->dev->speed == USB_SPEED_HIGH) { in us122l_start()
322 if (!usb_stream_new(&us122l->sk, us122l->dev, 1, 2, in us122l_start()
326 err = us122l_set_sample_rate(us122l->dev, rate); in us122l_start()
328 us122l_stop(us122l); in us122l_start()
332 err = usb_stream_start(&us122l->sk); in us122l_start()
334 us122l_stop(us122l); in us122l_start()
338 list_for_each(p, &us122l->midi_list) in us122l_start()
349 struct us122l *us122l = hw->private_data; in usb_stream_hwdep_ioctl() local
364 high_speed = us122l->dev->speed == USB_SPEED_HIGH; in usb_stream_hwdep_ioctl()
390 mutex_lock(&us122l->mutex); in usb_stream_hwdep_ioctl()
391 s = us122l->sk.s; in usb_stream_hwdep_ioctl()
392 if (!us122l->master) { in usb_stream_hwdep_ioctl()
393 us122l->master = file; in usb_stream_hwdep_ioctl()
394 } else if (us122l->master != file) { in usb_stream_hwdep_ioctl()
399 us122l->slave = file; in usb_stream_hwdep_ioctl()
403 us122l_stop(us122l); in usb_stream_hwdep_ioctl()
404 if (!us122l_start(us122l, cfg.sample_rate, cfg.period_frames)) in usb_stream_hwdep_ioctl()
410 mutex_unlock(&us122l->mutex); in usb_stream_hwdep_ioctl()
411 wake_up_all(&us122l->sk.sleep); in usb_stream_hwdep_ioctl()
443 struct us122l *us122l = US122L(card); in us122l_create_card() local
445 if (us122l->is_us144) { in us122l_create_card()
446 err = usb_set_interface(us122l->dev, 0, 1); in us122l_create_card()
452 err = usb_set_interface(us122l->dev, 1, 1); in us122l_create_card()
458 pt_info_set(us122l->dev, 0x11); in us122l_create_card()
459 pt_info_set(us122l->dev, 0x10); in us122l_create_card()
461 if (!us122l_start(us122l, 44100, 256)) in us122l_create_card()
464 if (us122l->is_us144) in us122l_create_card()
477 list_for_each(p, &us122l->midi_list) in us122l_create_card()
485 us122l_stop(us122l); in us122l_create_card()
491 struct us122l *us122l = US122L(card); in snd_us122l_free() local
492 int index = us122l->card_index; in snd_us122l_free()
513 sizeof(struct us122l), &card); in usx2y_create_card()
597 struct us122l *us122l; in snd_us122l_disconnect() local
606 us122l = US122L(card); in snd_us122l_disconnect()
607 mutex_lock(&us122l->mutex); in snd_us122l_disconnect()
608 us122l_stop(us122l); in snd_us122l_disconnect()
609 mutex_unlock(&us122l->mutex); in snd_us122l_disconnect()
612 list_for_each(p, &us122l->midi_list) { in snd_us122l_disconnect()
616 usb_put_intf(usb_ifnum_to_if(us122l->dev, 0)); in snd_us122l_disconnect()
617 usb_put_intf(usb_ifnum_to_if(us122l->dev, 1)); in snd_us122l_disconnect()
618 usb_put_dev(us122l->dev); in snd_us122l_disconnect()
620 while (atomic_read(&us122l->mmap_count)) in snd_us122l_disconnect()
629 struct us122l *us122l; in snd_us122l_suspend() local
637 us122l = US122L(card); in snd_us122l_suspend()
638 if (!us122l) in snd_us122l_suspend()
641 list_for_each(p, &us122l->midi_list) in snd_us122l_suspend()
644 mutex_lock(&us122l->mutex); in snd_us122l_suspend()
645 usb_stream_stop(&us122l->sk); in snd_us122l_suspend()
646 mutex_unlock(&us122l->mutex); in snd_us122l_suspend()
654 struct us122l *us122l; in snd_us122l_resume() local
662 us122l = US122L(card); in snd_us122l_resume()
663 if (!us122l) in snd_us122l_resume()
666 mutex_lock(&us122l->mutex); in snd_us122l_resume()
668 if (us122l->is_us144) { in snd_us122l_resume()
669 err = usb_set_interface(us122l->dev, 0, 1); in snd_us122l_resume()
675 err = usb_set_interface(us122l->dev, 1, 1); in snd_us122l_resume()
681 pt_info_set(us122l->dev, 0x11); in snd_us122l_resume()
682 pt_info_set(us122l->dev, 0x10); in snd_us122l_resume()
684 err = us122l_set_sample_rate(us122l->dev, in snd_us122l_resume()
685 us122l->sk.s->cfg.sample_rate); in snd_us122l_resume()
690 err = usb_stream_start(&us122l->sk); in snd_us122l_resume()
694 list_for_each(p, &us122l->midi_list) in snd_us122l_resume()
697 mutex_unlock(&us122l->mutex); in snd_us122l_resume()