linux/drivers/media/i2c/imx319.c

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

#include <asm/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 IMX319_REG_MODE_SELECT
#define IMX319_MODE_STANDBY
#define IMX319_MODE_STREAMING

/* Chip ID */
#define IMX319_REG_CHIP_ID
#define IMX319_CHIP_ID

/* V_TIMING internal */
#define IMX319_REG_FLL
#define IMX319_FLL_MAX

/* Exposure control */
#define IMX319_REG_EXPOSURE
#define IMX319_EXPOSURE_MIN
#define IMX319_EXPOSURE_STEP
#define IMX319_EXPOSURE_DEFAULT

/*
 *  the digital control register for all color control looks like:
 *  +-----------------+------------------+
 *  |      [7:0]      |       [15:8]     |
 *  +-----------------+------------------+
 *  |	  0x020f      |       0x020e     |
 *  --------------------------------------
 *  it is used to calculate the digital gain times value(integral + fractional)
 *  the [15:8] bits is the fractional part and [7:0] bits is the integral
 *  calculation equation is:
 *      gain value (unit: times) = REG[15:8] + REG[7:0]/0x100
 *  Only value in 0x0100 ~ 0x0FFF range is allowed.
 *  Analog gain use 10 bits in the registers and allowed range is 0 ~ 960
 */
/* Analog gain control */
#define IMX319_REG_ANALOG_GAIN
#define IMX319_ANA_GAIN_MIN
#define IMX319_ANA_GAIN_MAX
#define IMX319_ANA_GAIN_STEP
#define IMX319_ANA_GAIN_DEFAULT

/* Digital gain control */
#define IMX319_REG_DPGA_USE_GLOBAL_GAIN
#define IMX319_REG_DIG_GAIN_GLOBAL
#define IMX319_DGTL_GAIN_MIN
#define IMX319_DGTL_GAIN_MAX
#define IMX319_DGTL_GAIN_STEP
#define IMX319_DGTL_GAIN_DEFAULT

/* Test Pattern Control */
#define IMX319_REG_TEST_PATTERN
#define IMX319_TEST_PATTERN_DISABLED
#define IMX319_TEST_PATTERN_SOLID_COLOR
#define IMX319_TEST_PATTERN_COLOR_BARS
#define IMX319_TEST_PATTERN_GRAY_COLOR_BARS
#define IMX319_TEST_PATTERN_PN9

/* Flip Control */
#define IMX319_REG_ORIENTATION

/* default link frequency and external clock */
#define IMX319_LINK_FREQ_DEFAULT
#define IMX319_EXT_CLK
#define IMX319_LINK_FREQ_INDEX

struct imx319_reg {};

struct imx319_reg_list {};

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

struct imx319_hwcfg {};

struct imx319 {};

static const struct imx319_reg imx319_global_regs[] =;

static const struct imx319_reg_list imx319_global_setting =;

static const struct imx319_reg mode_3264x2448_regs[] =;

static const struct imx319_reg mode_3280x2464_regs[] =;

static const struct imx319_reg mode_1936x1096_regs[] =;

static const struct imx319_reg mode_1920x1080_regs[] =;

static const struct imx319_reg mode_1640x1232_regs[] =;

static const struct imx319_reg mode_1640x922_regs[] =;

static const struct imx319_reg mode_1296x736_regs[] =;

static const struct imx319_reg mode_1280x720_regs[] =;

static const char * const imx319_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 imx319_mode supported_modes[] =;

static inline struct imx319 *to_imx319(struct v4l2_subdev *_sd)
{}

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

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

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

/* Write a list of registers */
static int imx319_write_regs(struct imx319 *imx319,
			     const struct imx319_reg *regs, u32 len)
{}

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

static int imx319_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops imx319_ctrl_ops =;

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

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

static void imx319_update_pad_format(struct imx319 *imx319,
				     const struct imx319_mode *mode,
				     struct v4l2_subdev_format *fmt)
{}

static int imx319_do_get_pad_format(struct imx319 *imx319,
				    struct v4l2_subdev_state *sd_state,
				    struct v4l2_subdev_format *fmt)
{}

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

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

/* Verify chip ID */
static int imx319_identify_module(struct imx319 *imx319)
{}

/* Start streaming */
static int imx319_start_streaming(struct imx319 *imx319)
{}

/* Stop streaming */
static int imx319_stop_streaming(struct imx319 *imx319)
{}

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

static const struct v4l2_subdev_core_ops imx319_subdev_core_ops =;

static const struct v4l2_subdev_video_ops imx319_video_ops =;

static const struct v4l2_subdev_pad_ops imx319_pad_ops =;

static const struct v4l2_subdev_ops imx319_subdev_ops =;

static const struct media_entity_operations imx319_subdev_entity_ops =;

static const struct v4l2_subdev_internal_ops imx319_internal_ops =;

/* Initialize control handlers */
static int imx319_init_controls(struct imx319 *imx319)
{}

static struct imx319_hwcfg *imx319_get_hwcfg(struct device *dev)
{}

static int imx319_probe(struct i2c_client *client)
{}

static void imx319_remove(struct i2c_client *client)
{}

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

static struct i2c_driver imx319_i2c_driver =;
module_i2c_driver();

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