[media] gscpa_spca561: Add brightness control for rev12a cams
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
9a3dafe431
commit
a8931d5948
@@ -463,16 +463,21 @@ static int sd_init_72a(struct gspca_dev *gspca_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rev 72a only */
|
|
||||||
static void setbrightness(struct gspca_dev *gspca_dev, s32 val)
|
static void setbrightness(struct gspca_dev *gspca_dev, s32 val)
|
||||||
{
|
{
|
||||||
|
struct sd *sd = (struct sd *) gspca_dev;
|
||||||
struct usb_device *dev = gspca_dev->dev;
|
struct usb_device *dev = gspca_dev->dev;
|
||||||
|
__u16 reg;
|
||||||
|
|
||||||
/* offsets for white balance */
|
if (sd->chip_revision == Rev012A)
|
||||||
reg_w_val(dev, 0x8611, val); /* R */
|
reg = 0x8610;
|
||||||
reg_w_val(dev, 0x8612, val); /* Gr */
|
else
|
||||||
reg_w_val(dev, 0x8613, val); /* B */
|
reg = 0x8611;
|
||||||
reg_w_val(dev, 0x8614, val); /* Gb */
|
|
||||||
|
reg_w_val(dev, reg + 0, val); /* R */
|
||||||
|
reg_w_val(dev, reg + 1, val); /* Gr */
|
||||||
|
reg_w_val(dev, reg + 2, val); /* B */
|
||||||
|
reg_w_val(dev, reg + 3, val); /* Gb */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setwhite(struct gspca_dev *gspca_dev, s32 white, s32 contrast)
|
static void setwhite(struct gspca_dev *gspca_dev, s32 white, s32 contrast)
|
||||||
@@ -814,6 +819,8 @@ static int sd_init_controls_12a(struct gspca_dev *gspca_dev)
|
|||||||
v4l2_ctrl_handler_init(hdl, 3);
|
v4l2_ctrl_handler_init(hdl, 3);
|
||||||
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
|
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
|
||||||
V4L2_CID_HUE, 1, 0x7f, 1, 0x40);
|
V4L2_CID_HUE, 1, 0x7f, 1, 0x40);
|
||||||
|
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
|
||||||
|
V4L2_CID_BRIGHTNESS, -128, 127, 1, 0);
|
||||||
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
|
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
|
||||||
V4L2_CID_EXPOSURE, 1, EXPOSURE_MAX, 1, 700);
|
V4L2_CID_EXPOSURE, 1, EXPOSURE_MAX, 1, 700);
|
||||||
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
|
v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
|
||||||
|
Reference in New Issue
Block a user