#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <media/media-entity.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#include "camss-ispif.h"
#include "camss.h"
#define MSM_ISPIF_NAME …
#define ISPIF_RST_CMD_0 …
#define ISPIF_RST_CMD_1 …
#define ISPIF_RST_CMD_0_STROBED_RST_EN …
#define ISPIF_RST_CMD_0_MISC_LOGIC_RST …
#define ISPIF_RST_CMD_0_SW_REG_RST …
#define ISPIF_RST_CMD_0_PIX_INTF_0_CSID_RST …
#define ISPIF_RST_CMD_0_PIX_INTF_0_VFE_RST …
#define ISPIF_RST_CMD_0_PIX_INTF_1_CSID_RST …
#define ISPIF_RST_CMD_0_PIX_INTF_1_VFE_RST …
#define ISPIF_RST_CMD_0_RDI_INTF_0_CSID_RST …
#define ISPIF_RST_CMD_0_RDI_INTF_0_VFE_RST …
#define ISPIF_RST_CMD_0_RDI_INTF_1_CSID_RST …
#define ISPIF_RST_CMD_0_RDI_INTF_1_VFE_RST …
#define ISPIF_RST_CMD_0_RDI_INTF_2_CSID_RST …
#define ISPIF_RST_CMD_0_RDI_INTF_2_VFE_RST …
#define ISPIF_RST_CMD_0_PIX_OUTPUT_0_MISR_RST …
#define ISPIF_RST_CMD_0_RDI_OUTPUT_0_MISR_RST …
#define ISPIF_RST_CMD_0_RDI_OUTPUT_1_MISR_RST …
#define ISPIF_RST_CMD_0_RDI_OUTPUT_2_MISR_RST …
#define ISPIF_IRQ_GLOBAL_CLEAR_CMD …
#define ISPIF_VFE_m_CTRL_0(m) …
#define ISPIF_VFE_m_CTRL_0_PIX0_LINE_BUF_EN …
#define ISPIF_VFE_m_IRQ_MASK_0(m) …
#define ISPIF_VFE_m_IRQ_MASK_0_PIX0_ENABLE …
#define ISPIF_VFE_m_IRQ_MASK_0_PIX0_MASK …
#define ISPIF_VFE_m_IRQ_MASK_0_RDI0_ENABLE …
#define ISPIF_VFE_m_IRQ_MASK_0_RDI0_MASK …
#define ISPIF_VFE_m_IRQ_MASK_1(m) …
#define ISPIF_VFE_m_IRQ_MASK_1_PIX1_ENABLE …
#define ISPIF_VFE_m_IRQ_MASK_1_PIX1_MASK …
#define ISPIF_VFE_m_IRQ_MASK_1_RDI1_ENABLE …
#define ISPIF_VFE_m_IRQ_MASK_1_RDI1_MASK …
#define ISPIF_VFE_m_IRQ_MASK_2(m) …
#define ISPIF_VFE_m_IRQ_MASK_2_RDI2_ENABLE …
#define ISPIF_VFE_m_IRQ_MASK_2_RDI2_MASK …
#define ISPIF_VFE_m_IRQ_STATUS_0(m) …
#define ISPIF_VFE_m_IRQ_STATUS_0_PIX0_OVERFLOW …
#define ISPIF_VFE_m_IRQ_STATUS_0_RDI0_OVERFLOW …
#define ISPIF_VFE_m_IRQ_STATUS_1(m) …
#define ISPIF_VFE_m_IRQ_STATUS_1_PIX1_OVERFLOW …
#define ISPIF_VFE_m_IRQ_STATUS_1_RDI1_OVERFLOW …
#define ISPIF_VFE_m_IRQ_STATUS_2(m) …
#define ISPIF_VFE_m_IRQ_STATUS_2_RDI2_OVERFLOW …
#define ISPIF_VFE_m_IRQ_CLEAR_0(m) …
#define ISPIF_VFE_m_IRQ_CLEAR_1(m) …
#define ISPIF_VFE_m_IRQ_CLEAR_2(m) …
#define ISPIF_VFE_m_INTF_INPUT_SEL(m) …
#define ISPIF_VFE_m_INTF_CMD_0(m) …
#define ISPIF_VFE_m_INTF_CMD_1(m) …
#define ISPIF_VFE_m_PIX_INTF_n_CID_MASK(m, n) …
#define ISPIF_VFE_m_RDI_INTF_n_CID_MASK(m, n) …
#define ISPIF_VFE_m_RDI_INTF_n_PACK_CFG_0(m, n) …
#define ISPIF_VFE_m_RDI_INTF_n_PACK_CFG_1(m, n) …
#define ISPIF_VFE_m_RDI_INTF_n_PACK_CFG_0_CID_c_PLAIN(c) …
#define ISPIF_VFE_m_PIX_INTF_n_STATUS(m, n) …
#define ISPIF_VFE_m_RDI_INTF_n_STATUS(m, n) …
#define CSI_PIX_CLK_MUX_SEL …
#define CSI_RDI_CLK_MUX_SEL …
#define ISPIF_TIMEOUT_SLEEP_US …
#define ISPIF_TIMEOUT_ALL_US …
#define ISPIF_RESET_TIMEOUT_MS …
enum ispif_intf_cmd { … };
static const u32 ispif_formats_8x16[] = …;
static const u32 ispif_formats_8x96[] = …;
static irqreturn_t ispif_isr_8x96(int irq, void *dev)
{ … }
static irqreturn_t ispif_isr_8x16(int irq, void *dev)
{ … }
static int ispif_vfe_reset(struct ispif_device *ispif, u8 vfe_id)
{ … }
static int ispif_reset(struct ispif_device *ispif, u8 vfe_id)
{ … }
static int ispif_set_power(struct v4l2_subdev *sd, int on)
{ … }
static void ispif_select_clk_mux(struct ispif_device *ispif,
enum ispif_intf intf, u8 csid,
u8 vfe, u8 enable)
{ … }
static int ispif_validate_intf_status(struct ispif_device *ispif,
enum ispif_intf intf, u8 vfe)
{ … }
static int ispif_wait_for_stop(struct ispif_device *ispif,
enum ispif_intf intf, u8 vfe)
{ … }
static void ispif_select_csid(struct ispif_device *ispif, enum ispif_intf intf,
u8 csid, u8 vfe, u8 enable)
{ … }
static void ispif_select_cid(struct ispif_device *ispif, enum ispif_intf intf,
u8 cid, u8 vfe, u8 enable)
{ … }
static void ispif_config_irq(struct ispif_device *ispif, enum ispif_intf intf,
u8 vfe, u8 enable)
{ … }
static void ispif_config_pack(struct ispif_device *ispif, u32 code,
enum ispif_intf intf, u8 cid, u8 vfe, u8 enable)
{ … }
static void ispif_set_intf_cmd(struct ispif_device *ispif, u8 cmd,
enum ispif_intf intf, u8 vfe, u8 vc)
{ … }
static int ispif_set_stream(struct v4l2_subdev *sd, int enable)
{ … }
static struct v4l2_mbus_framefmt *
__ispif_get_format(struct ispif_line *line,
struct v4l2_subdev_state *sd_state,
unsigned int pad,
enum v4l2_subdev_format_whence which)
{ … }
static void ispif_try_format(struct ispif_line *line,
struct v4l2_subdev_state *sd_state,
unsigned int pad,
struct v4l2_mbus_framefmt *fmt,
enum v4l2_subdev_format_whence which)
{ … }
static int ispif_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int ispif_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static int ispif_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int ispif_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int ispif_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
int msm_ispif_subdev_init(struct camss *camss,
const struct camss_subdev_resources *res)
{ … }
static enum ispif_intf ispif_get_intf(enum vfe_line_id line_id)
{ … }
static void ispif_get_vfe_id(struct media_entity *entity, u8 *id)
{ … }
static void ispif_get_vfe_line_id(struct media_entity *entity,
enum vfe_line_id *id)
{ … }
static int ispif_link_setup(struct media_entity *entity,
const struct media_pad *local,
const struct media_pad *remote, u32 flags)
{ … }
static const struct v4l2_subdev_core_ops ispif_core_ops = …;
static const struct v4l2_subdev_video_ops ispif_video_ops = …;
static const struct v4l2_subdev_pad_ops ispif_pad_ops = …;
static const struct v4l2_subdev_ops ispif_v4l2_ops = …;
static const struct v4l2_subdev_internal_ops ispif_v4l2_internal_ops = …;
static const struct media_entity_operations ispif_media_ops = …;
int msm_ispif_register_entities(struct ispif_device *ispif,
struct v4l2_device *v4l2_dev)
{ … }
void msm_ispif_unregister_entities(struct ispif_device *ispif)
{ … }