• Home
  • Raw
  • Download

Lines Matching refs:dice

68 static int check_clock_caps(struct snd_dice *dice)  in check_clock_caps()  argument
74 if (dice->clock_caps > 0) { in check_clock_caps()
75 err = snd_dice_transaction_read_global(dice, in check_clock_caps()
80 dice->clock_caps = be32_to_cpu(value); in check_clock_caps()
83 dice->clock_caps = CLOCK_CAP_RATE_44100 | in check_clock_caps()
92 static void dice_card_strings(struct snd_dice *dice) in dice_card_strings() argument
94 struct snd_card *card = dice->card; in dice_card_strings()
95 struct fw_device *dev = fw_parent_device(dice->unit); in dice_card_strings()
104 err = snd_dice_transaction_read_global(dice, GLOBAL_NICK_NAME, in dice_card_strings()
118 fw_csr_string(dice->unit->directory, CSR_MODEL, model, sizeof(model)); in dice_card_strings()
122 dev_name(&dice->unit->device), 100 << dev->max_speed); in dice_card_strings()
129 struct snd_dice *dice = card->private_data; in dice_card_free() local
131 snd_dice_stream_destroy_duplex(dice); in dice_card_free()
132 snd_dice_transaction_destroy(dice); in dice_card_free()
137 struct snd_dice *dice = container_of(work, struct snd_dice, dwork.work); in do_registration() local
140 if (dice->registered) in do_registration()
143 err = snd_card_new(&dice->unit->device, -1, NULL, THIS_MODULE, 0, in do_registration()
144 &dice->card); in do_registration()
147 dice->card->private_free = dice_card_free; in do_registration()
148 dice->card->private_data = dice; in do_registration()
150 err = snd_dice_transaction_init(dice); in do_registration()
154 err = check_clock_caps(dice); in do_registration()
158 dice_card_strings(dice); in do_registration()
160 err = dice->detect_formats(dice); in do_registration()
164 err = snd_dice_stream_init_duplex(dice); in do_registration()
168 snd_dice_create_proc(dice); in do_registration()
170 err = snd_dice_create_pcm(dice); in do_registration()
174 err = snd_dice_create_midi(dice); in do_registration()
178 err = snd_dice_create_hwdep(dice); in do_registration()
182 err = snd_card_register(dice->card); in do_registration()
186 dice->registered = true; in do_registration()
190 snd_card_free(dice->card); in do_registration()
191 dev_info(&dice->unit->device, in do_registration()
198 struct snd_dice *dice; in dice_probe() local
208 dice = devm_kzalloc(&unit->device, sizeof(struct snd_dice), GFP_KERNEL); in dice_probe()
209 if (!dice) in dice_probe()
211 dice->unit = fw_unit_get(unit); in dice_probe()
212 dev_set_drvdata(&unit->device, dice); in dice_probe()
215 dice->detect_formats = snd_dice_stream_detect_current_formats; in dice_probe()
217 dice->detect_formats = in dice_probe()
221 spin_lock_init(&dice->lock); in dice_probe()
222 mutex_init(&dice->mutex); in dice_probe()
223 init_completion(&dice->clock_accepted); in dice_probe()
224 init_waitqueue_head(&dice->hwdep_wait); in dice_probe()
227 INIT_DEFERRABLE_WORK(&dice->dwork, do_registration); in dice_probe()
228 snd_fw_schedule_registration(unit, &dice->dwork); in dice_probe()
235 struct snd_dice *dice = dev_get_drvdata(&unit->device); in dice_remove() local
242 cancel_delayed_work_sync(&dice->dwork); in dice_remove()
244 if (dice->registered) { in dice_remove()
246 snd_card_free(dice->card); in dice_remove()
249 mutex_destroy(&dice->mutex); in dice_remove()
250 fw_unit_put(dice->unit); in dice_remove()
255 struct snd_dice *dice = dev_get_drvdata(&unit->device); in dice_bus_reset() local
258 if (!dice->registered) in dice_bus_reset()
259 snd_fw_schedule_registration(unit, &dice->dwork); in dice_bus_reset()
262 snd_dice_transaction_reinit(dice); in dice_bus_reset()
268 if (dice->registered) { in dice_bus_reset()
269 mutex_lock(&dice->mutex); in dice_bus_reset()
270 snd_dice_stream_update_duplex(dice); in dice_bus_reset()
271 mutex_unlock(&dice->mutex); in dice_bus_reset()