linux/drivers/media/i2c/ov5645.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for the OV5645 camera sensor.
 *
 * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
 * Copyright (C) 2015 By Tech Design S.L. All Rights Reserved.
 * Copyright (C) 2012-2013 Freescale Semiconductor, Inc. All Rights Reserved.
 *
 * Based on:
 * - the OV5645 driver from QC msm-3.10 kernel on codeaurora.org:
 *   https://us.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/
 *       media/platform/msm/camera_v2/sensor/ov5645.c?h=LA.BR.1.2.4_rb1.41
 * - the OV5640 driver posted on linux-media:
 *   https://www.mail-archive.com/linux-media%40vger.kernel.org/msg92671.html
 */

#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>

#define OV5645_SYSTEM_CTRL0
#define OV5645_SYSTEM_CTRL0_START
#define OV5645_SYSTEM_CTRL0_STOP
#define OV5645_CHIP_ID_HIGH
#define OV5645_CHIP_ID_HIGH_BYTE
#define OV5645_CHIP_ID_LOW
#define OV5645_CHIP_ID_LOW_BYTE
#define OV5645_IO_MIPI_CTRL00
#define OV5645_PAD_OUTPUT00
#define OV5645_AWB_MANUAL_CONTROL
#define OV5645_AWB_MANUAL_ENABLE
#define OV5645_AEC_PK_MANUAL
#define OV5645_AEC_MANUAL_ENABLE
#define OV5645_AGC_MANUAL_ENABLE
#define OV5645_TIMING_TC_REG20
#define OV5645_SENSOR_VFLIP
#define OV5645_ISP_VFLIP
#define OV5645_TIMING_TC_REG21
#define OV5645_SENSOR_MIRROR
#define OV5645_MIPI_CTRL00
#define OV5645_PRE_ISP_TEST_SETTING_1
#define OV5645_TEST_PATTERN_MASK
#define OV5645_SET_TEST_PATTERN(x)
#define OV5645_TEST_PATTERN_ENABLE
#define OV5645_SDE_SAT_U
#define OV5645_SDE_SAT_V

/* regulator supplies */
static const char * const ov5645_supply_name[] =;

#define OV5645_NUM_SUPPLIES

struct reg_value {};

struct ov5645_mode_info {};

struct ov5645 {};

static inline struct ov5645 *to_ov5645(struct v4l2_subdev *sd)
{}

static const struct reg_value ov5645_global_init_setting[] =;

static const struct reg_value ov5645_setting_sxga[] =;

static const struct reg_value ov5645_setting_1080p[] =;

static const struct reg_value ov5645_setting_full[] =;

static const s64 link_freq[] =;

static const struct ov5645_mode_info ov5645_mode_info_data[] =;

static int ov5645_write_reg(struct ov5645 *ov5645, u16 reg, u8 val)
{}

static int ov5645_read_reg(struct ov5645 *ov5645, u16 reg, u8 *val)
{}

static int ov5645_set_aec_mode(struct ov5645 *ov5645, u32 mode)
{}

static int ov5645_set_agc_mode(struct ov5645 *ov5645, u32 enable)
{}

static int ov5645_set_register_array(struct ov5645 *ov5645,
				     const struct reg_value *settings,
				     unsigned int num_settings)
{}

static int ov5645_set_power_off(struct device *dev)
{}

static int ov5645_set_power_on(struct device *dev)
{}

static int ov5645_set_saturation(struct ov5645 *ov5645, s32 value)
{}

static int ov5645_set_hflip(struct ov5645 *ov5645, s32 value)
{}

static int ov5645_set_vflip(struct ov5645 *ov5645, s32 value)
{}

static int ov5645_set_test_pattern(struct ov5645 *ov5645, s32 value)
{}

static const char * const ov5645_test_pattern_menu[] =;

static int ov5645_set_awb(struct ov5645 *ov5645, s32 enable_auto)
{}

static int ov5645_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops ov5645_ctrl_ops =;

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

static int ov5645_enum_frame_size(struct v4l2_subdev *subdev,
				  struct v4l2_subdev_state *sd_state,
				  struct v4l2_subdev_frame_size_enum *fse)
{}

static struct v4l2_mbus_framefmt *
__ov5645_get_pad_format(struct ov5645 *ov5645,
			struct v4l2_subdev_state *sd_state,
			unsigned int pad,
			enum v4l2_subdev_format_whence which)
{}

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

static struct v4l2_rect *
__ov5645_get_pad_crop(struct ov5645 *ov5645,
		      struct v4l2_subdev_state *sd_state,
		      unsigned int pad, enum v4l2_subdev_format_whence which)
{}

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

static int ov5645_init_state(struct v4l2_subdev *subdev,
			     struct v4l2_subdev_state *sd_state)
{}

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

static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable)
{}

static const struct v4l2_subdev_video_ops ov5645_video_ops =;

static const struct v4l2_subdev_pad_ops ov5645_subdev_pad_ops =;

static const struct v4l2_subdev_ops ov5645_subdev_ops =;

static const struct v4l2_subdev_internal_ops ov5645_internal_ops =;

static int ov5645_probe(struct i2c_client *client)
{}

static void ov5645_remove(struct i2c_client *client)
{}

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

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

static const struct dev_pm_ops ov5645_pm_ops =;

static struct i2c_driver ov5645_i2c_driver =;

module_i2c_driver();

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