linux/drivers/media/i2c/ov7740.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2017 Microchip Corporation.

#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/regmap.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <media/v4l2-image-sizes.h>
#include <media/v4l2-subdev.h>

#define REG_OUTSIZE_LSB

/* OV7740 register tables */
#define REG_GAIN
#define REG_BGAIN
#define REG_RGAIN
#define REG_GGAIN
#define REG_REG04
#define REG_BAVG
#define REG_GAVG
#define REG_RAVG

#define REG_REG0C
#define REG0C_IMG_FLIP
#define REG0C_IMG_MIRROR

#define REG_REG0E
#define REG_HAEC
#define REG_AEC

#define REG_CLK
#define REG_REG55

#define REG_REG12

#define REG_REG13
#define REG13_AEC_EN
#define REG13_AGC_EN

#define REG_REG14
#define REG_CTRL15
#define REG15_GAIN_MSB

#define REG_REG16

#define REG_MIDH
#define REG_MIDL
#define REG_PIDH
#define REG_PIDL

#define REG_84
#define REG_REG38

#define REG_AHSTART
#define REG_AHSIZE
#define REG_AVSTART
#define REG_AVSIZE
#define REG_PSHFT

#define REG_HOUTSIZE
#define REG_VOUTSIZE
#define REG_HVSIZEOFF
#define REG_REG34

#define REG_ISP_CTRL00
#define ISPCTRL00_AWB_EN
#define ISPCTRL00_AWB_GAIN_EN

#define REG_YGAIN

#define REG_YBRIGHT
#define REG_SGNSET
#define SGNSET_YBRIGHT_MASK

#define REG_USAT
#define REG_VSAT


struct ov7740 {};

struct ov7740_pixfmt {};

struct ov7740_framesize {};

static const struct reg_sequence ov7740_vga[] =;

static const struct ov7740_framesize ov7740_framesizes[] =;

#ifdef CONFIG_VIDEO_ADV_DEBUG
static int ov7740_get_register(struct v4l2_subdev *sd,
			       struct v4l2_dbg_register *reg)
{}

static int ov7740_set_register(struct v4l2_subdev *sd,
			       const struct v4l2_dbg_register *reg)
{}
#endif

static int ov7740_set_power(struct ov7740 *ov7740, int on)
{}

static const struct v4l2_subdev_core_ops ov7740_subdev_core_ops =;

static int ov7740_set_white_balance(struct ov7740 *ov7740, int awb)
{}

static int ov7740_set_saturation(struct regmap *regmap, int value)
{}

static int ov7740_set_gain(struct regmap *regmap, int value)
{}

static int ov7740_set_autogain(struct regmap *regmap, int value)
{}

static int ov7740_set_brightness(struct regmap *regmap, int value)
{}

static int ov7740_set_contrast(struct regmap *regmap, int value)
{}

static int ov7740_get_gain(struct ov7740 *ov7740, struct v4l2_ctrl *ctrl)
{}

static int ov7740_get_exp(struct ov7740 *ov7740, struct v4l2_ctrl *ctrl)
{}

static int ov7740_set_exp(struct regmap *regmap, int value)
{}

static int ov7740_set_autoexp(struct regmap *regmap,
			      enum v4l2_exposure_auto_type value)
{}


static int ov7740_get_volatile_ctrl(struct v4l2_ctrl *ctrl)
{}

static int ov7740_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops ov7740_ctrl_ops =;

static int ov7740_start_streaming(struct ov7740 *ov7740)
{}

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

static const struct v4l2_subdev_video_ops ov7740_subdev_video_ops =;

static const struct reg_sequence ov7740_format_yuyv[] =;

static const struct reg_sequence ov7740_format_bggr8[] =;

static const struct ov7740_pixfmt ov7740_formats[] =;
#define N_OV7740_FMTS

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

static int ov7740_enum_frame_interval(struct v4l2_subdev *sd,
				struct v4l2_subdev_state *sd_state,
				struct v4l2_subdev_frame_interval_enum *fie)
{}

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

static int ov7740_try_fmt_internal(struct v4l2_subdev *sd,
				   struct v4l2_mbus_framefmt *fmt,
				   const struct ov7740_pixfmt **ret_fmt,
				   const struct ov7740_framesize **ret_frmsize)
{}

static int ov7740_set_fmt(struct v4l2_subdev *sd,
			  struct v4l2_subdev_state *sd_state,
			  struct v4l2_subdev_format *format)
{}

static int ov7740_get_fmt(struct v4l2_subdev *sd,
			  struct v4l2_subdev_state *sd_state,
			  struct v4l2_subdev_format *format)
{}

static int ov7740_get_frame_interval(struct v4l2_subdev *sd,
				     struct v4l2_subdev_state *sd_state,
				     struct v4l2_subdev_frame_interval *ival)
{}

static const struct v4l2_subdev_pad_ops ov7740_subdev_pad_ops =;

static const struct v4l2_subdev_ops ov7740_subdev_ops =;

static void ov7740_get_default_format(struct v4l2_subdev *sd,
				      struct v4l2_mbus_framefmt *format)
{}

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

static const struct v4l2_subdev_internal_ops ov7740_subdev_internal_ops =;

static int ov7740_probe_dt(struct i2c_client *client,
			   struct ov7740 *ov7740)
{}

static int ov7740_detect(struct ov7740 *ov7740)
{}

static int ov7740_init_controls(struct ov7740 *ov7740)
{}

static void ov7740_free_controls(struct ov7740 *ov7740)
{}

#define OV7740_MAX_REGISTER
static const struct regmap_config ov7740_regmap_config =;

static int ov7740_probe(struct i2c_client *client)
{}

static void ov7740_remove(struct i2c_client *client)
{}

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

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

static const struct i2c_device_id ov7740_id[] =;
MODULE_DEVICE_TABLE(i2c, ov7740_id);

static const struct dev_pm_ops ov7740_pm_ops =;

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

static struct i2c_driver ov7740_i2c_driver =;
module_i2c_driver();

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