提交 36a91879 编写于 作者: D Devin Heitmueller 提交者: Mauro Carvalho Chehab

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: NDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 6a540bdf
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
/* Developer notes: /* Developer notes:
* *
* VBI support is not yet working * VBI support is not yet working
* Saturation and hue setting are not yet working
* Enough is implemented here for CVBS and S-Video inputs, but the actual * Enough is implemented here for CVBS and S-Video inputs, but the actual
* analog demodulator code isn't implemented (not needed for xc5000 since it * analog demodulator code isn't implemented (not needed for xc5000 since it
* has its own demodulator and outputs CVBS) * has its own demodulator and outputs CVBS)
...@@ -236,8 +235,10 @@ static void setup_decoder_defaults(struct au8522_state *state, u8 input_mode) ...@@ -236,8 +235,10 @@ static void setup_decoder_defaults(struct au8522_state *state, u8 input_mode)
state->contrast = 0x79; state->contrast = 0x79;
au8522_writereg(state, AU8522_TVDEC_SATURATION_CB_REG00CH, 0x80); au8522_writereg(state, AU8522_TVDEC_SATURATION_CB_REG00CH, 0x80);
au8522_writereg(state, AU8522_TVDEC_SATURATION_CR_REG00DH, 0x80); au8522_writereg(state, AU8522_TVDEC_SATURATION_CR_REG00DH, 0x80);
state->saturation = 0x80;
au8522_writereg(state, AU8522_TVDEC_HUE_H_REG00EH, 0x00); au8522_writereg(state, AU8522_TVDEC_HUE_H_REG00EH, 0x00);
au8522_writereg(state, AU8522_TVDEC_HUE_L_REG00FH, 0x00); au8522_writereg(state, AU8522_TVDEC_HUE_L_REG00FH, 0x00);
state->hue = 0x00;
/* Other decoder registers */ /* Other decoder registers */
au8522_writereg(state, AU8522_TVDEC_INT_MASK_REG010H, 0x00); 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,7 +505,19 @@ static int au8522_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
ctrl->value); ctrl->value);
break; break;
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
state->saturation = ctrl->value;
au8522_writereg(state, AU8522_TVDEC_SATURATION_CB_REG00CH,
ctrl->value);
au8522_writereg(state, AU8522_TVDEC_SATURATION_CR_REG00DH,
ctrl->value);
break;
case V4L2_CID_HUE: case V4L2_CID_HUE:
state->hue = ctrl->value;
au8522_writereg(state, AU8522_TVDEC_HUE_H_REG00EH,
ctrl->value >> 8);
au8522_writereg(state, AU8522_TVDEC_HUE_L_REG00FH,
ctrl->value & 0xFF);
break;
case V4L2_CID_AUDIO_VOLUME: case V4L2_CID_AUDIO_VOLUME:
case V4L2_CID_AUDIO_BASS: case V4L2_CID_AUDIO_BASS:
case V4L2_CID_AUDIO_TREBLE: case V4L2_CID_AUDIO_TREBLE:
...@@ -534,7 +547,11 @@ static int au8522_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) ...@@ -534,7 +547,11 @@ static int au8522_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
ctrl->value = state->contrast; ctrl->value = state->contrast;
break; break;
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
ctrl->value = state->saturation;
break;
case V4L2_CID_HUE: case V4L2_CID_HUE:
ctrl->value = state->hue;
break;
case V4L2_CID_AUDIO_VOLUME: case V4L2_CID_AUDIO_VOLUME:
case V4L2_CID_AUDIO_BASS: case V4L2_CID_AUDIO_BASS:
case V4L2_CID_AUDIO_TREBLE: case V4L2_CID_AUDIO_TREBLE:
...@@ -632,8 +649,9 @@ static int au8522_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc) ...@@ -632,8 +649,9 @@ static int au8522_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
case V4L2_CID_BRIGHTNESS: case V4L2_CID_BRIGHTNESS:
return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128); return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128);
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
return v4l2_ctrl_query_fill(qc, 0, 255, 1, 128);
case V4L2_CID_HUE: case V4L2_CID_HUE:
/* Not yet implemented */ return v4l2_ctrl_query_fill(qc, -32768, 32768, 1, 0);
default: default:
break; break;
} }
......
...@@ -62,6 +62,8 @@ struct au8522_state { ...@@ -62,6 +62,8 @@ struct au8522_state {
u32 rev; u32 rev;
u8 brightness; u8 brightness;
u8 contrast; u8 contrast;
u8 saturation;
s16 hue;
}; };
/* These are routines shared by both the VSB/QAM demodulator and the analog /* These are routines shared by both the VSB/QAM demodulator and the analog
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册