.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
1 | 2 | /* |
---|
2 | 3 | * Renesas USB DMA Controller Driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * based on rcar-dmac.c |
---|
7 | 8 | * Copyright (C) 2014 Renesas Electronics Inc. |
---|
8 | 9 | * Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
---|
9 | | - * |
---|
10 | | - * This is free software; you can redistribute it and/or modify |
---|
11 | | - * it under the terms of version 2 of the GNU General Public License as |
---|
12 | | - * published by the Free Software Foundation. |
---|
13 | 10 | */ |
---|
14 | 11 | |
---|
15 | 12 | #include <linux/delay.h> |
---|
.. | .. |
---|
60 | 57 | u32 residue; |
---|
61 | 58 | struct list_head node; |
---|
62 | 59 | dma_cookie_t done_cookie; |
---|
63 | | - struct usb_dmac_sg sg[0]; |
---|
| 60 | + struct usb_dmac_sg sg[]; |
---|
64 | 61 | }; |
---|
65 | 62 | |
---|
66 | 63 | #define to_usb_dmac_desc(vd) container_of(vd, struct usb_dmac_desc, vd) |
---|
.. | .. |
---|
589 | 586 | desc->residue = usb_dmac_get_current_residue(chan, desc, |
---|
590 | 587 | desc->sg_index - 1); |
---|
591 | 588 | desc->done_cookie = desc->vd.tx.cookie; |
---|
| 589 | + desc->vd.tx_result.result = DMA_TRANS_NOERROR; |
---|
| 590 | + desc->vd.tx_result.residue = desc->residue; |
---|
592 | 591 | vchan_cookie_complete(&desc->vd); |
---|
593 | 592 | |
---|
594 | 593 | /* Restart the next transfer if this driver has a next desc */ |
---|
.. | .. |
---|
639 | 638 | struct usb_dmac_chan *uchan = to_usb_dmac_chan(chan); |
---|
640 | 639 | struct of_phandle_args *dma_spec = arg; |
---|
641 | 640 | |
---|
642 | | - if (dma_spec->np != chan->device->dev->of_node) |
---|
643 | | - return false; |
---|
644 | | - |
---|
645 | 641 | /* USB-DMAC should be used with fixed usb controller's FIFO */ |
---|
646 | 642 | if (uchan->index != dma_spec->args[0]) |
---|
647 | 643 | return false; |
---|
.. | .. |
---|
662 | 658 | dma_cap_zero(mask); |
---|
663 | 659 | dma_cap_set(DMA_SLAVE, mask); |
---|
664 | 660 | |
---|
665 | | - chan = dma_request_channel(mask, usb_dmac_chan_filter, dma_spec); |
---|
| 661 | + chan = __dma_request_channel(&mask, usb_dmac_chan_filter, dma_spec, |
---|
| 662 | + ofdma->of_node); |
---|
666 | 663 | if (!chan) |
---|
667 | 664 | return NULL; |
---|
668 | 665 | |
---|
.. | .. |
---|
722 | 719 | /* Request the channel interrupt. */ |
---|
723 | 720 | sprintf(pdev_irqname, "ch%u", index); |
---|
724 | 721 | uchan->irq = platform_get_irq_byname(pdev, pdev_irqname); |
---|
725 | | - if (uchan->irq < 0) { |
---|
726 | | - dev_err(dmac->dev, "no IRQ specified for channel %u\n", index); |
---|
| 722 | + if (uchan->irq < 0) |
---|
727 | 723 | return -ENODEV; |
---|
728 | | - } |
---|
729 | 724 | |
---|
730 | 725 | irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u", |
---|
731 | 726 | dev_name(dmac->dev), index); |
---|