linux/drivers/media/i2c/ov2685.c

// SPDX-License-Identifier: GPL-2.0
/*
 * ov2685 driver
 *
 * Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd.
 */

#include <linux/clk.h>
#include <linux/device.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 <linux/sysfs.h>
#include <media/media-entity.h>
#include <media/v4l2-async.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>

#define CHIP_ID
#define OV2685_REG_CHIP_ID

#define OV2685_XVCLK_FREQ

#define REG_SC_CTRL_MODE
#define SC_CTRL_MODE_STANDBY
#define SC_CTRL_MODE_STREAMING

#define OV2685_REG_EXPOSURE
#define OV2685_EXPOSURE_MIN
#define OV2685_EXPOSURE_STEP

#define OV2685_REG_VTS
#define OV2685_VTS_MAX

#define OV2685_REG_GAIN
#define OV2685_GAIN_MIN
#define OV2685_GAIN_MAX
#define OV2685_GAIN_STEP
#define OV2685_GAIN_DEFAULT

#define OV2685_REG_TEST_PATTERN
#define OV2685_TEST_PATTERN_DISABLED
#define OV2685_TEST_PATTERN_COLOR_BAR
#define OV2685_TEST_PATTERN_RANDOM
#define OV2685_TEST_PATTERN_COLOR_BAR_FADE
#define OV2685_TEST_PATTERN_BW_SQUARE
#define OV2685_TEST_PATTERN_COLOR_SQUARE

#define REG_NULL

#define OV2685_REG_VALUE_08BIT
#define OV2685_REG_VALUE_16BIT
#define OV2685_REG_VALUE_24BIT

#define OV2685_NATIVE_WIDTH
#define OV2685_NATIVE_HEIGHT

#define OV2685_LANES
#define OV2685_BITS_PER_SAMPLE

static const char * const ov2685_supply_names[] =;

#define OV2685_NUM_SUPPLIES

struct regval {};

struct ov2685_mode {};

struct ov2685 {};

#define to_ov2685(sd)

/* PLL settings bases on 24M xvclk */
static struct regval ov2685_1600x1200_regs[] =;

#define OV2685_LINK_FREQ_330MHZ
static const s64 link_freq_menu_items[] =;

static const char * const ov2685_test_pattern_menu[] =;

static const int ov2685_test_pattern_val[] =;

static const struct v4l2_rect ov2685_analog_crop =;

static const struct ov2685_mode supported_modes[] =;

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

static int ov2685_write_array(struct i2c_client *client,
			      const struct regval *regs)
{}

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

static void ov2685_fill_fmt(const struct ov2685_mode *mode,
			    struct v4l2_mbus_framefmt *fmt)
{}

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

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

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

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

static const struct v4l2_rect *
__ov2685_get_pad_crop(struct ov2685 *ov2685,
		      struct v4l2_subdev_state *state, unsigned int pad,
		      enum v4l2_subdev_format_whence which)
{}

static int ov2685_get_selection(struct v4l2_subdev *sd,
				struct v4l2_subdev_state *sd_state,
				struct v4l2_subdev_selection *sel)
{}

/* Calculate the delay in us by clock rate and clock cycles */
static inline u32 ov2685_cal_delay(u32 cycles)
{}

static int __ov2685_power_on(struct ov2685 *ov2685)
{}

static void __ov2685_power_off(struct ov2685 *ov2685)
{}

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

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

static int __maybe_unused ov2685_runtime_resume(struct device *dev)
{}

static int __maybe_unused ov2685_runtime_suspend(struct device *dev)
{}

static const struct dev_pm_ops ov2685_pm_ops =;

static int ov2685_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_subdev_video_ops ov2685_video_ops =;

static const struct v4l2_subdev_pad_ops ov2685_pad_ops =;

static const struct v4l2_subdev_ops ov2685_subdev_ops =;

static const struct v4l2_subdev_internal_ops ov2685_internal_ops =;

static const struct v4l2_ctrl_ops ov2685_ctrl_ops =;

static int ov2685_initialize_controls(struct ov2685 *ov2685)
{}

static int ov2685_check_sensor_id(struct ov2685 *ov2685,
				  struct i2c_client *client)
{}

static int ov2685_configure_regulators(struct ov2685 *ov2685)
{}

static int ov2685_probe(struct i2c_client *client)
{}

static void ov2685_remove(struct i2c_client *client)
{}

#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id ov2685_of_match[] =;
MODULE_DEVICE_TABLE(of, ov2685_of_match);
#endif

static struct i2c_driver ov2685_i2c_driver =;

module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();