Lines Matching refs:hwdep
48 struct snd_hwdep *hwdep; in snd_hwdep_search() local
50 list_for_each_entry(hwdep, &snd_hwdep_devices, list) in snd_hwdep_search()
51 if (hwdep->card == card && hwdep->device == device) in snd_hwdep_search()
52 return hwdep; in snd_hwdep_search()
306 struct snd_hwdep *hwdep; in snd_hwdep_control_ioctl() local
311 hwdep = snd_hwdep_search(card, device); in snd_hwdep_control_ioctl()
312 if (hwdep) in snd_hwdep_control_ioctl()
313 err = snd_hwdep_info(hwdep, info); in snd_hwdep_control_ioctl()
368 struct snd_hwdep *hwdep; in snd_hwdep_new() local
380 hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); in snd_hwdep_new()
381 if (!hwdep) in snd_hwdep_new()
384 init_waitqueue_head(&hwdep->open_wait); in snd_hwdep_new()
385 mutex_init(&hwdep->open_mutex); in snd_hwdep_new()
386 hwdep->card = card; in snd_hwdep_new()
387 hwdep->device = device; in snd_hwdep_new()
389 strlcpy(hwdep->id, id, sizeof(hwdep->id)); in snd_hwdep_new()
391 snd_device_initialize(&hwdep->dev, card); in snd_hwdep_new()
392 hwdep->dev.release = release_hwdep_device; in snd_hwdep_new()
393 dev_set_name(&hwdep->dev, "hwC%iD%i", card->number, device); in snd_hwdep_new()
395 hwdep->oss_type = -1; in snd_hwdep_new()
398 err = snd_device_new(card, SNDRV_DEV_HWDEP, hwdep, &ops); in snd_hwdep_new()
400 put_device(&hwdep->dev); in snd_hwdep_new()
405 *rhwdep = hwdep; in snd_hwdep_new()
412 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_free() local
413 if (!hwdep) in snd_hwdep_dev_free()
415 if (hwdep->private_free) in snd_hwdep_dev_free()
416 hwdep->private_free(hwdep); in snd_hwdep_dev_free()
417 put_device(&hwdep->dev); in snd_hwdep_dev_free()
423 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_register() local
424 struct snd_card *card = hwdep->card; in snd_hwdep_dev_register()
428 if (snd_hwdep_search(card, hwdep->device)) { in snd_hwdep_dev_register()
432 list_add_tail(&hwdep->list, &snd_hwdep_devices); in snd_hwdep_dev_register()
434 hwdep->card, hwdep->device, in snd_hwdep_dev_register()
435 &snd_hwdep_f_ops, hwdep, &hwdep->dev); in snd_hwdep_dev_register()
437 dev_err(&hwdep->dev, "unable to register\n"); in snd_hwdep_dev_register()
438 list_del(&hwdep->list); in snd_hwdep_dev_register()
444 hwdep->ossreg = 0; in snd_hwdep_dev_register()
445 if (hwdep->oss_type >= 0) { in snd_hwdep_dev_register()
446 if (hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM && in snd_hwdep_dev_register()
447 hwdep->device) in snd_hwdep_dev_register()
448 dev_warn(&hwdep->dev, in snd_hwdep_dev_register()
450 else if (snd_register_oss_device(hwdep->oss_type, in snd_hwdep_dev_register()
451 card, hwdep->device, in snd_hwdep_dev_register()
452 &snd_hwdep_f_ops, hwdep) < 0) in snd_hwdep_dev_register()
453 dev_warn(&hwdep->dev, in snd_hwdep_dev_register()
456 hwdep->ossreg = 1; in snd_hwdep_dev_register()
465 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_disconnect() local
467 if (snd_BUG_ON(!hwdep)) in snd_hwdep_dev_disconnect()
470 if (snd_hwdep_search(hwdep->card, hwdep->device) != hwdep) { in snd_hwdep_dev_disconnect()
474 mutex_lock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
475 wake_up(&hwdep->open_wait); in snd_hwdep_dev_disconnect()
477 if (hwdep->ossreg) in snd_hwdep_dev_disconnect()
478 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device); in snd_hwdep_dev_disconnect()
480 snd_unregister_device(&hwdep->dev); in snd_hwdep_dev_disconnect()
481 list_del_init(&hwdep->list); in snd_hwdep_dev_disconnect()
482 mutex_unlock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
495 struct snd_hwdep *hwdep; in snd_hwdep_proc_read() local
498 list_for_each_entry(hwdep, &snd_hwdep_devices, list) in snd_hwdep_proc_read()
500 hwdep->card->number, hwdep->device, hwdep->name); in snd_hwdep_proc_read()