aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/sn9c102/sn9c102.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/sn9c102/sn9c102.h')
-rw-r--r--drivers/media/video/sn9c102/sn9c102.h57
1 files changed, 21 insertions, 36 deletions
diff --git a/drivers/media/video/sn9c102/sn9c102.h b/drivers/media/video/sn9c102/sn9c102.h
index 2c6ff396daf..5428f34e7c5 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
59enum sn9c102_bridge {
60 BRIDGE_SN9C101 = 0x01,
61 BRIDGE_SN9C102 = 0x02,
62 BRIDGE_SN9C103 = 0x04,
63};
64
65SN9C102_ID_TABLE
66SN9C102_SENSOR_TABLE
67 44
68enum sn9c102_frame_state { 45enum 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
102typedef char sn9c103_sof_header_t[18]; 79typedef char sn9c102_sof_header_t[62];
103typedef char sn9c102_sof_header_t[12];
104typedef char sn9c102_eof_header_t[4];
105 80
106struct sn9c102_sysfs_attr { 81struct 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
111struct sn9c102_module_param { 86struct 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 {
155struct sn9c102_device* 130struct sn9c102_device*
156sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id) 131sn9c102_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
145enum sn9c102_bridge
146sn9c102_get_bridge(struct sn9c102_device* cam)
147{
148 return cam->bridge;
149}
150
151
152struct 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