diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2012-07-01 15:15:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-06 18:36:31 -0400 |
commit | e6d0db1d47c0ac4d61c842a95988cbe8712df447 (patch) | |
tree | 42db042cb203310bf5c99eaa71d802ee8f17fe41 /drivers/media/video/cx25840 | |
parent | ba50e7e16b86e25048290b682f7a4e09e069d321 (diff) |
[media] cx25840: fix regression in analog support hue/saturation controls
Fix regression in HVR-1800 analog support hue/saturation controls.
The changes made for the cx23888 caused regressions in the analog
support for cx23885/cx23887 based boards (partly due to changes in the
locations of the hue/saturation controls). As a result the wrong
registers were being overwritten.
Add code to use the correct registers if it's a cx23888
Validated with the following boards:
HVR-1800 retail (0070:7801)
HVR-1800 OEM (0070:7809)
HVR-1850 retail (0070:8541)
Thanks to Steven Toth and Hauppauge for loaning me various boards to
regression test with.
Reported-by: Jonathan <sitten74490@mypacks.net>
Thanks-to: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Devin Heitmueler <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index a82b7045f8c9..e12b3b0d7f35 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -1106,9 +1106,23 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
1106 | 1106 | ||
1107 | cx25840_write4(client, 0x410, 0xffff0dbf); | 1107 | cx25840_write4(client, 0x410, 0xffff0dbf); |
1108 | cx25840_write4(client, 0x414, 0x00137d03); | 1108 | cx25840_write4(client, 0x414, 0x00137d03); |
1109 | cx25840_write4(client, 0x418, 0x01008080); | 1109 | |
1110 | /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is | ||
1111 | CHROMA_CTRL */ | ||
1112 | if (is_cx23888(state)) | ||
1113 | cx25840_write4(client, 0x418, 0x01008080); | ||
1114 | else | ||
1115 | cx25840_write4(client, 0x418, 0x01000000); | ||
1116 | |||
1110 | cx25840_write4(client, 0x41c, 0x00000000); | 1117 | cx25840_write4(client, 0x41c, 0x00000000); |
1111 | cx25840_write4(client, 0x420, 0x001c3e0f); | 1118 | |
1119 | /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is | ||
1120 | CRUSH_CTRL */ | ||
1121 | if (is_cx23888(state)) | ||
1122 | cx25840_write4(client, 0x420, 0x001c3e0f); | ||
1123 | else | ||
1124 | cx25840_write4(client, 0x420, 0x001c8282); | ||
1125 | |||
1112 | cx25840_write4(client, 0x42c, 0x42600000); | 1126 | cx25840_write4(client, 0x42c, 0x42600000); |
1113 | cx25840_write4(client, 0x430, 0x0000039b); | 1127 | cx25840_write4(client, 0x430, 0x0000039b); |
1114 | cx25840_write4(client, 0x438, 0x00000000); | 1128 | cx25840_write4(client, 0x438, 0x00000000); |
@@ -1315,6 +1329,7 @@ static int set_v4lstd(struct i2c_client *client) | |||
1315 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | 1329 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) |
1316 | { | 1330 | { |
1317 | struct v4l2_subdev *sd = to_sd(ctrl); | 1331 | struct v4l2_subdev *sd = to_sd(ctrl); |
1332 | struct cx25840_state *state = to_state(sd); | ||
1318 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1333 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1319 | 1334 | ||
1320 | switch (ctrl->id) { | 1335 | switch (ctrl->id) { |
@@ -1327,12 +1342,20 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | |||
1327 | break; | 1342 | break; |
1328 | 1343 | ||
1329 | case V4L2_CID_SATURATION: | 1344 | case V4L2_CID_SATURATION: |
1330 | cx25840_write(client, 0x420, ctrl->val << 1); | 1345 | if (is_cx23888(state)) { |
1331 | cx25840_write(client, 0x421, ctrl->val << 1); | 1346 | cx25840_write(client, 0x418, ctrl->val << 1); |
1347 | cx25840_write(client, 0x419, ctrl->val << 1); | ||
1348 | } else { | ||
1349 | cx25840_write(client, 0x420, ctrl->val << 1); | ||
1350 | cx25840_write(client, 0x421, ctrl->val << 1); | ||
1351 | } | ||
1332 | break; | 1352 | break; |
1333 | 1353 | ||
1334 | case V4L2_CID_HUE: | 1354 | case V4L2_CID_HUE: |
1335 | cx25840_write(client, 0x422, ctrl->val); | 1355 | if (is_cx23888(state)) |
1356 | cx25840_write(client, 0x41a, ctrl->val); | ||
1357 | else | ||
1358 | cx25840_write(client, 0x422, ctrl->val); | ||
1336 | break; | 1359 | break; |
1337 | 1360 | ||
1338 | default: | 1361 | default: |