blob: 6ae4cdcde3c08aaaa8aa21f29497b7a4830e5be7 [file] [log] [blame]
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef CAM_JPEG_ENC_CORE_H
#define CAM_JPEG_ENC_CORE_H
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/dma-buf.h>
struct cam_jpeg_enc_device_hw_info {
uint32_t hw_version;
uint32_t int_status;
uint32_t int_clr;
uint32_t int_mask;
uint32_t reset_cmd;
};
struct cam_jpeg_enc_set_irq_cb {
int32_t (*jpeg_hw_mgr_cb)(uint32_t irq_status,
int32_t result_size, void *data);
void *data;
};
enum cam_jpeg_enc_core_state {
CAM_JPEG_ENC_CORE_NOT_READY,
CAM_JPEG_ENC_CORE_READY,
CAM_JPEG_ENC_CORE_RESETTING,
CAM_JPEG_ENC_CORE_STATE_MAX,
};
struct cam_jpeg_enc_device_core_info {
enum cam_jpeg_enc_core_state core_state;
struct cam_jpeg_enc_device_hw_info *jpeg_enc_hw_info;
uint32_t cpas_handle;
struct cam_jpeg_enc_set_irq_cb irq_cb;
};
int cam_jpeg_enc_init_hw(void *device_priv,
void *init_hw_args, uint32_t arg_size);
int cam_jpeg_enc_deinit_hw(void *device_priv,
void *init_hw_args, uint32_t arg_size);
int cam_jpeg_enc_start_hw(void *device_priv,
void *start_hw_args, uint32_t arg_size);
int cam_jpeg_enc_reset_hw(void *device_priv,
void *reset_hw_args, uint32_t arg_size);
int cam_jpeg_enc_process_cmd(void *device_priv, uint32_t cmd_type,
void *cmd_args, uint32_t arg_size);
irqreturn_t cam_jpeg_enc_irq(int irq_num, void *data);
#endif /* CAM_JPEG_ENC_CORE_H */