Commit 34e59a7d authored by Guilherme Herrmann Destefani's avatar Guilherme Herrmann Destefani Committed by Mauro Carvalho Chehab

[media] bt8xx: Add video4linux control V4L2_CID_COLOR_KILLER

Added V4L2_CID_COLOR_KILLER control to the bt8xx driver.
The control V4L2_CID_PRIVATE_CHROMA_AGC was changed too because
with this change the bttv driver must touch two bits in the
SC Loop Control Registers, for controls V4L2_CID_COLOR_KILLER
and V4L2_CID_PRIVATE_CHROMA_AGC.
Signed-off-by: default avatarGuilherme Herrmann Destefani <linuxtv@destefani.eng.br>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 38a7996c
...@@ -668,6 +668,12 @@ static const struct v4l2_queryctrl bttv_ctls[] = { ...@@ -668,6 +668,12 @@ static const struct v4l2_queryctrl bttv_ctls[] = {
.default_value = 32768, .default_value = 32768,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
},{ },{
.id = V4L2_CID_COLOR_KILLER,
.name = "Color killer",
.minimum = 0,
.maximum = 1,
.type = V4L2_CTRL_TYPE_BOOLEAN,
}, {
.id = V4L2_CID_HUE, .id = V4L2_CID_HUE,
.name = "Hue", .name = "Hue",
.minimum = 0, .minimum = 0,
...@@ -1474,6 +1480,9 @@ static int bttv_g_ctrl(struct file *file, void *priv, ...@@ -1474,6 +1480,9 @@ static int bttv_g_ctrl(struct file *file, void *priv,
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
c->value = btv->saturation; c->value = btv->saturation;
break; break;
case V4L2_CID_COLOR_KILLER:
c->value = btv->opt_color_killer;
break;
case V4L2_CID_AUDIO_MUTE: case V4L2_CID_AUDIO_MUTE:
case V4L2_CID_AUDIO_VOLUME: case V4L2_CID_AUDIO_VOLUME:
...@@ -1526,7 +1535,6 @@ static int bttv_s_ctrl(struct file *file, void *f, ...@@ -1526,7 +1535,6 @@ static int bttv_s_ctrl(struct file *file, void *f,
struct v4l2_control *c) struct v4l2_control *c)
{ {
int err; int err;
int val;
struct bttv_fh *fh = f; struct bttv_fh *fh = f;
struct bttv *btv = fh->btv; struct bttv *btv = fh->btv;
...@@ -1547,6 +1555,16 @@ static int bttv_s_ctrl(struct file *file, void *f, ...@@ -1547,6 +1555,16 @@ static int bttv_s_ctrl(struct file *file, void *f,
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
bt848_sat(btv, c->value); bt848_sat(btv, c->value);
break; break;
case V4L2_CID_COLOR_KILLER:
btv->opt_color_killer = c->value;
if (btv->opt_color_killer) {
btor(BT848_SCLOOP_CKILL, BT848_E_SCLOOP);
btor(BT848_SCLOOP_CKILL, BT848_O_SCLOOP);
} else {
btand(~BT848_SCLOOP_CKILL, BT848_E_SCLOOP);
btand(~BT848_SCLOOP_CKILL, BT848_O_SCLOOP);
}
break;
case V4L2_CID_AUDIO_MUTE: case V4L2_CID_AUDIO_MUTE:
audio_mute(btv, c->value); audio_mute(btv, c->value);
/* fall through */ /* fall through */
...@@ -1564,9 +1582,13 @@ static int bttv_s_ctrl(struct file *file, void *f, ...@@ -1564,9 +1582,13 @@ static int bttv_s_ctrl(struct file *file, void *f,
case V4L2_CID_PRIVATE_CHROMA_AGC: case V4L2_CID_PRIVATE_CHROMA_AGC:
btv->opt_chroma_agc = c->value; btv->opt_chroma_agc = c->value;
val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0; if (btv->opt_chroma_agc) {
btwrite(val, BT848_E_SCLOOP); btor(BT848_SCLOOP_CAGC, BT848_E_SCLOOP);
btwrite(val, BT848_O_SCLOOP); btor(BT848_SCLOOP_CAGC, BT848_O_SCLOOP);
} else {
btand(~BT848_SCLOOP_CAGC, BT848_E_SCLOOP);
btand(~BT848_SCLOOP_CAGC, BT848_O_SCLOOP);
}
break; break;
case V4L2_CID_PRIVATE_COMBFILTER: case V4L2_CID_PRIVATE_COMBFILTER:
btv->opt_combfilter = c->value; btv->opt_combfilter = c->value;
......
...@@ -429,6 +429,7 @@ struct bttv { ...@@ -429,6 +429,7 @@ struct bttv {
int opt_lumafilter; int opt_lumafilter;
int opt_automute; int opt_automute;
int opt_chroma_agc; int opt_chroma_agc;
int opt_color_killer;
int opt_adc_crush; int opt_adc_crush;
int opt_vcr_hack; int opt_vcr_hack;
int opt_whitecrush_upper; int opt_whitecrush_upper;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment