card.c (95d002e0a34cb0f238abb39987f9980f325d8332) card.c (66354f18fe5fbb65f7b10a519654013d6df09f80)
1/*
2 * (Tentative) USB Audio Driver for ALSA
3 *
4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
5 *
6 * Many codes borrowed from audio.c by
7 * Alan Cox (alan@lxorguk.ukuu.org.uk)
8 * Thomas Sailer (sailer@ife.ee.ethz.ch)

--- 54 unchanged lines hidden (view full) ---

63#include "quirks.h"
64#include "endpoint.h"
65#include "helper.h"
66#include "debug.h"
67#include "pcm.h"
68#include "format.h"
69#include "power.h"
70#include "stream.h"
1/*
2 * (Tentative) USB Audio Driver for ALSA
3 *
4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
5 *
6 * Many codes borrowed from audio.c by
7 * Alan Cox (alan@lxorguk.ukuu.org.uk)
8 * Thomas Sailer (sailer@ife.ee.ethz.ch)

--- 54 unchanged lines hidden (view full) ---

63#include "quirks.h"
64#include "endpoint.h"
65#include "helper.h"
66#include "debug.h"
67#include "pcm.h"
68#include "format.h"
69#include "power.h"
70#include "stream.h"
71#include "media.h"
71
72MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
73MODULE_DESCRIPTION("USB Audio");
74MODULE_LICENSE("GPL");
75MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}");
76
77
78static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */

--- 589 unchanged lines hidden (view full) ---

668 goto __error;
669 }
670
671 /* we are allowed to call snd_card_register() many times */
672 err = snd_card_register(chip->card);
673 if (err < 0)
674 goto __error;
675
72
73MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
74MODULE_DESCRIPTION("USB Audio");
75MODULE_LICENSE("GPL");
76MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}");
77
78
79static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */

--- 589 unchanged lines hidden (view full) ---

669 goto __error;
670 }
671
672 /* we are allowed to call snd_card_register() many times */
673 err = snd_card_register(chip->card);
674 if (err < 0)
675 goto __error;
676
677 if (quirk && quirk->shares_media_device) {
678 /* don't want to fail when snd_media_device_create() fails */
679 snd_media_device_create(chip, intf);
680 }
681
676 usb_chip[chip->index] = chip;
677 chip->num_interfaces++;
678 usb_set_intfdata(intf, chip);
679 atomic_dec(&chip->active);
680 mutex_unlock(&register_mutex);
681 return 0;
682
683 __error:

--- 43 unchanged lines hidden (view full) ---

727 /* release the endpoint resources */
728 list_for_each_entry(ep, &chip->ep_list, list) {
729 snd_usb_endpoint_release(ep);
730 }
731 /* release the midi resources */
732 list_for_each(p, &chip->midi_list) {
733 snd_usbmidi_disconnect(p);
734 }
682 usb_chip[chip->index] = chip;
683 chip->num_interfaces++;
684 usb_set_intfdata(intf, chip);
685 atomic_dec(&chip->active);
686 mutex_unlock(&register_mutex);
687 return 0;
688
689 __error:

--- 43 unchanged lines hidden (view full) ---

733 /* release the endpoint resources */
734 list_for_each_entry(ep, &chip->ep_list, list) {
735 snd_usb_endpoint_release(ep);
736 }
737 /* release the midi resources */
738 list_for_each(p, &chip->midi_list) {
739 snd_usbmidi_disconnect(p);
740 }
741 /*
742 * Nice to check quirk && quirk->shares_media_device and
743 * then call the snd_media_device_delete(). Don't have
744 * access to the quirk here. snd_media_device_delete()
745 * accesses mixer_list
746 */
747 snd_media_device_delete(chip);
748
735 /* release mixer resources */
736 list_for_each_entry(mixer, &chip->mixer_list, list) {
737 snd_usb_mixer_disconnect(mixer);
738 }
739 }
740
741 chip->num_interfaces--;
742 if (chip->num_interfaces <= 0) {

--- 168 unchanged lines hidden ---
749 /* release mixer resources */
750 list_for_each_entry(mixer, &chip->mixer_list, list) {
751 snd_usb_mixer_disconnect(mixer);
752 }
753 }
754
755 chip->num_interfaces--;
756 if (chip->num_interfaces <= 0) {

--- 168 unchanged lines hidden ---