aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/au8522_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/au8522_decoder.c')
-rw-r--r--drivers/media/dvb/frontends/au8522_decoder.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c
index 7c6431fe33e0..2dc2723b724a 100644
--- a/drivers/media/dvb/frontends/au8522_decoder.c
+++ b/drivers/media/dvb/frontends/au8522_decoder.c
@@ -23,7 +23,6 @@
23/* Developer notes: 23/* Developer notes:
24 * 24 *
25 * VBI support is not yet working 25 * VBI support is not yet working
26 * Saturation and hue setting are not yet working
27 * Enough is implemented here for CVBS and S-Video inputs, but the actual 26 * Enough is implemented here for CVBS and S-Video inputs, but the actual
28 * analog demodulator code isn't implemented (not needed for xc5000 since it 27 * analog demodulator code isn't implemented (not needed for xc5000 since it
29 * has its own demodulator and outputs CVBS) 28 * has its own demodulator and outputs CVBS)
@@ -236,8 +235,10 @@ static void setup_decoder_defaults(struct au8522_state *state, u8 input_mode)
236 state->contrast = 0x79; 235 state->contrast = 0x79;
237 au8522_writereg(state, AU8522_TVDEC_SATURATION_CB_REG00CH, 0x80); 236 au8522_writereg(state, AU8522_TVDEC_SATURATION_CB_REG00CH, 0x80);
238 au8522_writereg(state, AU8522_TVDEC_SATURATION_CR_REG00DH, 0x80); 237 au8522_writereg(state, AU8522_TVDEC_SATURATION_CR_REG00DH, 0x80);
238 state->saturation = 0x80;
239 au8522_writereg(state, AU8522_TVDEC_HUE_H_REG00EH, 0x00); 239 au8522_writereg(state, AU8522_TVDEC_HUE_H_REG00EH, 0x00);
240 au8522_writereg(state, AU8522_TVDEC_HUE_L_REG00FH, 0x00); 240 au8522_writereg(state, AU8522_TVDEC_HUE_L_REG00FH, 0x00);
241 state->hue = 0x00;
241 242
242 /* Other decoder registers */ 243 /* Other decoder registers */
243 au8522_writereg(state, AU8522_TVDEC_INT_MASK_REG010H, 0x00); 244 au8522_writereg(state, AU8522_TVDEC_INT_MASK_REG010H, 0x00);
@@ -504,7 +505,19 @@ static int au8522_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
504 ctrl->value); 505 ctrl->value);
505 break; 506 break;
506 case V4L2_CID_SATURATION: 507 case V4L2_CID_SATURATION:
508 state->saturation = ctrl->value;
509 au8522_writereg(state, AU8522_TVDEC_SATURATION_CB_REG00CH,
510 ctrl->value);
511 au8522_writereg(state, AU8522_TVDEC_SATURATION_CR_REG00DH,
512 ctrl->value);
513 break;
507 case V4L2_CID_HUE: 514 case V4L2_CID_HUE:
515 state->hue = ctrl->value;
516 au8522_writereg(state, AU8522_TVDEC_HUE_H_REG00EH,
517 ctrl->value >> 8);
518 au8522_writereg(state, AU8522_TVDEC_HUE_L_REG00FH,
519 ctrl->value & 0xFF);
520 break;
508 case V4L2_CID_AUDIO_VOLUME: 521 case V4L2_CID_AUDIO_VOLUME:
509 case V4L2_CID_AUDIO_BASS: 522 case V4L2_CID_AUDIO_BASS:
510 case V4L2_CID_AUDIO_TREBLE: 523 case V4L2_CID_AUDIO_TREBLE:
@@ -534,7 +547,11 @@ static int au8522_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
534 ctrl->value = state->contrast; 547 ctrl->value = state->contrast;
535 break; 548 break;
536 case V4L2_CID_SATURATION: 549 case V4L2_CID_SATURATION:
550 ctrl->value = state->saturation;
551 break;
537 case V4L2_CID_HUE: 552 case V4L2_CID_HUE:
553 ctrl->value = state->hue;
554 break;
538 case V4L2_CID_AUDIO_VOLUME: 555 case V4L2_CID_AUDIO_VOLUME:
539 case V4L2_CID_AUDIO_BASS: 556 case V4L2_CID_AUDIO_BASS:
540 case V4L2_CID_AUDIO_TREBLE: 557 case V4L2_CID_AUDIO_TREBLE:
@@ -632,8 +649,9 @@ static int au8522_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
632 case V4L2_CID_BRIGHTNESS: 649 case V4L2_CID_BRIGHTNESS:
633 return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128); 650 return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128);
634 case V4L2_CID_SATURATION: 651 case V4L2_CID_SATURATION:
652 return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128);
635 case V4L2_CID_HUE: 653 case V4L2_CID_HUE:
636 /* Not yet implemented */ 654 return v4l2_ctrl_query_fill(qc, -32768, 32768, 1, 0);
637 default: 655 default:
638 break; 656 break;
639 } 657 }