linux/drivers/media/platform/qcom/camss/camss-vfe-4-8.c

// SPDX-License-Identifier: GPL-2.0
/*
 * camss-vfe-4-8.c
 *
 * Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module v4.8
 *
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (C) 2015-2021 Linaro Ltd.
 */

#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>

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

#define VFE_0_HW_VERSION

#define VFE_0_GLOBAL_RESET_CMD
#define VFE_0_GLOBAL_RESET_CMD_CORE
#define VFE_0_GLOBAL_RESET_CMD_CAMIF
#define VFE_0_GLOBAL_RESET_CMD_BUS
#define VFE_0_GLOBAL_RESET_CMD_BUS_BDG
#define VFE_0_GLOBAL_RESET_CMD_REGISTER
#define VFE_0_GLOBAL_RESET_CMD_PM
#define VFE_0_GLOBAL_RESET_CMD_BUS_MISR
#define VFE_0_GLOBAL_RESET_CMD_TESTGEN
#define VFE_0_GLOBAL_RESET_CMD_DSP
#define VFE_0_GLOBAL_RESET_CMD_IDLE_CGC

#define VFE_0_MODULE_LENS_EN
#define VFE_0_MODULE_LENS_EN_DEMUX
#define VFE_0_MODULE_LENS_EN_CHROMA_UPSAMPLE

#define VFE_0_MODULE_ZOOM_EN
#define VFE_0_MODULE_ZOOM_EN_SCALE_ENC
#define VFE_0_MODULE_ZOOM_EN_CROP_ENC
#define VFE_0_MODULE_ZOOM_EN_REALIGN_BUF

#define VFE_0_CORE_CFG
#define VFE_0_CORE_CFG_PIXEL_PATTERN_YCBYCR
#define VFE_0_CORE_CFG_PIXEL_PATTERN_YCRYCB
#define VFE_0_CORE_CFG_PIXEL_PATTERN_CBYCRY
#define VFE_0_CORE_CFG_PIXEL_PATTERN_CRYCBY
#define VFE_0_CORE_CFG_COMPOSITE_REG_UPDATE_EN

#define VFE_0_IRQ_CMD
#define VFE_0_IRQ_CMD_GLOBAL_CLEAR

#define VFE_0_IRQ_MASK_0
#define VFE_0_IRQ_MASK_0_CAMIF_SOF
#define VFE_0_IRQ_MASK_0_CAMIF_EOF
#define VFE_0_IRQ_MASK_0_RDIn_REG_UPDATE(n)
#define VFE_0_IRQ_MASK_0_line_n_REG_UPDATE(n)
#define VFE_0_IRQ_MASK_0_IMAGE_MASTER_n_PING_PONG(n)
#define VFE_0_IRQ_MASK_0_IMAGE_COMPOSITE_DONE_n(n)
#define VFE_0_IRQ_MASK_0_RESET_ACK
#define VFE_0_IRQ_MASK_1
#define VFE_0_IRQ_MASK_1_CAMIF_ERROR
#define VFE_0_IRQ_MASK_1_VIOLATION
#define VFE_0_IRQ_MASK_1_BUS_BDG_HALT_ACK
#define VFE_0_IRQ_MASK_1_IMAGE_MASTER_n_BUS_OVERFLOW(n)
#define VFE_0_IRQ_MASK_1_RDIn_SOF(n)

#define VFE_0_IRQ_CLEAR_0
#define VFE_0_IRQ_CLEAR_1

#define VFE_0_IRQ_STATUS_0
#define VFE_0_IRQ_STATUS_0_CAMIF_SOF
#define VFE_0_IRQ_STATUS_0_RDIn_REG_UPDATE(n)
#define VFE_0_IRQ_STATUS_0_line_n_REG_UPDATE(n)
#define VFE_0_IRQ_STATUS_0_IMAGE_MASTER_n_PING_PONG(n)
#define VFE_0_IRQ_STATUS_0_IMAGE_COMPOSITE_DONE_n(n)
#define VFE_0_IRQ_STATUS_0_RESET_ACK
#define VFE_0_IRQ_STATUS_1
#define VFE_0_IRQ_STATUS_1_VIOLATION
#define VFE_0_IRQ_STATUS_1_BUS_BDG_HALT_ACK
#define VFE_0_IRQ_STATUS_1_RDIn_SOF(n)

