diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-01-10 01:43:11 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:04:50 -0500 |
commit | a57ed8a1f7381aa7e1bec6c55d5f119706f2982d (patch) | |
tree | 0d9e8777cd884f8faf048c2b892891acec92d8cd /drivers/media | |
parent | 7b8880140ff6aec6a5bec7929b03ce0b96a7c79a (diff) |
V4L/DVB (7008): s5h1409: Ensure the silicon is initialized during attach
If not it impacts on analog tuner quality.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/s5h1409.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c index d3b148ddad2b..3391777e0b2f 100644 --- a/drivers/media/dvb/frontends/s5h1409.c +++ b/drivers/media/dvb/frontends/s5h1409.c | |||
@@ -750,6 +750,7 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, | |||
750 | struct i2c_adapter* i2c) | 750 | struct i2c_adapter* i2c) |
751 | { | 751 | { |
752 | struct s5h1409_state* state = NULL; | 752 | struct s5h1409_state* state = NULL; |
753 | u16 reg; | ||
753 | 754 | ||
754 | /* allocate memory for the internal state */ | 755 | /* allocate memory for the internal state */ |
755 | state = kmalloc(sizeof(struct s5h1409_state), GFP_KERNEL); | 756 | state = kmalloc(sizeof(struct s5h1409_state), GFP_KERNEL); |
@@ -763,7 +764,8 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, | |||
763 | state->if_freq = S5H1409_VSB_IF_FREQ; | 764 | state->if_freq = S5H1409_VSB_IF_FREQ; |
764 | 765 | ||
765 | /* check if the demod exists */ | 766 | /* check if the demod exists */ |
766 | if (s5h1409_readreg(state, 0x04) != 0x0066) | 767 | reg = s5h1409_readreg(state, 0x04); |
768 | if ((reg != 0x0066) && (reg != 0x007f)) | ||
767 | goto error; | 769 | goto error; |
768 | 770 | ||
769 | /* create dvb_frontend */ | 771 | /* create dvb_frontend */ |
@@ -771,8 +773,14 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, | |||
771 | sizeof(struct dvb_frontend_ops)); | 773 | sizeof(struct dvb_frontend_ops)); |
772 | state->frontend.demodulator_priv = state; | 774 | state->frontend.demodulator_priv = state; |
773 | 775 | ||
776 | if (s5h1409_init(&state->frontend) != 0) { | ||
777 | printk(KERN_ERR "%s: Failed to initialize correctly\n", | ||
778 | __FUNCTION__); | ||
779 | goto error; | ||
780 | } | ||
781 | |||
774 | /* Note: Leaving the I2C gate open here. */ | 782 | /* Note: Leaving the I2C gate open here. */ |
775 | s5h1409_writereg(state, 0xf3, 1); | 783 | s5h1409_i2c_gate_ctrl(&state->frontend, 1); |
776 | 784 | ||
777 | return &state->frontend; | 785 | return &state->frontend; |
778 | 786 | ||