From 2ca502dab581472343f680324e96acb590b4dd0c Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Thu, 10 Jan 2008 03:43:11 -0300 Subject: [PATCH] --- yaml --- r: 76727 b: refs/heads/master c: a57ed8a1f7381aa7e1bec6c55d5f119706f2982d h: refs/heads/master i: 76725: 3f88257c229549cda626e4888bb6da19d6f7104e 76723: 2477a49d675986a1941ff6d4f146096104b1a20f 76719: 4af0acd985fa62cb4c5fdf0b3b7561101d92c708 v: v3 --- [refs] | 2 +- trunk/drivers/media/dvb/frontends/s5h1409.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index e372cd86b16e..65c87cd30bd4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7b8880140ff6aec6a5bec7929b03ce0b96a7c79a +refs/heads/master: a57ed8a1f7381aa7e1bec6c55d5f119706f2982d diff --git a/trunk/drivers/media/dvb/frontends/s5h1409.c b/trunk/drivers/media/dvb/frontends/s5h1409.c index d3b148ddad2b..3391777e0b2f 100644 --- a/trunk/drivers/media/dvb/frontends/s5h1409.c +++ b/trunk/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,8 +773,14 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, sizeof(struct dvb_frontend_ops)); state->frontend.demodulator_priv = state; + if (s5h1409_init(&state->frontend) != 0) { + printk(KERN_ERR "%s: Failed to initialize correctly\n", + __FUNCTION__); + goto error; + } + /* Note: Leaving the I2C gate open here. */ - s5h1409_writereg(state, 0xf3, 1); + s5h1409_i2c_gate_ctrl(&state->frontend, 1); return &state->frontend;