diff options
Diffstat (limited to 'drivers/media/video/cpia2/cpia2.h')
-rw-r--r-- | drivers/media/video/cpia2/cpia2.h | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/media/video/cpia2/cpia2.h b/drivers/media/video/cpia2/cpia2.h index ab252188981b..cdef677d57ec 100644 --- a/drivers/media/video/cpia2/cpia2.h +++ b/drivers/media/video/cpia2/cpia2.h | |||
@@ -32,11 +32,12 @@ | |||
32 | #define __CPIA2_H__ | 32 | #define __CPIA2_H__ |
33 | 33 | ||
34 | #include <linux/videodev2.h> | 34 | #include <linux/videodev2.h> |
35 | #include <media/v4l2-common.h> | ||
36 | #include <linux/usb.h> | 35 | #include <linux/usb.h> |
37 | #include <linux/poll.h> | 36 | #include <linux/poll.h> |
37 | #include <media/v4l2-common.h> | ||
38 | #include <media/v4l2-device.h> | ||
39 | #include <media/v4l2-ctrls.h> | ||
38 | 40 | ||
39 | #include "cpia2dev.h" | ||
40 | #include "cpia2_registers.h" | 41 | #include "cpia2_registers.h" |
41 | 42 | ||
42 | /* define for verbose debug output */ | 43 | /* define for verbose debug output */ |
@@ -65,7 +66,6 @@ | |||
65 | 66 | ||
66 | /* Flicker Modes */ | 67 | /* Flicker Modes */ |
67 | #define NEVER_FLICKER 0 | 68 | #define NEVER_FLICKER 0 |
68 | #define ANTI_FLICKER_ON 1 | ||
69 | #define FLICKER_60 60 | 69 | #define FLICKER_60 60 |
70 | #define FLICKER_50 50 | 70 | #define FLICKER_50 50 |
71 | 71 | ||
@@ -148,7 +148,6 @@ enum { | |||
148 | #define DEFAULT_BRIGHTNESS 0x46 | 148 | #define DEFAULT_BRIGHTNESS 0x46 |
149 | #define DEFAULT_CONTRAST 0x93 | 149 | #define DEFAULT_CONTRAST 0x93 |
150 | #define DEFAULT_SATURATION 0x7f | 150 | #define DEFAULT_SATURATION 0x7f |
151 | #define DEFAULT_TARGET_KB 0x30 | ||
152 | 151 | ||
153 | /* Power state */ | 152 | /* Power state */ |
154 | #define HI_POWER_MODE CPIA2_SYSTEM_CONTROL_HIGH_POWER | 153 | #define HI_POWER_MODE CPIA2_SYSTEM_CONTROL_HIGH_POWER |
@@ -287,7 +286,6 @@ struct camera_params { | |||
287 | struct { | 286 | struct { |
288 | u8 cam_register; | 287 | u8 cam_register; |
289 | u8 flicker_mode_req; /* 1 if flicker on, else never flicker */ | 288 | u8 flicker_mode_req; /* 1 if flicker on, else never flicker */ |
290 | int mains_frequency; | ||
291 | } flicker_control; | 289 | } flicker_control; |
292 | 290 | ||
293 | struct { | 291 | struct { |
@@ -337,7 +335,7 @@ struct camera_params { | |||
337 | u8 vc_control; | 335 | u8 vc_control; |
338 | u8 vc_mp_direction; | 336 | u8 vc_mp_direction; |
339 | u8 vc_mp_data; | 337 | u8 vc_mp_data; |
340 | u8 target_kb; | 338 | u8 quality; |
341 | } vc_params; | 339 | } vc_params; |
342 | 340 | ||
343 | struct { | 341 | struct { |
@@ -366,23 +364,23 @@ struct framebuf { | |||
366 | struct framebuf *next; | 364 | struct framebuf *next; |
367 | }; | 365 | }; |
368 | 366 | ||
369 | struct cpia2_fh { | ||
370 | enum v4l2_priority prio; | ||
371 | u8 mmapped; | ||
372 | }; | ||
373 | |||
374 | struct camera_data { | 367 | struct camera_data { |
375 | /* locks */ | 368 | /* locks */ |
369 | struct v4l2_device v4l2_dev; | ||
376 | struct mutex v4l2_lock; /* serialize file operations */ | 370 | struct mutex v4l2_lock; /* serialize file operations */ |
377 | struct v4l2_prio_state prio; | 371 | struct v4l2_ctrl_handler hdl; |
372 | struct { | ||
373 | /* Lights control cluster */ | ||
374 | struct v4l2_ctrl *top_light; | ||
375 | struct v4l2_ctrl *bottom_light; | ||
376 | }; | ||
377 | struct v4l2_ctrl *usb_alt; | ||
378 | 378 | ||
379 | /* camera status */ | 379 | /* camera status */ |
380 | volatile int present; /* Is the camera still present? */ | ||
381 | int open_count; /* # of process that have camera open */ | ||
382 | int first_image_seen; | 380 | int first_image_seen; |
383 | u8 mains_freq; /* for flicker control */ | ||
384 | enum sensors sensor_type; | 381 | enum sensors sensor_type; |
385 | u8 flush; | 382 | u8 flush; |
383 | struct v4l2_fh *stream_fh; | ||
386 | u8 mmapped; | 384 | u8 mmapped; |
387 | int streaming; /* 0 = no, 1 = yes */ | 385 | int streaming; /* 0 = no, 1 = yes */ |
388 | int xfer_mode; /* XFER_BULK or XFER_ISOC */ | 386 | int xfer_mode; /* XFER_BULK or XFER_ISOC */ |
@@ -390,7 +388,7 @@ struct camera_data { | |||
390 | 388 | ||
391 | /* v4l */ | 389 | /* v4l */ |
392 | int video_size; /* VIDEO_SIZE_ */ | 390 | int video_size; /* VIDEO_SIZE_ */ |
393 | struct video_device *vdev; /* v4l videodev */ | 391 | struct video_device vdev; /* v4l videodev */ |
394 | u32 width; | 392 | u32 width; |
395 | u32 height; /* Its size */ | 393 | u32 height; /* Its size */ |
396 | __u32 pixelformat; /* Format fourcc */ | 394 | __u32 pixelformat; /* Format fourcc */ |
@@ -425,6 +423,7 @@ struct camera_data { | |||
425 | /* v4l */ | 423 | /* v4l */ |
426 | int cpia2_register_camera(struct camera_data *cam); | 424 | int cpia2_register_camera(struct camera_data *cam); |
427 | void cpia2_unregister_camera(struct camera_data *cam); | 425 | void cpia2_unregister_camera(struct camera_data *cam); |
426 | void cpia2_camera_release(struct v4l2_device *v4l2_dev); | ||
428 | 427 | ||
429 | /* core */ | 428 | /* core */ |
430 | int cpia2_reset_camera(struct camera_data *cam); | 429 | int cpia2_reset_camera(struct camera_data *cam); |
@@ -443,7 +442,7 @@ int cpia2_send_command(struct camera_data *cam, struct cpia2_command *cmd); | |||
443 | int cpia2_do_command(struct camera_data *cam, | 442 | int cpia2_do_command(struct camera_data *cam, |
444 | unsigned int command, | 443 | unsigned int command, |
445 | unsigned char direction, unsigned char param); | 444 | unsigned char direction, unsigned char param); |
446 | struct camera_data *cpia2_init_camera_struct(void); | 445 | struct camera_data *cpia2_init_camera_struct(struct usb_interface *intf); |
447 | int cpia2_init_camera(struct camera_data *cam); | 446 | int cpia2_init_camera(struct camera_data *cam); |
448 | int cpia2_allocate_buffers(struct camera_data *cam); | 447 | int cpia2_allocate_buffers(struct camera_data *cam); |
449 | void cpia2_free_buffers(struct camera_data *cam); | 448 | void cpia2_free_buffers(struct camera_data *cam); |
@@ -454,7 +453,6 @@ unsigned int cpia2_poll(struct camera_data *cam, | |||
454 | int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma); | 453 | int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma); |
455 | void cpia2_set_property_flip(struct camera_data *cam, int prop_val); | 454 | void cpia2_set_property_flip(struct camera_data *cam, int prop_val); |
456 | void cpia2_set_property_mirror(struct camera_data *cam, int prop_val); | 455 | void cpia2_set_property_mirror(struct camera_data *cam, int prop_val); |
457 | int cpia2_set_target_kb(struct camera_data *cam, unsigned char value); | ||
458 | int cpia2_set_gpio(struct camera_data *cam, unsigned char setting); | 456 | int cpia2_set_gpio(struct camera_data *cam, unsigned char setting); |
459 | int cpia2_set_fps(struct camera_data *cam, int framerate); | 457 | int cpia2_set_fps(struct camera_data *cam, int framerate); |
460 | 458 | ||