aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-11-30 07:15:21 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-18 10:32:55 -0500
commitee61cd9f12382caf819ae4a40089b49f90dc2184 (patch)
tree04120af69f00667f49b7734ec0a4fc0011ee1301
parentcdf472d32a5a1a99c54c3df5c155785db2e529c3 (diff)
[media] cx25840: more cx23888 register address changes
The cx23888 also moves the following registers around: !cx23888 cx23888 -------- ------- 0x418, 0x41c 0x434, 0x438 0x420 0x418 (expect for bit 29 which has a different meaning) 0x478 0x454 Also drop the set_input code where the scaler is changed: this does not belong here, changing the input should not change the scaler. And that's besides the fact that that code is plain wrong. After this change the cx23888 behaves much better. In particular, calling set_input no longer changes the saturation to 0, causing a grayscale image. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/i2c/cx25840/cx25840-core.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index ec11ba74d37c..a741c30a9a0e 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -559,7 +559,10 @@ static void cx23885_initialize(struct i2c_client *client)
559 cx25840_write4(client, 0x414, 0x00107d12); 559 cx25840_write4(client, 0x414, 0x00107d12);
560 560
561 /* Chroma */ 561 /* Chroma */
562 cx25840_write4(client, 0x420, 0x3d008282); 562 if (is_cx23888(state))
563 cx25840_write4(client, 0x418, 0x1d008282);
564 else
565 cx25840_write4(client, 0x420, 0x3d008282);
563 566
564 /* 567 /*
565 * Aux PLL 568 * Aux PLL
@@ -673,7 +676,10 @@ static void cx23885_initialize(struct i2c_client *client)
673 cx25840_write4(client, 0x130, 0x0); 676 cx25840_write4(client, 0x130, 0x0);
674 677
675 /* Undocumented */ 678 /* Undocumented */
676 cx25840_write4(client, 0x478, 0x6628021F); 679 if (is_cx23888(state))
680 cx25840_write4(client, 0x454, 0x6628021F);
681 else
682 cx25840_write4(client, 0x478, 0x6628021F);
677 683
678 /* AFE_CLK_OUT_CTRL - Select the clock output source as output */ 684 /* AFE_CLK_OUT_CTRL - Select the clock output source as output */
679 cx25840_write4(client, 0x144, 0x5); 685 cx25840_write4(client, 0x144, 0x5);
@@ -1106,25 +1112,10 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp
1106 cx25840_write4(client, 0x410, 0xffff0dbf); 1112 cx25840_write4(client, 0x410, 0xffff0dbf);
1107 cx25840_write4(client, 0x414, 0x00137d03); 1113 cx25840_write4(client, 0x414, 0x00137d03);
1108 1114
1109 /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is
1110 CHROMA_CTRL */
1111 if (is_cx23888(state))
1112 cx25840_write4(client, 0x418, 0x01008080);
1113 else
1114 cx25840_write4(client, 0x418, 0x01000000);
1115
1116 cx25840_write4(client, 0x41c, 0x00000000);
1117
1118 /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is
1119 CRUSH_CTRL */
1120 if (is_cx23888(state))
1121 cx25840_write4(client, 0x420, 0x001c3e0f);
1122 else
1123 cx25840_write4(client, 0x420, 0x001c8282);
1124
1125 cx25840_write4(client, state->vbi_regs_offset + 0x42c, 0x42600000); 1115 cx25840_write4(client, state->vbi_regs_offset + 0x42c, 0x42600000);
1126 cx25840_write4(client, state->vbi_regs_offset + 0x430, 0x0000039b); 1116 cx25840_write4(client, state->vbi_regs_offset + 0x430, 0x0000039b);
1127 cx25840_write4(client, state->vbi_regs_offset + 0x438, 0x00000000); 1117 cx25840_write4(client, state->vbi_regs_offset + 0x438, 0x00000000);
1118
1128 cx25840_write4(client, state->vbi_regs_offset + 0x440, 0xF8E3E824); 1119 cx25840_write4(client, state->vbi_regs_offset + 0x440, 0xF8E3E824);
1129 cx25840_write4(client, state->vbi_regs_offset + 0x444, 0x401040dc); 1120 cx25840_write4(client, state->vbi_regs_offset + 0x444, 0x401040dc);
1130 cx25840_write4(client, state->vbi_regs_offset + 0x448, 0xcd3f02a0); 1121 cx25840_write4(client, state->vbi_regs_offset + 0x448, 0xcd3f02a0);
@@ -1425,14 +1416,20 @@ static int cx25840_set_fmt(struct v4l2_subdev *sd,
1425 fmt->width, fmt->height, HSC, VSC); 1416 fmt->width, fmt->height, HSC, VSC);
1426 1417
1427 /* HSCALE=HSC */ 1418 /* HSCALE=HSC */
1428 cx25840_write(client, 0x418, HSC & 0xff); 1419 if (is_cx23888(state)) {
1429 cx25840_write(client, 0x419, (HSC >> 8) & 0xff); 1420 cx25840_write4(client, 0x434, HSC | (1 << 24));
1430 cx25840_write(client, 0x41a, HSC >> 16); 1421 /* VSCALE=VSC VS_INTRLACE=1 VFILT=filter */
1431 /* VSCALE=VSC */ 1422 cx25840_write4(client, 0x438, VSC | (1 << 19) | (filter << 16));
1432 cx25840_write(client, 0x41c, VSC & 0xff); 1423 } else {
1433 cx25840_write(client, 0x41d, VSC >> 8); 1424 cx25840_write(client, 0x418, HSC & 0xff);
1434 /* VS_INTRLACE=1 VFILT=filter */ 1425 cx25840_write(client, 0x419, (HSC >> 8) & 0xff);
1435 cx25840_write(client, 0x41e, 0x8 | filter); 1426 cx25840_write(client, 0x41a, HSC >> 16);
1427 /* VSCALE=VSC */
1428 cx25840_write(client, 0x41c, VSC & 0xff);
1429 cx25840_write(client, 0x41d, VSC >> 8);
1430 /* VS_INTRLACE=1 VFILT=filter */
1431 cx25840_write(client, 0x41e, 0x8 | filter);
1432 }
1436 return 0; 1433 return 0;
1437} 1434}
1438 1435