linux/drivers/media/i2c/ov9640.c

// SPDX-License-Identifier: GPL-2.0
/*
 * OmniVision OV96xx Camera Driver
 *
 * Copyright (C) 2009 Marek Vasut <[email protected]>
 *
 * Based on ov772x camera driver:
 *
 * Copyright (C) 2008 Renesas Solutions Corp.
 * Kuninori Morimoto <[email protected]>
 *
 * Based on ov7670 and soc_camera_platform driver,
 * transition from soc_camera to pxa_camera based on mt9m111
 *
 * Copyright 2006-7 Jonathan Corbet <[email protected]>
 * Copyright (C) 2008 Magnus Damm
 * Copyright (C) 2008, Guennadi Liakhovetski <[email protected]>
 */

#include <linux/clk.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/v4l2-mediabus.h>
#include <linux/videodev2.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 <linux/gpio/consumer.h>

#include "ov9640.h"

#define to_ov9640_sensor(sd)

/* default register setup */
static const struct ov9640_reg ov9640_regs_dflt[] =;

/* Configurations
 * NOTE: for YUV, alter the following registers:
 *		COM12 |= OV9640_COM12_YUV_AVG
 *
 *	 for RGB, alter the following registers:
 *		COM7  |= OV9640_COM7_RGB
 *		COM13 |= OV9640_COM13_RGB_AVG
 *		COM15 |= proper RGB color encoding mode
 */
static const struct ov9640_reg ov9640_regs_qqcif[] =;

static const struct ov9640_reg ov9640_regs_qqvga[] =;

static const struct ov9640_reg ov9640_regs_qcif[] =;

static const struct ov9640_reg ov9640_regs_qvga[] =;

static const struct ov9640_reg ov9640_regs_cif[] =;

static const struct ov9640_reg ov9640_regs_vga[] =;

static const struct ov9640_reg ov9640_regs_sxga[] =;

static const struct ov9640_reg ov9640_regs_yuv[] =;

static const struct ov9640_reg ov9640_regs_rgb[] =;

static const u32 ov9640_codes[] =;

/* read a register */
static int ov9640_reg_read(struct i2c_client *client, u8 reg, u8 *val)
{}

/* write a register */
static int ov9640_reg_write(struct i2c_client *client, u8 reg, u8 val)
{}


/* Read a register, alter its bits, write it back */
static int ov9640_reg_rmw(struct i2c_client *client, u8 reg, u8 set, u8 unset)
{}

/* Soft reset the camera. This has nothing to do with the RESET pin! */
static int ov9640_reset(struct i2c_client *client)
{}

/* Start/Stop streaming from the device */
static int ov9640_s_stream(struct v4l2_subdev *sd, int enable)
{}

/* Set status of additional camera capabilities */
static int ov9640_s_ctrl(struct v4l2_ctrl *ctrl)
{}

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

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

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

/* select nearest higher resolution for capture */
static void ov9640_res_roundup(u32 *width, u32 *height)
{}

/* Prepare necessary register changes depending on color encoding */
static void ov9640_alter_regs(u32 code,
			      struct ov9640_reg_alt *alt)
{}

/* Setup registers according to resolution and color encoding */
static int ov9640_write_regs(struct i2c_client *client, u32 width,
		u32 code, struct ov9640_reg_alt *alts)
{}

/* program default register values */
static int ov9640_prog_dflt(struct i2c_client *client)
{}

/* set the format we will capture in */
static int ov9640_s_fmt(struct v4l2_subdev *sd,
			struct v4l2_mbus_framefmt *mf)
{}

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

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

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

static int ov9640_video_probe(struct i2c_client *client)
{}

static const struct v4l2_ctrl_ops ov9640_ctrl_ops =;

static const struct v4l2_subdev_core_ops ov9640_core_ops =;

/* Request bus settings on camera side */
static int ov9640_get_mbus_config(struct v4l2_subdev *sd,
				  unsigned int pad,
				  struct v4l2_mbus_config *cfg)
{}

static const struct v4l2_subdev_video_ops ov9640_video_ops =;

static const struct v4l2_subdev_pad_ops ov9640_pad_ops =;

static const struct v4l2_subdev_ops ov9640_subdev_ops =;

/*
 * i2c_driver function
 */
static int ov9640_probe(struct i2c_client *client)
{}

static void ov9640_remove(struct i2c_client *client)
{}

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

static struct i2c_driver ov9640_i2c_driver =;

module_i2c_driver();

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