Lines Matching refs:kdev
20 #define knav_range_offset_to_inst(kdev, range, q) \ argument
21 (range->queue_base_inst + (q << kdev->inst_shift))
26 struct knav_device *kdev = range->kdev; in __knav_acc_notify() local
30 range_base = kdev->base_id + range->queue_base; in __knav_acc_notify()
34 inst = knav_range_offset_to_inst(kdev, range, in __knav_acc_notify()
38 dev_dbg(kdev->dev, "acc-irq: notifying %d\n", in __knav_acc_notify()
45 inst = knav_range_offset_to_inst(kdev, range, queue); in __knav_acc_notify()
46 dev_dbg(kdev->dev, "acc-irq: notifying %d\n", in __knav_acc_notify()
57 struct knav_device *kdev = range->kdev; in knav_acc_set_notify() local
71 dev_dbg(kdev->dev, "setup-notify: re-triggering irq for %s\n", in knav_acc_set_notify()
84 struct knav_device *kdev; in knav_acc_int_handler() local
92 kdev = range->kdev; in knav_acc_int_handler()
96 range_base = kdev->base_id + range->queue_base; in knav_acc_int_handler()
101 kq = knav_range_offset_to_inst(kdev, range, queue); in knav_acc_int_handler()
108 dev_dbg(kdev->dev, "acc-irq: channel %d, list %d, virt %p, dma %pad\n", in knav_acc_int_handler()
123 dma_sync_single_for_cpu(kdev->dev, list_dma, info->list_size, in knav_acc_int_handler()
129 dev_dbg(kdev->dev, in knav_acc_int_handler()
133 dev_dbg(kdev->dev, in knav_acc_int_handler()
137 dev_dbg(kdev->dev, in knav_acc_int_handler()
151 dev_err(kdev->dev, in knav_acc_int_handler()
158 kq = knav_range_offset_to_inst(kdev, range, in knav_acc_int_handler()
164 dev_err(kdev->dev, in knav_acc_int_handler()
173 dev_dbg(kdev->dev, "acc-irq: enqueue %08x at %d, queue %d\n", in knav_acc_int_handler()
179 dma_sync_single_for_device(kdev->dev, list_dma, info->list_size, in knav_acc_int_handler()
198 struct knav_device *kdev = range->kdev; in knav_range_setup_acc_irq() local
221 dev_dbg(kdev->dev, in knav_range_setup_acc_irq()
229 dev_dbg(kdev->dev, in knav_range_setup_acc_irq()
237 dev_warn(range->kdev->dev, in knav_range_setup_acc_irq()
245 dev_dbg(kdev->dev, "setup-acc-irq: freeing %s for channel %s\n", in knav_range_setup_acc_irq()
249 dev_warn(range->kdev->dev, in knav_range_setup_acc_irq()
277 knav_acc_write(struct knav_device *kdev, struct knav_pdsp_info *pdsp, in knav_acc_write() argument
282 dev_dbg(kdev->dev, "acc command %08x %08x %08x %08x %08x\n", in knav_acc_write()
300 static void knav_acc_setup_cmd(struct knav_device *kdev, in knav_acc_setup_cmd() argument
334 static void knav_acc_stop(struct knav_device *kdev, in knav_acc_stop() argument
344 knav_acc_setup_cmd(kdev, range, &cmd, queue); in knav_acc_stop()
346 result = knav_acc_write(kdev, range->acc_info.pdsp, &cmd); in knav_acc_stop()
348 dev_dbg(kdev->dev, "stopped acc channel %s, result %s\n", in knav_acc_stop()
352 static enum knav_acc_result knav_acc_start(struct knav_device *kdev, in knav_acc_start() argument
362 knav_acc_setup_cmd(kdev, range, &cmd, queue); in knav_acc_start()
364 result = knav_acc_write(kdev, range->acc_info.pdsp, &cmd); in knav_acc_start()
366 dev_dbg(kdev->dev, "started acc channel %s, result %s\n", in knav_acc_start()
374 struct knav_device *kdev = range->kdev; in knav_acc_init_range() local
382 knav_acc_stop(kdev, range, queue); in knav_acc_init_range()
384 result = knav_acc_start(kdev, range, queue); in knav_acc_init_range()
400 kq->descs = devm_kcalloc(range->kdev->dev, in knav_acc_init_queue()
429 struct knav_device *kdev = range->kdev; in knav_acc_free_range() local
445 dma_unmap_single(kdev->dev, acc->list_dma[0], in knav_acc_free_range()
449 devm_kfree(range->kdev->dev, range->acc); in knav_acc_free_range()
471 int knav_init_acc_range(struct knav_device *kdev, in knav_init_acc_range() argument
498 dev_err(kdev->dev, "channel %d invalid for range %s\n", in knav_init_acc_range()
504 dev_err(kdev->dev, "pacing mode %d invalid for range %s\n", in knav_init_acc_range()
509 pdsp = knav_find_pdsp(kdev, info->pdsp_id); in knav_init_acc_range()
511 dev_err(kdev->dev, "pdsp id %d not found for range %s\n", in knav_init_acc_range()
517 dev_err(kdev->dev, "pdsp id %d not started for range %s\n", in knav_init_acc_range()
528 dev_err(kdev->dev, in knav_init_acc_range()
534 dev_err(kdev->dev, in knav_init_acc_range()
547 range->acc = devm_kcalloc(kdev->dev, channels, sizeof(*range->acc), in knav_init_acc_range()
561 list_dma = dma_map_single(kdev->dev, list_mem, mem_size, in knav_init_acc_range()
563 if (dma_mapping_error(kdev->dev, list_dma)) { in knav_init_acc_range()
569 dma_sync_single_for_device(kdev->dev, list_dma, mem_size, in knav_init_acc_range()
577 dev_dbg(kdev->dev, "%s: channel %d, dma %pad, virt %8p\n", in knav_init_acc_range()