linux/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for OmniVision OV2722 1080p HD camera sensor.
 *
 * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/moduleparam.h>
#include <media/v4l2-device.h>
#include "../include/linux/atomisp_gmin_platform.h"
#include <linux/acpi.h>
#include <linux/io.h>

#include "ov2722.h"

/* i2c read/write stuff */
static int ov2722_read_reg(struct i2c_client *client,
			   u16 data_length, u16 reg, u16 *val)
{}

static int ov2722_i2c_write(struct i2c_client *client, u16 len, u8 *data)
{}

static int ov2722_write_reg(struct i2c_client *client, u16 data_length,
			    u16 reg, u16 val)
{}

/*
 * ov2722_write_reg_array - Initializes a list of OV2722 registers
 * @client: i2c driver client structure
 * @reglist: list of registers to be written
 *
 * This function initializes a list of registers. When consecutive addresses
 * are found in a row on the list, this function creates a buffer and sends
 * consecutive data in a single i2c_transfer().
 *
 * __ov2722_flush_reg_array, __ov2722_buf_reg_array() and
 * __ov2722_write_reg_is_consecutive() are internal functions to
 * ov2722_write_reg_array_fast() and should be not used anywhere else.
 *
 */

static int __ov2722_flush_reg_array(struct i2c_client *client,
				    struct ov2722_write_ctrl *ctrl)
{}

static int __ov2722_buf_reg_array(struct i2c_client *client,
				  struct ov2722_write_ctrl *ctrl,
				  const struct ov2722_reg *next)
{}

static int __ov2722_write_reg_is_consecutive(struct i2c_client *client,
					     struct ov2722_write_ctrl *ctrl,
					     const struct ov2722_reg *next)
{}

static int ov2722_write_reg_array(struct i2c_client *client,
				  const struct ov2722_reg *reglist)
{}

static long __ov2722_set_exposure(struct v4l2_subdev *sd, int coarse_itg,
				  int gain, int digitgain)

{}

static int ov2722_set_exposure(struct v4l2_subdev *sd, int exposure,
			       int gain, int digitgain)
{}

static long ov2722_s_exposure(struct v4l2_subdev *sd,
			      struct atomisp_exposure *exposure)
{}

static long ov2722_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
{}

/* This returns the exposure time being used. This should only be used
 * for filling in EXIF data, not for actual image processing.
 */
static int ov2722_q_exposure(struct v4l2_subdev *sd, s32 *value)
{}

static int ov2722_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops ctrl_ops =;

static const struct v4l2_ctrl_config ov2722_controls[] =;

static int ov2722_init(struct v4l2_subdev *sd)
{}

static int power_ctrl(struct v4l2_subdev *sd, bool flag)
{}

static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
{}

static int power_up(struct v4l2_subdev *sd)
{}

static int power_down(struct v4l2_subdev *sd)
{}

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

/* TODO: remove it. */
static int startup(struct v4l2_subdev *sd)
{}

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

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

static int ov2722_detect(struct i2c_client *client)
{}

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

static int ov2722_s_config(struct v4l2_subdev *sd,
			   int irq, void *platform_data)
{}

static int ov2722_get_frame_interval(struct v4l2_subdev *sd,
				     struct v4l2_subdev_state *sd_state,
				     struct v4l2_subdev_frame_interval *interval)
{}

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

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

static int ov2722_g_skip_frames(struct v4l2_subdev *sd, u32 *frames)
{}

static const struct v4l2_subdev_sensor_ops ov2722_sensor_ops =;

static const struct v4l2_subdev_video_ops ov2722_video_ops =;

static const struct v4l2_subdev_core_ops ov2722_core_ops =;

static const struct v4l2_subdev_pad_ops ov2722_pad_ops =;

static const struct v4l2_subdev_ops ov2722_ops =;

static void ov2722_remove(struct i2c_client *client)
{}

static int __ov2722_init_ctrl_handler(struct ov2722_device *dev)
{}

static int ov2722_probe(struct i2c_client *client)
{}

static const struct acpi_device_id ov2722_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, ov2722_acpi_match);

static struct i2c_driver ov2722_driver =;
module_i2c_driver();

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