[media] adv7604: sync polarities from platform data
authorMartin Bugge <marbugge@cisco.com>
Fri, 20 Dec 2013 08:14:57 +0000 (05:14 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 7 Jan 2014 08:16:54 +0000 (06:16 -0200)
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/adv7604.c
include/media/adv7604.h

index 0bc9e1a8c07eaf5095cdc4f4b6db19c5ed9e5dad..be9699e287381d2d74b7b5dac82285d4dfaecf45 100644 (file)
@@ -2126,9 +2126,10 @@ static int adv7604_core_init(struct v4l2_subdev *sd)
                                        pdata->replicate_av_codes << 1 |
                                        pdata->invert_cbcr << 0);
 
-       /* TODO from platform data */
        cp_write(sd, 0x69, 0x30);   /* Enable CP CSC */
-       io_write(sd, 0x06, 0xa6);   /* positive VS and HS */
+
+       /* VS, HS polarities */
+       io_write(sd, 0x06, 0xa0 | pdata->inv_vs_pol << 2 | pdata->inv_hs_pol << 1);
 
        /* Adjust drive strength */
        io_write(sd, 0x14, 0x40 | pdata->dr_str_data << 4 |
index baf7250ee8a141916defe4ac9517467cc4437e17..d262a3a922bdd4f0cd0dbf4eaf3e1d3c1769f3b2 100644 (file)
@@ -113,6 +113,10 @@ struct adv7604_platform_data {
        unsigned replicate_av_codes:1;
        unsigned invert_cbcr:1;
 
+       /* IO register 0x06 */
+       unsigned inv_vs_pol:1;
+       unsigned inv_hs_pol:1;
+
        /* IO register 0x14 */
        enum adv7604_drive_strength dr_str_data;
        enum adv7604_drive_strength dr_str_clk;