diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-10-13 22:32:29 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:48 -0500 |
commit | 36a91879d85396ea6470d3a5bde8287e40b5a0e9 (patch) | |
tree | 884f72a9cfb113b7298b9fccda29a7149ee11d51 /drivers/media/dvb | |
parent | 6a540bdf0134fc7198dd053a352b4c414a5e7e19 (diff) |
V4L/DVB (13187): au8522: add support for saturation and hue controls
Add support for saturation/hue controls, prompted by errors showing up in
the mythbackend log.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/frontends/au8522_decoder.c | 22 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/au8522_priv.h | 2 |
2 files changed, 22 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c index 74981ee923c8..dee609cdd77a 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 | } |
diff --git a/drivers/media/dvb/frontends/au8522_priv.h b/drivers/media/dvb/frontends/au8522_priv.h index f328f2b3ad3d..c74c4e72fe91 100644 --- a/drivers/media/dvb/frontends/au8522_priv.h +++ b/drivers/media/dvb/frontends/au8522_priv.h | |||
@@ -62,6 +62,8 @@ struct au8522_state { | |||
62 | u32 rev; | 62 | u32 rev; |
63 | u8 brightness; | 63 | u8 brightness; |
64 | u8 contrast; | 64 | u8 contrast; |
65 | u8 saturation; | ||
66 | s16 hue; | ||
65 | }; | 67 | }; |
66 | 68 | ||
67 | /* These are routines shared by both the VSB/QAM demodulator and the analog | 69 | /* These are routines shared by both the VSB/QAM demodulator and the analog |