From ea2278633ab4728c41b4043f47df4d3e39131992 Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Wed, 11 Mar 2009 02:58:53 -0300 Subject: V4L/DVB (11059): xc5000: fix bug for hybrid xc5000 devices with IF other than 5380 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 and Steven Toth for providing sample hardware, engineering level support, and testing. Signed-off-by: Devin Heitmueller Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/common/tuners/xc5000.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/media/common/tuners/xc5000.c') diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index ef4bdf2315f..b54598550dc 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c @@ -973,8 +973,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: @@ -983,6 +981,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. */ -- cgit v1.2.3