aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/m5602/m5602_sensor.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/m5602/m5602_sensor.h')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_sensor.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_sensor.h b/drivers/media/video/gspca/m5602/m5602_sensor.h
new file mode 100644
index 00000000000..930fcaab441
--- /dev/null
+++ b/drivers/media/video/gspca/m5602/m5602_sensor.h
@@ -0,0 +1,76 @@
1/*
2 * USB Driver for ALi m5602 based webcams
3 *
4 * Copyright (C) 2008 Erik Andren
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#define M5602_MAX_CTRLS (V4L2_CID_LASTP1 - V4L2_CID_BASE + 10)
28
29/* Enumerates all supported sensors */
30enum sensors {
31 OV9650_SENSOR = 1,
32 S5K83A_SENSOR = 2,
33 S5K4AA_SENSOR = 3,
34 MT9M111_SENSOR = 4,
35 PO1030_SENSOR = 5
36};
37
38/* Enumerates all possible instruction types */
39enum instruction {
40 BRIDGE,
41 SENSOR,
42 SENSOR_LONG
43};
44
45struct m5602_sensor {
46 /* Defines the name of a sensor */
47 char name[32];
48
49 /* What i2c address the sensor is connected to */
50 u8 i2c_slave_id;
51
52 /* Probes if the sensor is connected */
53 int (*probe)(struct sd *sd);
54
55 /* Performs a initialization sequence */
56 int (*init)(struct sd *sd);
57
58 /* Performs a power down sequence */
59 int (*power_down)(struct sd *sd);
60
61 /* Reads a sensor register */
62 int (*read_sensor)(struct sd *sd, const u8 address,
63 u8 *i2c_data, const u8 len);
64
65 /* Writes to a sensor register */
66 int (*write_sensor)(struct sd *sd, const u8 address,
67 u8 *i2c_data, const u8 len);
68
69 int nctrls;
70 struct ctrl ctrls[M5602_MAX_CTRLS];
71
72 char nmodes;
73 struct v4l2_pix_format modes[];
74};
75
76#endif