[media] adv7604: add hdmi driver strength adjustment
authorMikhail Khelik <mkhelik@cisco.com>
Fri, 20 Dec 2013 08:12:00 +0000 (05:12 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 7 Jan 2014 07:52:27 +0000 (05:52 -0200)
The driver strength is board dependent, so set it from the platform_data.

Signed-off-by: Mikhail Khelik <mkhelik@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 6372d316e50a7eb18d70b7b8c8643394233bfc08..00ce2716e3191d8b8d55cab73da9c6c580ad3c00 100644 (file)
@@ -1942,7 +1942,12 @@ static int adv7604_core_init(struct v4l2_subdev *sd)
        /* TODO from platform data */
        cp_write(sd, 0x69, 0x30);   /* Enable CP CSC */
        io_write(sd, 0x06, 0xa6);   /* positive VS and HS */
-       io_write(sd, 0x14, 0x7f);   /* Drive strength adjusted to max */
+
+       /* Adjust drive strength */
+       io_write(sd, 0x14, 0x40 | pdata->dr_str_data << 4 |
+                               pdata->dr_str_clk << 2 |
+                               pdata->dr_str_sync);
+
        cp_write(sd, 0xba, (pdata->hdmi_free_run_mode << 1) | 0x01); /* HDMI free run */
        cp_write(sd, 0xf3, 0xdc); /* Low threshold to enter/exit free run mode */
        cp_write(sd, 0xf9, 0x23); /*  STDI ch. 1 - LCVS change threshold -
index 0c96e169dbe3a792d24bb48aed1d6b86b22884b5..22fd1ac9d71b4b8a7712940270587e72e5a2e8dd 100644 (file)
@@ -78,6 +78,12 @@ enum adv7604_op_format_sel {
        ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a,
 };
 
+enum adv7604_drive_strength {
+       ADV7604_DR_STR_MEDIUM_LOW = 1,
+       ADV7604_DR_STR_MEDIUM_HIGH = 2,
+       ADV7604_DR_STR_HIGH = 3,
+};
+
 /* Platform dependent definition */
 struct adv7604_platform_data {
        /* connector - HDMI or DVI? */
@@ -110,6 +116,11 @@ struct adv7604_platform_data {
        unsigned replicate_av_codes:1;
        unsigned invert_cbcr:1;
 
+       /* IO register 0x14 */
+       enum adv7604_drive_strength dr_str_data;
+       enum adv7604_drive_strength dr_str_clk;
+       enum adv7604_drive_strength dr_str_sync;
+
        /* IO register 0x30 */
        unsigned output_bus_lsb_to_msb:1;