Lines Matching refs:oxfw

63 static int name_card(struct snd_oxfw *oxfw)  in name_card()  argument
65 struct fw_device *fw_dev = fw_parent_device(oxfw->unit); in name_card()
80 err = fw_csr_string(oxfw->unit->directory, CSR_MODEL, in name_card()
85 err = snd_fw_transaction(oxfw->unit, TCODE_READ_QUADLET_REQUEST, in name_card()
92 if (oxfw->entry->vendor_id == VENDOR_GRIFFIN || in name_card()
93 oxfw->entry->vendor_id == VENDOR_LACIE) { in name_card()
94 info = (const struct compat_info *)oxfw->entry->driver_data; in name_card()
104 strcpy(oxfw->card->driver, d); in name_card()
105 strcpy(oxfw->card->mixername, m); in name_card()
106 strcpy(oxfw->card->shortname, m); in name_card()
108 snprintf(oxfw->card->longname, sizeof(oxfw->card->longname), in name_card()
112 dev_name(&oxfw->unit->device), 100 << fw_dev->max_speed); in name_card()
119 struct snd_oxfw *oxfw = card->private_data; in oxfw_card_free() local
121 if (oxfw->has_output || oxfw->has_input) in oxfw_card_free()
122 snd_oxfw_stream_destroy_duplex(oxfw); in oxfw_card_free()
125 static int detect_quirks(struct snd_oxfw *oxfw) in detect_quirks() argument
127 struct fw_device *fw_dev = fw_parent_device(oxfw->unit); in detect_quirks()
136 if (oxfw->entry->vendor_id == VENDOR_GRIFFIN) in detect_quirks()
137 return snd_oxfw_add_spkr(oxfw, false); in detect_quirks()
138 if (oxfw->entry->vendor_id == VENDOR_LACIE) in detect_quirks()
139 return snd_oxfw_add_spkr(oxfw, true); in detect_quirks()
145 if (oxfw->entry->vendor_id == OUI_STANTON) { in detect_quirks()
147 oxfw->midi_input_ports = 0; in detect_quirks()
148 oxfw->midi_output_ports = 0; in detect_quirks()
150 return snd_oxfw_scs1x_add(oxfw); in detect_quirks()
157 if (oxfw->entry->vendor_id == VENDOR_TASCAM) { in detect_quirks()
158 oxfw->midi_input_ports++; in detect_quirks()
159 oxfw->midi_output_ports++; in detect_quirks()
178 oxfw->wrong_dbs = true; in detect_quirks()
185 struct snd_oxfw *oxfw = container_of(work, struct snd_oxfw, dwork.work); in do_registration() local
188 if (oxfw->registered) in do_registration()
191 err = snd_card_new(&oxfw->unit->device, -1, NULL, THIS_MODULE, 0, in do_registration()
192 &oxfw->card); in do_registration()
195 oxfw->card->private_free = oxfw_card_free; in do_registration()
196 oxfw->card->private_data = oxfw; in do_registration()
198 err = name_card(oxfw); in do_registration()
202 err = snd_oxfw_stream_discover(oxfw); in do_registration()
206 err = detect_quirks(oxfw); in do_registration()
210 if (oxfw->has_output || oxfw->has_input) { in do_registration()
211 err = snd_oxfw_stream_init_duplex(oxfw); in do_registration()
215 err = snd_oxfw_create_pcm(oxfw); in do_registration()
219 snd_oxfw_proc_init(oxfw); in do_registration()
221 err = snd_oxfw_create_midi(oxfw); in do_registration()
225 err = snd_oxfw_create_hwdep(oxfw); in do_registration()
230 err = snd_card_register(oxfw->card); in do_registration()
234 oxfw->registered = true; in do_registration()
238 snd_card_free(oxfw->card); in do_registration()
239 dev_info(&oxfw->unit->device, in do_registration()
246 struct snd_oxfw *oxfw; in oxfw_probe() local
252 oxfw = devm_kzalloc(&unit->device, sizeof(struct snd_oxfw), GFP_KERNEL); in oxfw_probe()
253 if (!oxfw) in oxfw_probe()
255 oxfw->unit = fw_unit_get(unit); in oxfw_probe()
256 dev_set_drvdata(&unit->device, oxfw); in oxfw_probe()
258 oxfw->entry = entry; in oxfw_probe()
259 mutex_init(&oxfw->mutex); in oxfw_probe()
260 spin_lock_init(&oxfw->lock); in oxfw_probe()
261 init_waitqueue_head(&oxfw->hwdep_wait); in oxfw_probe()
264 INIT_DEFERRABLE_WORK(&oxfw->dwork, do_registration); in oxfw_probe()
265 snd_fw_schedule_registration(unit, &oxfw->dwork); in oxfw_probe()
272 struct snd_oxfw *oxfw = dev_get_drvdata(&unit->device); in oxfw_bus_reset() local
274 if (!oxfw->registered) in oxfw_bus_reset()
275 snd_fw_schedule_registration(unit, &oxfw->dwork); in oxfw_bus_reset()
277 fcp_bus_reset(oxfw->unit); in oxfw_bus_reset()
279 if (oxfw->registered) { in oxfw_bus_reset()
280 if (oxfw->has_output || oxfw->has_input) { in oxfw_bus_reset()
281 mutex_lock(&oxfw->mutex); in oxfw_bus_reset()
282 snd_oxfw_stream_update_duplex(oxfw); in oxfw_bus_reset()
283 mutex_unlock(&oxfw->mutex); in oxfw_bus_reset()
286 if (oxfw->entry->vendor_id == OUI_STANTON) in oxfw_bus_reset()
287 snd_oxfw_scs1x_update(oxfw); in oxfw_bus_reset()
293 struct snd_oxfw *oxfw = dev_get_drvdata(&unit->device); in oxfw_remove() local
300 cancel_delayed_work_sync(&oxfw->dwork); in oxfw_remove()
302 if (oxfw->registered) { in oxfw_remove()
304 snd_card_free(oxfw->card); in oxfw_remove()
307 mutex_destroy(&oxfw->mutex); in oxfw_remove()
308 fw_unit_put(oxfw->unit); in oxfw_remove()