linux/drivers/media/i2c/imx355.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2018 Intel Corporation

#include <linux/unaligned.h>
#include <linux/acpi.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>

#define IMX355_REG_MODE_SELECT
#define IMX355_MODE_STANDBY
#define IMX355_MODE_STREAMING

/* Chip ID */
#define IMX355_REG_CHIP_ID
#define IMX355_CHIP_ID

/* V_TIMING internal */
#define IMX355_REG_FLL
#define IMX355_FLL_MAX

/* Exposure control */
#define IMX355_REG_EXPOSURE
#define IMX355_EXPOSURE_MIN
#define IMX355_EXPOSURE_STEP
#define IMX355_EXPOSURE_DEFAULT

/* Analog gain control */
#define IMX355_REG_ANALOG_GAIN
#define IMX355_ANA_GAIN_MIN
#define IMX355_ANA_GAIN_MAX
#define IMX355_ANA_GAIN_STEP
#define IMX355_ANA_GAIN_DEFAULT

/* Digital gain control */
#define IMX355_REG_DPGA_USE_GLOBAL_GAIN
#define IMX355_REG_DIG_GAIN_GLOBAL
#define IMX355_DGTL_GAIN_MIN
#define IMX355_DGTL_GAIN_MAX
#define IMX355_DGTL_GAIN_STEP
#define IMX355_DGTL_GAIN_DEFAULT

/* Test Pattern Control */
#define IMX355_REG_TEST_PATTERN
#define IMX355_TEST_PATTERN_DISABLED
#define IMX355_TEST_PATTERN_SOLID_COLOR
#define IMX355_TEST_PATTERN_COLOR_BARS
#define IMX355_TEST_PATTERN_GRAY_COLOR_BARS
#define IMX355_TEST_PATTERN_PN9

/* Flip Control */
#define IMX355_REG_ORIENTATION

/* default link frequency and external clock */
#define IMX355_LINK_FREQ_DEFAULT
#define IMX355_EXT_CLK
#define IMX355_LINK_FREQ_INDEX

struct imx355_reg {};

struct imx355_reg_list {};

/* Mode : resolution and related config&values */
struct imx355_mode {};

struct imx355_hwcfg {};

struct imx355 {};

static const struct imx355_reg imx355_global_regs[] =;

static const struct imx355_reg_list imx355_global_setting =;

static const struct imx355_reg mode_3268x2448_regs[] =;

static const struct imx355_reg mode_3264x2448_regs[] =;

static const struct imx355_reg mode_3280x2464_regs[] =;

static const struct imx355_reg mode_1940x1096_regs[] =;

static const struct imx355_reg mode_1936x1096_regs[] =;

static const struct imx355_reg mode_1924x1080_regs[] =;

static const struct imx355_reg mode_1920x1080_regs[] =;

static const struct imx355_reg mode_1640x1232_regs[] =;

static const struct imx355_reg mode_1640x922_regs[] =;

static const struct imx355_reg mode_1300x736_regs[] =;

static const struct imx355_reg mode_1296x736_regs[] =;

static const struct imx355_reg mode_1284x720_regs[] =;

static const struct imx355_reg mode_1280x720_regs[] =;

static const struct imx355_reg mode_820x616_regs[] =;

static const char * const imx355_test_pattern_menu[] =;

/*
 * When adding more than the one below, make sure the disallowed ones will
 * actually be disabled in the LINK_FREQ control.
 */
static const s64 link_freq_menu_items[] =;

/* Mode configs */
static const struct imx355_mode supported_modes[] =;

static inline struct imx355 *to_imx355(struct v4l2_subdev *_sd)
{}

/* Get bayer order based on flip setting. */
static u32 imx355_get_format_code(struct imx355 *imx355)
{}

/* Read registers up to 4 at a time */
static int imx355_read_reg(struct imx355 *imx355, u16 reg, u32 len, u32 *val)
{}

/* Write registers up to 4 at a time */
static int imx355_write_reg(struct imx355 *imx355, u16 reg, u32 len, u32 val)
{}

/* Write a list of registers */
static int imx355_write_regs(struct imx355 *imx355,
			     const struct imx355_reg *regs, u32 len)
{}

/* Open sub-device */
static int imx355_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{}

static int imx355_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops imx355_ctrl_ops =;

static int imx355_enum_mbus_code(struct v4l2_subdev *sd,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_mbus_code_enum *code)
{}

static int imx355_enum_frame_size(struct v4l2_subdev *sd,
				  struct v4l2_subdev_state *sd_state,
				  struct v4l2_subdev_frame_size_enum *fse)
{}

static void imx355_update_pad_format(struct imx355 *imx355,
				     const struct imx355_mode *mode,
				     struct v4l2_subdev_format *fmt)
{}

static int imx355_do_get_pad_format(struct imx355 *imx355,
				    struct v4l2_subdev_state *sd_state,
				    struct v4l2_subdev_format *fmt)
{}

static int imx355_get_pad_format(struct v4l2_subdev *sd,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_format *fmt)
{}

static int
imx355_set_pad_format(struct v4l2_subdev *sd,
		      struct v4l2_subdev_state *sd_state,
		      struct v4l2_subdev_format *fmt)
{}

/* Start streaming */
static int imx355_start_streaming(struct imx355 *imx355)
{}

/* Stop streaming */
static int imx355_stop_streaming(struct imx355 *imx355)
{}

static int imx355_set_stream(struct v4l2_subdev *sd, int enable)
{}

/* Verify chip ID */
static int imx355_identify_module(struct imx355 *imx355)
{}

static const struct v4l2_subdev_core_ops imx355_subdev_core_ops =;

static const struct v4l2_subdev_video_ops imx355_video_ops =;

static const struct v4l2_subdev_pad_ops imx355_pad_ops =;

static const struct v4l2_subdev_ops imx355_subdev_ops =;

static const struct media_entity_operations imx355_subdev_entity_ops =;

static const struct v4l2_subdev_internal_ops imx355_internal_ops =;

/* Initialize control handlers */
static int imx355_init_controls(struct imx355 *imx355)
{}

static struct imx355_hwcfg *imx355_get_hwcfg(struct device *dev)
{}

static int imx355_probe(struct i2c_client *client)
{}

static void imx355_remove(struct i2c_client *client)
{}

static const struct acpi_device_id imx355_acpi_ids[] __maybe_unused =;
MODULE_DEVICE_TABLE(acpi, imx355_acpi_ids);

static struct i2c_driver imx355_i2c_driver =;
module_i2c_driver();

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();