diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-07-10 06:06:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:25:54 -0400 |
commit | d0d0e39bc5912793405d3f84ffc982fa400e6cc0 (patch) | |
tree | bc9fde32fdc9dd0bfc77755f271650a2343fc3c8 /drivers/media | |
parent | 326c986207cb2065b9819107caa31efd2bbc48db (diff) |
V4L/DVB (8346): gspca: Bad pixel format of bridge VC0321.
vc032x: Light frequency was not initialized.
Change the pixel format of bridge VC0321 to V4L2_PIX_FMT_YUV420
('YU12').
Set a bridge to all webcams.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/vc032x.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index 7ca6240c64e1..668e024aaa8f 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #include "gspca.h" | 25 | #include "gspca.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) |
28 | static const char version[] = "2.1.5"; | 28 | static const char version[] = "2.1.7"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver"); |
@@ -58,7 +58,6 @@ static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val); | |||
58 | static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val); | 58 | static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val); |
59 | 59 | ||
60 | static struct ctrl sd_ctrls[] = { | 60 | static struct ctrl sd_ctrls[] = { |
61 | #define SD_AUTOGAIN 0 | ||
62 | { | 61 | { |
63 | { | 62 | { |
64 | .id = V4L2_CID_AUTOGAIN, | 63 | .id = V4L2_CID_AUTOGAIN, |
@@ -67,20 +66,22 @@ static struct ctrl sd_ctrls[] = { | |||
67 | .minimum = 0, | 66 | .minimum = 0, |
68 | .maximum = 1, | 67 | .maximum = 1, |
69 | .step = 1, | 68 | .step = 1, |
70 | .default_value = 1, | 69 | #define AUTOGAIN_DEF 1 |
70 | .default_value = AUTOGAIN_DEF, | ||
71 | }, | 71 | }, |
72 | .set = sd_setautogain, | 72 | .set = sd_setautogain, |
73 | .get = sd_getautogain, | 73 | .get = sd_getautogain, |
74 | }, | 74 | }, |
75 | #define SD_FREQ 1 | ||
76 | { | 75 | { |
77 | { | 76 | { |
78 | .id = V4L2_CID_POWER_LINE_FREQUENCY, | 77 | .id = V4L2_CID_POWER_LINE_FREQUENCY, |
79 | .type = V4L2_CTRL_TYPE_MENU, | 78 | .type = V4L2_CTRL_TYPE_MENU, |
80 | .name = "Light frequency filter", | 79 | .name = "Light frequency filter", |
81 | .minimum = 0, | 80 | .minimum = 0, |
82 | .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */ | 81 | .maximum = 2, /* 0: No, 1: 50Hz, 2:60Hz */ |
83 | .step = 1, | 82 | .step = 1, |
83 | #define FREQ_DEF 1 | ||
84 | .default_value = FREQ_DEF, | ||
84 | .default_value = 1, | 85 | .default_value = 1, |
85 | }, | 86 | }, |
86 | .set = sd_setfreq, | 87 | .set = sd_setfreq, |
@@ -89,12 +90,12 @@ static struct ctrl sd_ctrls[] = { | |||
89 | }; | 90 | }; |
90 | 91 | ||
91 | static struct v4l2_pix_format vc0321_mode[] = { | 92 | static struct v4l2_pix_format vc0321_mode[] = { |
92 | {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, | 93 | {320, 240, V4L2_PIX_FMT_YUV420, V4L2_FIELD_NONE, |
93 | .bytesperline = 320 * 2, | 94 | .bytesperline = 320 * 2, |
94 | .sizeimage = 320 * 240 * 2, | 95 | .sizeimage = 320 * 240 * 2, |
95 | .colorspace = V4L2_COLORSPACE_SRGB, | 96 | .colorspace = V4L2_COLORSPACE_SRGB, |
96 | .priv = 1}, | 97 | .priv = 1}, |
97 | {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE, | 98 | {640, 480, V4L2_PIX_FMT_YUV420, V4L2_FIELD_NONE, |
98 | .bytesperline = 640 * 2, | 99 | .bytesperline = 640 * 2, |
99 | .sizeimage = 640 * 480 * 2, | 100 | .sizeimage = 640 * 480 * 2, |
100 | .colorspace = V4L2_COLORSPACE_SRGB, | 101 | .colorspace = V4L2_COLORSPACE_SRGB, |
@@ -1418,28 +1419,13 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1418 | struct cam *cam; | 1419 | struct cam *cam; |
1419 | __u8 tmp2[4]; | 1420 | __u8 tmp2[4]; |
1420 | int sensor; | 1421 | int sensor; |
1421 | __u16 vendor; | ||
1422 | __u16 product; | 1422 | __u16 product; |
1423 | 1423 | ||
1424 | vendor = id->idVendor; | ||
1425 | product = id->idProduct; | 1424 | product = id->idProduct; |
1426 | switch (vendor) { | 1425 | sd->bridge = BRIDGE_VC0321; |
1427 | case 0x046d: /* Logitech Labtec */ | 1426 | switch (id->idVendor) { |
1428 | /* switch (product) { */ | ||
1429 | /* case 0x0892: */ | ||
1430 | /* case 0x0896: */ | ||
1431 | sd->bridge = BRIDGE_VC0321; | ||
1432 | /* break; */ | ||
1433 | /* } */ | ||
1434 | break; | ||
1435 | case 0x0ac8: /* Vimicro z-star */ | 1427 | case 0x0ac8: /* Vimicro z-star */ |
1436 | switch (product) { | 1428 | switch (product) { |
1437 | case 0x0321: | ||
1438 | case 0x0328: | ||
1439 | case 0xc001: | ||
1440 | case 0xc002: | ||
1441 | sd->bridge = BRIDGE_VC0321; | ||
1442 | break; | ||
1443 | case 0x0323: | 1429 | case 0x0323: |
1444 | sd->bridge = BRIDGE_VC0323; | 1430 | sd->bridge = BRIDGE_VC0323; |
1445 | break; | 1431 | break; |
@@ -1459,10 +1445,10 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1459 | cam->epaddr = 0x02; | 1445 | cam->epaddr = 0x02; |
1460 | if (sd->bridge == BRIDGE_VC0321) { | 1446 | if (sd->bridge == BRIDGE_VC0321) { |
1461 | cam->cam_mode = vc0321_mode; | 1447 | cam->cam_mode = vc0321_mode; |
1462 | cam->nmodes = sizeof vc0321_mode / sizeof vc0321_mode[0]; | 1448 | cam->nmodes = ARRAY_SIZE(vc0321_mode); |
1463 | } else { | 1449 | } else { |
1464 | cam->cam_mode = vc0323_mode; | 1450 | cam->cam_mode = vc0323_mode; |
1465 | cam->nmodes = sizeof vc0323_mode / sizeof vc0323_mode[0]; | 1451 | cam->nmodes = ARRAY_SIZE(vc0323_mode); |
1466 | } | 1452 | } |
1467 | 1453 | ||
1468 | vc0321_reset(gspca_dev); | 1454 | vc0321_reset(gspca_dev); |
@@ -1498,7 +1484,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1498 | } | 1484 | } |
1499 | 1485 | ||
1500 | sd->qindex = 7; | 1486 | sd->qindex = 7; |
1501 | sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value; | 1487 | sd->autogain = AUTOGAIN_DEF; |
1488 | sd->lightfreq = FREQ_DEF; | ||
1502 | 1489 | ||
1503 | if (sd->bridge == BRIDGE_VC0321) { | 1490 | if (sd->bridge == BRIDGE_VC0321) { |
1504 | reg_r(dev, 0x8a, 0, tmp2, 3); | 1491 | reg_r(dev, 0x8a, 0, tmp2, 3); |