mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 12:26:41 +07:00
c6f82787a5
To allow other code to safely read DMA Channel Status Register (where the register attribute for Channel Error, Descriptor Time Out & Descriptor Done fields are read-clear), export hsu_dma_get_status(). hsu_dma_irq() is renamed to hsu_dma_do_irq() and requires Status Register value to be passed in. Signed-off-by: Chuah, Kim Tatt <kim.tatt.chuah@intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
66 lines
1.8 KiB
C
66 lines
1.8 KiB
C
/*
|
|
* 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;
|
|
};
|
|
|
|
#if IS_ENABLED(CONFIG_HSU_DMA)
|
|
/* Export to the internal users */
|
|
int hsu_dma_get_status(struct hsu_dma_chip *chip, unsigned short nr,
|
|
u32 *status);
|
|
irqreturn_t hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr,
|
|
u32 status);
|
|
|
|
/* Export to the platform drivers */
|
|
int hsu_dma_probe(struct hsu_dma_chip *chip);
|
|
int hsu_dma_remove(struct hsu_dma_chip *chip);
|
|
#else
|
|
static inline int hsu_dma_get_status(struct hsu_dma_chip *chip,
|
|
unsigned short nr, u32 *status)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline irqreturn_t hsu_dma_do_irq(struct hsu_dma_chip *chip,
|
|
unsigned short nr, u32 status)
|
|
{
|
|
return IRQ_NONE;
|
|
}
|
|
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 */
|
|
|
|
#endif /* _DMA_HSU_H */
|