1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* TI K3 CPPI5 descriptors pool
3  *
4  * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
5  */
6 
7 #ifndef K3_CPPI_DESC_POOL_H_
8 #define K3_CPPI_DESC_POOL_H_
9 
10 #include <linux/device.h>
11 #include <linux/types.h>
12 
13 struct k3_cppi_desc_pool;
14 
15 void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool);
16 struct k3_cppi_desc_pool *
17 k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
18 			      size_t desc_size,
19 			      const char *name);
20 #define k3_cppi_desc_pool_create(dev, size, desc_size) \
21 		k3_cppi_desc_pool_create_name(dev, size, desc_size, NULL)
22 dma_addr_t
23 k3_cppi_desc_pool_virt2dma(struct k3_cppi_desc_pool *pool, void *addr);
24 void *
25 k3_cppi_desc_pool_dma2virt(struct k3_cppi_desc_pool *pool, dma_addr_t dma);
26 void *k3_cppi_desc_pool_alloc(struct k3_cppi_desc_pool *pool);
27 void k3_cppi_desc_pool_free(struct k3_cppi_desc_pool *pool, void *addr);
28 size_t k3_cppi_desc_pool_avail(struct k3_cppi_desc_pool *pool);
29 
30 #endif /* K3_CPPI_DESC_POOL_H_ */
31