2015-02-23 22:24:42 +08:00
|
|
|
/*
|
|
|
|
* Driver for the High Speed UART DMA
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 Intel Corporation
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DMA_HSU_H
|
|
|
|
#define _DMA_HSU_H
|
|
|
|
|
|
|
|
#include <linux/device.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
|
|
|
|
#include <linux/platform_data/dma-hsu.h>
|
|
|
|
|
|
|
|
struct hsu_dma;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct hsu_dma_chip - representation of HSU DMA hardware
|
|
|
|
* @dev: struct device of the DMA controller
|
|
|
|
* @irq: irq line
|
|
|
|
* @regs: memory mapped I/O space
|
|
|
|
* @length: I/O space length
|
|
|
|
* @offset: offset of the I/O space where registers are located
|
|
|
|
* @hsu: struct hsu_dma that is filed by ->probe()
|
|
|
|
* @pdata: platform data for the DMA controller if provided
|
|
|
|
*/
|
|
|
|
struct hsu_dma_chip {
|
|
|
|
struct device *dev;
|
|
|
|
int irq;
|
|
|
|
void __iomem *regs;
|
|
|
|
unsigned int length;
|
|
|
|
unsigned int offset;
|
|
|
|
struct hsu_dma *hsu;
|
|
|
|
};
|
|
|
|
|
2015-10-13 18:29:04 +08:00
|
|
|
#if IS_ENABLED(CONFIG_HSU_DMA)
|
2015-02-23 22:24:42 +08:00
|
|
|
/* Export to the internal users */
|
2016-06-15 13:44:11 +08:00
|
|
|
int hsu_dma_get_status(struct hsu_dma_chip *chip, unsigned short nr,
|
|
|
|
u32 *status);
|
2016-08-23 21:09:40 +08:00
|
|
|
int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr, u32 status);
|
2015-02-23 22:24:42 +08:00
|
|
|
|
|
|
|
/* Export to the platform drivers */
|
|
|
|
int hsu_dma_probe(struct hsu_dma_chip *chip);
|
|
|
|
int hsu_dma_remove(struct hsu_dma_chip *chip);
|
2015-10-13 18:29:04 +08:00
|
|
|
#else
|
2016-06-15 13:44:11 +08:00
|
|
|
static inline int hsu_dma_get_status(struct hsu_dma_chip *chip,
|
|
|
|
unsigned short nr, u32 *status)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2016-08-23 21:09:40 +08:00
|
|
|
static inline int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr,
|
|
|
|
u32 status)
|
2015-10-13 18:29:04 +08:00
|
|
|
{
|
2016-08-23 21:09:40 +08:00
|
|
|
return 0;
|
2015-10-13 18:29:04 +08:00
|
|
|
}
|
|
|
|
static inline int hsu_dma_probe(struct hsu_dma_chip *chip) { return -ENODEV; }
|
|
|
|
static inline int hsu_dma_remove(struct hsu_dma_chip *chip) { return 0; }
|
|
|
|
#endif /* CONFIG_HSU_DMA */
|
2015-02-23 22:24:42 +08:00
|
|
|
|
|
|
|
#endif /* _DMA_HSU_H */
|