Lines Matching +full:sub +full:- +full:spaces

1 // SPDX-License-Identifier: GPL-2.0-only
3 * dice_transaction.c - a part of driver for Dice based devices
16 offset += dice->tx_offset; in get_subaddr()
19 offset += dice->rx_offset; in get_subaddr()
22 offset += dice->sync_offset; in get_subaddr()
25 offset += dice->rsrv_offset; in get_subaddr()
29 offset += dice->global_offset; in get_subaddr()
40 return snd_fw_transaction(dice->unit, in snd_dice_transaction_write()
50 return snd_fw_transaction(dice->unit, in snd_dice_transaction_read()
87 err = -ENOSYS; in snd_dice_transaction_get_rate()
101 if (dice->global_enabled) in snd_dice_transaction_set_enable()
105 err = snd_fw_transaction(dice->unit, TCODE_WRITE_QUADLET_REQUEST, in snd_dice_transaction_set_enable()
109 FW_FIXED_GENERATION | dice->owner_generation); in snd_dice_transaction_set_enable()
113 dice->global_enabled = true; in snd_dice_transaction_set_enable()
123 snd_fw_transaction(dice->unit, TCODE_WRITE_QUADLET_REQUEST, in snd_dice_transaction_clear_enable()
127 FW_FIXED_GENERATION | dice->owner_generation); in snd_dice_transaction_clear_enable()
129 dice->global_enabled = false; in snd_dice_transaction_clear_enable()
152 spin_lock_irqsave(&dice->lock, flags); in dice_notification()
153 dice->notification_bits |= bits; in dice_notification()
154 spin_unlock_irqrestore(&dice->lock, flags); in dice_notification()
159 complete(&dice->clock_accepted); in dice_notification()
160 wake_up(&dice->hwdep_wait); in dice_notification()
165 struct fw_device *device = fw_parent_device(dice->unit); in register_notification_address()
174 return -ENOMEM; in register_notification_address()
179 ((u64)device->card->node_id << OWNER_NODE_SHIFT) | in register_notification_address()
180 dice->notification_handler.offset); in register_notification_address()
182 dice->owner_generation = device->generation; in register_notification_address()
184 err = snd_fw_transaction(dice->unit, TCODE_LOCK_COMPARE_SWAP, in register_notification_address()
190 dice->owner_generation); in register_notification_address()
199 dev_err(&dice->unit->device, in register_notification_address()
201 err = -EBUSY; in register_notification_address()
203 if (err != -EAGAIN || retries-- > 0) in register_notification_address()
212 dice->owner_generation = -1; in register_notification_address()
219 struct fw_device *device = fw_parent_device(dice->unit); in unregister_notification_address()
227 ((u64)device->card->node_id << OWNER_NODE_SHIFT) | in unregister_notification_address()
228 dice->notification_handler.offset); in unregister_notification_address()
230 snd_fw_transaction(dice->unit, TCODE_LOCK_COMPARE_SWAP, in unregister_notification_address()
234 FW_FIXED_GENERATION | dice->owner_generation); in unregister_notification_address()
238 dice->owner_generation = -1; in unregister_notification_address()
243 struct fw_address_handler *handler = &dice->notification_handler; in snd_dice_transaction_destroy()
245 if (handler->callback_data == NULL) in snd_dice_transaction_destroy()
251 handler->callback_data = NULL; in snd_dice_transaction_destroy()
256 struct fw_address_handler *handler = &dice->notification_handler; in snd_dice_transaction_reinit()
258 if (handler->callback_data == NULL) in snd_dice_transaction_reinit()
259 return -EINVAL; in snd_dice_transaction_reinit()
282 return -ENOMEM; in get_subaddrs()
285 * Check that the sub address spaces exist and are located inside the in get_subaddrs()
289 err = snd_fw_transaction(dice->unit, TCODE_READ_BLOCK_REQUEST, in get_subaddrs()
298 err = -ENODEV; in get_subaddrs()
308 err = snd_fw_transaction(dice->unit, TCODE_READ_QUADLET_REQUEST, in get_subaddrs()
317 dev_err(&dice->unit->device, in get_subaddrs()
320 err = -ENODEV; in get_subaddrs()
325 dice->clock_caps = 1; in get_subaddrs()
328 dice->global_offset = be32_to_cpu(pointers[0]) * 4; in get_subaddrs()
329 dice->tx_offset = be32_to_cpu(pointers[2]) * 4; in get_subaddrs()
330 dice->rx_offset = be32_to_cpu(pointers[4]) * 4; in get_subaddrs()
334 dice->sync_offset = be32_to_cpu(pointers[6]) * 4; in get_subaddrs()
336 dice->rsrv_offset = be32_to_cpu(pointers[8]) * 4; in get_subaddrs()
344 struct fw_address_handler *handler = &dice->notification_handler; in snd_dice_transaction_init()
352 handler->length = 4; in snd_dice_transaction_init()
353 handler->address_callback = dice_notification; in snd_dice_transaction_init()
354 handler->callback_data = dice; in snd_dice_transaction_init()
357 handler->callback_data = NULL; in snd_dice_transaction_init()
365 handler->callback_data = NULL; in snd_dice_transaction_init()