diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-14 09:44:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-26 14:58:48 -0400 |
commit | bc36ec746409e4e4719b94a86dc0d8cbeb6f439f (patch) | |
tree | f154a4ab27dd0fd6d355498c161e39d72190129e /drivers/media | |
parent | b25fed115a8bd8d39d14ce0d03e808272a401d67 (diff) |
V4L/DVB (8028): Improve error messages for tda1004x attach
A fresh copy of v.29 firmware, using get_firmware, is leading to an invalid
firmware:
DVB: registering new adapter (saa7133[0])
DVB: registering frontend 0 (Philips TDA10046H DVB-T)...
tda1004x: setting up plls for 48MHz sampling clock
tda1004x: found firmware revision ff -- invalid
tda1004x: trying to boot from eeprom
tda1004x: found firmware revision ff -- invalid
tda1004x: waiting for firmware upload...
tda1004x: Error during firmware upload
tda1004x: found firmware revision ff -- invalid
tda1004x: firmware upload failed
Sometimes, loading/unloading this firmware makes tda1004x to return an invalid
ID. However, there were no printk messages to help to identify what were the
cause for the error.
With this patch, it will now print:
Invalid tda1004x ID = 0xff. Can't proceed
saa7133[0]/dvb: failed to attach tda10046
saa7133[0]/dvb: frontend initialization failed
Tested with LifeView FlyDVB-T Hybrid Cardbus/MSI TV @nywhere A/D NB
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/tda1004x.c | 18 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 3 |
2 files changed, 16 insertions, 5 deletions
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c index 49973846373e..3993d1ce334a 100644 --- a/drivers/media/dvb/frontends/tda1004x.c +++ b/drivers/media/dvb/frontends/tda1004x.c | |||
@@ -1248,11 +1248,14 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, | |||
1248 | struct i2c_adapter* i2c) | 1248 | struct i2c_adapter* i2c) |
1249 | { | 1249 | { |
1250 | struct tda1004x_state *state; | 1250 | struct tda1004x_state *state; |
1251 | u8 id; | ||
1251 | 1252 | ||
1252 | /* allocate memory for the internal state */ | 1253 | /* allocate memory for the internal state */ |
1253 | state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); | 1254 | state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); |
1254 | if (!state) | 1255 | if (!state) { |
1256 | printk(KERN_ERR "Can't alocate memory for tda10045 state\n"); | ||
1255 | return NULL; | 1257 | return NULL; |
1258 | } | ||
1256 | 1259 | ||
1257 | /* setup the state */ | 1260 | /* setup the state */ |
1258 | state->config = config; | 1261 | state->config = config; |
@@ -1260,7 +1263,9 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, | |||
1260 | state->demod_type = TDA1004X_DEMOD_TDA10045; | 1263 | state->demod_type = TDA1004X_DEMOD_TDA10045; |
1261 | 1264 | ||
1262 | /* check if the demod is there */ | 1265 | /* check if the demod is there */ |
1263 | if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x25) { | 1266 | id = tda1004x_read_byte(state, TDA1004X_CHIPID); |
1267 | if (id != 0x25) { | ||
1268 | printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id); | ||
1264 | kfree(state); | 1269 | kfree(state); |
1265 | return NULL; | 1270 | return NULL; |
1266 | } | 1271 | } |
@@ -1307,11 +1312,14 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config, | |||
1307 | struct i2c_adapter* i2c) | 1312 | struct i2c_adapter* i2c) |
1308 | { | 1313 | { |
1309 | struct tda1004x_state *state; | 1314 | struct tda1004x_state *state; |
1315 | u8 id; | ||
1310 | 1316 | ||
1311 | /* allocate memory for the internal state */ | 1317 | /* allocate memory for the internal state */ |
1312 | state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); | 1318 | state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); |
1313 | if (!state) | 1319 | if (!state) { |
1320 | printk(KERN_ERR "Can't alocate memory for tda10046 state\n"); | ||
1314 | return NULL; | 1321 | return NULL; |
1322 | } | ||
1315 | 1323 | ||
1316 | /* setup the state */ | 1324 | /* setup the state */ |
1317 | state->config = config; | 1325 | state->config = config; |
@@ -1319,7 +1327,9 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config, | |||
1319 | state->demod_type = TDA1004X_DEMOD_TDA10046; | 1327 | state->demod_type = TDA1004X_DEMOD_TDA10046; |
1320 | 1328 | ||
1321 | /* check if the demod is there */ | 1329 | /* check if the demod is there */ |
1322 | if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x46) { | 1330 | id = tda1004x_read_byte(state, TDA1004X_CHIPID); |
1331 | if (id != 0x46) { | ||
1332 | printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id); | ||
1323 | kfree(state); | 1333 | kfree(state); |
1324 | return NULL; | 1334 | return NULL; |
1325 | } | 1335 | } |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 726f01ccedf0..653107c83803 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -1091,7 +1091,8 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1091 | ads_tech_duo_config.tuner_address); | 1091 | ads_tech_duo_config.tuner_address); |
1092 | goto dettach_frontend; | 1092 | goto dettach_frontend; |
1093 | } | 1093 | } |
1094 | } | 1094 | } else |
1095 | wprintk("failed to attach tda10046\n"); | ||
1095 | break; | 1096 | break; |
1096 | case SAA7134_BOARD_TEVION_DVBT_220RF: | 1097 | case SAA7134_BOARD_TEVION_DVBT_220RF: |
1097 | if (configure_tda827x_fe(dev, &tevion_dvbt220rf_config, | 1098 | if (configure_tda827x_fe(dev, &tevion_dvbt220rf_config, |