Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174153
b: refs/heads/master
c: 2d19a2c
h: refs/heads/master
i:
  174151: 72b9c30
v: v3
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent 3ed4b05 commit 6cc2991
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4af85668588e249d98957a41030c3a2d2acc87e5
refs/heads/master: 2d19a2c1186d86e38b51ef59e4b9678f8ad7acf4
34 changes: 22 additions & 12 deletions trunk/drivers/media/video/gspca/ov534.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
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,
Expand All @@ -115,7 +115,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setbrightness,
.get = sd_getbrightness,
},
{
{ /* 1 */
{
.id = V4L2_CID_CONTRAST,
.type = V4L2_CTRL_TYPE_INTEGER,
Expand All @@ -129,7 +129,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setcontrast,
.get = sd_getcontrast,
},
{
{ /* 2 */
{
.id = V4L2_CID_GAIN,
.type = V4L2_CTRL_TYPE_INTEGER,
Expand All @@ -143,7 +143,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setgain,
.get = sd_getgain,
},
{
{ /* 3 */
{
.id = V4L2_CID_EXPOSURE,
.type = V4L2_CTRL_TYPE_INTEGER,
Expand All @@ -157,7 +157,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setexposure,
.get = sd_getexposure,
},
{
{ /* 4 */
{
.id = V4L2_CID_RED_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
Expand All @@ -171,7 +171,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setredblc,
.get = sd_getredblc,
},
{
{ /* 5 */
{
.id = V4L2_CID_BLUE_BALANCE,
.type = V4L2_CTRL_TYPE_INTEGER,
Expand All @@ -185,7 +185,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setblueblc,
.get = sd_getblueblc,
},
{
{ /* 6 */
{
.id = V4L2_CID_HUE,
.type = V4L2_CTRL_TYPE_INTEGER,
Expand All @@ -199,7 +199,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_sethue,
.get = sd_gethue,
},
{
{ /* 7 */
{
.id = V4L2_CID_AUTOGAIN,
.type = V4L2_CTRL_TYPE_BOOLEAN,
Expand All @@ -213,7 +213,8 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setautogain,
.get = sd_getautogain,
},
{
#define AWB_IDX 8
{ /* 8 */
{
.id = V4L2_CID_AUTO_WHITE_BALANCE,
.type = V4L2_CTRL_TYPE_BOOLEAN,
Expand All @@ -227,7 +228,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setawb,
.get = sd_getawb,
},
{
{ /* 9 */
{
.id = V4L2_CID_SHARPNESS,
.type = V4L2_CTRL_TYPE_INTEGER,
Expand All @@ -241,7 +242,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_setsharpness,
.get = sd_getsharpness,
},
{
{ /* 10 */
{
.id = V4L2_CID_HFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
Expand All @@ -255,7 +256,7 @@ static struct ctrl sd_ctrls_ov772x[] = {
.set = sd_sethflip,
.get = sd_gethflip,
},
{
{ /* 11 */
{
.id = V4L2_CID_VFLIP,
.type = V4L2_CTRL_TYPE_BOOLEAN,
Expand Down Expand Up @@ -1237,6 +1238,8 @@ static int sd_config(struct gspca_dev *gspca_dev,
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
Expand Down Expand Up @@ -1606,6 +1609,13 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val)
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;
Expand Down

0 comments on commit 6cc2991

Please sign in to comment.