#include <linux/clk.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/of_dma.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include "../virt-dma.h"
#define MTK_UART_APDMA_NR_VCHANS …
#define VFF_EN_B …
#define VFF_STOP_B …
#define VFF_FLUSH_B …
#define VFF_4G_EN_B …
#define VFF_RX_INT_EN_B …
#define VFF_TX_INT_EN_B …
#define VFF_WARM_RST_B …
#define VFF_RX_INT_CLR_B …
#define VFF_TX_INT_CLR_B …
#define VFF_STOP_CLR_B …
#define VFF_EN_CLR_B …
#define VFF_INT_EN_CLR_B …
#define VFF_4G_SUPPORT_CLR_B …
#define VFF_TX_THRE(n) …
#define VFF_RX_THRE(n) …
#define VFF_RING_SIZE …
#define VFF_RING_WRAP …
#define VFF_INT_FLAG …
#define VFF_INT_EN …
#define VFF_EN …
#define VFF_RST …
#define VFF_STOP …
#define VFF_FLUSH …
#define VFF_ADDR …
#define VFF_LEN …
#define VFF_THRE …
#define VFF_WPT …
#define VFF_RPT …
#define VFF_VALID_SIZE …
#define VFF_LEFT_SIZE …
#define VFF_DEBUG_STATUS …
#define VFF_4G_SUPPORT …
struct mtk_uart_apdmadev { … };
struct mtk_uart_apdma_desc { … };
struct mtk_chan { … };
static inline struct mtk_uart_apdmadev *
to_mtk_uart_apdma_dev(struct dma_device *d)
{ … }
static inline struct mtk_chan *to_mtk_uart_apdma_chan(struct dma_chan *c)
{ … }
static inline struct mtk_uart_apdma_desc *to_mtk_uart_apdma_desc
(struct dma_async_tx_descriptor *t)
{ … }
static void mtk_uart_apdma_write(struct mtk_chan *c,
unsigned int reg, unsigned int val)
{ … }
static unsigned int mtk_uart_apdma_read(struct mtk_chan *c, unsigned int reg)
{ … }
static void mtk_uart_apdma_desc_free(struct virt_dma_desc *vd)
{ … }
static void mtk_uart_apdma_start_tx(struct mtk_chan *c)
{ … }
static void mtk_uart_apdma_start_rx(struct mtk_chan *c)
{ … }
static void mtk_uart_apdma_tx_handler(struct mtk_chan *c)
{ … }
static void mtk_uart_apdma_rx_handler(struct mtk_chan *c)
{ … }
static void mtk_uart_apdma_chan_complete_handler(struct mtk_chan *c)
{ … }
static irqreturn_t mtk_uart_apdma_irq_handler(int irq, void *dev_id)
{ … }
static int mtk_uart_apdma_alloc_chan_resources(struct dma_chan *chan)
{ … }
static void mtk_uart_apdma_free_chan_resources(struct dma_chan *chan)
{ … }
static enum dma_status mtk_uart_apdma_tx_status(struct dma_chan *chan,
dma_cookie_t cookie,
struct dma_tx_state *txstate)
{ … }
static struct dma_async_tx_descriptor *mtk_uart_apdma_prep_slave_sg
(struct dma_chan *chan, struct scatterlist *sgl,
unsigned int sglen, enum dma_transfer_direction dir,
unsigned long tx_flags, void *context)
{ … }
static void mtk_uart_apdma_issue_pending(struct dma_chan *chan)
{ … }
static int mtk_uart_apdma_slave_config(struct dma_chan *chan,
struct dma_slave_config *config)
{ … }
static int mtk_uart_apdma_terminate_all(struct dma_chan *chan)
{ … }
static int mtk_uart_apdma_device_pause(struct dma_chan *chan)
{ … }
static void mtk_uart_apdma_free(struct mtk_uart_apdmadev *mtkd)
{ … }
static const struct of_device_id mtk_uart_apdma_match[] = …;
MODULE_DEVICE_TABLE(of, mtk_uart_apdma_match);
static int mtk_uart_apdma_probe(struct platform_device *pdev)
{ … }
static void mtk_uart_apdma_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int mtk_uart_apdma_suspend(struct device *dev)
{ … }
static int mtk_uart_apdma_resume(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM
static int mtk_uart_apdma_runtime_suspend(struct device *dev)
{ … }
static int mtk_uart_apdma_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops mtk_uart_apdma_pm_ops = …;
static struct platform_driver mtk_uart_apdma_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;