linux/drivers/media/i2c/tw9910.c

// SPDX-License-Identifier: GPL-2.0
/*
 * tw9910 Video Driver
 *
 * Copyright (C) 2017 Jacopo Mondi <[email protected]>
 *
 * Copyright (C) 2008 Renesas Solutions Corp.
 * Kuninori Morimoto <[email protected]>
 *
 * Based on ov772x driver,
 *
 * Copyright (C) 2008 Kuninori Morimoto <[email protected]>
 * 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/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/v4l2-mediabus.h>
#include <linux/videodev2.h>

#include <media/i2c/tw9910.h>
#include <media/v4l2-subdev.h>

#define GET_ID(val)
#define GET_REV(val)

/*
 * register offset
 */
#define ID
#define STATUS1
#define INFORM
#define OPFORM
#define DLYCTR
#define OUTCTR1
#define ACNTL1
#define CROP_HI
#define VDELAY_LO
#define VACTIVE_LO
#define HDELAY_LO
#define HACTIVE_LO
#define CNTRL1
#define VSCALE_LO
#define SCALE_HI
#define HSCALE_LO
#define BRIGHT
#define CONTRAST
#define SHARPNESS
#define SAT_U
#define SAT_V
#define HUE
#define CORING1
#define CORING2
#define VBICNTL
#define ACNTL2
#define OUTCTR2
#define SDT
#define SDTR
#define TEST
#define CLMPG
#define IAGC
#define AGCGAIN
#define PEAKWT
#define CLMPL
#define SYNCT
#define MISSCNT
#define PCLAMP
#define VCNTL1
#define VCNTL2
#define CKILL
#define COMB
#define LDLY
#define MISC1
#define LOOP
#define MISC2
#define MVSN
#define STATUS2
#define HFREF
#define CLMD
#define IDCNTL
#define CLCNTL1
#define ANAPLLCTL
#define VBIMIN
#define HSLOWCTL
#define WSS3
#define FILLDATA
#define SDID
#define DID
#define WSS1
#define WSS2
#define VVBI
#define LCTL6
#define LCTL7
#define LCTL8
#define LCTL9
#define LCTL10
#define LCTL11
#define LCTL12
#define LCTL13
#define LCTL14
#define LCTL15
#define LCTL16
#define LCTL17
#define LCTL18
#define LCTL19
#define LCTL20
#define LCTL21
#define LCTL22
#define LCTL23
#define LCTL24
#define LCTL25
#define LCTL26
#define HSBEGIN
#define HSEND
#define OVSDLY
#define OVSEND
#define VBIDELAY

/*
 * register detail
 */

/* INFORM */
#define FC27_ON
#define FC27_FF
			 /*     Must use 24.54MHz for 60Hz field rate */
			 /*     source or 29.5MHz for 50Hz field rate */
#define IFSEL_S
#define IFSEL_C
			 /* Y input video selection */
#define YSEL_M0
#define YSEL_M1
#define YSEL_M2
#define YSEL_M3

/* OPFORM */
#define MODE
			 /* 1 : ITU-R-656 compatible data sequence format */
#define LEN
			 /* 1 : 16-bit YCrCb 4:2:2 output format.*/
#define LLCMODE
			 /* 0 : free-run output mode */
#define AINC
			 /* 0 : auto-increment */
			 /* 1 : non-auto */
#define VSCTL
			 /* 0 : Vertical out ctrl by HACTIVE and DVALID */
#define OEN_TRI_SEL_MASK
#define OEN_TRI_SEL_ALL_ON
#define OEN_TRI_SEL_ALL_OFF_r0
#define OEN_TRI_SEL_ALL_OFF_r1

/* OUTCTR1 */
#define VSP_LO
#define VSP_HI
			 /* VS pin output control */
#define VSSL_VSYNC
#define VSSL_VACT
#define VSSL_FIELD
#define VSSL_VVALID
#define VSSL_ZERO
#define HSP_LOW
#define HSP_HI
			 /* HS pin output control */
#define HSSL_HACT
#define HSSL_HSYNC
#define HSSL_DVALID
#define HSSL_HLOCK
#define HSSL_ASYNCW
#define HSSL_ZERO

/* ACNTL1 */
#define SRESET
#define ACNTL1_PDN_MASK
#define CLK_PDN
#define Y_PDN
#define C_PDN

/* ACNTL2 */
#define ACNTL2_PDN_MASK
#define PLL_PDN

/* VBICNTL */

/* RTSEL : control the real time signal output from the MPOUT pin */
#define RTSEL_MASK
#define RTSEL_VLOSS
#define RTSEL_HLOCK
#define RTSEL_SLOCK
#define RTSEL_VLOCK
#define RTSEL_MONO
#define RTSEL_DET50
#define RTSEL_FIELD
#define RTSEL_RTCO

/* HSYNC start and end are constant for now */
#define HSYNC_START
#define HSYNC_END

/*
 * structure
 */

struct tw9910_scale_ctrl {};

struct tw9910_priv {};

static const struct tw9910_scale_ctrl tw9910_ntsc_scales[] =;

static const struct tw9910_scale_ctrl tw9910_pal_scales[] =;

/*
 * general function
 */
static struct tw9910_priv *to_tw9910(const struct i2c_client *client)
{}

static int tw9910_mask_set(struct i2c_client *client, u8 command,
			   u8 mask, u8 set)
{}

static int tw9910_set_scale(struct i2c_client *client,
			    const struct tw9910_scale_ctrl *scale)
{}

static int tw9910_set_hsync(struct i2c_client *client)
{}

static void tw9910_reset(struct i2c_client *client)
{}

static int tw9910_power(struct i2c_client *client, int enable)
{}

static const struct tw9910_scale_ctrl *tw9910_select_norm(v4l2_std_id norm,
							  u32 width, u32 height)
{}

/*
 * subdevice operations
 */
static int tw9910_s_stream(struct v4l2_subdev *sd, int enable)
{}

static int tw9910_g_std(struct v4l2_subdev *sd, v4l2_std_id *norm)
{}

static int tw9910_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
{}

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

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

static void tw9910_set_gpio_value(struct gpio_desc *desc, int value)
{}

static int tw9910_power_on(struct tw9910_priv *priv)
{}

static int tw9910_power_off(struct tw9910_priv *priv)
{}

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

static int tw9910_set_frame(struct v4l2_subdev *sd, u32 *width, u32 *height)
{}

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

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

static int tw9910_s_fmt(struct v4l2_subdev *sd,
			struct v4l2_mbus_framefmt *mf)
{}

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

static int tw9910_video_probe(struct i2c_client *client)
{}

static const struct v4l2_subdev_core_ops tw9910_subdev_core_ops =;

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

static int tw9910_g_tvnorms(struct v4l2_subdev *sd, v4l2_std_id *norm)
{}

static const struct v4l2_subdev_video_ops tw9910_subdev_video_ops =;

static const struct v4l2_subdev_pad_ops tw9910_subdev_pad_ops =;

static const struct v4l2_subdev_ops tw9910_subdev_ops =;

/*
 * i2c_driver function
 */

static int tw9910_probe(struct i2c_client *client)

{}

static void tw9910_remove(struct i2c_client *client)
{}

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

static struct i2c_driver tw9910_i2c_driver =;

module_i2c_driver();

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