Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Driver for the High Speed UART DMA
0004  *
0005  * Copyright (C) 2015 Intel Corporation
0006  */
0007 
0008 #ifndef _DMA_HSU_H
0009 #define _DMA_HSU_H
0010 
0011 #include <linux/device.h>
0012 #include <linux/interrupt.h>
0013 
0014 #include <linux/platform_data/dma-hsu.h>
0015 
0016 struct hsu_dma;
0017 
0018 /**
0019  * struct hsu_dma_chip - representation of HSU DMA hardware
0020  * @dev:         struct device of the DMA controller
0021  * @irq:         irq line
0022  * @regs:        memory mapped I/O space
0023  * @length:      I/O space length
0024  * @offset:      offset of the I/O space where registers are located
0025  * @hsu:         struct hsu_dma that is filed by ->probe()
0026  * @pdata:       platform data for the DMA controller if provided
0027  */
0028 struct hsu_dma_chip {
0029     struct device           *dev;
0030     int             irq;
0031     void __iomem            *regs;
0032     unsigned int            length;
0033     unsigned int            offset;
0034     struct hsu_dma          *hsu;
0035 };
0036 
0037 #if IS_ENABLED(CONFIG_HSU_DMA)
0038 /* Export to the internal users */
0039 int hsu_dma_get_status(struct hsu_dma_chip *chip, unsigned short nr,
0040                u32 *status);
0041 int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr, u32 status);
0042 
0043 /* Export to the platform drivers */
0044 int hsu_dma_probe(struct hsu_dma_chip *chip);
0045 int hsu_dma_remove(struct hsu_dma_chip *chip);
0046 #else
0047 static inline int hsu_dma_get_status(struct hsu_dma_chip *chip,
0048                      unsigned short nr, u32 *status)
0049 {
0050     return 0;
0051 }
0052 static inline int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr,
0053                  u32 status)
0054 {
0055     return 0;
0056 }
0057 static inline int hsu_dma_probe(struct hsu_dma_chip *chip) { return -ENODEV; }
0058 static inline int hsu_dma_remove(struct hsu_dma_chip *chip) { return 0; }
0059 #endif /* CONFIG_HSU_DMA */
0060 
0061 #endif /* _DMA_HSU_H */