diff options
Diffstat (limited to 'drivers/media/video/sn9c102/sn9c102.h')
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102.h | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/drivers/media/video/sn9c102/sn9c102.h b/drivers/media/video/sn9c102/sn9c102.h index 2c6ff396dafc..5428f34e7c5b 100644 --- a/drivers/media/video/sn9c102/sn9c102.h +++ b/drivers/media/video/sn9c102/sn9c102.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * V4L2 driver for SN9C10x PC Camera Controllers * | 2 | * V4L2 driver for SN9C1xx PC Camera Controllers * |
3 | * * | 3 | * * |
4 | * Copyright (C) 2004-2006 by Luca Risolia <luca.risolia@studio.unibo.it> * | 4 | * Copyright (C) 2004-2006 by Luca Risolia <luca.risolia@studio.unibo.it> * |
5 | * * | 5 | * * |
@@ -37,33 +37,10 @@ | |||
37 | #include <linux/string.h> | 37 | #include <linux/string.h> |
38 | #include <linux/stddef.h> | 38 | #include <linux/stddef.h> |
39 | 39 | ||
40 | #include "sn9c102_config.h" | ||
40 | #include "sn9c102_sensor.h" | 41 | #include "sn9c102_sensor.h" |
42 | #include "sn9c102_devtable.h" | ||
41 | 43 | ||
42 | /*****************************************************************************/ | ||
43 | |||
44 | #define SN9C102_DEBUG | ||
45 | #define SN9C102_DEBUG_LEVEL 2 | ||
46 | #define SN9C102_MAX_DEVICES 64 | ||
47 | #define SN9C102_PRESERVE_IMGSCALE 0 | ||
48 | #define SN9C102_FORCE_MUNMAP 0 | ||
49 | #define SN9C102_MAX_FRAMES 32 | ||
50 | #define SN9C102_URBS 2 | ||
51 | #define SN9C102_ISO_PACKETS 7 | ||
52 | #define SN9C102_ALTERNATE_SETTING 8 | ||
53 | #define SN9C102_URB_TIMEOUT msecs_to_jiffies(2 * SN9C102_ISO_PACKETS) | ||
54 | #define SN9C102_CTRL_TIMEOUT 300 | ||
55 | #define SN9C102_FRAME_TIMEOUT 2 | ||
56 | |||
57 | /*****************************************************************************/ | ||
58 | |||
59 | enum sn9c102_bridge { | ||
60 | BRIDGE_SN9C101 = 0x01, | ||
61 | BRIDGE_SN9C102 = 0x02, | ||
62 | BRIDGE_SN9C103 = 0x04, | ||
63 | }; | ||
64 | |||
65 | SN9C102_ID_TABLE | ||
66 | SN9C102_SENSOR_TABLE | ||
67 | 44 | ||
68 | enum sn9c102_frame_state { | 45 | enum sn9c102_frame_state { |
69 | F_UNUSED, | 46 | F_UNUSED, |
@@ -99,13 +76,11 @@ enum sn9c102_stream_state { | |||
99 | STREAM_ON, | 76 | STREAM_ON, |
100 | }; | 77 | }; |
101 | 78 | ||
102 | typedef char sn9c103_sof_header_t[18]; | 79 | typedef char sn9c102_sof_header_t[62]; |
103 | typedef char sn9c102_sof_header_t[12]; | ||
104 | typedef char sn9c102_eof_header_t[4]; | ||
105 | 80 | ||
106 | struct sn9c102_sysfs_attr { | 81 | struct sn9c102_sysfs_attr { |
107 | u8 reg, i2c_reg; | 82 | u8 reg, i2c_reg; |
108 | sn9c103_sof_header_t frame_header; | 83 | sn9c102_sof_header_t frame_header; |
109 | }; | 84 | }; |
110 | 85 | ||
111 | struct sn9c102_module_param { | 86 | struct sn9c102_module_param { |
@@ -137,8 +112,8 @@ struct sn9c102_device { | |||
137 | struct v4l2_jpegcompression compression; | 112 | struct v4l2_jpegcompression compression; |
138 | 113 | ||
139 | struct sn9c102_sysfs_attr sysfs; | 114 | struct sn9c102_sysfs_attr sysfs; |
140 | sn9c103_sof_header_t sof_header; | 115 | sn9c102_sof_header_t sof_header; |
141 | u16 reg[63]; | 116 | u16 reg[384]; |
142 | 117 | ||
143 | struct sn9c102_module_param module_param; | 118 | struct sn9c102_module_param module_param; |
144 | 119 | ||
@@ -155,10 +130,7 @@ struct sn9c102_device { | |||
155 | struct sn9c102_device* | 130 | struct sn9c102_device* |
156 | sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id) | 131 | sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id) |
157 | { | 132 | { |
158 | if (usb_match_id(usb_ifnum_to_if(cam->usbdev, 0), id)) | 133 | return usb_match_id(usb_ifnum_to_if(cam->usbdev, 0), id) ? cam : NULL; |
159 | return cam; | ||
160 | |||
161 | return NULL; | ||
162 | } | 134 | } |
163 | 135 | ||
164 | 136 | ||
@@ -169,6 +141,19 @@ sn9c102_attach_sensor(struct sn9c102_device* cam, | |||
169 | memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor)); | 141 | memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor)); |
170 | } | 142 | } |
171 | 143 | ||
144 | |||
145 | enum sn9c102_bridge | ||
146 | sn9c102_get_bridge(struct sn9c102_device* cam) | ||
147 | { | ||
148 | return cam->bridge; | ||
149 | } | ||
150 | |||
151 | |||
152 | struct sn9c102_sensor* sn9c102_get_sensor(struct sn9c102_device* cam) | ||
153 | { | ||
154 | return &cam->sensor; | ||
155 | } | ||
156 | |||
172 | /*****************************************************************************/ | 157 | /*****************************************************************************/ |
173 | 158 | ||
174 | #undef DBG | 159 | #undef DBG |