linux/drivers/media/i2c/ov8856.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2019 Intel Corporation.

#include <asm/unaligned.h>
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fwnode.h>

#define OV8856_REG_VALUE_08BIT
#define OV8856_REG_VALUE_16BIT
#define OV8856_REG_VALUE_24BIT

#define OV8856_SCLK
#define OV8856_XVCLK_19_2
#define OV8856_DATA_LANES
#define OV8856_RGB_DEPTH

#define OV8856_REG_CHIP_ID
#define OV8856_CHIP_ID

#define OV8856_REG_MODE_SELECT
#define OV8856_MODE_STANDBY
#define OV8856_MODE_STREAMING

/* module revisions */
#define OV8856_2A_MODULE
#define OV8856_1B_MODULE

/* the OTP read-out buffer is at 0x7000 and 0xf is the offset
 * of the byte in the OTP that means the module revision
 */
#define OV8856_MODULE_REVISION
#define OV8856_OTP_MODE_CTRL
#define OV8856_OTP_LOAD_CTRL
#define OV8856_OTP_MODE_AUTO
#define OV8856_OTP_LOAD_CTRL_ENABLE

/* vertical-timings from sensor */
#define OV8856_REG_VTS
#define OV8856_VTS_MAX

/* horizontal-timings from sensor */
#define OV8856_REG_HTS

/* Exposure controls from sensor */
#define OV8856_REG_EXPOSURE
#define OV8856_EXPOSURE_MIN
#define OV8856_EXPOSURE_MAX_MARGIN
#define OV8856_EXPOSURE_STEP

/* Analog gain controls from sensor */
#define OV8856_REG_ANALOG_GAIN
#define OV8856_ANAL_GAIN_MIN
#define OV8856_ANAL_GAIN_MAX
#define OV8856_ANAL_GAIN_STEP

/* Digital gain controls from sensor */
#define OV8856_REG_DIGITAL_GAIN
#define OV8856_REG_MWB_R_GAIN
#define OV8856_REG_MWB_G_GAIN
#define OV8856_REG_MWB_B_GAIN
#define OV8856_DGTL_GAIN_MIN
#define OV8856_DGTL_GAIN_MAX
#define OV8856_DGTL_GAIN_STEP
#define OV8856_DGTL_GAIN_DEFAULT

/* Test Pattern Control */
#define OV8856_REG_TEST_PATTERN
#define OV8856_TEST_PATTERN_ENABLE
#define OV8856_TEST_PATTERN_BAR_SHIFT

#define NUM_REGS
#define NUM_MODE_REGS
#define NUM_MODE_REGS_2

/* Flip Mirror Controls from sensor */
#define OV8856_REG_FORMAT1
#define OV8856_REG_FORMAT2
#define OV8856_REG_FORMAT1_OP_1
#define OV8856_REG_FORMAT1_OP_2
#define OV8856_REG_FORMAT1_OP_3
#define OV8856_REG_FORMAT2_OP_1
#define OV8856_REG_FORMAT2_OP_2
#define OV8856_REG_FORMAT2_OP_3
#define OV8856_REG_FLIP_OPT_1
#define OV8856_REG_FLIP_OPT_2
#define OV8856_REG_FLIP_OPT_3
#define OV8856_REG_MIRROR_OPT_1
#define OV8856_REG_FLIP_OP_0
#define OV8856_REG_FLIP_OP_1
#define OV8856_REG_FLIP_OP_2
#define OV8856_REG_MIRROR_OP_1
#define OV8856_REG_MIRROR_OP_2

#define to_ov8856(_sd)

static const char * const ov8856_supply_names[] =;

enum {};

struct ov8856_reg {};

struct ov8856_reg_list {};

struct ov8856_link_freq_config {};

struct ov8856_mode {};

struct ov8856_mipi_data_rates {};

static const struct ov8856_mipi_data_rates mipi_data_rate_lane_2 =;

static const struct ov8856_mipi_data_rates mipi_data_rate_lane_4 =;

