Lines Matching +full:chip +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0-or-later
12 #include "chip.h"
30 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
31 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */
38 module_param_array(id, charp, NULL, 0444);
39 MODULE_PARM_DESC(id, "ID string for the 6fire sound device.");
45 static void usb6fire_chip_abort(struct sfire_chip *chip)
47 if (chip) {
48 if (chip->pcm)
49 usb6fire_pcm_abort(chip);
50 if (chip->midi)
51 usb6fire_midi_abort(chip);
52 if (chip->comm)
53 usb6fire_comm_abort(chip);
54 if (chip->control)
55 usb6fire_control_abort(chip);
56 if (chip->card) {
57 snd_card_disconnect(chip->card);
58 snd_card_free_when_closed(chip->card);
59 chip->card = NULL;
66 struct sfire_chip *chip = card->private_data;
68 if (chip) {
69 if (chip->pcm)
70 usb6fire_pcm_destroy(chip);
71 if (chip->midi)
72 usb6fire_midi_destroy(chip);
73 if (chip->comm)
74 usb6fire_comm_destroy(chip);
75 if (chip->control)
76 usb6fire_control_destroy(chip);
85 struct sfire_chip *chip = NULL;
87 int regidx = -1; /* index in module parameter array */
95 chips[i]->intf_count++;
102 dev_err(&intf->dev, "too many cards registered.\n");
103 return -ENODEV;
117 dev_err(&intf->dev, "can't set first interface.\n");
118 return -EIO;
120 ret = snd_card_new(&intf->dev, index[regidx], id[regidx],
123 dev_err(&intf->dev, "cannot create alsa card.\n");
126 strscpy(card->driver, "6FireUSB");
127 strscpy(card->shortname, "TerraTec DMX6FireUSB");
128 sprintf(card->longname, "%s at %d:%d", card->shortname,
129 device->bus->busnum, device->devnum);
131 chip = card->private_data;
132 chips[regidx] = chip;
133 chip->dev = device;
134 chip->regidx = regidx;
135 chip->intf_count = 1;
136 chip->card = card;
137 card->private_free = usb6fire_card_free;
139 ret = usb6fire_comm_init(chip);
143 ret = usb6fire_midi_init(chip);
147 ret = usb6fire_pcm_init(chip);
151 ret = usb6fire_control_init(chip);
157 dev_err(&intf->dev, "cannot register card.");
160 usb_set_intfdata(intf, chip);
170 struct sfire_chip *chip;
172 chip = usb_get_intfdata(intf);
173 if (chip) { /* if !chip, fw upload has been performed */
174 chip->intf_count--;
175 if (!chip->intf_count) {
177 devices[chip->regidx] = NULL;
178 chips[chip->regidx] = NULL;
181 chip->shutdown = true;
182 usb6fire_chip_abort(chip);
199 .name = "snd-usb-6fire",