]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6995): ubvision: add adjust_X_Offset/adjust_Y_Offset parms
authorThierry MERLE <thierry.merle@free.fr>
Wed, 9 Jan 2008 20:34:53 +0000 (17:34 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:04:46 +0000 (19:04 -0200)
Add adjust_X_Offset/adjust_Y_Offset module parameters to allow users
to tune X and Y picture offsets for their almost-working tuners without
repetitive recompilation.

Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/usbvision/usbvision-core.c

index 9e404b87d000da0199f58bab99f1cc69a1b0578f..1e52a0387aa5c6fcf813de018a976a6edb5ffb6b 100644 (file)
@@ -69,6 +69,15 @@ static int SwitchSVideoInput = 0;                    // To help people with Black and White outpu
 module_param(SwitchSVideoInput, int, 0444);
 MODULE_PARM_DESC(SwitchSVideoInput, " Set the S-Video input.  Some cables and input device are wired differently. Default: 0 (Off)");
 
+static unsigned int adjust_X_Offset = -1;
+module_param(adjust_X_Offset, int, 0644);
+MODULE_PARM_DESC(adjust_X_Offset, "adjust X offset display [core]");
+
+static unsigned int adjust_Y_Offset = -1;
+module_param(adjust_Y_Offset, int, 0644);
+MODULE_PARM_DESC(adjust_Y_Offset, "adjust Y offset display [core]");
+
+
 #define        ENABLE_HEXDUMP  0       /* Enable if you need it */
 
 
@@ -2097,11 +2106,21 @@ int usbvision_set_input(struct usb_usbvision *usbvision)
                value[5]=(usbvision_device_data[usbvision->DevModel].X_Offset & 0x0300) >> 8;
        }
 
+       if (adjust_X_Offset != -1) {
+               value[4] = adjust_X_Offset & 0xff;
+               value[5] = (adjust_X_Offset & 0x0300) >> 8;
+       }
+
        if (usbvision_device_data[usbvision->DevModel].Y_Offset >= 0) {
                value[6]=usbvision_device_data[usbvision->DevModel].Y_Offset & 0xff;
                value[7]=(usbvision_device_data[usbvision->DevModel].Y_Offset & 0x0300) >> 8;
        }
 
+       if (adjust_Y_Offset != -1) {
+               value[6] = adjust_Y_Offset & 0xff;
+               value[7] = (adjust_Y_Offset & 0x0300) >> 8;
+       }
+
        rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
                             USBVISION_OP_CODE, /* USBVISION specific code */
                             USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, 0,