linux/drivers/media/i2c/ov8858.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2023 Jacopo Mondi <[email protected]>
 * Copyright (C) 2022 Nicholas Roth <[email protected]>
 * Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd.
 */

#include <linux/unaligned.h>

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>

#include <media/media-entity.h>
#include <media/v4l2-async.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-mediabus.h>
#include <media/v4l2-subdev.h>

#define OV8858_LINK_FREQ
#define OV8858_XVCLK_FREQ

#define OV8858_REG_SIZE_SHIFT
#define OV8858_REG_ADDR_MASK
#define OV8858_REG_8BIT(n)
#define OV8858_REG_16BIT(n)
#define OV8858_REG_24BIT(n)

#define OV8858_REG_SC_CTRL0100
#define OV8858_MODE_SW_STANDBY
#define OV8858_MODE_STREAMING

#define OV8858_REG_CHIP_ID
#define OV8858_CHIP_ID

#define OV8858_REG_SUB_ID
#define OV8858_R1A
#define OV8858_R2A

#define OV8858_REG_LONG_EXPO
#define OV8858_EXPOSURE_MIN
#define OV8858_EXPOSURE_STEP
#define OV8858_EXPOSURE_MARGIN

#define OV8858_REG_LONG_GAIN
#define OV8858_LONG_GAIN_MIN
#define OV8858_LONG_GAIN_MAX
#define OV8858_LONG_GAIN_STEP
#define OV8858_LONG_GAIN_DEFAULT

#define OV8858_REG_LONG_DIGIGAIN
#define OV8858_LONG_DIGIGAIN_H_MASK
#define OV8858_LONG_DIGIGAIN_L_MASK
#define OV8858_LONG_DIGIGAIN_H_SHIFT
#define OV8858_LONG_DIGIGAIN_MIN
#define OV8858_LONG_DIGIGAIN_MAX
#define OV8858_LONG_DIGIGAIN_STEP
#define OV8858_LONG_DIGIGAIN_DEFAULT

#define OV8858_REG_VTS
#define OV8858_VTS_MAX

#define OV8858_REG_TEST_PATTERN
#define OV8858_TEST_PATTERN_ENABLE
#define OV8858_TEST_PATTERN_DISABLE

#define REG_NULL

static const char * const ov8858_supply_names[] =;

struct regval {};

struct regval_modes {};

struct ov8858_mode {};

struct ov8858 {};

static inline struct ov8858 *sd_to_ov8858(struct v4l2_subdev *sd)
{}

static const struct regval ov8858_global_regs_r1a[] =;

static const struct regval ov8858_global_regs_r2a_2lane[] =;

/*
 * Xclk 24Mhz
 * max_framerate 30fps
 * mipi_datarate per lane 720Mbps
 */
static const struct regval ov8858_1632x1224_regs_2lane[] =;

/*
 * Xclk 24Mhz
 * max_framerate 15fps
 * mipi_datarate per lane 720Mbps
 */
static const struct regval ov8858_3264x2448_regs_2lane[] =;

static const struct regval ov8858_global_regs_r2a_4lane[] =;

/*
 * Xclk 24Mhz
 * max_framerate 60fps
 * mipi_datarate per lane 720Mbps
 */
static const struct regval ov8858_1632x1224_regs_4lane[] =;

/*
 * Xclk 24Mhz
 * max_framerate 30fps
 * mipi_datarate per lane 720Mbps
 */
static const struct regval ov8858_3264x2448_regs_4lane[] =;

static const struct ov8858_mode ov8858_modes[] =;

static const s64 link_freq_menu_items[] =;

static const char * const ov8858_test_pattern_menu[] =;

/* ----------------------------------------------------------------------------
 * HW access
 */

static int ov8858_write(struct ov8858 *ov8858, u32 reg, u32 val, int *err)
{}

static int ov8858_write_array(struct ov8858 *ov8858, const struct regval *regs)
{}

static int ov8858_read(struct ov8858 *ov8858, u32 reg, u32 *val)
{}

/* ----------------------------------------------------------------------------
 * Streaming
 */

static int ov8858_start_stream(struct ov8858 *ov8858,
			       struct v4l2_subdev_state *state)
{}

static int ov8858_stop_stream(struct ov8858 *ov8858)
{}

static int ov8858_s_stream(struct v4l2_subdev *sd, int on)
{}

static const struct v4l2_subdev_video_ops ov8858_video_ops =;

/* ----------------------------------------------------------------------------
 * Pad ops
 */

static int ov8858_set_fmt(struct v4l2_subdev *sd,
			  struct v4l2_subdev_state *state,
			  struct v4l2_subdev_format *fmt)
{}

static int ov8858_enum_frame_sizes(struct v4l2_subdev *sd,
				   struct v4l2_subdev_state *state,
				   struct v4l2_subdev_frame_size_enum *fse)
{}

static int ov8858_enum_mbus_code(struct v4l2_subdev *sd,
				 struct v4l2_subdev_state *state,
				 struct v4l2_subdev_mbus_code_enum *code)
{}

static int ov8858_init_state(struct v4l2_subdev *sd,
			     struct v4l2_subdev_state *sd_state)
{}

static const struct v4l2_subdev_pad_ops ov8858_pad_ops =;

static const struct v4l2_subdev_core_ops ov8858_core_ops =;

static const struct v4l2_subdev_ops ov8858_subdev_ops =;

static const struct v4l2_subdev_internal_ops ov8858_internal_ops =;

/* ----------------------------------------------------------------------------
 * Controls handling
 */

static int ov8858_enable_test_pattern(struct ov8858 *ov8858, u32 pattern)
{}

static int ov8858_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops ov8858_ctrl_ops =;

/* ----------------------------------------------------------------------------
 * Power Management
 */

static int ov8858_power_on(struct ov8858 *ov8858)
{}

static void ov8858_power_off(struct ov8858 *ov8858)
{}

static int ov8858_runtime_resume(struct device *dev)
{}

static int ov8858_runtime_suspend(struct device *dev)
{}

static const struct dev_pm_ops ov8858_pm_ops =;

/* ----------------------------------------------------------------------------
 * Probe and initialization
 */

static int ov8858_init_ctrls(struct ov8858 *ov8858)
{}

static int ov8858_check_sensor_id(struct ov8858 *ov8858)
{}

static int ov8858_configure_regulators(struct ov8858 *ov8858)
{}

static int ov8858_parse_of(struct ov8858 *ov8858)
{}

static int ov8858_probe(struct i2c_client *client)
{}

static void ov8858_remove(struct i2c_client *client)
{}

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

static struct i2c_driver ov8858_i2c_driver =;

module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();