Commit 30f544ec authored by Istvan Varga's avatar Istvan Varga Committed by Mauro Carvalho Chehab

[media] xc4000: setting registers

This patch implements setting the registers in xc4000_set_params()
and xc4000_set_analog_params(). A new register is defined which enables
filtering of the composite video output (this is needed to avoid bad
picture quality with some boards).
Signed-off-by: default avatarIstvan Varga <istvan_v@mailbox.hu>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f4312e2f
...@@ -131,6 +131,7 @@ struct xc4000_priv { ...@@ -131,6 +131,7 @@ struct xc4000_priv {
#define XREG_SEEK_MODE 0x06 #define XREG_SEEK_MODE 0x06
#define XREG_POWER_DOWN 0x08 #define XREG_POWER_DOWN 0x08
#define XREG_SIGNALSOURCE 0x0A #define XREG_SIGNALSOURCE 0x0A
#define XREG_SMOOTHEDCVBS 0x0E
#define XREG_AMPLITUDE 0x10 #define XREG_AMPLITUDE 0x10
/* Registers (Read-only) */ /* Registers (Read-only) */
...@@ -1218,15 +1219,35 @@ static int xc4000_set_params(struct dvb_frontend *fe, ...@@ -1218,15 +1219,35 @@ static int xc4000_set_params(struct dvb_frontend *fe,
"xc4000: xc_SetSignalSource(%d) failed\n", "xc4000: xc_SetSignalSource(%d) failed\n",
priv->rf_mode); priv->rf_mode);
goto fail; goto fail;
} else {
u16 video_mode, audio_mode;
video_mode = XC4000_Standard[priv->video_standard].VideoMode;
audio_mode = XC4000_Standard[priv->video_standard].AudioMode;
if (type == DTV6 && priv->firm_version != 0x0102)
video_mode |= 0x0001;
ret = xc_SetTVStandard(priv, video_mode, audio_mode);
if (ret != XC_RESULT_SUCCESS) {
printk(KERN_ERR "xc4000: xc_SetTVStandard failed\n");
/* DJH - do not return when it fails... */
/* goto fail; */
}
} }
ret = xc_SetTVStandard(priv, if (priv->card_type == XC4000_CARD_WINFAST_CX88) {
XC4000_Standard[priv->video_standard].VideoMode, if (xc_write_reg(priv, XREG_D_CODE, 0) == 0)
XC4000_Standard[priv->video_standard].AudioMode); ret = 0;
if (ret != XC_RESULT_SUCCESS) { if (xc_write_reg(priv, XREG_AMPLITUDE,
printk(KERN_ERR "xc4000: xc_SetTVStandard failed\n"); (priv->firm_version == 0x0102 ? 132 : 134))
goto fail; != 0)
ret = -EREMOTEIO;
if (xc_write_reg(priv, XREG_SMOOTHEDCVBS, 1) != 0)
ret = -EREMOTEIO;
if (ret != 0) {
printk(KERN_ERR "xc4000: setting registers failed\n");
/* goto fail; */
}
} }
xc_tune_channel(priv, priv->freq_hz, XC_TUNE_DIGITAL); xc_tune_channel(priv, priv->freq_hz, XC_TUNE_DIGITAL);
ret = 0; ret = 0;
...@@ -1311,14 +1332,36 @@ static int xc4000_set_analog_params(struct dvb_frontend *fe, ...@@ -1311,14 +1332,36 @@ static int xc4000_set_analog_params(struct dvb_frontend *fe,
"xc4000: xc_SetSignalSource(%d) failed\n", "xc4000: xc_SetSignalSource(%d) failed\n",
priv->rf_mode); priv->rf_mode);
goto fail; goto fail;
} else {
u16 video_mode, audio_mode;
video_mode = XC4000_Standard[priv->video_standard].VideoMode;
audio_mode = XC4000_Standard[priv->video_standard].AudioMode;
if (priv->video_standard < XC4000_BG_PAL_A2) {
if (0 /*type & NOGD*/)
video_mode &= 0xFF7F;
} else if (priv->video_standard < XC4000_I_PAL_NICAM) {
if (priv->card_type == XC4000_CARD_WINFAST_CX88 &&
priv->firm_version == 0x0102)
video_mode &= 0xFEFF;
}
ret = xc_SetTVStandard(priv, video_mode, audio_mode);
if (ret != XC_RESULT_SUCCESS) {
printk(KERN_ERR "xc4000: xc_SetTVStandard failed\n");
goto fail;
}
} }
ret = xc_SetTVStandard(priv, if (priv->card_type == XC4000_CARD_WINFAST_CX88) {
XC4000_Standard[priv->video_standard].VideoMode, if (xc_write_reg(priv, XREG_D_CODE, 0) == 0)
XC4000_Standard[priv->video_standard].AudioMode); ret = 0;
if (ret != XC_RESULT_SUCCESS) { if (xc_write_reg(priv, XREG_AMPLITUDE, 1) != 0)
printk(KERN_ERR "xc4000: xc_SetTVStandard failed\n"); ret = -EREMOTEIO;
goto fail; if (xc_write_reg(priv, XREG_SMOOTHEDCVBS, 1) != 0)
ret = -EREMOTEIO;
if (ret != 0) {
printk(KERN_ERR "xc4000: setting registers failed\n");
goto fail;
}
} }
xc_tune_channel(priv, priv->freq_hz, XC_TUNE_ANALOG); xc_tune_channel(priv, priv->freq_hz, XC_TUNE_ANALOG);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment