• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/core/

Lines Matching refs:hwdep

31 #include <sound/hwdep.h>
41 static int snd_hwdep_free(struct snd_hwdep *hwdep);
49 struct snd_hwdep *hwdep;
51 list_for_each_entry(hwdep, &snd_hwdep_devices, list)
52 if (hwdep->card == card && hwdep->device == device)
53 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;
360 hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL);
361 if (hwdep == NULL) {
362 snd_printk(KERN_ERR "hwdep: cannot allocate\n");
365 hwdep->card = card;
366 hwdep->device = device;
368 strlcpy(hwdep->id, id, sizeof(hwdep->id));
370 hwdep->oss_type = -1;
372 if ((err = snd_device_new(card, SNDRV_DEV_HWDEP, hwdep, &ops)) < 0) {
373 snd_hwdep_free(hwdep);
376 init_waitqueue_head(&hwdep->open_wait);
377 mutex_init(&hwdep->open_mutex);
378 *rhwdep = hwdep;
382 static int snd_hwdep_free(struct snd_hwdep *hwdep)
384 snd_assert(hwdep != NULL, return -ENXIO);
385 if (hwdep->private_free)
386 hwdep->private_free(hwdep);
387 kfree(hwdep);
393 struct snd_hwdep *hwdep = device->device_data;
394 return snd_hwdep_free(hwdep);
399 struct snd_hwdep *hwdep = device->device_data;
404 if (snd_hwdep_search(hwdep->card, hwdep->device)) {
408 list_add_tail(&hwdep->list, &snd_hwdep_devices);
409 sprintf(name, "hwC%iD%i", hwdep->card->number, hwdep->device);
411 hwdep->card, hwdep->device,
412 &snd_hwdep_f_ops, hwdep, name)) < 0) {
414 hwdep->card->number, hwdep->device);
415 list_del(&hwdep->list);
420 hwdep->ossreg = 0;
421 if (hwdep->oss_type >= 0) {
422 if ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) {
423 snd_printk (KERN_WARNING "only hwdep device 0 can be registered as OSS direct FM device!\n");
425 if (snd_register_oss_device(hwdep->oss_type,
426 hwdep->card, hwdep->device,
427 &snd_hwdep_f_ops, hwdep,
428 hwdep->oss_dev) < 0) {
430 hwdep->card->number, hwdep->device);
432 hwdep->ossreg = 1;
442 struct snd_hwdep *hwdep = device->device_data;
444 snd_assert(hwdep != NULL, return -ENXIO);
446 if (snd_hwdep_search(hwdep->card, hwdep->device) != hwdep) {
451 if (hwdep->ossreg)
452 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device);
454 snd_unregister_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device);
455 list_del_init(&hwdep->list);
468 struct snd_hwdep *hwdep;
471 list_for_each_entry(hwdep, &snd_hwdep_devices, list)
473 hwdep->card->number, hwdep->device, hwdep->name);
483 if ((entry = snd_info_create_module_entry(THIS_MODULE, "hwdep", NULL)) != NULL) {