Rajakumar Govindaram | 7d2b977 | 2017-07-19 15:16:12 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef CAM_JPEG_DMA_CORE_H |
| 14 | #define CAM_JPEG_DMA_CORE_H |
| 15 | |
| 16 | #include <linux/interrupt.h> |
| 17 | #include <linux/io.h> |
| 18 | #include <linux/of.h> |
| 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/dma-buf.h> |
| 21 | |
| 22 | struct cam_jpeg_dma_device_hw_info { |
| 23 | uint32_t reserved; |
| 24 | }; |
| 25 | |
| 26 | struct cam_jpeg_dma_set_irq_cb { |
| 27 | int32_t (*jpeg_hw_mgr_cb)(uint32_t irq_status, |
| 28 | int32_t result_size, void *data); |
| 29 | void *data; |
| 30 | }; |
| 31 | |
| 32 | enum cam_jpeg_dma_core_state { |
| 33 | CAM_JPEG_DMA_CORE_NOT_READY, |
| 34 | CAM_JPEG_DMA_CORE_READY, |
| 35 | CAM_JPEG_DMA_CORE_RESETTING, |
| 36 | CAM_JPEG_DMA_CORE_STATE_MAX, |
| 37 | }; |
| 38 | |
| 39 | struct cam_jpeg_dma_device_core_info { |
| 40 | enum cam_jpeg_dma_core_state core_state; |
| 41 | struct cam_jpeg_dma_device_hw_info *jpeg_dma_hw_info; |
| 42 | uint32_t cpas_handle; |
| 43 | struct cam_jpeg_dma_set_irq_cb irq_cb; |
Rajakumar Govindaram | 2264d15 | 2017-09-11 10:53:31 -0700 | [diff] [blame] | 44 | int32_t ref_count; |
| 45 | struct mutex core_mutex; |
Rajakumar Govindaram | 7d2b977 | 2017-07-19 15:16:12 -0700 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | int cam_jpeg_dma_init_hw(void *device_priv, |
| 49 | void *init_hw_args, uint32_t arg_size); |
| 50 | int cam_jpeg_dma_deinit_hw(void *device_priv, |
| 51 | void *init_hw_args, uint32_t arg_size); |
| 52 | int cam_jpeg_dma_process_cmd(void *device_priv, uint32_t cmd_type, |
| 53 | void *cmd_args, uint32_t arg_size); |
| 54 | irqreturn_t cam_jpeg_dma_irq(int irq_num, void *data); |
| 55 | |
| 56 | #endif /* CAM_JPEG_DMA_CORE_H */ |