Lines Matching refs:hwdep

34 	struct snd_hwdep *hwdep;  in snd_hwdep_search()  local
36 list_for_each_entry(hwdep, &snd_hwdep_devices, list) in snd_hwdep_search()
37 if (hwdep->card == card && hwdep->device == device) in snd_hwdep_search()
38 return hwdep; in snd_hwdep_search()
300 struct snd_hwdep *hwdep; in snd_hwdep_control_ioctl() local
305 hwdep = snd_hwdep_search(card, device); in snd_hwdep_control_ioctl()
306 if (hwdep) in snd_hwdep_control_ioctl()
307 err = snd_hwdep_info(hwdep, info); in snd_hwdep_control_ioctl()
341 static void snd_hwdep_free(struct snd_hwdep *hwdep) in snd_hwdep_free() argument
343 if (!hwdep) in snd_hwdep_free()
345 if (hwdep->private_free) in snd_hwdep_free()
346 hwdep->private_free(hwdep); in snd_hwdep_free()
347 put_device(hwdep->dev); in snd_hwdep_free()
348 kfree(hwdep); in snd_hwdep_free()
367 struct snd_hwdep *hwdep; in snd_hwdep_new() local
379 hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); in snd_hwdep_new()
380 if (!hwdep) in snd_hwdep_new()
383 init_waitqueue_head(&hwdep->open_wait); in snd_hwdep_new()
384 mutex_init(&hwdep->open_mutex); in snd_hwdep_new()
385 hwdep->card = card; in snd_hwdep_new()
386 hwdep->device = device; in snd_hwdep_new()
388 strscpy(hwdep->id, id, sizeof(hwdep->id)); in snd_hwdep_new()
390 err = snd_device_alloc(&hwdep->dev, card); in snd_hwdep_new()
392 snd_hwdep_free(hwdep); in snd_hwdep_new()
396 dev_set_name(hwdep->dev, "hwC%iD%i", card->number, device); in snd_hwdep_new()
398 hwdep->oss_type = -1; in snd_hwdep_new()
401 err = snd_device_new(card, SNDRV_DEV_HWDEP, hwdep, &ops); in snd_hwdep_new()
403 snd_hwdep_free(hwdep); in snd_hwdep_new()
408 *rhwdep = hwdep; in snd_hwdep_new()
421 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_register() local
422 struct snd_card *card = hwdep->card; in snd_hwdep_dev_register()
426 if (snd_hwdep_search(card, hwdep->device)) { in snd_hwdep_dev_register()
430 list_add_tail(&hwdep->list, &snd_hwdep_devices); in snd_hwdep_dev_register()
432 hwdep->card, hwdep->device, in snd_hwdep_dev_register()
433 &snd_hwdep_f_ops, hwdep, hwdep->dev); in snd_hwdep_dev_register()
435 dev_err(hwdep->dev, "unable to register\n"); in snd_hwdep_dev_register()
436 list_del(&hwdep->list); in snd_hwdep_dev_register()
442 hwdep->ossreg = 0; in snd_hwdep_dev_register()
443 if (hwdep->oss_type >= 0) { in snd_hwdep_dev_register()
444 if (hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM && in snd_hwdep_dev_register()
445 hwdep->device) in snd_hwdep_dev_register()
446 dev_warn(hwdep->dev, in snd_hwdep_dev_register()
448 else if (snd_register_oss_device(hwdep->oss_type, in snd_hwdep_dev_register()
449 card, hwdep->device, in snd_hwdep_dev_register()
450 &snd_hwdep_f_ops, hwdep) < 0) in snd_hwdep_dev_register()
451 dev_warn(hwdep->dev, in snd_hwdep_dev_register()
454 hwdep->ossreg = 1; in snd_hwdep_dev_register()
463 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_disconnect() local
465 if (snd_BUG_ON(!hwdep)) in snd_hwdep_dev_disconnect()
468 if (snd_hwdep_search(hwdep->card, hwdep->device) != hwdep) { in snd_hwdep_dev_disconnect()
472 mutex_lock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
473 wake_up(&hwdep->open_wait); in snd_hwdep_dev_disconnect()
475 if (hwdep->ossreg) in snd_hwdep_dev_disconnect()
476 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device); in snd_hwdep_dev_disconnect()
478 snd_unregister_device(hwdep->dev); in snd_hwdep_dev_disconnect()
479 list_del_init(&hwdep->list); in snd_hwdep_dev_disconnect()
480 mutex_unlock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
493 struct snd_hwdep *hwdep; in snd_hwdep_proc_read() local
496 list_for_each_entry(hwdep, &snd_hwdep_devices, list) in snd_hwdep_proc_read()
498 hwdep->card->number, hwdep->device, hwdep->name); in snd_hwdep_proc_read()