xref: /linux/drivers/media/usb/gspca/m5602/m5602_sensor.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*a10e763bSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
20c0d06caSMauro Carvalho Chehab /*
30c0d06caSMauro Carvalho Chehab  * USB Driver for ALi m5602 based webcams
40c0d06caSMauro Carvalho Chehab  *
50c0d06caSMauro Carvalho Chehab  * Copyright (C) 2008 Erik Andrén
60c0d06caSMauro Carvalho Chehab  * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.
70c0d06caSMauro Carvalho Chehab  * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>
80c0d06caSMauro Carvalho Chehab  *
90c0d06caSMauro Carvalho Chehab  * Portions of code to USB interface and ALi driver software,
100c0d06caSMauro Carvalho Chehab  * Copyright (c) 2006 Willem Duinker
110c0d06caSMauro Carvalho Chehab  * v4l2 interface modeled after the V4L2 driver
120c0d06caSMauro Carvalho Chehab  * for SN9C10x PC Camera Controllers
130c0d06caSMauro Carvalho Chehab  */
140c0d06caSMauro Carvalho Chehab 
150c0d06caSMauro Carvalho Chehab #ifndef M5602_SENSOR_H_
160c0d06caSMauro Carvalho Chehab #define M5602_SENSOR_H_
170c0d06caSMauro Carvalho Chehab 
180c0d06caSMauro Carvalho Chehab #include "m5602_bridge.h"
190c0d06caSMauro Carvalho Chehab 
200c0d06caSMauro Carvalho Chehab #define M5602_V4L2_CID_GREEN_BALANCE	(V4L2_CID_PRIVATE_BASE + 0)
210c0d06caSMauro Carvalho Chehab #define M5602_V4L2_CID_NOISE_SUPPRESION	(V4L2_CID_PRIVATE_BASE + 1)
220c0d06caSMauro Carvalho Chehab 
230c0d06caSMauro Carvalho Chehab /* Enumerates all supported sensors */
240c0d06caSMauro Carvalho Chehab enum sensors {
250c0d06caSMauro Carvalho Chehab 	OV9650_SENSOR	= 1,
260c0d06caSMauro Carvalho Chehab 	S5K83A_SENSOR	= 2,
270c0d06caSMauro Carvalho Chehab 	S5K4AA_SENSOR	= 3,
280c0d06caSMauro Carvalho Chehab 	MT9M111_SENSOR	= 4,
290c0d06caSMauro Carvalho Chehab 	PO1030_SENSOR	= 5,
300c0d06caSMauro Carvalho Chehab 	OV7660_SENSOR   = 6,
310c0d06caSMauro Carvalho Chehab };
320c0d06caSMauro Carvalho Chehab 
330c0d06caSMauro Carvalho Chehab /* Enumerates all possible instruction types */
340c0d06caSMauro Carvalho Chehab enum instruction {
350c0d06caSMauro Carvalho Chehab 	BRIDGE,
360c0d06caSMauro Carvalho Chehab 	SENSOR,
370c0d06caSMauro Carvalho Chehab 	SENSOR_LONG
380c0d06caSMauro Carvalho Chehab };
390c0d06caSMauro Carvalho Chehab 
400c0d06caSMauro Carvalho Chehab struct m5602_sensor {
410c0d06caSMauro Carvalho Chehab 	/* Defines the name of a sensor */
420c0d06caSMauro Carvalho Chehab 	char name[32];
430c0d06caSMauro Carvalho Chehab 
440c0d06caSMauro Carvalho Chehab 	/* What i2c address the sensor is connected to */
450c0d06caSMauro Carvalho Chehab 	u8 i2c_slave_id;
460c0d06caSMauro Carvalho Chehab 
470c0d06caSMauro Carvalho Chehab 	/* Width of each i2c register (in bytes) */
480c0d06caSMauro Carvalho Chehab 	u8 i2c_regW;
490c0d06caSMauro Carvalho Chehab 
500c0d06caSMauro Carvalho Chehab 	/* Probes if the sensor is connected */
510c0d06caSMauro Carvalho Chehab 	int (*probe)(struct sd *sd);
520c0d06caSMauro Carvalho Chehab 
530c0d06caSMauro Carvalho Chehab 	/* Performs a initialization sequence */
540c0d06caSMauro Carvalho Chehab 	int (*init)(struct sd *sd);
550c0d06caSMauro Carvalho Chehab 
56c84e412fSHans de Goede 	/* Controls initialization, maybe NULL */
57c84e412fSHans de Goede 	int (*init_controls)(struct sd *sd);
58c84e412fSHans de Goede 
590c0d06caSMauro Carvalho Chehab 	/* Executed when the camera starts to send data */
600c0d06caSMauro Carvalho Chehab 	int (*start)(struct sd *sd);
610c0d06caSMauro Carvalho Chehab 
620c0d06caSMauro Carvalho Chehab 	/* Executed when the camera ends to send data */
630c0d06caSMauro Carvalho Chehab 	int (*stop)(struct sd *sd);
640c0d06caSMauro Carvalho Chehab 
650c0d06caSMauro Carvalho Chehab 	/* Executed when the device is disconnected */
660c0d06caSMauro Carvalho Chehab 	void (*disconnect)(struct sd *sd);
670c0d06caSMauro Carvalho Chehab };
680c0d06caSMauro Carvalho Chehab 
690c0d06caSMauro Carvalho Chehab #endif
70