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()
299 struct snd_hwdep *hwdep; in snd_hwdep_control_ioctl() local
304 hwdep = snd_hwdep_search(card, device); in snd_hwdep_control_ioctl()
305 if (hwdep) in snd_hwdep_control_ioctl()
306 err = snd_hwdep_info(hwdep, info); in snd_hwdep_control_ioctl()
361 struct snd_hwdep *hwdep; in snd_hwdep_new() local
373 hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); in snd_hwdep_new()
374 if (!hwdep) in snd_hwdep_new()
377 init_waitqueue_head(&hwdep->open_wait); in snd_hwdep_new()
378 mutex_init(&hwdep->open_mutex); in snd_hwdep_new()
379 hwdep->card = card; in snd_hwdep_new()
380 hwdep->device = device; in snd_hwdep_new()
382 strlcpy(hwdep->id, id, sizeof(hwdep->id)); in snd_hwdep_new()
384 snd_device_initialize(&hwdep->dev, card); in snd_hwdep_new()
385 hwdep->dev.release = release_hwdep_device; in snd_hwdep_new()
386 dev_set_name(&hwdep->dev, "hwC%iD%i", card->number, device); in snd_hwdep_new()
388 hwdep->oss_type = -1; in snd_hwdep_new()
391 err = snd_device_new(card, SNDRV_DEV_HWDEP, hwdep, &ops); in snd_hwdep_new()
393 put_device(&hwdep->dev); in snd_hwdep_new()
398 *rhwdep = hwdep; in snd_hwdep_new()
405 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_free() local
406 if (!hwdep) in snd_hwdep_dev_free()
408 if (hwdep->private_free) in snd_hwdep_dev_free()
409 hwdep->private_free(hwdep); in snd_hwdep_dev_free()
410 put_device(&hwdep->dev); in snd_hwdep_dev_free()
416 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_register() local
417 struct snd_card *card = hwdep->card; in snd_hwdep_dev_register()
421 if (snd_hwdep_search(card, hwdep->device)) { in snd_hwdep_dev_register()
425 list_add_tail(&hwdep->list, &snd_hwdep_devices); in snd_hwdep_dev_register()
427 hwdep->card, hwdep->device, in snd_hwdep_dev_register()
428 &snd_hwdep_f_ops, hwdep, &hwdep->dev); in snd_hwdep_dev_register()
430 dev_err(&hwdep->dev, "unable to register\n"); in snd_hwdep_dev_register()
431 list_del(&hwdep->list); in snd_hwdep_dev_register()
437 hwdep->ossreg = 0; in snd_hwdep_dev_register()
438 if (hwdep->oss_type >= 0) { in snd_hwdep_dev_register()
439 if (hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM && in snd_hwdep_dev_register()
440 hwdep->device) in snd_hwdep_dev_register()
441 dev_warn(&hwdep->dev, in snd_hwdep_dev_register()
443 else if (snd_register_oss_device(hwdep->oss_type, in snd_hwdep_dev_register()
444 card, hwdep->device, in snd_hwdep_dev_register()
445 &snd_hwdep_f_ops, hwdep) < 0) in snd_hwdep_dev_register()
446 dev_warn(&hwdep->dev, in snd_hwdep_dev_register()
449 hwdep->ossreg = 1; in snd_hwdep_dev_register()
458 struct snd_hwdep *hwdep = device->device_data; in snd_hwdep_dev_disconnect() local
460 if (snd_BUG_ON(!hwdep)) in snd_hwdep_dev_disconnect()
463 if (snd_hwdep_search(hwdep->card, hwdep->device) != hwdep) { in snd_hwdep_dev_disconnect()
467 mutex_lock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
468 wake_up(&hwdep->open_wait); in snd_hwdep_dev_disconnect()
470 if (hwdep->ossreg) in snd_hwdep_dev_disconnect()
471 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device); in snd_hwdep_dev_disconnect()
473 snd_unregister_device(&hwdep->dev); in snd_hwdep_dev_disconnect()
474 list_del_init(&hwdep->list); in snd_hwdep_dev_disconnect()
475 mutex_unlock(&hwdep->open_mutex); in snd_hwdep_dev_disconnect()
488 struct snd_hwdep *hwdep; in snd_hwdep_proc_read() local
491 list_for_each_entry(hwdep, &snd_hwdep_devices, list) in snd_hwdep_proc_read()
493 hwdep->card->number, hwdep->device, hwdep->name); in snd_hwdep_proc_read()