blob: 1e0c2e2d29be4ab8a636b65fef432924732b51b4 [file] [log] [blame]
Rajakumar Govindaram7d2b9772017-07-19 15:16:12 -07001/* 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
22struct cam_jpeg_dma_device_hw_info {
23 uint32_t reserved;
24};
25
26struct 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
32enum 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
39struct 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 Govindaram2264d152017-09-11 10:53:31 -070044 int32_t ref_count;
45 struct mutex core_mutex;
Rajakumar Govindaram7d2b9772017-07-19 15:16:12 -070046};
47
48int cam_jpeg_dma_init_hw(void *device_priv,
49 void *init_hw_args, uint32_t arg_size);
50int cam_jpeg_dma_deinit_hw(void *device_priv,
51 void *init_hw_args, uint32_t arg_size);
52int cam_jpeg_dma_process_cmd(void *device_priv, uint32_t cmd_type,
53 void *cmd_args, uint32_t arg_size);
54irqreturn_t cam_jpeg_dma_irq(int irq_num, void *data);
55
56#endif /* CAM_JPEG_DMA_CORE_H */