static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
static struct ctrl sd_ctrls_ov772x[] = {
- {
+ { /* 0 */
{
.id = V4L2_CID_BRIGHTNESS,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setbrightness,
.get = sd_getbrightness,
},
- {
+ { /* 1 */
{
.id = V4L2_CID_CONTRAST,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setcontrast,
.get = sd_getcontrast,
},
- {
+ { /* 2 */
{
.id = V4L2_CID_GAIN,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setgain,
.get = sd_getgain,
},
- {
+ { /* 3 */
{
.id = V4L2_CID_EXPOSURE,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setexposure,
.get = sd_getexposure,
},
- {
+ { /* 4 */
{
.id = V4L2_CID_RED_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setredblc,
.get = sd_getredblc,
},
- {
+ { /* 5 */
{
.id = V4L2_CID_BLUE_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setblueblc,
.get = sd_getblueblc,
},
- {
+ { /* 6 */
{
.id = V4L2_CID_HUE,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_sethue,
.get = sd_gethue,
},
- {
+ { /* 7 */
{
.id = V4L2_CID_AUTOGAIN,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.set = sd_setautogain,
.get = sd_getautogain,
},
- {
+#define AWB_IDX 8
+ { /* 8 */
{
.id = V4L2_CID_AUTO_WHITE_BALANCE,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.set = sd_setawb,
.get = sd_getawb,
},
- {
+ { /* 9 */
{
.id = V4L2_CID_SHARPNESS,
.type = V4L2_CTRL_TYPE_INTEGER,
.set = sd_setsharpness,
.get = sd_getsharpness,
},
- {
+ { /* 10 */
{
.id = V4L2_CID_HFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
.set = sd_sethflip,
.get = sd_gethflip,
},
- {
+ { /* 11 */
{
.id = V4L2_CID_VFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
sd->hue = HUE_DEF;
#if AUTOGAIN_DEF != 0
sd->autogain = AUTOGAIN_DEF;
+#else
+ gspca_dev->ctrl_inac |= (1 << AWB_IDX);
#endif
#if AWB_DEF != 0
sd->awb = AWB_DEF
struct sd *sd = (struct sd *) gspca_dev;
sd->autogain = val;
+
+ /* the auto white balance control works only when auto gain is set */
+ if (val)
+ gspca_dev->ctrl_inac &= ~(1 << AWB_IDX);
+ else
+ gspca_dev->ctrl_inac |= (1 << AWB_IDX);
+
if (gspca_dev->streaming)
setautogain(gspca_dev);
return 0;