aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/conex.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-05 10:49:20 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:17:15 -0400
commitc2446b3eba97243acbe2ad0939a28b5edb97eae7 (patch)
treef7ff764cf48062c4ef7c243205b85ae73d69763e /drivers/media/video/gspca/conex.c
parentefab8211db79d20032fa7d09b8a3671e68a9c5b9 (diff)
V4L/DVB (8201): gspca: v4l2_pix_format in each subdriver.
main: Parameter comp_fac removed. main, pac207: get_buff_size op removed. (all) v4l2_pix_format in each subdriver. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/gspca/conex.c')
-rw-r--r--drivers/media/video/gspca/conex.c54
1 files changed, 35 insertions, 19 deletions
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c
index 6d50247b7ad2..b5481017dd4f 100644
--- a/drivers/media/video/gspca/conex.c
+++ b/drivers/media/video/gspca/conex.c
@@ -25,8 +25,8 @@
25#define CONEX_CAM 1 /* special JPEG header */ 25#define CONEX_CAM 1 /* special JPEG header */
26#include "jpeg.h" 26#include "jpeg.h"
27 27
28#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4) 28#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5)
29static const char version[] = "2.1.4"; 29static const char version[] = "2.1.5";
30 30
31MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); 31MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
32MODULE_DESCRIPTION("GSPCA USB Conexant Camera Driver"); 32MODULE_DESCRIPTION("GSPCA USB Conexant Camera Driver");
@@ -52,7 +52,6 @@ static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val);
52static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val); 52static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val);
53 53
54static struct ctrl sd_ctrls[] = { 54static struct ctrl sd_ctrls[] = {
55#define SD_BRIGHTNESS 0
56 { 55 {
57 { 56 {
58 .id = V4L2_CID_BRIGHTNESS, 57 .id = V4L2_CID_BRIGHTNESS,
@@ -61,12 +60,12 @@ static struct ctrl sd_ctrls[] = {
61 .minimum = 0, 60 .minimum = 0,
62 .maximum = 255, 61 .maximum = 255,
63 .step = 1, 62 .step = 1,
64 .default_value = 0xd4, 63#define BRIGHTNESS_DEF 0xd4
64 .default_value = BRIGHTNESS_DEF,
65 }, 65 },
66 .set = sd_setbrightness, 66 .set = sd_setbrightness,
67 .get = sd_getbrightness, 67 .get = sd_getbrightness,
68 }, 68 },
69#define SD_CONTRAST 1
70 { 69 {
71 { 70 {
72 .id = V4L2_CID_CONTRAST, 71 .id = V4L2_CID_CONTRAST,
@@ -75,12 +74,12 @@ static struct ctrl sd_ctrls[] = {
75 .minimum = 0x0a, 74 .minimum = 0x0a,
76 .maximum = 0x1f, 75 .maximum = 0x1f,
77 .step = 1, 76 .step = 1,
78 .default_value = 0x0c, 77#define CONTRAST_DEF 0x0c
78 .default_value = CONTRAST_DEF,
79 }, 79 },
80 .set = sd_setcontrast, 80 .set = sd_setcontrast,
81 .get = sd_getcontrast, 81 .get = sd_getcontrast,
82 }, 82 },
83#define SD_COLOR 2
84 { 83 {
85 { 84 {
86 .id = V4L2_CID_SATURATION, 85 .id = V4L2_CID_SATURATION,
@@ -89,18 +88,35 @@ static struct ctrl sd_ctrls[] = {
89 .minimum = 0, 88 .minimum = 0,
90 .maximum = 7, 89 .maximum = 7,
91 .step = 1, 90 .step = 1,
92 .default_value = 3, 91#define COLOR_DEF 3
92 .default_value = COLOR_DEF,
93 }, 93 },
94 .set = sd_setcolors, 94 .set = sd_setcolors,
95 .get = sd_getcolors, 95 .get = sd_getcolors,
96 }, 96 },
97}; 97};
98 98
99static struct cam_mode vga_mode[] = { 99static struct v4l2_pix_format vga_mode[] = {
100 {V4L2_PIX_FMT_JPEG, 176, 144, 3}, 100 {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
101 {V4L2_PIX_FMT_JPEG, 320, 240, 2}, 101 .bytesperline = 176,
102 {V4L2_PIX_FMT_JPEG, 352, 288, 1}, 102 .sizeimage = 176 * 144 * 3 / 8 + 590,
103 {V4L2_PIX_FMT_JPEG, 640, 480, 0}, 103 .colorspace = V4L2_COLORSPACE_JPEG,
104 .priv = 3},
105 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
106 .bytesperline = 320,
107 .sizeimage = 320 * 240 * 3 / 8 + 590,
108 .colorspace = V4L2_COLORSPACE_JPEG,
109 .priv = 2},
110 {352, 288, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
111 .bytesperline = 352,
112 .sizeimage = 352 * 288 * 3 / 8 + 590,
113 .colorspace = V4L2_COLORSPACE_JPEG,
114 .priv = 1},
115 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
116 .bytesperline = 640,
117 .sizeimage = 640 * 480 * 3 / 8 + 590,
118 .colorspace = V4L2_COLORSPACE_JPEG,
119 .priv = 0},
104}; 120};
105 121
106static void reg_r(struct usb_device *dev, 122static void reg_r(struct usb_device *dev,
@@ -269,7 +285,7 @@ static void cx_sensor(struct gspca_dev*gspca_dev)
269 val = 0x03; 285 val = 0x03;
270 reg_w(gspca_dev->dev, 0x0092, &val, 1); 286 reg_w(gspca_dev->dev, 0x0092, &val, 1);
271 287
272 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { 288 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
273 case 0: 289 case 0:
274 reg_w(gspca_dev->dev, 0x0071, reg71a, 4); 290 reg_w(gspca_dev->dev, 0x0071, reg71a, 4);
275 break; 291 break;
@@ -350,7 +366,7 @@ static int cx11646_initsize(struct gspca_dev *gspca_dev)
350 static const __u8 reg17[] = 366 static const __u8 reg17[] =
351 { 0x0a, 0x00, 0xf2, 0x01, 0x0f, 0x00, 0x97, 0x02 }; 367 { 0x0a, 0x00, 0xf2, 0x01, 0x0f, 0x00, 0x97, 0x02 };
352 368
353 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { 369 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
354 case 0: 370 case 0:
355 cxinit = cx_inits_640; 371 cxinit = cx_inits_640;
356 break; 372 break;
@@ -668,7 +684,7 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev)
668 reg_w(gspca_dev->dev, 0x00c0, &val, 1); 684 reg_w(gspca_dev->dev, 0x00c0, &val, 1);
669 reg_r(gspca_dev->dev, 0x0001, &val, 1); 685 reg_r(gspca_dev->dev, 0x0001, &val, 1);
670 length = 8; 686 length = 8;
671 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].mode) { 687 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
672 case 0: 688 case 0:
673 for (i = 0; i < 27; i++) { 689 for (i = 0; i < 27; i++) {
674 if (i == 26) 690 if (i == 26)
@@ -832,9 +848,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
832 cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; 848 cam->nmodes = sizeof vga_mode / sizeof vga_mode[0];
833 849
834 sd->qindex = 0; /* set the quantization */ 850 sd->qindex = 0; /* set the quantization */
835 sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; 851 sd->brightness = BRIGHTNESS_DEF;
836 sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; 852 sd->contrast = CONTRAST_DEF;
837 sd->colors = sd_ctrls[SD_COLOR].qctrl.default_value; 853 sd->colors = COLOR_DEF;
838 return 0; 854 return 0;
839} 855}
840 856