• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/sound/core/

Lines Matching defs:hwdep

30 #include <sound/hwdep.h>
40 static int snd_hwdep_free(struct snd_hwdep *hwdep);
48 struct snd_hwdep *hwdep;
50 list_for_each_entry(hwdep, &snd_hwdep_devices, list)
51 if (hwdep->card == card && hwdep->device == device)
52 return hwdep;
292 struct snd_hwdep *hwdep;
297 hwdep = snd_hwdep_search(card, device);
298 if (hwdep)
299 err = snd_hwdep_info(hwdep, info);
334 * snd_hwdep_new - create a new hwdep instance
338 * @rhwdep: the pointer to store the new hwdep instance
340 * Creates a new hwdep instance with the given index on the card.
341 * The callbacks (hwdep->ops) must be set on the returned instance
349 struct snd_hwdep *hwdep;
361 hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL);
362 if (hwdep == NULL) {
363 snd_printk(KERN_ERR "hwdep: cannot allocate\n");
366 hwdep->card = card;
367 hwdep->device = device;
369 strlcpy(hwdep->id, id, sizeof(hwdep->id));
371 hwdep->oss_type = -1;
373 if ((err = snd_device_new(card, SNDRV_DEV_HWDEP, hwdep, &ops)) < 0) {
374 snd_hwdep_free(hwdep);
377 init_waitqueue_head(&hwdep->open_wait);
378 mutex_init(&hwdep->open_mutex);
380 *rhwdep = hwdep;
384 static int snd_hwdep_free(struct snd_hwdep *hwdep)
386 if (!hwdep)
388 if (hwdep->private_free)
389 hwdep->private_free(hwdep);
390 kfree(hwdep);
396 struct snd_hwdep *hwdep = device->device_data;
397 return snd_hwdep_free(hwdep);
402 struct snd_hwdep *hwdep = device->device_data;
407 if (snd_hwdep_search(hwdep->card, hwdep->device)) {
411 list_add_tail(&hwdep->list, &snd_hwdep_devices);
412 sprintf(name, "hwC%iD%i", hwdep->card->number, hwdep->device);
414 hwdep->card, hwdep->device,
415 &snd_hwdep_f_ops, hwdep, name)) < 0) {
417 hwdep->card->number, hwdep->device);
418 list_del(&hwdep->list);
423 hwdep->ossreg = 0;
424 if (hwdep->oss_type >= 0) {
425 if ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) {
426 snd_printk (KERN_WARNING "only hwdep device 0 can be registered as OSS direct FM device!\n");
428 if (snd_register_oss_device(hwdep->oss_type,
429 hwdep->card, hwdep->device,
430 &snd_hwdep_f_ops, hwdep,
431 hwdep->oss_dev) < 0) {
433 hwdep->card->number, hwdep->device);
435 hwdep->ossreg = 1;
445 struct snd_hwdep *hwdep = device->device_data;
447 if (snd_BUG_ON(!hwdep))
450 if (snd_hwdep_search(hwdep->card, hwdep->device) != hwdep) {
455 if (hwdep->ossreg)
456 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device);
458 snd_unregister_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device);
459 list_del_init(&hwdep->list);
472 struct snd_hwdep *hwdep;
475 list_for_each_entry(hwdep, &snd_hwdep_devices, list)
477 hwdep->card->number, hwdep->device, hwdep->name);
487 if ((entry = snd_info_create_module_entry(THIS_MODULE, "hwdep", NULL)) != NULL) {