summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/s5h1409.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2008-01-10 01:43:11 -0500
committerSteven Toth <stoth@hauppauge.com>2008-01-10 01:43:11 -0500
commitbe7a36ce7d9838a3cceae950ff3a4bb43c493ff0 (patch)
tree7ae63d96a028be5ae36871b3da3f37b5e191f392 /linux/drivers/media/dvb/frontends/s5h1409.c
parent492978ae020c471092cfcf1fc6bd2f68a79ff4cb (diff)
downloadmediapointer-dvb-s2-be7a36ce7d9838a3cceae950ff3a4bb43c493ff0.tar.gz
mediapointer-dvb-s2-be7a36ce7d9838a3cceae950ff3a4bb43c493ff0.tar.bz2
s5h1409: Ensure the silicon is initialized during attach.
From: Steven Toth <stoth@hauppauge.com> If not it impacts on analog tuner quality. Signed-off-by: Steven Toth <stoth@hauppauge.com>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/s5h1409.c')
-rw-r--r--linux/drivers/media/dvb/frontends/s5h1409.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/linux/drivers/media/dvb/frontends/s5h1409.c b/linux/drivers/media/dvb/frontends/s5h1409.c
index 29ec9ac8f..3391777e0 100644
--- a/linux/drivers/media/dvb/frontends/s5h1409.c
+++ b/linux/drivers/media/dvb/frontends/s5h1409.c
@@ -750,6 +750,7 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config,
struct i2c_adapter* i2c)
{
struct s5h1409_state* state = NULL;
+ u16 reg;
/* allocate memory for the internal state */
state = kmalloc(sizeof(struct s5h1409_state), GFP_KERNEL);
@@ -763,7 +764,8 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config,
state->if_freq = S5H1409_VSB_IF_FREQ;
/* check if the demod exists */
- if (s5h1409_readreg(state, 0x04) != 0x0066)
+ reg = s5h1409_readreg(state, 0x04);
+ if ((reg != 0x0066) && (reg != 0x007f))
goto error;
/* create dvb_frontend */
@@ -771,19 +773,15 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config,
sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state;
- /* Note: Leaving the I2C gate open here. */
- s5h1409_writereg(state, 0xf3, 1);
-
-#if 0
- /* Enable GPIO to disable EZ QAM before
- * analog tuners try to calibrate. */
-
- s5h1409_set_gpio(fe, 1);
+ if (s5h1409_init(&state->frontend) != 0) {
+ printk(KERN_ERR "%s: Failed to initialize correctly\n",
+ __FUNCTION__);
+ goto error;
+ }
- or ?
+ /* Note: Leaving the I2C gate open here. */
+ s5h1409_i2c_gate_ctrl(&state->frontend, 1);
- s5h1409_set_gpio(fe, state->config->gpio);
-#endif
return &state->frontend;
error: