diff options
author | Devin Heitmueller <dheitmueller@linuxtv.org> | 2009-03-11 01:58:53 -0400 |
---|---|---|
committer | Devin Heitmueller <dheitmueller@linuxtv.org> | 2009-03-11 01:58:53 -0400 |
commit | 50f5fcb71020940ea1d520eb2faa59c76253cfed (patch) | |
tree | d660383d7754087827bcddea1196f63cad5770d9 | |
parent | 02b5c443f53867b693751a9aff1753ffea8891d4 (diff) | |
download | mediapointer-dvb-s2-50f5fcb71020940ea1d520eb2faa59c76253cfed.tar.gz mediapointer-dvb-s2-50f5fcb71020940ea1d520eb2faa59c76253cfed.tar.bz2 |
xc5000: fix bug for hybrid xc5000 devices with IF other than 5380
From: Devin Heitmueller <dheitmueller@linuxtv.org>
The xc5000 driver has a bug where the IF is always set to whatever the first
caller to dvb_attach() provides. This fails when the device requires an IF
other than 5380 and the analog driver is loaded first through tuner-core
(which always supplies the hard-coded value of 5380).
Thanks to Michael Krufky <mkrufky@linuxtv.org> and Steven Toth
<stoth@linuxtv.org> for providing sample hardware, engineering level support,
and testing.
Priority: normal
Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-rw-r--r-- | linux/drivers/media/common/tuners/xc5000.c | 9 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/linux/drivers/media/common/tuners/xc5000.c b/linux/drivers/media/common/tuners/xc5000.c index 36c81febb..a64c52171 100644 --- a/linux/drivers/media/common/tuners/xc5000.c +++ b/linux/drivers/media/common/tuners/xc5000.c @@ -989,8 +989,6 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe, case 1: /* new tuner instance */ priv->bandwidth = BANDWIDTH_6_MHZ; - priv->if_khz = cfg->if_khz; - fe->tuner_priv = priv; break; default: @@ -999,6 +997,13 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe, break; } + if (priv->if_khz == 0) { + /* If the IF hasn't been set yet, use the value provided by + the caller (occurs in hybrid devices where the analog + call to xc5000_attach occurs before the digital side) */ + priv->if_khz = cfg->if_khz; + } + /* Check if firmware has been loaded. It is possible that another instance of the driver has loaded the firmware. */ diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index 0188d87ea..9a0ddd57c 100644 --- a/linux/drivers/media/video/tuner-core.c +++ b/linux/drivers/media/video/tuner-core.c @@ -453,7 +453,8 @@ static void set_type(struct i2c_client *c, unsigned int type, struct dvb_tuner_ops *xc_tuner_ops; xc5000_cfg.i2c_address = t->i2c->addr; - xc5000_cfg.if_khz = 5380; + /* if_khz will be set when the digital dvb_attach() occurs */ + xc5000_cfg.if_khz = 0; if (!dvb_attach(xc5000_attach, &t->fe, t->i2c->adapter, &xc5000_cfg)) goto attach_failed; |