]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6270): V4L: Honor dev->ctl_invert when setting up the decoder in saa7134
authorMaxim Levitsky <maximlevitsky@gmail.com>
Thu, 27 Sep 2007 23:34:20 +0000 (20:34 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 03:02:59 +0000 (00:02 -0300)
When user sets dev->ctl_invert, driver writes negative values to
SAA7134_DEC_LUMA_CONTRAST and SAA7134_DEC_CHROMA_SATURATION,
but general code that initializes decorder ignores that

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/saa7134/saa7134-video.c

index 27c659cd0f30db9eaf567aec19fd703960a2c939..525b5b77c13a8fed3e9b1c4d739a99905ec01f7e 100644 (file)
@@ -584,9 +584,13 @@ static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm)
        saa_writeb(SAA7134_SYNC_CTRL,             sync_control);
        saa_writeb(SAA7134_LUMA_CTRL,             luma_control);
        saa_writeb(SAA7134_DEC_LUMA_BRIGHT,       dev->ctl_bright);
-       saa_writeb(SAA7134_DEC_LUMA_CONTRAST,     dev->ctl_contrast);
 
-       saa_writeb(SAA7134_DEC_CHROMA_SATURATION, dev->ctl_saturation);
+       saa_writeb(SAA7134_DEC_LUMA_CONTRAST,
+               dev->ctl_invert ? -dev->ctl_contrast : dev->ctl_contrast);
+
+       saa_writeb(SAA7134_DEC_CHROMA_SATURATION,
+               dev->ctl_invert ? -dev->ctl_saturation : dev->ctl_saturation);
+
        saa_writeb(SAA7134_DEC_CHROMA_HUE,        dev->ctl_hue);
        saa_writeb(SAA7134_CHROMA_CTRL1,          norm->chroma_ctrl1);
        saa_writeb(SAA7134_CHROMA_GAIN,           norm->chroma_gain);