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;
19 offset += dice->rx_offset;
22 offset += dice->sync_offset;
25 offset += dice->rsrv_offset;
29 offset += dice->global_offset;
40 return snd_fw_transaction(dice->unit,
50 return snd_fw_transaction(dice->unit,
87 err = -ENOSYS;
101 if (dice->global_enabled)
105 err = snd_fw_transaction(dice->unit, TCODE_WRITE_QUADLET_REQUEST,
109 FW_FIXED_GENERATION | dice->owner_generation);
113 dice->global_enabled = true;
123 snd_fw_transaction(dice->unit, TCODE_WRITE_QUADLET_REQUEST,
127 FW_FIXED_GENERATION | dice->owner_generation);
129 dice->global_enabled = false;
151 scoped_guard(spinlock_irqsave, &dice->lock) {
152 dice->notification_bits |= bits;
158 complete(&dice->clock_accepted);
159 wake_up(&dice->hwdep_wait);
164 struct fw_device *device = fw_parent_device(dice->unit);
173 return -ENOMEM;
178 ((u64)device->card->node_id << OWNER_NODE_SHIFT) |
179 dice->notification_handler.offset);
181 dice->owner_generation = device->generation;
183 err = snd_fw_transaction(dice->unit, TCODE_LOCK_COMPARE_SWAP,
189 dice->owner_generation);
198 dev_err(&dice->unit->device,
200 err = -EBUSY;
202 if (err != -EAGAIN || retries-- > 0)
211 dice->owner_generation = -1;
218 struct fw_device *device = fw_parent_device(dice->unit);
226 ((u64)device->card->node_id << OWNER_NODE_SHIFT) |
227 dice->notification_handler.offset);
229 snd_fw_transaction(dice->unit, TCODE_LOCK_COMPARE_SWAP,
233 FW_FIXED_GENERATION | dice->owner_generation);
237 dice->owner_generation = -1;
242 struct fw_address_handler *handler = &dice->notification_handler;
244 if (handler->callback_data == NULL)
250 handler->callback_data = NULL;
255 struct fw_address_handler *handler = &dice->notification_handler;
257 if (handler->callback_data == NULL)
258 return -EINVAL;
281 return -ENOMEM;
284 * Check that the sub address spaces exist and are located inside the
288 err = snd_fw_transaction(dice->unit, TCODE_READ_BLOCK_REQUEST,
297 err = -ENODEV;
307 err = snd_fw_transaction(dice->unit, TCODE_READ_QUADLET_REQUEST,
316 dev_err(&dice->unit->device,
319 err = -ENODEV;
324 dice->clock_caps = 1;
327 dice->global_offset = be32_to_cpu(pointers[0]) * 4;
328 dice->tx_offset = be32_to_cpu(pointers[2]) * 4;
329 dice->rx_offset = be32_to_cpu(pointers[4]) * 4;
333 dice->sync_offset = be32_to_cpu(pointers[6]) * 4;
335 dice->rsrv_offset = be32_to_cpu(pointers[8]) * 4;
343 struct fw_address_handler *handler = &dice->notification_handler;
351 handler->length = 4;
352 handler->address_callback = dice_notification;
353 handler->callback_data = dice;
356 handler->callback_data = NULL;
364 handler->callback_data = NULL;