V4L/DVB (9754): em28xx: improve debug messages

Now, the first message states board names. Also, removed printing the alternate
settings by default. I2C messages are now clearer.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Mauro Carvalho Chehab 2008-11-25 10:06:21 -03:00
parent ec5de990d9
commit 1bee0184f6
3 changed files with 26 additions and 23 deletions

View file

@ -1274,6 +1274,10 @@ void em28xx_pre_card_setup(struct em28xx *dev)
{
int rc;
em28xx_set_model(dev);
em28xx_info("Found %s\n", dev->board.name);
/* Set the default GPO/GPIO for legacy devices */
dev->reg_gpo_num = EM2880_R04_GPO;
dev->reg_gpio_num = EM28XX_R08_GPIO;
@ -1284,7 +1288,8 @@ void em28xx_pre_card_setup(struct em28xx *dev)
rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
if (rc > 0) {
dev->chip_id = rc;
switch (rc) {
switch (dev->chip_id) {
case CHIP_ID_EM2750:
em28xx_info("chip ID is em2750\n");
break;
@ -1307,7 +1312,7 @@ void em28xx_pre_card_setup(struct em28xx *dev)
dev->wait_after_write = 0;
break;
default:
em28xx_info("em28xx chip ID = %d\n", rc);
em28xx_info("em28xx chip ID = %d\n", dev->chip_id);
}
}
@ -1316,8 +1321,6 @@ void em28xx_pre_card_setup(struct em28xx *dev)
if (rc >= 0)
dev->reg_gpo = rc;
em28xx_set_model(dev);
/* Those are the default values for the majority of boards
Use those values if not specified otherwise at boards entry
*/

View file

@ -388,47 +388,49 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len)
if (em_eeprom->id == 0x9567eb1a)
dev->hash = em28xx_hash_mem(eedata, len, 32);
printk(KERN_INFO "EEPROM ID= 0x%08x, hash = 0x%08lx\n",
em_eeprom->id, dev->hash);
printk(KERN_INFO "Vendor/Product ID= %04x:%04x\n", em_eeprom->vendor_ID,
em_eeprom->product_ID);
printk(KERN_INFO "%s: EEPROM ID= 0x%08x, EEPROM hash = 0x%08lx\n",
dev->name, em_eeprom->id, dev->hash);
printk(KERN_INFO "%s: EEPROM info:\n", dev->name);
switch (em_eeprom->chip_conf >> 4 & 0x3) {
case 0:
printk(KERN_INFO "No audio on board.\n");
printk(KERN_INFO "%s:\tNo audio on board.\n", dev->name);
break;
case 1:
printk(KERN_INFO "AC97 audio (5 sample rates)\n");
printk(KERN_INFO "%s:\tAC97 audio (5 sample rates)\n",
dev->name);
break;
case 2:
printk(KERN_INFO "I2S audio, sample rate=32k\n");
printk(KERN_INFO "%s:\tI2S audio, sample rate=32k\n", dev->name);
break;
case 3:
printk(KERN_INFO "I2S audio, 3 sample rates\n");
printk(KERN_INFO "%s:\tI2S audio, 3 sample rates\n", dev->name);
break;
}
if (em_eeprom->chip_conf & 1 << 3)
printk(KERN_INFO "USB Remote wakeup capable\n");
printk(KERN_INFO "%s:\tUSB Remote wakeup capable\n", dev->name);
if (em_eeprom->chip_conf & 1 << 2)
printk(KERN_INFO "USB Self power capable\n");
printk(KERN_INFO "%s:\tUSB Self power capable\n", dev->name);
switch (em_eeprom->chip_conf & 0x3) {
case 0:
printk(KERN_INFO "500mA max power\n");
printk(KERN_INFO "%s:\t500mA max power\n", dev->name);
break;
case 1:
printk(KERN_INFO "400mA max power\n");
printk(KERN_INFO "%s:\t400mA max power\n", dev->name);
break;
case 2:
printk(KERN_INFO "300mA max power\n");
printk(KERN_INFO "%s:\t300mA max power\n", dev->name);
break;
case 3:
printk(KERN_INFO "200mA max power\n");
printk(KERN_INFO "%s:\t200mA max power\n", dev->name);
break;
}
printk(KERN_INFO "Table at 0x%02x, strings=0x%04x, 0x%04x, 0x%04x\n",
printk(KERN_INFO "%s:\tTable at 0x%02x, strings=0x%04x, 0x%04x, 0x%04x\n",
dev->name,
em_eeprom->string_idx_table,
em_eeprom->string1,
em_eeprom->string2,

View file

@ -2272,7 +2272,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
uif = udev->actconfig->interface[0];
dev->num_alt = uif->num_altsetting;
em28xx_info("Alternate settings: %i\n", dev->num_alt);
em28xx_videodbg("Alternate settings: %i\n", dev->num_alt);
/* dev->alt_max_pkt_size = kmalloc(sizeof(*dev->alt_max_pkt_size)* */
dev->alt_max_pkt_size = kmalloc(32 * dev->num_alt, GFP_KERNEL);
@ -2288,7 +2288,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
wMaxPacketSize);
dev->alt_max_pkt_size[i] =
(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
em28xx_info("Alternate setting %i, max size= %i\n", i,
em28xx_videodbg("Alternate setting %i, max size= %i\n", i,
dev->alt_max_pkt_size[i]);
}
@ -2304,8 +2304,6 @@ static int em28xx_usb_probe(struct usb_interface *interface,
return retval;
}
em28xx_info("Found %s\n", em28xx_boards[dev->model].name);
/* save our data pointer in this interface device */
usb_set_intfdata(interface, dev);