#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_dma.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include "../dmaengine.h"
#include "../virt-dma.h"
struct usb_dmac_sg { … };
struct usb_dmac_desc { … };
#define to_usb_dmac_desc(vd) …
struct usb_dmac_chan { … };
#define to_usb_dmac_chan(c) …
struct usb_dmac { … };
#define to_usb_dmac(d) …
#define USB_DMAC_CHAN_OFFSET(i) …
#define USB_DMASWR …
#define USB_DMASWR_SWR …
#define USB_DMAOR …
#define USB_DMAOR_AE …
#define USB_DMAOR_DME …
#define USB_DMASAR …
#define USB_DMADAR …
#define USB_DMATCR …
#define USB_DMATCR_MASK …
#define USB_DMACHCR …
#define USB_DMACHCR_FTE …
#define USB_DMACHCR_NULLE …
#define USB_DMACHCR_NULL …
#define USB_DMACHCR_TS_8B …
#define USB_DMACHCR_TS_16B …
#define USB_DMACHCR_TS_32B …
#define USB_DMACHCR_IE …
#define USB_DMACHCR_SP …
#define USB_DMACHCR_TE …
#define USB_DMACHCR_DE …
#define USB_DMATEND …
#define USB_DMAC_XFER_SHIFT …
#define USB_DMAC_XFER_SIZE …
#define USB_DMAC_CHCR_TS …
#define USB_DMAC_SLAVE_BUSWIDTH …
#define USB_DMAC_INITIAL_NR_DESC …
#define USB_DMAC_INITIAL_NR_SG …
static void usb_dmac_write(struct usb_dmac *dmac, u32 reg, u32 data)
{ … }
static u32 usb_dmac_read(struct usb_dmac *dmac, u32 reg)
{ … }
static u32 usb_dmac_chan_read(struct usb_dmac_chan *chan, u32 reg)
{ … }
static void usb_dmac_chan_write(struct usb_dmac_chan *chan, u32 reg, u32 data)
{ … }
static bool usb_dmac_chan_is_busy(struct usb_dmac_chan *chan)
{ … }
static u32 usb_dmac_calc_tend(u32 size)
{ … }
static void usb_dmac_chan_start_sg(struct usb_dmac_chan *chan,
unsigned int index)
{ … }
static void usb_dmac_chan_start_desc(struct usb_dmac_chan *chan)
{ … }
static int usb_dmac_init(struct usb_dmac *dmac)
{ … }
static int usb_dmac_desc_alloc(struct usb_dmac_chan *chan, unsigned int sg_len,
gfp_t gfp)
{ … }
static void usb_dmac_desc_free(struct usb_dmac_chan *chan)
{ … }
static struct usb_dmac_desc *usb_dmac_desc_get(struct usb_dmac_chan *chan,
unsigned int sg_len, gfp_t gfp)
{ … }
static void usb_dmac_desc_put(struct usb_dmac_chan *chan,
struct usb_dmac_desc *desc)
{ … }
static void usb_dmac_soft_reset(struct usb_dmac_chan *uchan)
{ … }
static void usb_dmac_chan_halt(struct usb_dmac_chan *chan)
{ … }
static void usb_dmac_stop(struct usb_dmac *dmac)
{ … }
static int usb_dmac_alloc_chan_resources(struct dma_chan *chan)
{ … }
static void usb_dmac_free_chan_resources(struct dma_chan *chan)
{ … }
static struct dma_async_tx_descriptor *
usb_dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
unsigned int sg_len, enum dma_transfer_direction dir,
unsigned long dma_flags, void *context)
{ … }
static int usb_dmac_chan_terminate_all(struct dma_chan *chan)
{ … }
static unsigned int usb_dmac_get_current_residue(struct usb_dmac_chan *chan,
struct usb_dmac_desc *desc,
unsigned int sg_index)
{ … }
static u32 usb_dmac_chan_get_residue_if_complete(struct usb_dmac_chan *chan,
dma_cookie_t cookie)
{ … }
static u32 usb_dmac_chan_get_residue(struct usb_dmac_chan *chan,
dma_cookie_t cookie)
{ … }
static enum dma_status usb_dmac_tx_status(struct dma_chan *chan,
dma_cookie_t cookie,
struct dma_tx_state *txstate)
{ … }
static void usb_dmac_issue_pending(struct dma_chan *chan)
{ … }
static void usb_dmac_virt_desc_free(struct virt_dma_desc *vd)
{ … }
static void usb_dmac_isr_transfer_end(struct usb_dmac_chan *chan)
{ … }
static irqreturn_t usb_dmac_isr_channel(int irq, void *dev)
{ … }
static bool usb_dmac_chan_filter(struct dma_chan *chan, void *arg)
{ … }
static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{ … }
#ifdef CONFIG_PM
static int usb_dmac_runtime_suspend(struct device *dev)
{ … }
static int usb_dmac_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops usb_dmac_pm = …;
static int usb_dmac_chan_probe(struct usb_dmac *dmac,
struct usb_dmac_chan *uchan,
u8 index)
{ … }
static int usb_dmac_parse_of(struct device *dev, struct usb_dmac *dmac)
{ … }
static int usb_dmac_probe(struct platform_device *pdev)
{ … }
static void usb_dmac_chan_remove(struct usb_dmac *dmac,
struct usb_dmac_chan *uchan)
{ … }
static void usb_dmac_remove(struct platform_device *pdev)
{ … }
static void usb_dmac_shutdown(struct platform_device *pdev)
{ … }
static const struct of_device_id usb_dmac_of_ids[] = …;
MODULE_DEVICE_TABLE(of, usb_dmac_of_ids);
static struct platform_driver usb_dmac_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;