···1111#define MAX_DMA_PACKET_SIZE_SHIFT 111212#define MAX_DMA_PACKET_SIZE (1 << MAX_DMA_PACKET_SIZE_SHIFT)13131414+struct device;1515+1616+struct coh901318_pool {1717+ spinlock_t lock;1818+ struct dma_pool *dmapool;1919+ struct device *dev;2020+2121+#ifdef CONFIG_DEBUG_FS2222+ int debugfs_pool_counter;2323+#endif2424+};2525+1426/**1527 * struct coh901318_lli - linked list item for DMAC1628 * @control: control settings for DMAC···4129 void *virt_link_addr;4230 dma_addr_t phy_this;4331};3232+3333+/**3434+ * coh901318_pool_create() - Creates an dma pool for lli:s3535+ * @pool: pool handle3636+ * @dev: dma device3737+ * @lli_nbr: number of lli:s in the pool3838+ * @algin: address alignemtn of lli:s3939+ * returns 0 on success otherwise none zero4040+ */4141+int coh901318_pool_create(struct coh901318_pool *pool,4242+ struct device *dev,4343+ size_t lli_nbr, size_t align);4444+4545+/**4646+ * coh901318_pool_destroy() - Destroys the dma pool4747+ * @pool: pool handle4848+ * returns 0 on success otherwise none zero4949+ */5050+int coh901318_pool_destroy(struct coh901318_pool *pool);5151+5252+/**5353+ * coh901318_lli_alloc() - Allocates a linked list5454+ *5555+ * @pool: pool handle5656+ * @len: length to list5757+ * return: none NULL if success otherwise NULL5858+ */5959+struct coh901318_lli *6060+coh901318_lli_alloc(struct coh901318_pool *pool,6161+ unsigned int len);6262+6363+/**6464+ * coh901318_lli_free() - Returns the linked list items to the pool6565+ * @pool: pool handle6666+ * @lli: reference to lli pointer to be freed6767+ */6868+void coh901318_lli_free(struct coh901318_pool *pool,6969+ struct coh901318_lli **lli);7070+7171+/**7272+ * coh901318_lli_fill_memcpy() - Prepares the lli:s for dma memcpy7373+ * @pool: pool handle7474+ * @lli: allocated lli7575+ * @src: src address7676+ * @size: transfer size7777+ * @dst: destination address7878+ * @ctrl_chained: ctrl for chained lli7979+ * @ctrl_last: ctrl for the last lli8080+ * returns number of CPU interrupts for the lli, negative on error.8181+ */8282+int8383+coh901318_lli_fill_memcpy(struct coh901318_pool *pool,8484+ struct coh901318_lli *lli,8585+ dma_addr_t src, unsigned int size,8686+ dma_addr_t dst, u32 ctrl_chained, u32 ctrl_last);8787+8888+/**8989+ * coh901318_lli_fill_single() - Prepares the lli:s for dma single transfer9090+ * @pool: pool handle9191+ * @lli: allocated lli9292+ * @buf: transfer buffer9393+ * @size: transfer size9494+ * @dev_addr: address of periphal9595+ * @ctrl_chained: ctrl for chained lli9696+ * @ctrl_last: ctrl for the last lli9797+ * @dir: direction of transfer (to or from device)9898+ * returns number of CPU interrupts for the lli, negative on error.9999+ */100100+int101101+coh901318_lli_fill_single(struct coh901318_pool *pool,102102+ struct coh901318_lli *lli,103103+ dma_addr_t buf, unsigned int size,104104+ dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_last,105105+ enum dma_transfer_direction dir);106106+107107+/**108108+ * coh901318_lli_fill_single() - Prepares the lli:s for dma scatter list transfer109109+ * @pool: pool handle110110+ * @lli: allocated lli111111+ * @sg: scatter gather list112112+ * @nents: number of entries in sg113113+ * @dev_addr: address of periphal114114+ * @ctrl_chained: ctrl for chained lli115115+ * @ctrl: ctrl of middle lli116116+ * @ctrl_last: ctrl for the last lli117117+ * @dir: direction of transfer (to or from device)118118+ * @ctrl_irq_mask: ctrl mask for CPU interrupt119119+ * returns number of CPU interrupts for the lli, negative on error.120120+ */121121+int122122+coh901318_lli_fill_sg(struct coh901318_pool *pool,123123+ struct coh901318_lli *lli,124124+ struct scatterlist *sg, unsigned int nents,125125+ dma_addr_t dev_addr, u32 ctrl_chained,126126+ u32 ctrl, u32 ctrl_last,127127+ enum dma_transfer_direction dir, u32 ctrl_irq_mask);4412845129#endif /* COH901318_H */
···11-/*22- * driver/dma/coh901318_lli.h33- *44- * Copyright (C) 2007-2009 ST-Ericsson55- * License terms: GNU General Public License (GPL) version 266- * Support functions for handling lli for coh90131877- * Author: Per Friden <per.friden@stericsson.com>88- */99-1010-#ifndef COH901318_LLI_H1111-#define COH901318_LLI_H1212-1313-struct device;1414-1515-struct coh901318_pool {1616- spinlock_t lock;1717- struct dma_pool *dmapool;1818- struct device *dev;1919-2020-#ifdef CONFIG_DEBUG_FS2121- int debugfs_pool_counter;2222-#endif2323-};2424-2525-struct device;2626-/**2727- * coh901318_pool_create() - Creates an dma pool for lli:s2828- * @pool: pool handle2929- * @dev: dma device3030- * @lli_nbr: number of lli:s in the pool3131- * @algin: address alignemtn of lli:s3232- * returns 0 on success otherwise none zero3333- */3434-int coh901318_pool_create(struct coh901318_pool *pool,3535- struct device *dev,3636- size_t lli_nbr, size_t align);3737-3838-/**3939- * coh901318_pool_destroy() - Destroys the dma pool4040- * @pool: pool handle4141- * returns 0 on success otherwise none zero4242- */4343-int coh901318_pool_destroy(struct coh901318_pool *pool);4444-4545-/**4646- * coh901318_lli_alloc() - Allocates a linked list4747- *4848- * @pool: pool handle4949- * @len: length to list5050- * return: none NULL if success otherwise NULL5151- */5252-struct coh901318_lli *5353-coh901318_lli_alloc(struct coh901318_pool *pool,5454- unsigned int len);5555-5656-/**5757- * coh901318_lli_free() - Returns the linked list items to the pool5858- * @pool: pool handle5959- * @lli: reference to lli pointer to be freed6060- */6161-void coh901318_lli_free(struct coh901318_pool *pool,6262- struct coh901318_lli **lli);6363-6464-/**6565- * coh901318_lli_fill_memcpy() - Prepares the lli:s for dma memcpy6666- * @pool: pool handle6767- * @lli: allocated lli6868- * @src: src address6969- * @size: transfer size7070- * @dst: destination address7171- * @ctrl_chained: ctrl for chained lli7272- * @ctrl_last: ctrl for the last lli7373- * returns number of CPU interrupts for the lli, negative on error.7474- */7575-int7676-coh901318_lli_fill_memcpy(struct coh901318_pool *pool,7777- struct coh901318_lli *lli,7878- dma_addr_t src, unsigned int size,7979- dma_addr_t dst, u32 ctrl_chained, u32 ctrl_last);8080-8181-/**8282- * coh901318_lli_fill_single() - Prepares the lli:s for dma single transfer8383- * @pool: pool handle8484- * @lli: allocated lli8585- * @buf: transfer buffer8686- * @size: transfer size8787- * @dev_addr: address of periphal8888- * @ctrl_chained: ctrl for chained lli8989- * @ctrl_last: ctrl for the last lli9090- * @dir: direction of transfer (to or from device)9191- * returns number of CPU interrupts for the lli, negative on error.9292- */9393-int9494-coh901318_lli_fill_single(struct coh901318_pool *pool,9595- struct coh901318_lli *lli,9696- dma_addr_t buf, unsigned int size,9797- dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_last,9898- enum dma_transfer_direction dir);9999-100100-/**101101- * coh901318_lli_fill_single() - Prepares the lli:s for dma scatter list transfer102102- * @pool: pool handle103103- * @lli: allocated lli104104- * @sg: scatter gather list105105- * @nents: number of entries in sg106106- * @dev_addr: address of periphal107107- * @ctrl_chained: ctrl for chained lli108108- * @ctrl: ctrl of middle lli109109- * @ctrl_last: ctrl for the last lli110110- * @dir: direction of transfer (to or from device)111111- * @ctrl_irq_mask: ctrl mask for CPU interrupt112112- * returns number of CPU interrupts for the lli, negative on error.113113- */114114-int115115-coh901318_lli_fill_sg(struct coh901318_pool *pool,116116- struct coh901318_lli *lli,117117- struct scatterlist *sg, unsigned int nents,118118- dma_addr_t dev_addr, u32 ctrl_chained,119119- u32 ctrl, u32 ctrl_last,120120- enum dma_transfer_direction dir, u32 ctrl_irq_mask);121121-122122-#endif /* COH901318_LLI_H */