diff options
Diffstat (limited to 'drivers/media/video/gspca/gspca.h')
-rw-r--r-- | drivers/media/video/gspca/gspca.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index 59c7941da999..02c696a22be0 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h | |||
@@ -48,26 +48,27 @@ extern int gspca_debug; | |||
48 | 48 | ||
49 | /* used to list framerates supported by a camera mode (resolution) */ | 49 | /* used to list framerates supported by a camera mode (resolution) */ |
50 | struct framerates { | 50 | struct framerates { |
51 | int *rates; | 51 | const u8 *rates; |
52 | int nrates; | 52 | int nrates; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* device information - set at probe time */ | 55 | /* device information - set at probe time */ |
56 | struct cam { | 56 | struct cam { |
57 | int bulk_size; /* buffer size when image transfer by bulk */ | ||
58 | const struct v4l2_pix_format *cam_mode; /* size nmodes */ | 57 | const struct v4l2_pix_format *cam_mode; /* size nmodes */ |
59 | char nmodes; | ||
60 | const struct framerates *mode_framerates; /* must have size nmode, | 58 | const struct framerates *mode_framerates; /* must have size nmode, |
61 | * just like cam_mode */ | 59 | * just like cam_mode */ |
62 | __u8 bulk_nurbs; /* number of URBs in bulk mode | 60 | u32 bulk_size; /* buffer size when image transfer by bulk */ |
61 | u32 input_flags; /* value for ENUM_INPUT status flags */ | ||
62 | u8 nmodes; /* size of cam_mode */ | ||
63 | u8 no_urb_create; /* don't create transfer URBs */ | ||
64 | u8 bulk_nurbs; /* number of URBs in bulk mode | ||
63 | * - cannot be > MAX_NURBS | 65 | * - cannot be > MAX_NURBS |
64 | * - when 0 and bulk_size != 0 means | 66 | * - when 0 and bulk_size != 0 means |
65 | * 1 URB and submit done by subdriver */ | 67 | * 1 URB and submit done by subdriver */ |
66 | u8 bulk; /* image transfer by 0:isoc / 1:bulk */ | 68 | u8 bulk; /* image transfer by 0:isoc / 1:bulk */ |
67 | u8 npkt; /* number of packets in an ISOC message | 69 | u8 npkt; /* number of packets in an ISOC message |
68 | * 0 is the default value: 32 packets */ | 70 | * 0 is the default value: 32 packets */ |
69 | u32 input_flags; /* value for ENUM_INPUT status flags */ | 71 | u8 reverse_alts; /* Alt settings are in high to low order */ |
70 | char reverse_alts; /* Alt settings are in high to low order */ | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | struct gspca_dev; | 74 | struct gspca_dev; |
@@ -90,6 +91,9 @@ typedef int (*cam_qmnu_op) (struct gspca_dev *, | |||
90 | typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev, | 91 | typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev, |
91 | u8 *data, | 92 | u8 *data, |
92 | int len); | 93 | int len); |
94 | typedef int (*cam_int_pkt_op) (struct gspca_dev *gspca_dev, | ||
95 | u8 *data, | ||
96 | int len); | ||
93 | 97 | ||
94 | struct ctrl { | 98 | struct ctrl { |
95 | struct v4l2_queryctrl qctrl; | 99 | struct v4l2_queryctrl qctrl; |
@@ -125,6 +129,12 @@ struct sd_desc { | |||
125 | cam_reg_op get_register; | 129 | cam_reg_op get_register; |
126 | #endif | 130 | #endif |
127 | cam_ident_op get_chip_ident; | 131 | cam_ident_op get_chip_ident; |
132 | #ifdef CONFIG_INPUT | ||
133 | cam_int_pkt_op int_pkt_scan; | ||
134 | /* other_input makes the gspca core create gspca_dev->input even when | ||
135 | int_pkt_scan is NULL, for cams with non interrupt driven buttons */ | ||
136 | u8 other_input; | ||
137 | #endif | ||
128 | }; | 138 | }; |
129 | 139 | ||
130 | /* packet types when moving from iso buf to frame buf */ | 140 | /* packet types when moving from iso buf to frame buf */ |
@@ -147,6 +157,10 @@ struct gspca_dev { | |||
147 | struct module *module; /* subdriver handling the device */ | 157 | struct module *module; /* subdriver handling the device */ |
148 | struct usb_device *dev; | 158 | struct usb_device *dev; |
149 | struct file *capt_file; /* file doing video capture */ | 159 | struct file *capt_file; /* file doing video capture */ |
160 | #ifdef CONFIG_INPUT | ||
161 | struct input_dev *input_dev; | ||
162 | char phys[64]; /* physical device path */ | ||
163 | #endif | ||
150 | 164 | ||
151 | struct cam cam; /* device information */ | 165 | struct cam cam; /* device information */ |
152 | const struct sd_desc *sd_desc; /* subdriver description */ | 166 | const struct sd_desc *sd_desc; /* subdriver description */ |
@@ -156,6 +170,9 @@ struct gspca_dev { | |||
156 | #define USB_BUF_SZ 64 | 170 | #define USB_BUF_SZ 64 |
157 | __u8 *usb_buf; /* buffer for USB exchanges */ | 171 | __u8 *usb_buf; /* buffer for USB exchanges */ |
158 | struct urb *urb[MAX_NURBS]; | 172 | struct urb *urb[MAX_NURBS]; |
173 | #ifdef CONFIG_INPUT | ||
174 | struct urb *int_urb; | ||
175 | #endif | ||
159 | 176 | ||
160 | __u8 *frbuf; /* buffer for nframes */ | 177 | __u8 *frbuf; /* buffer for nframes */ |
161 | struct gspca_frame frame[GSPCA_MAX_FRAMES]; | 178 | struct gspca_frame frame[GSPCA_MAX_FRAMES]; |
@@ -187,7 +204,6 @@ struct gspca_dev { | |||
187 | char users; /* number of opens */ | 204 | char users; /* number of opens */ |
188 | char present; /* device connected */ | 205 | char present; /* device connected */ |
189 | char nbufread; /* number of buffers for read() */ | 206 | char nbufread; /* number of buffers for read() */ |
190 | char nurbs; /* number of allocated URBs */ | ||
191 | char memory; /* memory type (V4L2_MEMORY_xxx) */ | 207 | char memory; /* memory type (V4L2_MEMORY_xxx) */ |
192 | __u8 iface; /* USB interface number */ | 208 | __u8 iface; /* USB interface number */ |
193 | __u8 alt; /* USB alternate setting */ | 209 | __u8 alt; /* USB alternate setting */ |