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

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for mt9m114 Camera Sensor.
 *
 * Copyright (c) 2010 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/fs.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/acpi.h>
#include "../include/linux/atomisp_gmin_platform.h"
#include <media/v4l2-device.h>

#include "mt9m114.h"

#define to_mt9m114_sensor(s)

/*
 * TODO: use debug parameter to actually define when debug messages should
 * be printed.
 */
static int debug;
static int aaalock;
module_param(debug, int, 0644);
MODULE_PARM_DESC();

static int mt9m114_t_vflip(struct v4l2_subdev *sd, int value);
static int mt9m114_t_hflip(struct v4l2_subdev *sd, int value);
static int mt9m114_wait_state(struct i2c_client *client, int timeout);

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

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

/**
 * misensor_rmw_reg - Read/Modify/Write a value to a register in the sensor
 * device
 * @client: i2c driver client structure
 * @data_length: 8/16/32-bits length
 * @reg: register address
 * @mask: masked out bits
 * @set: bits set
 *
 * Read/modify/write a value to a register in the  sensor device.
 * Returns zero if successful, or non-zero otherwise.
 */
static int
misensor_rmw_reg(struct i2c_client *client, u16 data_length, u16 reg,
		 u32 mask, u32 set)
{}

static int __mt9m114_flush_reg_array(struct i2c_client *client,
				     struct mt9m114_write_ctrl *ctrl)
{}

static int __mt9m114_buf_reg_array(struct i2c_client *client,
				   struct mt9m114_write_ctrl *ctrl,
				   const struct misensor_reg *next)
{}

static int
__mt9m114_write_reg_is_consecutive(struct i2c_client *client,
				   struct mt9m114_write_ctrl *ctrl,
				   const struct misensor_reg *next)
{}

/*
 * mt9m114_write_reg_array - Initializes a list of mt9m114 registers
 * @client: i2c driver client structure
 * @reglist: list of registers to be written
 * @poll: completion polling requirement
 * 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().
 *
 * __mt9m114_flush_reg_array, __mt9m114_buf_reg_array() and
 * __mt9m114_write_reg_is_consecutive() are internal functions to
 * mt9m114_write_reg_array() and should be not used anywhere else.
 *
 */
static int mt9m114_write_reg_array(struct i2c_client *client,
				   const struct misensor_reg *reglist,
				   int poll)
{}

static int mt9m114_wait_state(struct i2c_client *client, int timeout)
{}

static int mt9m114_set_suspend(struct v4l2_subdev *sd)
{}

static int mt9m114_init_common(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 mt9m114_s_power(struct v4l2_subdev *sd, int power)
{}

static int mt9m114_res2size(struct v4l2_subdev *sd, int *h_size, int *v_size)
{}

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

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

/* Horizontal flip the image. */
static int mt9m114_g_hflip(struct v4l2_subdev *sd, s32 *val)
{}

static int mt9m114_g_vflip(struct v4l2_subdev *sd, s32 *val)
{}

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

static long mt9m114_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 mt9m114_g_exposure(struct v4l2_subdev *sd, s32 *value)
{}

/*
 * This function will return the sensor supported max exposure zone number.
 * the sensor which supports max exposure zone number is 1.
 */
static int mt9m114_g_exposure_zone_num(struct v4l2_subdev *sd, s32 *val)
{}

/*
 * set exposure metering, average/center_weighted/spot/matrix.
 */
static int mt9m114_s_exposure_metering(struct v4l2_subdev *sd, s32 val)
{}

/*
 * This function is for touch exposure feature.
 */
static int mt9m114_s_exposure_selection(struct v4l2_subdev *sd,
					struct v4l2_subdev_state *sd_state,
					struct v4l2_subdev_selection *sel)
{}

static int mt9m114_s_ev(struct v4l2_subdev *sd, s32 val)
{}

static int mt9m114_g_ev(struct v4l2_subdev *sd, s32 *val)
{}

/*
 * Fake interface
 * mt9m114 now can not support 3a_lock
 */
static int mt9m114_s_3a_lock(struct v4l2_subdev *sd, s32 val)
{}

static int mt9m114_g_3a_lock(struct v4l2_subdev *sd, s32 *val)
{}

static int mt9m114_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static int mt9m114_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops ctrl_ops =;

static struct v4l2_ctrl_config mt9m114_controls[] =;

static int mt9m114_detect(struct mt9m114_device *dev, struct i2c_client *client)
{}

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

/* Horizontal flip the image. */
static int mt9m114_t_hflip(struct v4l2_subdev *sd, int value)
{}

/* Vertically flip the image */
static int mt9m114_t_vflip(struct v4l2_subdev *sd, int value)
{}

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

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

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

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

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

static const struct v4l2_subdev_video_ops mt9m114_video_ops =;

static const struct v4l2_subdev_sensor_ops mt9m114_sensor_ops =;

static const struct v4l2_subdev_core_ops mt9m114_core_ops =;

/* REVISIT: Do we need pad operations? */
static const struct v4l2_subdev_pad_ops mt9m114_pad_ops =;

static const struct v4l2_subdev_ops mt9m114_ops =;

static void mt9m114_remove(struct i2c_client *client)
{}

static int mt9m114_probe(struct i2c_client *client)
{}

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

static struct i2c_driver mt9m114_driver =;
module_i2c_driver();

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