static const struct ov8856_reg lane_2_mode_3280x2464[] =;

static const struct ov8856_reg lane_2_mode_1640x1232[] =;

static const struct ov8856_reg lane_4_mode_3280x2464[] =;

static const struct ov8856_reg lane_4_mode_1640x1232[] =;

static const struct ov8856_reg lane_4_mode_3264x2448[] =;

static const struct ov8856_reg lane_4_mode_1632x1224[] =;

static const struct ov8856_reg mipi_data_mbus_sbggr10_1x10[] =;

static const struct ov8856_reg mipi_data_mbus_sgrbg10_1x10[] =;

static const u32 ov8856_mbus_codes[] =;

static const char * const ov8856_test_pattern_menu[] =;

static const struct ov8856_reg_list bayer_offset_configs[] =;

struct ov8856 {};

struct ov8856_lane_cfg {};

static const struct ov8856_lane_cfg lane_cfg_2 =;

static const struct ov8856_lane_cfg lane_cfg_4 =;

static unsigned int ov8856_modes_num(const struct ov8856 *ov8856)
{}

static u64 to_rate(const s64 *link_freq_menu_items,
		   u32 f_index, u8 nlanes)
{}

static u64 to_pixels_per_line(const s64 *link_freq_menu_items, u32 hts,
			      u32 f_index, u8 nlanes)
{}

static int ov8856_read_reg(struct ov8856 *ov8856, u16 reg, u16 len, u32 *val)
{}

static int ov8856_write_reg(struct ov8856 *ov8856, u16 reg, u16 len, u32 val)
{}

static int ov8856_write_reg_list(struct ov8856 *ov8856,
				 const struct ov8856_reg_list *r_list)
{}

static int ov8856_identify_module(struct ov8856 *ov8856)
{}

static int ov8856_update_digital_gain(struct ov8856 *ov8856, u32 d_gain)
{}

static int ov8856_test_pattern(struct ov8856 *ov8856, u32 pattern)
{}

static int ov8856_set_ctrl_hflip(struct ov8856 *ov8856, u32 ctrl_val)
{}

static int ov8856_set_ctrl_vflip(struct ov8856 *ov8856, u8 ctrl_val)
{}

static int ov8856_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops ov8856_ctrl_ops =;

static int ov8856_init_controls(struct ov8856 *ov8856)
{}

static void ov8856_update_pad_format(struct ov8856 *ov8856,
				     const struct ov8856_mode *mode,
				     struct v4l2_mbus_framefmt *fmt)
{}

static int ov8856_start_streaming(struct ov8856 *ov8856)
{}

static void ov8856_stop_streaming(struct ov8856 *ov8856)
{}

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

static int ov8856_power_on(struct device *dev)
{}

static int ov8856_power_off(struct device *dev)
{}

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

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

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

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

static int ov8856_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{}

static const struct v4l2_subdev_video_ops ov8856_video_ops =;

static const struct v4l2_subdev_pad_ops ov8856_pad_ops =;

static const struct v4l2_subdev_ops ov8856_subdev_ops =;

static const struct media_entity_operations ov8856_subdev_entity_ops =;

static const struct v4l2_subdev_internal_ops ov8856_internal_ops =;


static int ov8856_get_hwcfg(struct ov8856 *ov8856, struct device *dev)
{}

static void ov8856_remove(struct i2c_client *client)
{}

static int ov8856_probe(struct i2c_client *client)
{}

static const struct dev_pm_ops ov8856_pm_ops =;

#ifdef CONFIG_ACPI
static const struct acpi_device_id ov8856_acpi_ids[] =;

MODULE_DEVICE_TABLE(acpi, ov8856_acpi_ids);
#endif

static const struct of_device_id ov8856_of_match[] =;
MODULE_DEVICE_TABLE(of, ov8856_of_match);

static struct i2c_driver ov8856_i2c_driver =;

module_i2c_driver();

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