Lines Matching refs:efw

72 get_hardware_info(struct snd_efw *efw)  in get_hardware_info()  argument
74 struct fw_device *fw_dev = fw_parent_device(efw->unit); in get_hardware_info()
83 err = snd_efw_command_get_hwinfo(efw, hwinfo); in get_hardware_info()
91 efw->firmware_version = hwinfo->arm_version; in get_hardware_info()
93 strcpy(efw->card->driver, "Fireworks"); in get_hardware_info()
94 strcpy(efw->card->shortname, hwinfo->model_name); in get_hardware_info()
95 strcpy(efw->card->mixername, hwinfo->model_name); in get_hardware_info()
96 snprintf(efw->card->longname, sizeof(efw->card->longname), in get_hardware_info()
100 dev_name(&efw->unit->device), 100 << fw_dev->max_speed); in get_hardware_info()
103 efw->resp_addr_changable = true; in get_hardware_info()
105 efw->supported_sampling_rate = 0; in get_hardware_info()
108 efw->supported_sampling_rate |= SNDRV_PCM_RATE_22050; in get_hardware_info()
111 efw->supported_sampling_rate |= SNDRV_PCM_RATE_32000; in get_hardware_info()
114 efw->supported_sampling_rate |= SNDRV_PCM_RATE_44100; in get_hardware_info()
117 efw->supported_sampling_rate |= SNDRV_PCM_RATE_48000; in get_hardware_info()
120 efw->supported_sampling_rate |= SNDRV_PCM_RATE_88200; in get_hardware_info()
123 efw->supported_sampling_rate |= SNDRV_PCM_RATE_96000; in get_hardware_info()
126 efw->supported_sampling_rate |= SNDRV_PCM_RATE_176400; in get_hardware_info()
129 efw->supported_sampling_rate |= SNDRV_PCM_RATE_192000; in get_hardware_info()
137 efw->midi_out_ports = hwinfo->midi_out_ports; in get_hardware_info()
138 efw->midi_in_ports = hwinfo->midi_in_ports; in get_hardware_info()
149 efw->pcm_capture_channels[0] = hwinfo->amdtp_tx_pcm_channels; in get_hardware_info()
150 efw->pcm_capture_channels[1] = hwinfo->amdtp_tx_pcm_channels_2x; in get_hardware_info()
151 efw->pcm_capture_channels[2] = hwinfo->amdtp_tx_pcm_channels_4x; in get_hardware_info()
152 efw->pcm_playback_channels[0] = hwinfo->amdtp_rx_pcm_channels; in get_hardware_info()
153 efw->pcm_playback_channels[1] = hwinfo->amdtp_rx_pcm_channels_2x; in get_hardware_info()
154 efw->pcm_playback_channels[2] = hwinfo->amdtp_rx_pcm_channels_4x; in get_hardware_info()
162 efw->phys_in = hwinfo->phys_in; in get_hardware_info()
163 efw->phys_out = hwinfo->phys_out; in get_hardware_info()
164 efw->phys_in_grp_count = hwinfo->phys_in_grp_count; in get_hardware_info()
165 efw->phys_out_grp_count = hwinfo->phys_out_grp_count; in get_hardware_info()
166 memcpy(&efw->phys_in_grps, hwinfo->phys_in_grps, in get_hardware_info()
168 memcpy(&efw->phys_out_grps, hwinfo->phys_out_grps, in get_hardware_info()
173 efw->is_af9 = true; in get_hardware_info()
180 efw->is_fireworks3 = true; in get_hardware_info()
189 struct snd_efw *efw = card->private_data; in efw_card_free() local
192 clear_bit(efw->card_index, devices_used); in efw_card_free()
195 snd_efw_stream_destroy_duplex(efw); in efw_card_free()
196 snd_efw_transaction_remove_instance(efw); in efw_card_free()
202 struct snd_efw *efw = container_of(work, struct snd_efw, dwork.work); in do_registration() local
206 if (efw->registered) in do_registration()
220 err = snd_card_new(&efw->unit->device, index[card_index], in do_registration()
221 id[card_index], THIS_MODULE, 0, &efw->card); in do_registration()
229 efw->card->private_free = efw_card_free; in do_registration()
230 efw->card->private_data = efw; in do_registration()
235 efw->resp_buf = devm_kzalloc(&efw->card->card_dev, in do_registration()
237 if (!efw->resp_buf) { in do_registration()
241 efw->pull_ptr = efw->push_ptr = efw->resp_buf; in do_registration()
242 snd_efw_transaction_add_instance(efw); in do_registration()
244 err = get_hardware_info(efw); in do_registration()
248 err = snd_efw_stream_init_duplex(efw); in do_registration()
252 snd_efw_proc_init(efw); in do_registration()
254 if (efw->midi_out_ports || efw->midi_in_ports) { in do_registration()
255 err = snd_efw_create_midi_devices(efw); in do_registration()
260 err = snd_efw_create_pcm_devices(efw); in do_registration()
264 err = snd_efw_create_hwdep_device(efw); in do_registration()
268 err = snd_card_register(efw->card); in do_registration()
272 efw->registered = true; in do_registration()
276 snd_card_free(efw->card); in do_registration()
277 dev_info(&efw->unit->device, in do_registration()
284 struct snd_efw *efw; in efw_probe() local
286 efw = devm_kzalloc(&unit->device, sizeof(struct snd_efw), GFP_KERNEL); in efw_probe()
287 if (efw == NULL) in efw_probe()
289 efw->unit = fw_unit_get(unit); in efw_probe()
290 dev_set_drvdata(&unit->device, efw); in efw_probe()
292 mutex_init(&efw->mutex); in efw_probe()
293 spin_lock_init(&efw->lock); in efw_probe()
294 init_waitqueue_head(&efw->hwdep_wait); in efw_probe()
297 INIT_DEFERRABLE_WORK(&efw->dwork, do_registration); in efw_probe()
298 snd_fw_schedule_registration(unit, &efw->dwork); in efw_probe()
305 struct snd_efw *efw = dev_get_drvdata(&unit->device); in efw_update() local
308 if (!efw->registered) in efw_update()
309 snd_fw_schedule_registration(unit, &efw->dwork); in efw_update()
311 snd_efw_transaction_bus_reset(efw->unit); in efw_update()
317 if (efw->registered) { in efw_update()
318 mutex_lock(&efw->mutex); in efw_update()
319 snd_efw_stream_update_duplex(efw); in efw_update()
320 mutex_unlock(&efw->mutex); in efw_update()
326 struct snd_efw *efw = dev_get_drvdata(&unit->device); in efw_remove() local
333 cancel_delayed_work_sync(&efw->dwork); in efw_remove()
335 if (efw->registered) { in efw_remove()
337 snd_card_free(efw->card); in efw_remove()
340 mutex_destroy(&efw->mutex); in efw_remove()
341 fw_unit_put(efw->unit); in efw_remove()