#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/dmaengine.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/phy/phy.h>
#include <linux/libata.h>
#include <linux/slab.h>
#include <trace/events/libata.h>
#include "libata.h"
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
#undef DRV_NAME
#undef DRV_VERSION
#define DRV_NAME …
#define DRV_VERSION …
#define sata_dwc_writel(a, v) …
#define sata_dwc_readl(a) …
#define AHB_DMA_BRST_DFLT …
enum { … };
struct sata_dwc_regs { … };
enum { … };
#define SATA_DWC_SCR0_SPD_GET(v) …
#define SATA_DWC_DMACR_TX_CLEAR(v) …
#define SATA_DWC_DMACR_RX_CLEAR(v) …
#define SATA_DWC_DBTSR_MWR(size) …
#define SATA_DWC_DBTSR_MRD(size) …
struct sata_dwc_device { … };
#define SATA_DWC_QCMD_MAX …
struct sata_dwc_device_port { … };
#define HSDEV_FROM_HOST(host) …
#define HSDEV_FROM_AP(ap) …
#define HSDEVP_FROM_AP(ap) …
#define HSDEV_FROM_QC(qc) …
#define HSDEV_FROM_HSDEVP(p) …
enum { … };
static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag);
static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc);
static void sata_dwc_dma_xfer_complete(struct ata_port *ap);
static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag);
#ifdef CONFIG_SATA_DWC_OLD_DMA
#include <linux/platform_data/dma-dw.h>
#include <linux/dma/dw.h>
static struct dw_dma_slave sata_dwc_dma_dws = …;
static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
{ … }
static int sata_dwc_dma_get_channel_old(struct sata_dwc_device_port *hsdevp)
{ … }
static int sata_dwc_dma_init_old(struct platform_device *pdev,
struct sata_dwc_device *hsdev)
{ … }
static void sata_dwc_dma_exit_old(struct sata_dwc_device *hsdev)
{ … }
#endif
static const char *get_prot_descript(u8 protocol)
{ … }
static void dma_dwc_xfer_done(void *hsdev_instance)
{ … }
static struct dma_async_tx_descriptor *dma_dwc_xfer_setup(struct ata_queued_cmd *qc)
{ … }
static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
{ … }
static int sata_dwc_scr_write(struct ata_link *link, unsigned int scr, u32 val)
{ … }
static void clear_serror(struct ata_port *ap)
{ … }
static void clear_interrupt_bit(struct sata_dwc_device *hsdev, u32 bit)
{ … }
static u32 qcmd_tag_to_mask(u8 tag)
{ … }
static void sata_dwc_error_intr(struct ata_port *ap,
struct sata_dwc_device *hsdev, uint intpr)
{ … }
static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
{ … }
static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag)
{ … }
static void sata_dwc_dma_xfer_complete(struct ata_port *ap)
{ … }
static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc)
{ … }
static void sata_dwc_enable_interrupts(struct sata_dwc_device *hsdev)
{ … }
static void sata_dwc_setup_port(struct ata_ioports *port, void __iomem *base)
{ … }
static int sata_dwc_dma_get_channel(struct sata_dwc_device_port *hsdevp)
{ … }
static int sata_dwc_port_start(struct ata_port *ap)
{ … }
static void sata_dwc_port_stop(struct ata_port *ap)
{ … }
static void sata_dwc_exec_command_by_tag(struct ata_port *ap,
struct ata_taskfile *tf,
u8 tag, u32 cmd_issued)
{ … }
static void sata_dwc_bmdma_setup_by_tag(struct ata_queued_cmd *qc, u8 tag)
{ … }
static void sata_dwc_bmdma_setup(struct ata_queued_cmd *qc)
{ … }
static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag)
{ … }
static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc)
{ … }
static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)
{ … }
static void sata_dwc_error_handler(struct ata_port *ap)
{ … }
static int sata_dwc_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{ … }
static void sata_dwc_dev_select(struct ata_port *ap, unsigned int device)
{ … }
static const struct scsi_host_template sata_dwc_sht = …;
static struct ata_port_operations sata_dwc_ops = …;
static const struct ata_port_info sata_dwc_port_info[] = …;
static int sata_dwc_probe(struct platform_device *ofdev)
{ … }
static void sata_dwc_remove(struct platform_device *ofdev)
{ … }
static const struct of_device_id sata_dwc_match[] = …;
MODULE_DEVICE_TABLE(of, sata_dwc_match);
static struct platform_driver sata_dwc_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);