Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
m5602_sensor.h
Go to the documentation of this file.
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 <[email protected]>
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_V4L2_CID_GREEN_BALANCE (V4L2_CID_PRIVATE_BASE + 0)
25 #define M5602_V4L2_CID_NOISE_SUPPRESION (V4L2_CID_PRIVATE_BASE + 1)
26 
27 /* Enumerates all supported sensors */
28 enum sensors {
35 };
36 
37 /* Enumerates all possible instruction types */
42 };
43 
44 struct m5602_sensor {
45  /* Defines the name of a sensor */
46  char name[32];
47 
48  /* What i2c address the sensor is connected to */
50 
51  /* Width of each i2c register (in bytes) */
53 
54  /* Probes if the sensor is connected */
55  int (*probe)(struct sd *sd);
56 
57  /* Performs a initialization sequence */
58  int (*init)(struct sd *sd);
59 
60  /* Executed when the camera starts to send data */
61  int (*start)(struct sd *sd);
62 
63  /* Executed when the camera ends to send data */
64  int (*stop)(struct sd *sd);
65 
66  /* Executed when the device is disconnected */
67  void (*disconnect)(struct sd *sd);
68 };
69 
70 #endif