#define VFE_0_IRQ_COMPOSITE_MASK_0
#define VFE_0_VIOLATION_STATUS

#define VFE_0_BUS_CMD
#define VFE_0_BUS_CMD_Mx_RLD_CMD(x)

#define VFE_0_BUS_CFG

#define VFE_0_BUS_XBAR_CFG_x(x)
#define VFE_0_BUS_XBAR_CFG_x_M_PAIR_STREAM_EN
#define VFE_0_BUS_XBAR_CFG_x_M_REALIGN_BUF_EN
#define VFE_0_BUS_XBAR_CFG_x_M_PAIR_STREAM_SWAP_INTRA
#define VFE_0_BUS_XBAR_CFG_x_M_PAIR_STREAM_SWAP_INTER
#define VFE_0_BUS_XBAR_CFG_x_M_PAIR_STREAM_SWAP_INTER_INTRA
#define VFE_0_BUS_XBAR_CFG_x_M_SINGLE_STREAM_SEL_SHIFT
#define VFE_0_BUS_XBAR_CFG_x_M_SINGLE_STREAM_SEL_LUMA
#define VFE_0_BUS_XBAR_CFG_x_M_SINGLE_STREAM_SEL_VAL_RDI0
#define VFE_0_BUS_XBAR_CFG_x_M_SINGLE_STREAM_SEL_VAL_RDI1
#define VFE_0_BUS_XBAR_CFG_x_M_SINGLE_STREAM_SEL_VAL_RDI2

#define VFE_0_BUS_IMAGE_MASTER_n_WR_CFG(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_CFG_WR_PATH_SHIFT
#define VFE_0_BUS_IMAGE_MASTER_n_WR_PING_ADDR(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_PONG_ADDR(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_ADDR_CFG(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_ADDR_CFG_FRM_BASED_SHIFT
#define VFE_0_BUS_IMAGE_MASTER_n_WR_ADDR_CFG_FRM_DROP_PER_SHIFT
#define VFE_0_BUS_IMAGE_MASTER_n_WR_ADDR_CFG_FRM_DROP_PER_MASK
#define VFE_0_BUS_IMAGE_MASTER_n_WR_UB_CFG(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_UB_CFG_OFFSET_SHIFT
#define VFE_0_BUS_IMAGE_MASTER_n_WR_IMAGE_SIZE(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_BUFFER_CFG(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_FRAMEDROP_PATTERN(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_IRQ_SUBSAMPLE_PATTERN(n)
#define VFE_0_BUS_IMAGE_MASTER_n_WR_IRQ_SUBSAMPLE_PATTERN_DEF

#define VFE_0_BUS_PING_PONG_STATUS

#define VFE_0_BUS_BDG_CMD
#define VFE_0_BUS_BDG_CMD_HALT_REQ

#define VFE_0_BUS_BDG_QOS_CFG_0
#define VFE_0_BUS_BDG_QOS_CFG_0_CFG
#define VFE_0_BUS_BDG_QOS_CFG_1
#define VFE_0_BUS_BDG_QOS_CFG_2
#define VFE_0_BUS_BDG_QOS_CFG_3
#define VFE_0_BUS_BDG_QOS_CFG_3_CFG
#define VFE_0_BUS_BDG_QOS_CFG_4
#define VFE_0_BUS_BDG_QOS_CFG_4_CFG
#define VFE_0_BUS_BDG_QOS_CFG_5
#define VFE_0_BUS_BDG_QOS_CFG_6
#define VFE_0_BUS_BDG_QOS_CFG_7
#define VFE_0_BUS_BDG_QOS_CFG_7_CFG

