#include <linux/dmapool.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_dma.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include "dmaengine.h"
#include "virt-dma.h"
#define LS1X_DMA_CTRL …
#define LS1X_DMA_STOP …
#define LS1X_DMA_START …
#define LS1X_DMA_ASK_VALID …
#define LS1X_DMA_NEXT_VALID …
#define LS1X_DMA_RAM2DEV …
#define LS1X_DMA_INT …
#define LS1X_DMA_INT_MASK …
#define LS1X_DMA_LLI_ALIGNMENT …
#define LS1X_DMA_LLI_ADDR_MASK …
#define LS1X_DMA_MAX_CHANNELS …
enum ls1x_dmadesc_offsets { … };
struct ls1x_dma_lli { … } __aligned(…);
struct ls1x_dma_desc { … };
struct ls1x_dma_chan { … };
struct ls1x_dma { … };
static irqreturn_t ls1x_dma_irq_handler(int irq, void *data);
#define to_ls1x_dma_chan(dchan) …
#define to_ls1x_dma_desc(d) …
static inline struct device *chan2dev(struct dma_chan *chan)
{ … }
static inline int ls1x_dma_query(struct ls1x_dma_chan *chan,
dma_addr_t *lli_phys)
{ … }
static inline int ls1x_dma_start(struct ls1x_dma_chan *chan,
dma_addr_t *lli_phys)
{ … }
static inline void ls1x_dma_stop(struct ls1x_dma_chan *chan)
{ … }
static void ls1x_dma_free_chan_resources(struct dma_chan *dchan)
{ … }
static int ls1x_dma_alloc_chan_resources(struct dma_chan *dchan)
{ … }
static void ls1x_dma_free_desc(struct virt_dma_desc *vd)
{ … }
static struct ls1x_dma_desc *ls1x_dma_alloc_desc(void)
{ … }
static int ls1x_dma_prep_lli(struct dma_chan *dchan, struct ls1x_dma_desc *desc,
struct scatterlist *sgl, unsigned int sg_len,
enum dma_transfer_direction dir, bool is_cyclic)
{ … }
static struct dma_async_tx_descriptor *
ls1x_dma_prep_slave_sg(struct dma_chan *dchan, struct scatterlist *sgl,
unsigned int sg_len, enum dma_transfer_direction dir,
unsigned long flags, void *context)
{ … }
static struct dma_async_tx_descriptor *
ls1x_dma_prep_dma_cyclic(struct dma_chan *dchan, dma_addr_t buf_addr,
size_t buf_len, size_t period_len,
enum dma_transfer_direction dir, unsigned long flags)
{ … }
static int ls1x_dma_slave_config(struct dma_chan *dchan,
struct dma_slave_config *config)
{ … }
static int ls1x_dma_pause(struct dma_chan *dchan)
{ … }
static int ls1x_dma_resume(struct dma_chan *dchan)
{ … }
static int ls1x_dma_terminate_all(struct dma_chan *dchan)
{ … }
static void ls1x_dma_synchronize(struct dma_chan *dchan)
{ … }
static enum dma_status ls1x_dma_tx_status(struct dma_chan *dchan,
dma_cookie_t cookie,
struct dma_tx_state *state)
{ … }
static void ls1x_dma_issue_pending(struct dma_chan *dchan)
{ … }
static irqreturn_t ls1x_dma_irq_handler(int irq, void *data)
{ … }
static int ls1x_dma_chan_probe(struct platform_device *pdev,
struct ls1x_dma *dma)
{ … }
static void ls1x_dma_chan_remove(struct ls1x_dma *dma)
{ … }
static int ls1x_dma_probe(struct platform_device *pdev)
{ … }
static void ls1x_dma_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id ls1x_dma_match[] = …;
MODULE_DEVICE_TABLE(of, ls1x_dma_match);
static struct platform_driver ls1x_dma_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;