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()
362 struct snd_hwdep *hwdep; in snd_hwdep_new() local
374 hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); in snd_hwdep_new()
375 if (!hwdep) in snd_hwdep_new()
378 init_waitqueue_head(&hwdep->open_wait); in snd_hwdep_new()
379 mutex_init(&hwdep->open_mutex); in snd_hwdep_new()
380 hwdep->card = card; in snd_hwdep_new()
381 hwdep->device = device; in snd_hwdep_new()
383 strscpy(hwdep->id, id, sizeof(hwdep->id)); in snd_hwdep_new()
385 snd_device_initialize(&hwdep->dev, card); in snd_hwdep_new()
386 hwdep->dev.release = release_hwdep_device; in snd_hwdep_new()
387 dev_set_name(&hwdep->dev, "hwC%iD%i", card->number, device); in snd_hwdep_new()
389 hwdep->oss_type = -1; in snd_hwdep_new()
392 err = snd_device_new(card, SNDRV_DEV_HWDEP, hwdep, &ops); in snd_hwdep_new()
394 put_device(&hwdep->dev); in snd_hwdep_new()
399 *rhwdep = hwdep; in snd_hwdep_new()
406 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_free() local
407 if (!hwdep) in snd_hwdep_dev_free()
409 if (hwdep->private_free) in snd_hwdep_dev_free()
410 hwdep->private_free(hwdep); in snd_hwdep_dev_free()
411 put_device(&hwdep->dev); in snd_hwdep_dev_free()
417 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_register() local
418 struct snd_card *card = hwdep->card; in snd_hwdep_dev_register()
422 if (snd_hwdep_search(card, hwdep->device)) { in snd_hwdep_dev_register()
426 list_add_tail(&hwdep->list, &snd_hwdep_devices); in snd_hwdep_dev_register()
428 hwdep->card, hwdep->device, in snd_hwdep_dev_register()
429 &snd_hwdep_f_ops, hwdep, &hwdep->dev); in snd_hwdep_dev_register()
431 dev_err(&hwdep->dev, "unable to register\n"); in snd_hwdep_dev_register()
432 list_del(&hwdep->list); in snd_hwdep_dev_register()
438 hwdep->ossreg = 0; in snd_hwdep_dev_register()
439 if (hwdep->oss_type >= 0) { in snd_hwdep_dev_register()
440 if (hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM && in snd_hwdep_dev_register()
441 hwdep->device) in snd_hwdep_dev_register()
442 dev_warn(&hwdep->dev, in snd_hwdep_dev_register()
444 else if (snd_register_oss_device(hwdep->oss_type, in snd_hwdep_dev_register()
445 card, hwdep->device, in snd_hwdep_dev_register()
446 &snd_hwdep_f_ops, hwdep) < 0) in snd_hwdep_dev_register()
447 dev_warn(&hwdep->dev, in snd_hwdep_dev_register()
450 hwdep->ossreg = 1; in snd_hwdep_dev_register()
459 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_disconnect() local
461 if (snd_BUG_ON(!hwdep)) in snd_hwdep_dev_disconnect()
464 if (snd_hwdep_search(hwdep->card, hwdep->device) != hwdep) { in snd_hwdep_dev_disconnect()
468 mutex_lock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
469 wake_up(&hwdep->open_wait); in snd_hwdep_dev_disconnect()
471 if (hwdep->ossreg) in snd_hwdep_dev_disconnect()
472 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device); in snd_hwdep_dev_disconnect()
474 snd_unregister_device(&hwdep->dev); in snd_hwdep_dev_disconnect()
475 list_del_init(&hwdep->list); in snd_hwdep_dev_disconnect()
476 mutex_unlock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
489 struct snd_hwdep *hwdep; in snd_hwdep_proc_read() local
492 list_for_each_entry(hwdep, &snd_hwdep_devices, list) in snd_hwdep_proc_read()
494 hwdep->card->number, hwdep->device, hwdep->name); in snd_hwdep_proc_read()