#define VFE_0_BUS_BDG_DS_CFG_0
#define VFE_0_BUS_BDG_DS_CFG_0_CFG
#define VFE_0_BUS_BDG_DS_CFG_1
#define VFE_0_BUS_BDG_DS_CFG_2
#define VFE_0_BUS_BDG_DS_CFG_3
#define VFE_0_BUS_BDG_DS_CFG_4
#define VFE_0_BUS_BDG_DS_CFG_5
#define VFE_0_BUS_BDG_DS_CFG_6
#define VFE_0_BUS_BDG_DS_CFG_7
#define VFE_0_BUS_BDG_DS_CFG_8
#define VFE_0_BUS_BDG_DS_CFG_9
#define VFE_0_BUS_BDG_DS_CFG_10
#define VFE_0_BUS_BDG_DS_CFG_11
#define VFE_0_BUS_BDG_DS_CFG_12
#define VFE_0_BUS_BDG_DS_CFG_13
#define VFE_0_BUS_BDG_DS_CFG_14
#define VFE_0_BUS_BDG_DS_CFG_15
#define VFE_0_BUS_BDG_DS_CFG_16
#define VFE_0_BUS_BDG_DS_CFG_16_CFG

#define VFE_0_RDI_CFG_x(x)
#define VFE_0_RDI_CFG_x_RDI_STREAM_SEL_SHIFT
#define VFE_0_RDI_CFG_x_RDI_STREAM_SEL_MASK
#define VFE_0_RDI_CFG_x_RDI_M0_SEL_SHIFT
#define VFE_0_RDI_CFG_x_RDI_M0_SEL_MASK
#define VFE_0_RDI_CFG_x_RDI_EN_BIT
#define VFE_0_RDI_CFG_x_MIPI_EN_BITS

#define VFE_0_CAMIF_CMD
#define VFE_0_CAMIF_CMD_DISABLE_FRAME_BOUNDARY
#define VFE_0_CAMIF_CMD_ENABLE_FRAME_BOUNDARY
#define VFE_0_CAMIF_CMD_NO_CHANGE
#define VFE_0_CAMIF_CMD_CLEAR_CAMIF_STATUS
#define VFE_0_CAMIF_CFG
#define VFE_0_CAMIF_CFG_VFE_OUTPUT_EN
#define VFE_0_CAMIF_FRAME_CFG
#define VFE_0_CAMIF_WINDOW_WIDTH_CFG
#define VFE_0_CAMIF_WINDOW_HEIGHT_CFG
#define VFE_0_CAMIF_SUBSAMPLE_CFG
#define VFE_0_CAMIF_IRQ_FRAMEDROP_PATTERN
#define VFE_0_CAMIF_IRQ_SUBSAMPLE_PATTERN
#define VFE_0_CAMIF_STATUS
#define VFE_0_CAMIF_STATUS_HALT

#define VFE_0_REG_UPDATE
#define VFE_0_REG_UPDATE_RDIn(n)
#define VFE_0_REG_UPDATE_line_n(n)

#define VFE_0_DEMUX_CFG
#define VFE_0_DEMUX_CFG_PERIOD
#define VFE_0_DEMUX_GAIN_0
#define VFE_0_DEMUX_GAIN_0_CH0_EVEN
#define VFE_0_DEMUX_GAIN_0_CH0_ODD
#define VFE_0_DEMUX_GAIN_1
#define VFE_0_DEMUX_GAIN_1_CH1
#define VFE_0_DEMUX_GAIN_1_CH2
#define VFE_0_DEMUX_EVEN_CFG
#define VFE_0_DEMUX_EVEN_CFG_PATTERN_YUYV
#define VFE_0_DEMUX_EVEN_CFG_PATTERN_YVYU
#define VFE_0_DEMUX_EVEN_CFG_PATTERN_UYVY
#define VFE_0_DEMUX_EVEN_CFG_PATTERN_VYUY
#define VFE_0_DEMUX_ODD_CFG
#define VFE_0_DEMUX_ODD_CFG_PATTERN_YUYV
#define VFE_0_DEMUX_ODD_CFG_PATTERN_YVYU
#define VFE_0_DEMUX_ODD_CFG_PATTERN_UYVY
#define VFE_0_DEMUX_ODD_CFG_PATTERN_VYUY

