提交 abe8cee7 编写于 作者: J Jean-François Moine 提交者: Mauro Carvalho Chehab

[media] gspca - sonixj: Adjust the contrast control

The contrast was too low. Higher values are better.
Signed-off-by: NJean-François Moine <moinejf@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 7d84a179
......@@ -159,7 +159,7 @@ static const struct ctrl sd_ctrls[NCTRLS] = {
#define CONTRAST_MAX 127
.maximum = CONTRAST_MAX,
.step = 1,
.default_value = 63,
.default_value = 20,
},
.set_control = setcontrast
},
......@@ -2021,13 +2021,13 @@ static void setcontrast(struct gspca_dev *gspca_dev)
u8 k2;
u8 contrast[6];
k2 = sd->ctrls[CONTRAST].val * 0x30 / (CONTRAST_MAX + 1)
+ 0x10; /* 10..40 */
k2 = sd->ctrls[CONTRAST].val * 37 / (CONTRAST_MAX + 1)
+ 37; /* 37..73 */
contrast[0] = (k2 + 1) / 2; /* red */
contrast[1] = 0;
contrast[2] = k2; /* green */
contrast[3] = 0;
contrast[4] = (k2 + 1) / 5; /* blue */
contrast[4] = k2 / 5; /* blue */
contrast[5] = 0;
reg_w(gspca_dev, 0x84, contrast, sizeof contrast);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册