aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
authoristvan_v@mailbox.hu <istvan_v@mailbox.hu>2011-07-11 10:07:43 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:01 -0400
commitbded70d296a976da1b52ff5d7f574551fbc503bb (patch)
treea18cb19387be5d3384edec9624ccd67f07238ce3 /drivers/media/video/cx88
parenteea16e3661f7177ba106780a2f6cbf373d73bab1 (diff)
[media] cx88: implemented luma notch filter control
The following patch adds a new control that makes it possible to set the luma notch filter type to finetune picture quality. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/cx88-core.c7
-rw-r--r--drivers/media/video/cx88/cx88-video.c15
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 20ad809568cf..fbcaa1c5b09d 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -636,6 +636,9 @@ int cx88_reset(struct cx88_core *core)
636 cx_write(MO_PCI_INTSTAT, 0xFFFFFFFF); // Clear PCI int 636 cx_write(MO_PCI_INTSTAT, 0xFFFFFFFF); // Clear PCI int
637 cx_write(MO_INT1_STAT, 0xFFFFFFFF); // Clear RISC int 637 cx_write(MO_INT1_STAT, 0xFFFFFFFF); // Clear RISC int
638 638
639 /* set default notch filter */
640 cx_andor(MO_HTOTAL, 0x1800, (HLNotchFilter4xFsc << 11));
641
639 /* Reset on-board parts */ 642 /* Reset on-board parts */
640 cx_write(MO_SRST_IO, 0); 643 cx_write(MO_SRST_IO, 0);
641 msleep(10); 644 msleep(10);
@@ -994,10 +997,10 @@ int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm)
994 // htotal 997 // htotal
995 tmp64 = norm_htotal(norm) * (u64)vdec_clock; 998 tmp64 = norm_htotal(norm) * (u64)vdec_clock;
996 do_div(tmp64, fsc8); 999 do_div(tmp64, fsc8);
997 htotal = (u32)tmp64 | (HLNotchFilter4xFsc << 11); 1000 htotal = (u32)tmp64;
998 dprintk(1,"set_tvnorm: MO_HTOTAL 0x%08x [old=0x%08x,htotal=%d]\n", 1001 dprintk(1,"set_tvnorm: MO_HTOTAL 0x%08x [old=0x%08x,htotal=%d]\n",
999 htotal, cx_read(MO_HTOTAL), (u32)tmp64); 1002 htotal, cx_read(MO_HTOTAL), (u32)tmp64);
1000 cx_write(MO_HTOTAL, htotal); 1003 cx_andor(MO_HTOTAL, 0x07ff, htotal);
1001 1004
1002 // vbi stuff, set vbi offset to 10 (for 20 Clk*2 pixels), this makes 1005 // vbi stuff, set vbi offset to 10 (for 20 Clk*2 pixels), this makes
1003 // the effective vbi offset ~244 samples, the same as the Bt8x8 1006 // the effective vbi offset ~244 samples, the same as the Bt8x8
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 516aa6ec1e82..60d28fdd7791 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -262,6 +262,20 @@ static const struct cx88_ctrl cx8800_ctls[] = {
262 .mask = 1 << 9, 262 .mask = 1 << 9,
263 .shift = 9, 263 .shift = 9,
264 }, { 264 }, {
265 .v = {
266 .id = V4L2_CID_BAND_STOP_FILTER,
267 .name = "Notch filter",
268 .minimum = 0,
269 .maximum = 3,
270 .step = 1,
271 .default_value = 0x0,
272 .type = V4L2_CTRL_TYPE_INTEGER,
273 },
274 .off = 0,
275 .reg = MO_HTOTAL,
276 .mask = 3 << 11,
277 .shift = 11,
278 }, {
265 /* --- audio --- */ 279 /* --- audio --- */
266 .v = { 280 .v = {
267 .id = V4L2_CID_AUDIO_MUTE, 281 .id = V4L2_CID_AUDIO_MUTE,
@@ -320,6 +334,7 @@ const u32 cx88_user_ctrls[] = {
320 V4L2_CID_SHARPNESS, 334 V4L2_CID_SHARPNESS,
321 V4L2_CID_CHROMA_AGC, 335 V4L2_CID_CHROMA_AGC,
322 V4L2_CID_COLOR_KILLER, 336 V4L2_CID_COLOR_KILLER,
337 V4L2_CID_BAND_STOP_FILTER,
323 0 338 0
324}; 339};
325EXPORT_SYMBOL(cx88_user_ctrls); 340EXPORT_SYMBOL(cx88_user_ctrls);