Skip to content

Commit

Permalink
[media] cx25840: fix regression in analog support hue/saturation cont…
Browse files Browse the repository at this point in the history
…rols

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 <[email protected]>
Thanks-to: Steven Toth <[email protected]>
Signed-off-by: Devin Heitmueler <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
dheitmueller authored and Mauro Carvalho Chehab committed Jul 6, 2012
1 parent ba50e7e commit e6d0db1
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,9 +1106,23 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp

cx25840_write4(client, 0x410, 0xffff0dbf);
cx25840_write4(client, 0x414, 0x00137d03);
cx25840_write4(client, 0x418, 0x01008080);

/* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is
CHROMA_CTRL */
if (is_cx23888(state))
cx25840_write4(client, 0x418, 0x01008080);
else
cx25840_write4(client, 0x418, 0x01000000);

cx25840_write4(client, 0x41c, 0x00000000);
cx25840_write4(client, 0x420, 0x001c3e0f);

/* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is
CRUSH_CTRL */
if (is_cx23888(state))
cx25840_write4(client, 0x420, 0x001c3e0f);
else
cx25840_write4(client, 0x420, 0x001c8282);

cx25840_write4(client, 0x42c, 0x42600000);
cx25840_write4(client, 0x430, 0x0000039b);
cx25840_write4(client, 0x438, 0x00000000);
Expand Down Expand Up @@ -1315,6 +1329,7 @@ static int set_v4lstd(struct i2c_client *client)
static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct v4l2_subdev *sd = to_sd(ctrl);
struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);

switch (ctrl->id) {
Expand All @@ -1327,12 +1342,20 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl)
break;

case V4L2_CID_SATURATION:
cx25840_write(client, 0x420, ctrl->val << 1);
cx25840_write(client, 0x421, ctrl->val << 1);
if (is_cx23888(state)) {
cx25840_write(client, 0x418, ctrl->val << 1);
cx25840_write(client, 0x419, ctrl->val << 1);
} else {
cx25840_write(client, 0x420, ctrl->val << 1);
cx25840_write(client, 0x421, ctrl->val << 1);
}
break;

case V4L2_CID_HUE:
cx25840_write(client, 0x422, ctrl->val);
if (is_cx23888(state))
cx25840_write(client, 0x41a, ctrl->val);
else
cx25840_write(client, 0x422, ctrl->val);
break;

default:
Expand Down

0 comments on commit e6d0db1

Please sign in to comment.