Commit bc36ec74 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent b25fed11
...@@ -1248,11 +1248,14 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, ...@@ -1248,11 +1248,14 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
struct i2c_adapter* i2c) struct i2c_adapter* i2c)
{ {
struct tda1004x_state *state; struct tda1004x_state *state;
u8 id;
/* allocate memory for the internal state */ /* allocate memory for the internal state */
state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL);
if (!state) if (!state) {
printk(KERN_ERR "Can't alocate memory for tda10045 state\n");
return NULL; return NULL;
}
/* setup the state */ /* setup the state */
state->config = config; state->config = config;
...@@ -1260,7 +1263,9 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, ...@@ -1260,7 +1263,9 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
state->demod_type = TDA1004X_DEMOD_TDA10045; state->demod_type = TDA1004X_DEMOD_TDA10045;
/* check if the demod is there */ /* check if the demod is there */
if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x25) { id = tda1004x_read_byte(state, TDA1004X_CHIPID);
if (id != 0x25) {
printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id);
kfree(state); kfree(state);
return NULL; return NULL;
} }
...@@ -1307,11 +1312,14 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config, ...@@ -1307,11 +1312,14 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config,
struct i2c_adapter* i2c) struct i2c_adapter* i2c)
{ {
struct tda1004x_state *state; struct tda1004x_state *state;
u8 id;
/* allocate memory for the internal state */ /* allocate memory for the internal state */
state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL);
if (!state) if (!state) {
printk(KERN_ERR "Can't alocate memory for tda10046 state\n");
return NULL; return NULL;
}
/* setup the state */ /* setup the state */
state->config = config; state->config = config;
...@@ -1319,7 +1327,9 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config, ...@@ -1319,7 +1327,9 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config,
state->demod_type = TDA1004X_DEMOD_TDA10046; state->demod_type = TDA1004X_DEMOD_TDA10046;
/* check if the demod is there */ /* check if the demod is there */
if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x46) { id = tda1004x_read_byte(state, TDA1004X_CHIPID);
if (id != 0x46) {
printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id);
kfree(state); kfree(state);
return NULL; return NULL;
} }
......
...@@ -1091,7 +1091,8 @@ static int dvb_init(struct saa7134_dev *dev) ...@@ -1091,7 +1091,8 @@ static int dvb_init(struct saa7134_dev *dev)
ads_tech_duo_config.tuner_address); ads_tech_duo_config.tuner_address);
goto dettach_frontend; goto dettach_frontend;
} }
} } else
wprintk("failed to attach tda10046\n");
break; break;
case SAA7134_BOARD_TEVION_DVBT_220RF: case SAA7134_BOARD_TEVION_DVBT_220RF:
if (configure_tda827x_fe(dev, &tevion_dvbt220rf_config, if (configure_tda827x_fe(dev, &tevion_dvbt220rf_config,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment