V4L/DVB (11413): gspca - m5602-mt9m111: Separate mode vectors per sensor.
[linux-2.6] / drivers / media / video / gspca / m5602 / m5602_sensor.h
1 /*
2  * USB Driver for ALi m5602 based webcams
3  *
4  * Copyright (C) 2008 Erik AndrĂ©n
5  * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.
6  * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>
7  *
8  * Portions of code to USB interface and ALi driver software,
9  * Copyright (c) 2006 Willem Duinker
10  * v4l2 interface modeled after the V4L2 driver
11  * for SN9C10x PC Camera Controllers
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License as
15  * published by the Free Software Foundation, version 2.
16  *
17  */
18
19 #ifndef M5602_SENSOR_H_
20 #define M5602_SENSOR_H_
21
22 #include "m5602_bridge.h"
23
24 #define M5602_DEFAULT_FRAME_WIDTH  640
25 #define M5602_DEFAULT_FRAME_HEIGHT 480
26
27 /* Enumerates all supported sensors */
28 enum sensors {
29         OV9650_SENSOR   = 1,
30         S5K83A_SENSOR   = 2,
31         S5K4AA_SENSOR   = 3,
32         MT9M111_SENSOR  = 4,
33         PO1030_SENSOR   = 5
34 };
35
36 /* Enumerates all possible instruction types */
37 enum instruction {
38         BRIDGE,
39         SENSOR,
40         SENSOR_LONG
41 };
42
43 struct m5602_sensor {
44         /* Defines the name of a sensor */
45         char name[32];
46
47         /* What i2c address the sensor is connected to */
48         u8 i2c_slave_id;
49
50         /* Width of each i2c register (in bytes) */
51         u8 i2c_regW;
52
53         /* Probes if the sensor is connected */
54         int (*probe)(struct sd *sd);
55
56         /* Performs a initialization sequence */
57         int (*init)(struct sd *sd);
58
59         /* Executed when the camera starts to send data */
60         int (*start)(struct sd *sd);
61
62         /* Executed when the camera ends to send data */
63         int (*stop)(struct sd *sd);
64
65         /* Performs a power down sequence */
66         int (*power_down)(struct sd *sd);
67
68         const struct ctrl *ctrls;
69 };
70
71 #endif