linux/drivers/media/platform/qcom/camss/camss-vfe.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * camss-vfe.h
 *
 * Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module
 *
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (C) 2015-2018 Linaro Ltd.
 */
#ifndef QC_MSM_CAMSS_VFE_H
#define QC_MSM_CAMSS_VFE_H

#include <linux/clk.h>
#include <linux/spinlock_types.h>
#include <media/media-entity.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>

#include "camss-video.h"
#include "camss-vfe-gen1.h"

#define MSM_VFE_PAD_SINK
#define MSM_VFE_PAD_SRC
#define MSM_VFE_PADS_NUM

#define MSM_VFE_IMAGE_MASTERS_NUM
#define MSM_VFE_COMPOSITE_IRQ_NUM

/* VFE halt timeout */
#define VFE_HALT_TIMEOUT_MS
/* Frame drop value. VAL + UPDATES - 1 should not exceed 31 */
#define VFE_FRAME_DROP_VAL

#define vfe_line_array(ptr_line)

#define to_vfe(ptr_line)

enum vfe_output_state {};

enum vfe_line_id {};

struct vfe_output {};

struct vfe_line {};

struct vfe_device;

struct vfe_hw_ops {};

struct vfe_isr_ops {};

struct vfe_subdev_resources {};

struct vfe_device {};

struct camss_subdev_resources;

int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
			const struct camss_subdev_resources *res, u8 id);

void msm_vfe_genpd_cleanup(struct vfe_device *vfe);

int msm_vfe_register_entities(struct vfe_device *vfe,
			      struct v4l2_device *v4l2_dev);

void msm_vfe_unregister_entities(struct vfe_device *vfe);

/*
 * vfe_buf_add_pending - Add output buffer to list of pending
 * @output: VFE output
 * @buffer: Video buffer
 */
void vfe_buf_add_pending(struct vfe_output *output, struct camss_buffer *buffer);

struct camss_buffer *vfe_buf_get_pending(struct vfe_output *output);

int vfe_flush_buffers(struct camss_video *vid, enum vb2_buffer_state state);

/*
 * vfe_isr_comp_done - Process composite image done interrupt
 * @vfe: VFE Device
 * @comp: Composite image id
 */
void vfe_isr_comp_done(struct vfe_device *vfe, u8 comp);

void vfe_isr_reset_ack(struct vfe_device *vfe);
int vfe_put_output(struct vfe_line *line);
int vfe_release_wm(struct vfe_device *vfe, u8 wm);
int vfe_reserve_wm(struct vfe_device *vfe, enum vfe_line_id line_id);

/*
 * vfe_reset - Trigger reset on VFE module and wait to complete
 * @vfe: VFE device
 *
 * Return 0 on success or a negative error code otherwise
 */
int vfe_reset(struct vfe_device *vfe);

/*
 * vfe_disable - Disable streaming on VFE line
 * @line: VFE line
 *
 * Return 0 on success or a negative error code otherwise
 */
int vfe_disable(struct vfe_line *line);

/*
 * vfe_pm_domain_off - Disable power domains specific to this VFE.
 * @vfe: VFE Device
 */
void vfe_pm_domain_off(struct vfe_device *vfe);

/*
 * vfe_pm_domain_on - Enable power domains specific to this VFE.
 * @vfe: VFE Device
 */
int vfe_pm_domain_on(struct vfe_device *vfe);

extern const struct camss_formats vfe_formats_rdi_8x16;
extern const struct camss_formats vfe_formats_pix_8x16;
extern const struct camss_formats vfe_formats_rdi_8x96;
extern const struct camss_formats vfe_formats_pix_8x96;
extern const struct camss_formats vfe_formats_rdi_845;
extern const struct camss_formats vfe_formats_pix_845;

extern const struct vfe_hw_ops vfe_ops_4_1;
extern const struct vfe_hw_ops vfe_ops_4_7;
extern const struct vfe_hw_ops vfe_ops_4_8;
extern const struct vfe_hw_ops vfe_ops_170;
extern const struct vfe_hw_ops vfe_ops_480;

int vfe_get(struct vfe_device *vfe);
void vfe_put(struct vfe_device *vfe);

/*
 * vfe_is_lite - Return if VFE is VFE lite.
 * @vfe: VFE Device
 *
 * Some VFE lites have a different register layout.
 *
 * Return whether VFE is VFE lite
 */
bool vfe_is_lite(struct vfe_device *vfe);

#endif /* QC_MSM_CAMSS_VFE_H */