aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorGuilherme Herrmann Destefani <linuxtv@destefani.eng.br>2012-09-25 17:10:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-06 11:14:01 -0400
commit34e59a7d45950b1a03e498d34c1baf4998218cd7 (patch)
tree357721b0115314a63c060f282b4c2353e3f8dbc1 /drivers/media
parent38a7996cbb26ddd6b595e2fafa9742aefcb2f115 (diff)
[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: Guilherme Herrmann Destefani <linuxtv@destefani.eng.br> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c30
-rw-r--r--drivers/media/pci/bt8xx/bttvp.h1
2 files changed, 27 insertions, 4 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 16f5ca23698c..8bad444c86f2 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -668,6 +668,12 @@ static const struct v4l2_queryctrl bttv_ctls[] = {
668 .default_value = 32768, 668 .default_value = 32768,
669 .type = V4L2_CTRL_TYPE_INTEGER, 669 .type = V4L2_CTRL_TYPE_INTEGER,
670 },{ 670 },{
671 .id = V4L2_CID_COLOR_KILLER,
672 .name = "Color killer",
673 .minimum = 0,
674 .maximum = 1,
675 .type = V4L2_CTRL_TYPE_BOOLEAN,
676 }, {
671 .id = V4L2_CID_HUE, 677 .id = V4L2_CID_HUE,
672 .name = "Hue", 678 .name = "Hue",
673 .minimum = 0, 679 .minimum = 0,
@@ -1474,6 +1480,9 @@ static int bttv_g_ctrl(struct file *file, void *priv,
1474 case V4L2_CID_SATURATION: 1480 case V4L2_CID_SATURATION:
1475 c->value = btv->saturation; 1481 c->value = btv->saturation;
1476 break; 1482 break;
1483 case V4L2_CID_COLOR_KILLER:
1484 c->value = btv->opt_color_killer;
1485 break;
1477 1486
1478 case V4L2_CID_AUDIO_MUTE: 1487 case V4L2_CID_AUDIO_MUTE:
1479 case V4L2_CID_AUDIO_VOLUME: 1488 case V4L2_CID_AUDIO_VOLUME:
@@ -1526,7 +1535,6 @@ static int bttv_s_ctrl(struct file *file, void *f,
1526 struct v4l2_control *c) 1535 struct v4l2_control *c)
1527{ 1536{
1528 int err; 1537 int err;
1529 int val;
1530 struct bttv_fh *fh = f; 1538 struct bttv_fh *fh = f;
1531 struct bttv *btv = fh->btv; 1539 struct bttv *btv = fh->btv;
1532 1540
@@ -1547,6 +1555,16 @@ static int bttv_s_ctrl(struct file *file, void *f,
1547 case V4L2_CID_SATURATION: 1555 case V4L2_CID_SATURATION:
1548 bt848_sat(btv, c->value); 1556 bt848_sat(btv, c->value);
1549 break; 1557 break;
1558 case V4L2_CID_COLOR_KILLER:
1559 btv->opt_color_killer = c->value;
1560 if (btv->opt_color_killer) {
1561 btor(BT848_SCLOOP_CKILL, BT848_E_SCLOOP);
1562 btor(BT848_SCLOOP_CKILL, BT848_O_SCLOOP);
1563 } else {
1564 btand(~BT848_SCLOOP_CKILL, BT848_E_SCLOOP);
1565 btand(~BT848_SCLOOP_CKILL, BT848_O_SCLOOP);
1566 }
1567 break;
1550 case V4L2_CID_AUDIO_MUTE: 1568 case V4L2_CID_AUDIO_MUTE:
1551 audio_mute(btv, c->value); 1569 audio_mute(btv, c->value);
1552 /* fall through */ 1570 /* fall through */
@@ -1564,9 +1582,13 @@ static int bttv_s_ctrl(struct file *file, void *f,
1564 1582
1565 case V4L2_CID_PRIVATE_CHROMA_AGC: 1583 case V4L2_CID_PRIVATE_CHROMA_AGC:
1566 btv->opt_chroma_agc = c->value; 1584 btv->opt_chroma_agc = c->value;
1567 val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0; 1585 if (btv->opt_chroma_agc) {
1568 btwrite(val, BT848_E_SCLOOP); 1586 btor(BT848_SCLOOP_CAGC, BT848_E_SCLOOP);
1569 btwrite(val, BT848_O_SCLOOP); 1587 btor(BT848_SCLOOP_CAGC, BT848_O_SCLOOP);
1588 } else {
1589 btand(~BT848_SCLOOP_CAGC, BT848_E_SCLOOP);
1590 btand(~BT848_SCLOOP_CAGC, BT848_O_SCLOOP);
1591 }
1570 break; 1592 break;
1571 case V4L2_CID_PRIVATE_COMBFILTER: 1593 case V4L2_CID_PRIVATE_COMBFILTER:
1572 btv->opt_combfilter = c->value; 1594 btv->opt_combfilter = c->value;
diff --git a/drivers/media/pci/bt8xx/bttvp.h b/drivers/media/pci/bt8xx/bttvp.h
index 70fd4f23f605..9ec0adba236c 100644
--- a/drivers/media/pci/bt8xx/bttvp.h
+++ b/drivers/media/pci/bt8xx/bttvp.h
@@ -429,6 +429,7 @@ struct bttv {
429 int opt_lumafilter; 429 int opt_lumafilter;
430 int opt_automute; 430 int opt_automute;
431 int opt_chroma_agc; 431 int opt_chroma_agc;
432 int opt_color_killer;
432 int opt_adc_crush; 433 int opt_adc_crush;
433 int opt_vcr_hack; 434 int opt_vcr_hack;
434 int opt_whitecrush_upper; 435 int opt_whitecrush_upper;