#define VFE_0_SCALE_ENC_Y_CFG
#define VFE_0_SCALE_ENC_Y_H_IMAGE_SIZE
#define VFE_0_SCALE_ENC_Y_H_PHASE
#define VFE_0_SCALE_ENC_Y_V_IMAGE_SIZE
#define VFE_0_SCALE_ENC_Y_V_PHASE
#define VFE_0_SCALE_ENC_CBCR_CFG
#define VFE_0_SCALE_ENC_CBCR_H_IMAGE_SIZE
#define VFE_0_SCALE_ENC_CBCR_H_PHASE
#define VFE_0_SCALE_ENC_CBCR_V_IMAGE_SIZE
#define VFE_0_SCALE_ENC_CBCR_V_PHASE

#define VFE_0_CROP_ENC_Y_WIDTH
#define VFE_0_CROP_ENC_Y_HEIGHT
#define VFE_0_CROP_ENC_CBCR_WIDTH
#define VFE_0_CROP_ENC_CBCR_HEIGHT

#define VFE_0_CLAMP_ENC_MAX_CFG
#define VFE_0_CLAMP_ENC_MAX_CFG_CH0
#define VFE_0_CLAMP_ENC_MAX_CFG_CH1
#define VFE_0_CLAMP_ENC_MAX_CFG_CH2
#define VFE_0_CLAMP_ENC_MIN_CFG
#define VFE_0_CLAMP_ENC_MIN_CFG_CH0
#define VFE_0_CLAMP_ENC_MIN_CFG_CH1
#define VFE_0_CLAMP_ENC_MIN_CFG_CH2

#define VFE_0_REALIGN_BUF_CFG
#define VFE_0_REALIGN_BUF_CFG_CB_ODD_PIXEL
#define VFE_0_REALIGN_BUF_CFG_CR_ODD_PIXEL
#define VFE_0_REALIGN_BUF_CFG_HSUB_ENABLE

#define VFE_0_BUS_IMAGE_MASTER_CMD
#define VFE_0_BUS_IMAGE_MASTER_n_SHIFT(x)

#define CAMIF_TIMEOUT_SLEEP_US
#define CAMIF_TIMEOUT_ALL_US

#define MSM_VFE_VFE0_UB_SIZE
#define MSM_VFE_VFE0_UB_SIZE_RDI
#define MSM_VFE_VFE1_UB_SIZE
#define MSM_VFE_VFE1_UB_SIZE_RDI

static u32 vfe_hw_version(struct vfe_device *vfe)
{}

static inline void vfe_reg_clr(struct vfe_device *vfe, u32 reg, u32 clr_bits)
{}

static inline void vfe_reg_set(struct vfe_device *vfe, u32 reg, u32 set_bits)
{}

static void vfe_global_reset(struct vfe_device *vfe)
{}

static void vfe_halt_request(struct vfe_device *vfe)
{}

static void vfe_halt_clear(struct vfe_device *vfe)
{}

static void vfe_wm_frame_based(struct vfe_device *vfe, u8 wm, u8 enable)
{}

#define CALC_WORD(width, M, N)

static int vfe_word_per_line_by_pixel(u32 format, u32 pixel_per_line)
{}

static int vfe_word_per_line_by_bytes(u32 bytes_per_line)
{}

static void vfe_get_wm_sizes(struct v4l2_pix_format_mplane *pix, u8 plane,
			     u16 *width, u16 *height, u16 *bytesperline)
{}

static void vfe_wm_line_based(struct vfe_device *vfe, u32 wm,
			      struct v4l2_pix_format_mplane *pix,
			      u8 plane, u32 enable)
{}

static void vfe_wm_set_framedrop_period(struct vfe_device *vfe, u8 wm, u8 per)
{}

static void vfe_wm_set_framedrop_pattern(struct vfe_device *vfe, u8 wm,
					 u32 pattern)
{}

static void vfe_wm_set_ub_cfg(struct vfe_device *vfe, u8 wm,
			      u16 offset, u16 depth)
{}

static void vfe_bus_reload_wm(struct vfe_device *vfe, u8 wm)
{}

static void vfe_wm_set_ping_addr(struct vfe_device *vfe, u8 wm, u32 addr)
{}

static void vfe_wm_set_pong_addr(struct vfe_device *vfe, u8 wm, u32 addr)
{}

static int vfe_wm_get_ping_pong_status(struct vfe_device *vfe, u8 wm)
{}

static void vfe_bus_enable_wr_if(struct vfe_device *vfe, u8 enable)
{}

static void vfe_bus_connect_wm_to_rdi(struct vfe_device *vfe, u8 wm,
				      enum vfe_line_id id)
{}

static void vfe_wm_set_subsample(struct vfe_device *vfe, u8 wm)
{}

static void vfe_bus_disconnect_wm_from_rdi(struct vfe_device *vfe, u8 wm,
					   enum vfe_line_id id)
{}

static void vfe_set_xbar_cfg(struct vfe_device *vfe, struct vfe_output *output,
			     u8 enable)
{}

static void vfe_set_realign_cfg(struct vfe_device *vfe, struct vfe_line *line,
				u8 enable)
{}

static void vfe_set_rdi_cid(struct vfe_device *vfe, enum vfe_line_id id, u8 cid)
{}

static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_id)
{}

static inline void vfe_reg_update_clear(struct vfe_device *vfe,
					enum vfe_line_id line_id)
{}

static void vfe_enable_irq_wm_line(struct vfe_device *vfe, u8 wm,
				   enum vfe_line_id line_id, u8 enable)
{}

static void vfe_enable_irq_pix_line(struct vfe_device *vfe, u8 comp,
				    enum vfe_line_id line_id, u8 enable)
{}

static void vfe_enable_irq_common(struct vfe_device *vfe)
{}

static void vfe_set_demux_cfg(struct vfe_device *vfe, struct vfe_line *line)
{}

static void vfe_set_scale_cfg(struct vfe_device *vfe, struct vfe_line *line)
{}

static void vfe_set_crop_cfg(struct vfe_device *vfe, struct vfe_line *line)
{}

static void vfe_set_clamp_cfg(struct vfe_device *vfe)
{}

static void vfe_set_cgc_override(struct vfe_device *vfe, u8 wm, u8 enable)
{}

static void vfe_set_camif_cfg(struct vfe_device *vfe, struct vfe_line *line)
{}

static void vfe_set_camif_cmd(struct vfe_device *vfe, u8 enable)
{}

static void vfe_set_module_cfg(struct vfe_device *vfe, u8 enable)
{}

static int vfe_camif_wait_for_stop(struct vfe_device *vfe, struct device *dev)
{}

/*
 * vfe_isr - VFE module interrupt handler
 * @irq: Interrupt line
 * @dev: VFE device
 *
 * Return IRQ_HANDLED on success
 */
static irqreturn_t vfe_isr(int irq, void *dev)
{}

static u16 vfe_get_ub_size(u8 vfe_id)
{}

static void vfe_wm_enable(struct vfe_device *vfe, u8 wm, u8 enable)
{}

static void vfe_set_qos(struct vfe_device *vfe)
{}

static void vfe_set_ds(struct vfe_device *vfe)
{}

static void vfe_isr_read(struct vfe_device *vfe, u32 *value0, u32 *value1)
{}

static void vfe_violation_read(struct vfe_device *vfe)
{}

static const struct vfe_hw_ops_gen1 vfe_ops_gen1_4_8 =;

static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
{}

const struct vfe_hw_ops vfe_ops_4_8 =;