Lines Matching full:ff

3  * ff.c - a part of driver for RME Fireface series
8 #include "ff.h"
16 static void name_card(struct snd_ff *ff) in name_card() argument
18 struct fw_device *fw_dev = fw_parent_device(ff->unit); in name_card()
28 name = names[ff->unit_version]; in name_card()
30 strcpy(ff->card->driver, "Fireface"); in name_card()
31 strcpy(ff->card->shortname, name); in name_card()
32 strcpy(ff->card->mixername, name); in name_card()
33 snprintf(ff->card->longname, sizeof(ff->card->longname), in name_card()
36 dev_name(&ff->unit->device), 100 << fw_dev->max_speed); in name_card()
41 struct snd_ff *ff = card->private_data; in ff_card_free() local
43 snd_ff_stream_destroy_duplex(ff); in ff_card_free()
44 snd_ff_transaction_unregister(ff); in ff_card_free()
49 struct snd_ff *ff = container_of(work, struct snd_ff, dwork.work); in do_registration() local
52 if (ff->registered) in do_registration()
55 err = snd_card_new(&ff->unit->device, -1, NULL, THIS_MODULE, 0, in do_registration()
56 &ff->card); in do_registration()
59 ff->card->private_free = ff_card_free; in do_registration()
60 ff->card->private_data = ff; in do_registration()
62 err = snd_ff_transaction_register(ff); in do_registration()
66 name_card(ff); in do_registration()
68 err = snd_ff_stream_init_duplex(ff); in do_registration()
72 snd_ff_proc_init(ff); in do_registration()
74 err = snd_ff_create_midi_devices(ff); in do_registration()
78 err = snd_ff_create_pcm_devices(ff); in do_registration()
82 err = snd_ff_create_hwdep_devices(ff); in do_registration()
86 err = snd_card_register(ff->card); in do_registration()
90 ff->registered = true; in do_registration()
94 snd_card_free(ff->card); in do_registration()
95 dev_info(&ff->unit->device, in do_registration()
102 struct snd_ff *ff; in snd_ff_probe() local
104 ff = devm_kzalloc(&unit->device, sizeof(struct snd_ff), GFP_KERNEL); in snd_ff_probe()
105 if (!ff) in snd_ff_probe()
107 ff->unit = fw_unit_get(unit); in snd_ff_probe()
108 dev_set_drvdata(&unit->device, ff); in snd_ff_probe()
110 mutex_init(&ff->mutex); in snd_ff_probe()
111 spin_lock_init(&ff->lock); in snd_ff_probe()
112 init_waitqueue_head(&ff->hwdep_wait); in snd_ff_probe()
114 ff->unit_version = entry->version; in snd_ff_probe()
115 ff->spec = (const struct snd_ff_spec *)entry->driver_data; in snd_ff_probe()
118 INIT_DEFERRABLE_WORK(&ff->dwork, do_registration); in snd_ff_probe()
119 snd_fw_schedule_registration(unit, &ff->dwork); in snd_ff_probe()
126 struct snd_ff *ff = dev_get_drvdata(&unit->device); in snd_ff_update() local
129 if (!ff->registered) in snd_ff_update()
130 snd_fw_schedule_registration(unit, &ff->dwork); in snd_ff_update()
132 snd_ff_transaction_reregister(ff); in snd_ff_update()
134 if (ff->registered) in snd_ff_update()
135 snd_ff_stream_update_duplex(ff); in snd_ff_update()
140 struct snd_ff *ff = dev_get_drvdata(&unit->device); in snd_ff_remove() local
147 cancel_work_sync(&ff->dwork.work); in snd_ff_remove()
149 if (ff->registered) { in snd_ff_remove()
151 snd_card_free(ff->card); in snd_ff_remove()
154 mutex_destroy(&ff->mutex); in snd_ff_remove()
155 fw_unit_put(ff->unit); in snd_ff_remove()