From 9c5f82199c365e847906919af0f3b985fbc1696a Mon Sep 17 00:00:00 2001 From: Brian Johnson Date: Wed, 18 Mar 2009 12:19:23 -0400 Subject: [PATCH] Revert saturation control patches Revert "Restore default Saturation/Color V4L2 control behaviour" Revert "Fix saturation control" Revert "Adding V4L2 saturation control for sn9c20x" This patch reverts the following commits: e989d496ed5d911a1eb4462b610af52278fc815b 8b47753f8d1e2b64643ce267eba4ca495be6efee cb1d9bde62c08b7b0a157c6281984e3852212585 This fully removes all the broken saturation patches. Signed-off-by: Brian Johnson --- sn9c20x-bridge.c | 81 -------------------------------------------------------- sn9c20x-usb.c | 9 ------- sn9c20x-v4l2.c | 8 +++--- sn9c20x.h | 1 - 4 files changed, 4 insertions(+), 95 deletions(-) diff --git a/sn9c20x-bridge.c b/sn9c20x-bridge.c index 3eed622..dfbf87f 100644 --- a/sn9c20x-bridge.c +++ b/sn9c20x-bridge.c @@ -53,12 +53,6 @@ int sn9c20x_set_camera_control(struct usb_sn9c20x *dev, ret = dev->camera.set_gamma(dev); } break; - case V4L2_CID_SATURATION: - if (dev->camera.set_saturation) { - dev->vsettings.colour = value; - ret = dev->camera.set_saturation(dev); - } - break; case V4L2_CID_SHARPNESS: if (dev->camera.set_sharpness) { dev->vsettings.sharpness = value; @@ -577,80 +571,6 @@ int sn9c20x_set_gamma(struct usb_sn9c20x *dev) } /** - * @brief Set saturation inside sn9c20x chip - * - * @author Neekhil - * - * @param dev Pointer to the device - * - * @return Zero (success) or negative (USB-error value) - * - */ -int sn9c20x_set_saturation(struct usb_sn9c20x *dev) -{ - int ret = 0; - int i = 0; - __u16 reg; - __u8 value; - __u16 saturation_bw[10][2] = { - {0x10e7, 0x00}, - {0x10e8, 0x00}, - {0x10e9, 0x00}, - {0x10ea, 0x00}, - {0x10eb, 0x00}, - {0x10ed, 0x00}, - {0x10ef, 0x00}, - {0x10f0, 0x00}, - {0x10f1, 0x00}, - {0x10f2, 0x00}, - }; - - __u16 saturation[10][2] = { - {0x10e7, 0xf6}, - {0x10e8, 0x0f}, - {0x10e9, 0xd2}, - {0x10ea, 0x0f}, - {0x10eb, 0x38}, - {0x10ed, 0x34}, - {0x10ef, 0xcf}, - {0x10f0, 0x0f}, - {0x10f1, 0xfd}, - {0x10f2, 0x0f}, - }; - - __u16 saturation_full[10][2] = { - {0x10e7, 0xdc}, - {0x10e8, 0x0f}, - {0x10e9, 0xb9}, - {0x10ea, 0x0f}, - {0x10eb, 0x6b}, - {0x10ed, 0x59}, - {0x10ef, 0xb6}, - {0x10f0, 0x0f}, - {0x10f1, 0xf2}, - {0x10f2, 0x0f}, - }; - - - - if (dev->vsettings.colour == 0xff) memcpy(saturation, saturation_full, sizeof(saturation)); - else if (dev->vsettings.colour == 0x00) memcpy(saturation, saturation_bw, sizeof(saturation)); - - for( i = 0; i < 10; i++) { - reg = saturation[i][0]; - value = saturation[i][1]; - ret = usb_sn9c20x_control_write(dev, reg, &value, 1); - UDIA_DEBUG("Saturation - Reg:0x%X Value:0x%X\n", reg, value); - } - - if (ret < 0) - return ret; - else - return 0; -} - - -/** * @brief Set sharpness inside sn9c20x chip * * @author Comer352l @@ -986,7 +906,6 @@ int sn9c20x_initialize(struct usb_sn9c20x *dev) dev->camera.set_contrast = sn9c20x_set_contrast; dev->camera.set_brightness = sn9c20x_set_brightness; dev->camera.set_gamma = sn9c20x_set_gamma; - dev->camera.set_saturation = sn9c20x_set_saturation; dev->camera.set_sharpness = sn9c20x_set_sharpness; dev->camera.set_red_gain = sn9c20x_set_red_gain; dev->camera.set_blue_gain = sn9c20x_set_blue_gain; diff --git a/sn9c20x-usb.c b/sn9c20x-usb.c index 4eab2d5..17d8c2e 100644 --- a/sn9c20x-usb.c +++ b/sn9c20x-usb.c @@ -96,12 +96,6 @@ static __u16 brightness = SN9C20X_PERCENT(50, 0xFF); static __u16 gamma = SN9C20X_PERCENT(20, 0xFF); /** - * @var gamma - * Module parameter to set the gamma - */ -static __u16 saturation = SN9C20X_PERCENT(50, 0xFF); - -/** * @var contrast * Module parameter to set the contrast */ @@ -726,7 +720,6 @@ static int usb_sn9c20x_default_settings(struct usb_sn9c20x *dev) v4l2_set_control_default(dev, V4L2_CID_BRIGHTNESS, brightness); v4l2_set_control_default(dev, V4L2_CID_CONTRAST, contrast); v4l2_set_control_default(dev, V4L2_CID_GAMMA, gamma); - v4l2_set_control_default(dev, V4L2_CID_SATURATION, saturation); v4l2_set_control_default(dev, V4L2_CID_SHARPNESS, sharpness); v4l2_set_control_default(dev, V4L2_CID_RED_BALANCE, red_gain); v4l2_set_control_default(dev, V4L2_CID_BLUE_BALANCE, blue_gain); @@ -905,7 +898,6 @@ module_param(auto_gain, byte, 0444); /**< @brief Module parameter automatic gai module_param(auto_whitebalance, byte, 0444); /**< @brief Module parameter automatic whitebalance control */ module_param(brightness, ushort, 0444); /**< @brief Module parameter brightness */ module_param(gamma, ushort, 0444); /**< @brief Module parameter gamma */ -module_param(saturation, ushort, 0444); /**< @brief Module parameter saturation */ module_param(contrast, ushort, 0444); /**< @brief Module parameter contrast */ module_param(exposure, ushort, 0444); /**< @brief Module parameter exposure */ module_param(sharpness, ushort, 0444); /**< @brief Module parameter sharpness */ @@ -1054,7 +1046,6 @@ MODULE_PARM_DESC(auto_gain, "Automatic gain control"); /**< @brief Description MODULE_PARM_DESC(auto_whitebalance, "Automatic whitebalance"); /**< @brief Description of 'auto_whitebalance' parameter */ MODULE_PARM_DESC(brightness, "Brightness setting"); /**< @brief Description of 'brightness' parameter */ MODULE_PARM_DESC(gamma, "Gamma setting"); /**< @brief Description of 'gamma' parameter */ -MODULE_PARM_DESC(saturation, "Saturation setting"); /**< @brief Description of 'saturation' parameter */ MODULE_PARM_DESC(exposure, "Exposure setting"); /**< @brief Description of 'exposure' parameter */ MODULE_PARM_DESC(gain, "Gain setting"); /**< @brief Description of 'gain' parameter */ MODULE_PARM_DESC(contrast, "Contrast setting"); /**< @brief Description of 'contrast' parameter */ diff --git a/sn9c20x-v4l2.c b/sn9c20x-v4l2.c index 627c841..b762678 100644 --- a/sn9c20x-v4l2.c +++ b/sn9c20x-v4l2.c @@ -68,7 +68,7 @@ static struct v4l2_queryctrl sn9c20x_controls[] = { .maximum = 0xff, .step = 1, }, - +/* { .id = V4L2_CID_SATURATION, .type = V4L2_CTRL_TYPE_INTEGER, @@ -77,7 +77,7 @@ static struct v4l2_queryctrl sn9c20x_controls[] = { .maximum = 0xff, .step = 1, }, - +*/ { .id = V4L2_CID_CONTRAST, .type = V4L2_CTRL_TYPE_INTEGER, @@ -856,11 +856,11 @@ int sn9c20x_vidioc_g_ctrl(struct file *file, void *priv, case V4L2_CID_GAMMA: ctrl->value = dev->vsettings.gamma; break; - +/* case V4L2_CID_SATURATION: ctrl->value = dev->vsettings.colour; break; - +*/ case V4L2_CID_CONTRAST: ctrl->value = dev->vsettings.contrast; break; diff --git a/sn9c20x.h b/sn9c20x.h index 306b1fb..6a846a4 100644 --- a/sn9c20x.h +++ b/sn9c20x.h @@ -326,7 +326,6 @@ struct sn9c20x_camera { int (*set_contrast) (struct usb_sn9c20x *dev); int (*set_brightness) (struct usb_sn9c20x *dev); int (*set_gamma) (struct usb_sn9c20x *dev); - int (*set_saturation) (struct usb_sn9c20x *dev); int (*set_sharpness) (struct usb_sn9c20x *dev); int (*set_red_gain) (struct usb_sn9c20x *dev); int (*set_blue_gain) (struct usb_sn9c20x *dev); -- 2.11.4.GIT