summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Bugge <marbugge@cisco.com>2013-12-20 06:02:24 -0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:55:31 +0900
commitf0b30685cf32fe1584c03c97ef9cde78a8b6db50 (patch)
tree7043fa0357f074c03b3b8f24ea7735a892f350f5
parent76fd7d99a5a4c175507f3f5a5b58e5d753249371 (diff)
downloadlinux-3.10-f0b30685cf32fe1584c03c97ef9cde78a8b6db50.tar.gz
linux-3.10-f0b30685cf32fe1584c03c97ef9cde78a8b6db50.tar.bz2
linux-3.10-f0b30685cf32fe1584c03c97ef9cde78a8b6db50.zip
upstream: [media] adv7842: obtain free-run mode from the platform_data
The free-run mode can be board-specific. Also updated the platform_data in ezkit to ensure that what was the old default value is now explicitly specified, so the behavior for that board is unchanged. Signed-off-by: Martin Bugge <marbugge@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--arch/blackfin/mach-bf609/boards/ezkit.c2
-rw-r--r--drivers/media/i2c/adv7842.c11
-rw-r--r--include/media/adv7842.h14
3 files changed, 22 insertions, 5 deletions
diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c
index d95c869eb82..b7aeb2bfdbd 100644
--- a/arch/blackfin/mach-bf609/boards/ezkit.c
+++ b/arch/blackfin/mach-bf609/boards/ezkit.c
@@ -1002,6 +1002,8 @@ static struct adv7842_platform_data adv7842_data = {
.ain_sel = ADV7842_AIN10_11_12_NC_SYNC_4_1,
.prim_mode = ADV7842_PRIM_MODE_SDP,
.vid_std_select = ADV7842_SDP_VID_STD_CVBS_SD_4x1,
+ .hdmi_free_run_enable = 1,
+ .sdp_free_run_auto = 1,
.i2c_sdp_io = 0x40,
.i2c_sdp = 0x41,
.i2c_cp = 0x42,
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 890095b389a..a630912fa99 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -1624,8 +1624,6 @@ static void select_input(struct v4l2_subdev *sd,
/* deinterlacer enabled and 3D comb */
sdp_write_and_or(sd, 0x12, 0xf6, 0x09);
- sdp_write(sd, 0xdd, 0x08); /* free run auto */
-
break;
case ADV7842_MODE_COMP:
@@ -2538,7 +2536,14 @@ static int adv7842_core_init(struct v4l2_subdev *sd)
pdata->drive_strength.sync);
/* HDMI free run */
- cp_write(sd, 0xba, (pdata->hdmi_free_run_mode << 1) | 0x01);
+ cp_write_and_or(sd, 0xba, 0xfc, pdata->hdmi_free_run_enable |
+ (pdata->hdmi_free_run_mode << 1));
+
+ /* SPD free run */
+ sdp_write_and_or(sd, 0xdd, 0xf0, pdata->sdp_free_run_force |
+ (pdata->sdp_free_run_cbar_en << 1) |
+ (pdata->sdp_free_run_man_col_en << 2) |
+ (pdata->sdp_free_run_force << 3));
/* TODO from platform data */
cp_write(sd, 0x69, 0x14); /* Enable CP CSC */
diff --git a/include/media/adv7842.h b/include/media/adv7842.h
index a4851bff8fa..772cdecfa71 100644
--- a/include/media/adv7842.h
+++ b/include/media/adv7842.h
@@ -192,8 +192,18 @@ struct adv7842_platform_data {
unsigned sd_ram_size; /* ram size in MB */
unsigned sd_ram_ddr:1; /* ddr or sdr sdram */
- /* Free run */
- unsigned hdmi_free_run_mode;
+ /* HDMI free run, CP-reg 0xBA */
+ unsigned hdmi_free_run_enable:1;
+ /* 0 = Mode 0: run when there is no TMDS clock
+ 1 = Mode 1: run when there is no TMDS clock or the
+ video resolution does not match programmed one. */
+ unsigned hdmi_free_run_mode:1;
+
+ /* SDP free run, CP-reg 0xDD */
+ unsigned sdp_free_run_auto:1;
+ unsigned sdp_free_run_man_col_en:1;
+ unsigned sdp_free_run_cbar_en:1;
+ unsigned sdp_free_run_force:1;
struct adv7842_sdp_csc_coeff sdp_csc_coeff;