commit 7d7797b59db17cb7be572c1a6b0190e84179f3dc
parent 046c982a201c6ebd986949eecab4e311c42f8fc6
Author: alex <alex@022568fa-442e-4ef8-a3e8-54dcafdb011a>
Date: Sun, 14 Dec 2008 22:50:53 +0000
Patch from Benoit Laniel that fixes a videobuf PCI call and some V4L2_CID defines.
git-svn-id: http://svn.mediati.org/svn/r5u870/trunk@109 022568fa-442e-4ef8-a3e8-54dcafdb011a
Diffstat:
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/r5u870.c b/r5u870.c
@@ -858,14 +858,21 @@ enum {
/* TODO: Merge these into V4L API. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
#define V4L2_CID_GREEN_BALANCE (V4L2_CID_BASE+24)
-#define V4L2_CID_AUTOEXPOSURE (V4L2_CID_BASE+25)
-#define V4L2_CID_POWER_LINE_FREQ (V4L2_CID_BASE+26)
-#define V4L2_CID_BACKLIGHT_COMP (V4L2_CID_BASE+27)
+#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_BASE+25)
+#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+26)
+#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+27)
#define V4L2_CID_PRIVACY (V4L2_CID_BASE+28)
#define V4L2_CID_NIGHT_MODE (V4L2_CID_BASE+29)
#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+30)
#define V4L2_CID_LASTP1 (V4L2_CID_BASE+31) /* last CID + 1 */
+#else
+#define V4L2_CID_GREEN_BALANCE (V4L2_CID_BASE+31)
+#define V4L2_CID_PRIVACY (V4L2_CID_BASE+32)
+#define V4L2_CID_NIGHT_MODE (V4L2_CID_BASE+33)
+#define V4L2_CID_LASTP1 (V4L2_CID_BASE+34) /* last CID + 1 */
+#endif
/* 2007-09-09 TJ Ensure names are identical to uvcvideo,
* so user applications aren't confused by differing results for UVC queries */
@@ -953,7 +960,7 @@ static struct r5u870_ctrl r5u870_wdm_ctrls[] = {
.reg = R5U870_REG_GAMMA,
},
[R5U870_WDM_CTRL_BACKLIGHT_COMP_500] = {
- .base = { .uc_v4l = { .id = V4L2_CID_BACKLIGHT_COMP,
+ .base = { .uc_v4l = { .id = V4L2_CID_BACKLIGHT_COMPENSATION,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Backlight Compensation",
.minimum = 0,
@@ -966,7 +973,7 @@ static struct r5u870_ctrl r5u870_wdm_ctrls[] = {
.reg = R5U870_REG_BACKLIGHT_COMP,
},
[R5U870_WDM_CTRL_BACKLIGHT_COMP_500_DEF1] = {
- .base = { .uc_v4l = { .id = V4L2_CID_BACKLIGHT_COMP,
+ .base = { .uc_v4l = { .id = V4L2_CID_BACKLIGHT_COMPENSATION,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Backlight Compensation",
.minimum = 0,
@@ -979,7 +986,7 @@ static struct r5u870_ctrl r5u870_wdm_ctrls[] = {
.reg = R5U870_REG_BACKLIGHT_COMP,
},
[R5U870_WDM_CTRL_BACKLIGHT_COMP_X1834] = {
- .base = { .uc_v4l = { .id = V4L2_CID_BACKLIGHT_COMP,
+ .base = { .uc_v4l = { .id = V4L2_CID_BACKLIGHT_COMPENSATION,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "Backlight Compensation",
.minimum = 0,
@@ -1052,7 +1059,7 @@ static struct r5u870_ctrl r5u870_wdm_ctrls[] = {
.val_offset = offsetof(struct r5u870_ctx, vh_auto_wb)
},
[R5U870_WDM_CTRL_AUTO_EXPOSURE] = {
- .base = { .uc_v4l = { .id = V4L2_CID_AUTOEXPOSURE,
+ .base = { .uc_v4l = { .id = V4L2_CID_EXPOSURE_AUTO,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "Auto Exposure Control",
.minimum = 0,
@@ -1112,7 +1119,7 @@ static struct r5u870_ctrl r5u870_wdm_ctrls[] = {
.auto_offset = offsetof(struct r5u870_ctx, vh_agc)
},
[R5U870_WDM_CTRL_POWERLINE] = {
- .base = { .uc_v4l = { .id = V4L2_CID_POWER_LINE_FREQ,
+ .base = { .uc_v4l = { .id = V4L2_CID_POWER_LINE_FREQUENCY,
.type = V4L2_CTRL_TYPE_MENU,
.name = "Power Line Frequency",
.minimum = 0,
@@ -1710,14 +1717,14 @@ static struct r5u870_uvc_ctrlinfo r5u870_uvc_proc_ctrls[] = {
.ci_size = 2,
.ci_bm_index = 5 },
{ .ci_name = "Backlight Compensation",
- .ci_v4l_id = V4L2_CID_BACKLIGHT_COMP,
+ .ci_v4l_id = V4L2_CID_BACKLIGHT_COMPENSATION,
.ci_v4l_type = V4L2_CTRL_TYPE_INTEGER,
.ci_v4l_flags = V4L2_CTRL_FLAG_SLIDER,
.ci_reg = UVC_PU_BACKLIGHT_COMPENSATION_CONTROL,
.ci_size = 2,
.ci_bm_index = 8 },
{ .ci_name = "Power Line Frequency",
- .ci_v4l_id = V4L2_CID_POWER_LINE_FREQ,
+ .ci_v4l_id = V4L2_CID_POWER_LINE_FREQUENCY,
.ci_v4l_type = V4L2_CTRL_TYPE_MENU,
.ci_reg = UVC_PU_POWER_LINE_FREQUENCY_CONTROL,
.ci_size = 1,
diff --git a/usbcam/usbcam_fops.c b/usbcam/usbcam_fops.c
@@ -83,6 +83,8 @@ const static char *v4l_ioctl_names[] = {
"VIDIOCSVBIFMT",
};
+spinlock_t slock;
+
static unsigned int __pure
palette_to_pixelformat(unsigned int palette)
{
@@ -150,7 +152,7 @@ static int usbcam_v4l_open(struct inode *inode, struct file *filp)
videobuf_queue_pci_init(&ufp->ufh_vbq,
&usbcam_videobuf_qops,
NULL,
- NULL,
+ &slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED,
sizeof(struct usbcam_frame), ufp);