Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma: coh901318: merge header files

We do not need two header files for the two parts of the driver
to talk to each other so merge them into one.

Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+108 -124
-1
drivers/dma/coh901318.c
··· 24 24 #include <linux/platform_data/dma-coh901318.h> 25 25 26 26 #include "coh901318.h" 27 - #include "coh901318_lli.h" 28 27 #include "dmaengine.h" 29 28 30 29 #define COH901318_MOD32_MASK (0x1F)
+108
drivers/dma/coh901318.h
··· 11 11 #define MAX_DMA_PACKET_SIZE_SHIFT 11 12 12 #define MAX_DMA_PACKET_SIZE (1 << MAX_DMA_PACKET_SIZE_SHIFT) 13 13 14 + struct device; 15 + 16 + struct coh901318_pool { 17 + spinlock_t lock; 18 + struct dma_pool *dmapool; 19 + struct device *dev; 20 + 21 + #ifdef CONFIG_DEBUG_FS 22 + int debugfs_pool_counter; 23 + #endif 24 + }; 25 + 14 26 /** 15 27 * struct coh901318_lli - linked list item for DMAC 16 28 * @control: control settings for DMAC ··· 41 29 void *virt_link_addr; 42 30 dma_addr_t phy_this; 43 31 }; 32 + 33 + /** 34 + * coh901318_pool_create() - Creates an dma pool for lli:s 35 + * @pool: pool handle 36 + * @dev: dma device 37 + * @lli_nbr: number of lli:s in the pool 38 + * @algin: address alignemtn of lli:s 39 + * returns 0 on success otherwise none zero 40 + */ 41 + int coh901318_pool_create(struct coh901318_pool *pool, 42 + struct device *dev, 43 + size_t lli_nbr, size_t align); 44 + 45 + /** 46 + * coh901318_pool_destroy() - Destroys the dma pool 47 + * @pool: pool handle 48 + * returns 0 on success otherwise none zero 49 + */ 50 + int coh901318_pool_destroy(struct coh901318_pool *pool); 51 + 52 + /** 53 + * coh901318_lli_alloc() - Allocates a linked list 54 + * 55 + * @pool: pool handle 56 + * @len: length to list 57 + * return: none NULL if success otherwise NULL 58 + */ 59 + struct coh901318_lli * 60 + coh901318_lli_alloc(struct coh901318_pool *pool, 61 + unsigned int len); 62 + 63 + /** 64 + * coh901318_lli_free() - Returns the linked list items to the pool 65 + * @pool: pool handle 66 + * @lli: reference to lli pointer to be freed 67 + */ 68 + void coh901318_lli_free(struct coh901318_pool *pool, 69 + struct coh901318_lli **lli); 70 + 71 + /** 72 + * coh901318_lli_fill_memcpy() - Prepares the lli:s for dma memcpy 73 + * @pool: pool handle 74 + * @lli: allocated lli 75 + * @src: src address 76 + * @size: transfer size 77 + * @dst: destination address 78 + * @ctrl_chained: ctrl for chained lli 79 + * @ctrl_last: ctrl for the last lli 80 + * returns number of CPU interrupts for the lli, negative on error. 81 + */ 82 + int 83 + coh901318_lli_fill_memcpy(struct coh901318_pool *pool, 84 + struct coh901318_lli *lli, 85 + dma_addr_t src, unsigned int size, 86 + dma_addr_t dst, u32 ctrl_chained, u32 ctrl_last); 87 + 88 + /** 89 + * coh901318_lli_fill_single() - Prepares the lli:s for dma single transfer 90 + * @pool: pool handle 91 + * @lli: allocated lli 92 + * @buf: transfer buffer 93 + * @size: transfer size 94 + * @dev_addr: address of periphal 95 + * @ctrl_chained: ctrl for chained lli 96 + * @ctrl_last: ctrl for the last lli 97 + * @dir: direction of transfer (to or from device) 98 + * returns number of CPU interrupts for the lli, negative on error. 99 + */ 100 + int 101 + coh901318_lli_fill_single(struct coh901318_pool *pool, 102 + struct coh901318_lli *lli, 103 + dma_addr_t buf, unsigned int size, 104 + dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_last, 105 + enum dma_transfer_direction dir); 106 + 107 + /** 108 + * coh901318_lli_fill_single() - Prepares the lli:s for dma scatter list transfer 109 + * @pool: pool handle 110 + * @lli: allocated lli 111 + * @sg: scatter gather list 112 + * @nents: number of entries in sg 113 + * @dev_addr: address of periphal 114 + * @ctrl_chained: ctrl for chained lli 115 + * @ctrl: ctrl of middle lli 116 + * @ctrl_last: ctrl for the last lli 117 + * @dir: direction of transfer (to or from device) 118 + * @ctrl_irq_mask: ctrl mask for CPU interrupt 119 + * returns number of CPU interrupts for the lli, negative on error. 120 + */ 121 + int 122 + coh901318_lli_fill_sg(struct coh901318_pool *pool, 123 + struct coh901318_lli *lli, 124 + struct scatterlist *sg, unsigned int nents, 125 + dma_addr_t dev_addr, u32 ctrl_chained, 126 + u32 ctrl, u32 ctrl_last, 127 + enum dma_transfer_direction dir, u32 ctrl_irq_mask); 44 128 45 129 #endif /* COH901318_H */
-1
drivers/dma/coh901318_lli.c
··· 14 14 #include <linux/dmaengine.h> 15 15 16 16 #include "coh901318.h" 17 - #include "coh901318_lli.h" 18 17 19 18 #if (defined(CONFIG_DEBUG_FS) && defined(CONFIG_U300_DEBUG)) 20 19 #define DEBUGFS_POOL_COUNTER_RESET(pool) (pool->debugfs_pool_counter = 0)
-122
drivers/dma/coh901318_lli.h
··· 1 - /* 2 - * driver/dma/coh901318_lli.h 3 - * 4 - * Copyright (C) 2007-2009 ST-Ericsson 5 - * License terms: GNU General Public License (GPL) version 2 6 - * Support functions for handling lli for coh901318 7 - * Author: Per Friden <per.friden@stericsson.com> 8 - */ 9 - 10 - #ifndef COH901318_LLI_H 11 - #define COH901318_LLI_H 12 - 13 - struct device; 14 - 15 - struct coh901318_pool { 16 - spinlock_t lock; 17 - struct dma_pool *dmapool; 18 - struct device *dev; 19 - 20 - #ifdef CONFIG_DEBUG_FS 21 - int debugfs_pool_counter; 22 - #endif 23 - }; 24 - 25 - struct device; 26 - /** 27 - * coh901318_pool_create() - Creates an dma pool for lli:s 28 - * @pool: pool handle 29 - * @dev: dma device 30 - * @lli_nbr: number of lli:s in the pool 31 - * @algin: address alignemtn of lli:s 32 - * returns 0 on success otherwise none zero 33 - */ 34 - int coh901318_pool_create(struct coh901318_pool *pool, 35 - struct device *dev, 36 - size_t lli_nbr, size_t align); 37 - 38 - /** 39 - * coh901318_pool_destroy() - Destroys the dma pool 40 - * @pool: pool handle 41 - * returns 0 on success otherwise none zero 42 - */ 43 - int coh901318_pool_destroy(struct coh901318_pool *pool); 44 - 45 - /** 46 - * coh901318_lli_alloc() - Allocates a linked list 47 - * 48 - * @pool: pool handle 49 - * @len: length to list 50 - * return: none NULL if success otherwise NULL 51 - */ 52 - struct coh901318_lli * 53 - coh901318_lli_alloc(struct coh901318_pool *pool, 54 - unsigned int len); 55 - 56 - /** 57 - * coh901318_lli_free() - Returns the linked list items to the pool 58 - * @pool: pool handle 59 - * @lli: reference to lli pointer to be freed 60 - */ 61 - void coh901318_lli_free(struct coh901318_pool *pool, 62 - struct coh901318_lli **lli); 63 - 64 - /** 65 - * coh901318_lli_fill_memcpy() - Prepares the lli:s for dma memcpy 66 - * @pool: pool handle 67 - * @lli: allocated lli 68 - * @src: src address 69 - * @size: transfer size 70 - * @dst: destination address 71 - * @ctrl_chained: ctrl for chained lli 72 - * @ctrl_last: ctrl for the last lli 73 - * returns number of CPU interrupts for the lli, negative on error. 74 - */ 75 - int 76 - coh901318_lli_fill_memcpy(struct coh901318_pool *pool, 77 - struct coh901318_lli *lli, 78 - dma_addr_t src, unsigned int size, 79 - dma_addr_t dst, u32 ctrl_chained, u32 ctrl_last); 80 - 81 - /** 82 - * coh901318_lli_fill_single() - Prepares the lli:s for dma single transfer 83 - * @pool: pool handle 84 - * @lli: allocated lli 85 - * @buf: transfer buffer 86 - * @size: transfer size 87 - * @dev_addr: address of periphal 88 - * @ctrl_chained: ctrl for chained lli 89 - * @ctrl_last: ctrl for the last lli 90 - * @dir: direction of transfer (to or from device) 91 - * returns number of CPU interrupts for the lli, negative on error. 92 - */ 93 - int 94 - coh901318_lli_fill_single(struct coh901318_pool *pool, 95 - struct coh901318_lli *lli, 96 - dma_addr_t buf, unsigned int size, 97 - dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_last, 98 - enum dma_transfer_direction dir); 99 - 100 - /** 101 - * coh901318_lli_fill_single() - Prepares the lli:s for dma scatter list transfer 102 - * @pool: pool handle 103 - * @lli: allocated lli 104 - * @sg: scatter gather list 105 - * @nents: number of entries in sg 106 - * @dev_addr: address of periphal 107 - * @ctrl_chained: ctrl for chained lli 108 - * @ctrl: ctrl of middle lli 109 - * @ctrl_last: ctrl for the last lli 110 - * @dir: direction of transfer (to or from device) 111 - * @ctrl_irq_mask: ctrl mask for CPU interrupt 112 - * returns number of CPU interrupts for the lli, negative on error. 113 - */ 114 - int 115 - coh901318_lli_fill_sg(struct coh901318_pool *pool, 116 - struct coh901318_lli *lli, 117 - struct scatterlist *sg, unsigned int nents, 118 - dma_addr_t dev_addr, u32 ctrl_chained, 119 - u32 ctrl, u32 ctrl_last, 120 - enum dma_transfer_direction dir, u32 ctrl_irq_mask); 121 - 122 - #endif /* COH901318_LLI_H */