aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-08-21 18:56:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-03 20:02:52 -0400
commit8af443e581ab57a6a38f595eb40be3514ea55195 (patch)
treeceb43d2544308cb1eac95b238680b1892efc5f3b
parentd8a10ac948545d8a4261728719af39b5dffaf7da (diff)
[media] bt8xx: Use current logging styles
This converts some messages that were emitted at KERN_INFO to KERN_DEBUG. All of these messages were guarded by bttv_debug tests. Add pr_fmt. Convert printks to pr_<level> Convert printks without KERN_<level> to appropriate pr_<level>. Removed embedded prefixes when pr_fmt was added. Whitespace cleanups when around other conversions. Macros coded with if statements should be do { if... } while (0) so the macros can be used in other if tests. Use ##__VA_ARGS__ for variadic macro as well. Coalesce format strings. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c242
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c294
-rw-r--r--drivers/media/video/bt8xx/bttv-gpio.c4
-rw-r--r--drivers/media/video/bt8xx/bttv-i2c.c56
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c37
-rw-r--r--drivers/media/video/bt8xx/bttv-risc.c25
-rw-r--r--drivers/media/video/bt8xx/bttv-vbi.c9
-rw-r--r--drivers/media/video/bt8xx/bttvp.h18
8 files changed, 355 insertions, 330 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 5b15f63bf065..5939021d8eba 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -25,6 +25,8 @@
25 25
26*/ 26*/
27 27
28#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
29
28#include <linux/delay.h> 30#include <linux/delay.h>
29#include <linux/module.h> 31#include <linux/module.h>
30#include <linux/kmod.h> 32#include <linux/kmod.h>
@@ -2905,19 +2907,17 @@ void __devinit bttv_idcard(struct bttv *btv)
2905 2907
2906 if (type != -1) { 2908 if (type != -1) {
2907 /* found it */ 2909 /* found it */
2908 printk(KERN_INFO "bttv%d: detected: %s [card=%d], " 2910 pr_info("%d: detected: %s [card=%d], PCI subsystem ID is %04x:%04x\n",
2909 "PCI subsystem ID is %04x:%04x\n", 2911 btv->c.nr, cards[type].name, cards[type].cardnr,
2910 btv->c.nr,cards[type].name,cards[type].cardnr, 2912 btv->cardid & 0xffff,
2911 btv->cardid & 0xffff, 2913 (btv->cardid >> 16) & 0xffff);
2912 (btv->cardid >> 16) & 0xffff);
2913 btv->c.type = cards[type].cardnr; 2914 btv->c.type = cards[type].cardnr;
2914 } else { 2915 } else {
2915 /* 404 */ 2916 /* 404 */
2916 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n", 2917 pr_info("%d: subsystem: %04x:%04x (UNKNOWN)\n",
2917 btv->c.nr, btv->cardid & 0xffff, 2918 btv->c.nr, btv->cardid & 0xffff,
2918 (btv->cardid >> 16) & 0xffff); 2919 (btv->cardid >> 16) & 0xffff);
2919 printk(KERN_DEBUG "please mail id, board name and " 2920 pr_debug("please mail id, board name and the correct card= insmod option to linux-media@vger.kernel.org\n");
2920 "the correct card= insmod option to linux-media@vger.kernel.org\n");
2921 } 2921 }
2922 } 2922 }
2923 2923
@@ -2926,10 +2926,10 @@ void __devinit bttv_idcard(struct bttv *btv)
2926 btv->c.type=card[btv->c.nr]; 2926 btv->c.type=card[btv->c.nr];
2927 2927
2928 /* print which card config we are using */ 2928 /* print which card config we are using */
2929 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr, 2929 pr_info("%d: using: %s [card=%d,%s]\n",
2930 bttv_tvcards[btv->c.type].name, btv->c.type, 2930 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type,
2931 card[btv->c.nr] < bttv_num_tvcards 2931 card[btv->c.nr] < bttv_num_tvcards
2932 ? "insmod option" : "autodetected"); 2932 ? "insmod option" : "autodetected");
2933 2933
2934 /* overwrite gpio stuff ?? */ 2934 /* overwrite gpio stuff ?? */
2935 if (UNSET == audioall && UNSET == audiomux[0]) 2935 if (UNSET == audioall && UNSET == audiomux[0])
@@ -2948,12 +2948,13 @@ void __devinit bttv_idcard(struct bttv *btv)
2948 } 2948 }
2949 } 2949 }
2950 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits; 2950 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2951 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=", 2951 pr_info("%d: gpio config override: mask=0x%x, mux=",
2952 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask); 2952 btv->c.nr, bttv_tvcards[btv->c.type].gpiomask);
2953 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) { 2953 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2954 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]); 2954 pr_cont("%s0x%x",
2955 i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2955 } 2956 }
2956 printk("\n"); 2957 pr_cont("\n");
2957} 2958}
2958 2959
2959/* 2960/*
@@ -2974,8 +2975,8 @@ static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2974 2975
2975 if (-1 != type) { 2976 if (-1 != type) {
2976 btv->c.type = type; 2977 btv->c.type = type;
2977 printk("bttv%d: detected by eeprom: %s [card=%d]\n", 2978 pr_info("%d: detected by eeprom: %s [card=%d]\n",
2978 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type); 2979 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2979 } 2980 }
2980} 2981}
2981 2982
@@ -3019,7 +3020,7 @@ static void flyvideo_gpio(struct bttv *btv)
3019 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ 3020 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3020 break; 3021 break;
3021 default: 3022 default:
3022 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr); 3023 pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr);
3023 break; 3024 break;
3024 } 3025 }
3025 3026
@@ -3036,13 +3037,13 @@ static void flyvideo_gpio(struct bttv *btv)
3036 if (is_capture_only) 3037 if (is_capture_only)
3037 tuner_type = TUNER_ABSENT; /* No tuner present */ 3038 tuner_type = TUNER_ABSENT; /* No tuner present */
3038 3039
3039 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", 3040 pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3040 btv->c.nr, has_radio ? "yes" : "no ", 3041 btv->c.nr, has_radio ? "yes" : "no",
3041 has_remote ? "yes" : "no ", tuner_type, gpio); 3042 has_remote ? "yes" : "no", tuner_type, gpio);
3042 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", 3043 pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3043 btv->c.nr, is_lr90 ? "yes" : "no ", 3044 btv->c.nr, is_lr90 ? "yes" : "no",
3044 has_tda9820_tda9821 ? "yes" : "no ", 3045 has_tda9820_tda9821 ? "yes" : "no",
3045 is_capture_only ? "yes" : "no "); 3046 is_capture_only ? "yes" : "no");
3046 3047
3047 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */ 3048 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3048 btv->tuner_type = tuner_type; 3049 btv->tuner_type = tuner_type;
@@ -3091,12 +3092,11 @@ static void miro_pinnacle_gpio(struct bttv *btv)
3091 if (btv->c.type == BTTV_BOARD_PINNACLE) 3092 if (btv->c.type == BTTV_BOARD_PINNACLE)
3092 btv->c.type = BTTV_BOARD_PINNACLEPRO; 3093 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3093 } 3094 }
3094 printk(KERN_INFO 3095 pr_info("%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3095 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n", 3096 btv->c.nr, id+1, btv->tuner_type,
3096 btv->c.nr, id+1, btv->tuner_type, 3097 !btv->has_radio ? "no" :
3097 !btv->has_radio ? "no" : 3098 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3098 (btv->has_matchbox ? "matchbox" : "fmtuner"), 3099 (-1 == msp) ? "no" : "yes");
3099 (-1 == msp) ? "no" : "yes");
3100 } else { 3100 } else {
3101 /* new cards with microtune tuner */ 3101 /* new cards with microtune tuner */
3102 id = 63 - id; 3102 id = 63 - id;
@@ -3138,9 +3138,8 @@ static void miro_pinnacle_gpio(struct bttv *btv)
3138 } 3138 }
3139 if (-1 != msp) 3139 if (-1 != msp)
3140 btv->c.type = BTTV_BOARD_PINNACLEPRO; 3140 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3141 printk(KERN_INFO 3141 pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3142 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n", 3142 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3143 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3144 btv->tuner_type = TUNER_MT2032; 3143 btv->tuner_type = TUNER_MT2032;
3145 } 3144 }
3146} 3145}
@@ -3202,7 +3201,7 @@ static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3202 3201
3203static void init_lmlbt4x(struct bttv *btv) 3202static void init_lmlbt4x(struct bttv *btv)
3204{ 3203{
3205 printk(KERN_DEBUG "LMLBT4x init\n"); 3204 pr_debug("LMLBT4x init\n");
3206 btwrite(0x000000, BT848_GPIO_REG_INP); 3205 btwrite(0x000000, BT848_GPIO_REG_INP);
3207 gpio_inout(0xffffff, 0x0006C0); 3206 gpio_inout(0xffffff, 0x0006C0);
3208 gpio_write(0x000000); 3207 gpio_write(0x000000);
@@ -3246,7 +3245,7 @@ static void bttv_reset_audio(struct bttv *btv)
3246 return; 3245 return;
3247 3246
3248 if (bttv_debug) 3247 if (bttv_debug)
3249 printk("bttv%d: BT878A ARESET\n",btv->c.nr); 3248 pr_debug("%d: BT878A ARESET\n", btv->c.nr);
3250 btwrite((1<<7), 0x058); 3249 btwrite((1<<7), 0x058);
3251 udelay(10); 3250 udelay(10);
3252 btwrite( 0, 0x058); 3251 btwrite( 0, 0x058);
@@ -3349,7 +3348,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
3349 case BTTV_BOARD_MAGICTVIEW061: 3348 case BTTV_BOARD_MAGICTVIEW061:
3350 if (btv->cardid == 0x3002144f) { 3349 if (btv->cardid == 0x3002144f) {
3351 btv->has_radio=1; 3350 btv->has_radio=1;
3352 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr); 3351 pr_info("%d: radio detected by subsystem id (CPH05x)\n",
3352 btv->c.nr);
3353 } 3353 }
3354 break; 3354 break;
3355 case BTTV_BOARD_STB2: 3355 case BTTV_BOARD_STB2:
@@ -3438,17 +3438,16 @@ void __devinit bttv_init_card2(struct bttv *btv)
3438 btv->tuner_type = tuner[btv->c.nr]; 3438 btv->tuner_type = tuner[btv->c.nr];
3439 3439
3440 if (btv->tuner_type == TUNER_ABSENT) 3440 if (btv->tuner_type == TUNER_ABSENT)
3441 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr); 3441 pr_info("%d: tuner absent\n", btv->c.nr);
3442 else if(btv->tuner_type == UNSET) 3442 else if (btv->tuner_type == UNSET)
3443 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr); 3443 pr_warn("%d: tuner type unset\n", btv->c.nr);
3444 else 3444 else
3445 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr, 3445 pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type);
3446 btv->tuner_type);
3447 3446
3448 if (autoload != UNSET) { 3447 if (autoload != UNSET) {
3449 printk(KERN_WARNING "bttv%d: the autoload option is obsolete.\n", btv->c.nr); 3448 pr_warn("%d: the autoload option is obsolete\n", btv->c.nr);
3450 printk(KERN_WARNING "bttv%d: use option msp3400, tda7432 or tvaudio to\n", btv->c.nr); 3449 pr_warn("%d: use option msp3400, tda7432 or tvaudio to override which audio module should be used\n",
3451 printk(KERN_WARNING "bttv%d: override which audio module should be used.\n", btv->c.nr); 3450 btv->c.nr);
3452 } 3451 }
3453 3452
3454 if (UNSET == btv->tuner_type) 3453 if (UNSET == btv->tuner_type)
@@ -3541,8 +3540,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3541 } 3540 }
3542 3541
3543 default: 3542 default:
3544 printk(KERN_WARNING "bttv%d: unknown audiodev value!\n", 3543 pr_warn("%d: unknown audiodev value!\n", btv->c.nr);
3545 btv->c.nr);
3546 return; 3544 return;
3547 } 3545 }
3548 3546
@@ -3585,8 +3583,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3585 return; 3583 return;
3586 3584
3587no_audio: 3585no_audio:
3588 printk(KERN_WARNING "bttv%d: audio absent, no audio device found!\n", 3586 pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr);
3589 btv->c.nr);
3590} 3587}
3591 3588
3592 3589
@@ -3639,19 +3636,19 @@ static void modtec_eeprom(struct bttv *btv)
3639{ 3636{
3640 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) { 3637 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3641 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I; 3638 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3642 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", 3639 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3643 btv->c.nr,&eeprom_data[0x1e]); 3640 btv->c.nr, &eeprom_data[0x1e]);
3644 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) { 3641 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3645 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I; 3642 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3646 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", 3643 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3647 btv->c.nr,&eeprom_data[0x1e]); 3644 btv->c.nr, &eeprom_data[0x1e]);
3648 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) { 3645 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3649 btv->tuner_type=TUNER_PHILIPS_NTSC; 3646 btv->tuner_type=TUNER_PHILIPS_NTSC;
3650 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n", 3647 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3651 btv->c.nr,&eeprom_data[0x1e]); 3648 btv->c.nr, &eeprom_data[0x1e]);
3652 } else { 3649 } else {
3653 printk("bttv%d: Modtec: Unknown TunerString: %s\n", 3650 pr_info("%d: Modtec: Unknown TunerString: %s\n",
3654 btv->c.nr,&eeprom_data[0x1e]); 3651 btv->c.nr, &eeprom_data[0x1e]);
3655 } 3652 }
3656} 3653}
3657 3654
@@ -3663,7 +3660,7 @@ static void __devinit hauppauge_eeprom(struct bttv *btv)
3663 btv->tuner_type = tv.tuner_type; 3660 btv->tuner_type = tv.tuner_type;
3664 btv->has_radio = tv.has_radio; 3661 btv->has_radio = tv.has_radio;
3665 3662
3666 printk("bttv%d: Hauppauge eeprom indicates model#%d\n", 3663 pr_info("%d: Hauppauge eeprom indicates model#%d\n",
3667 btv->c.nr, tv.model); 3664 btv->c.nr, tv.model);
3668 3665
3669 /* 3666 /*
@@ -3671,7 +3668,7 @@ static void __devinit hauppauge_eeprom(struct bttv *btv)
3671 * type based on model #. 3668 * type based on model #.
3672 */ 3669 */
3673 if(tv.model == 64900) { 3670 if(tv.model == 64900) {
3674 printk("bttv%d: Switching board type from %s to %s\n", 3671 pr_info("%d: Switching board type from %s to %s\n",
3675 btv->c.nr, 3672 btv->c.nr,
3676 bttv_tvcards[btv->c.type].name, 3673 bttv_tvcards[btv->c.type].name,
3677 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name); 3674 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
@@ -3698,8 +3695,7 @@ static int terratec_active_radio_upgrade(struct bttv *btv)
3698 freq=88000/62.5; 3695 freq=88000/62.5;
3699 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */ 3696 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3700 if (0x1ed8 == tea5757_read(btv)) { 3697 if (0x1ed8 == tea5757_read(btv)) {
3701 printk("bttv%d: Terratec Active Radio Upgrade found.\n", 3698 pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr);
3702 btv->c.nr);
3703 btv->has_radio = 1; 3699 btv->has_radio = 1;
3704 btv->has_saa6588 = 1; 3700 btv->has_saa6588 = 1;
3705 btv->has_matchbox = 1; 3701 btv->has_matchbox = 1;
@@ -3771,13 +3767,12 @@ static int __devinit pvr_boot(struct bttv *btv)
3771 3767
3772 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev); 3768 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3773 if (rc != 0) { 3769 if (rc != 0) {
3774 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n", 3770 pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr);
3775 btv->c.nr);
3776 return rc; 3771 return rc;
3777 } 3772 }
3778 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size); 3773 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3779 printk(KERN_INFO "bttv%d: altera firmware upload %s\n", 3774 pr_info("%d: altera firmware upload %s\n",
3780 btv->c.nr, (rc < 0) ? "failed" : "ok"); 3775 btv->c.nr, (rc < 0) ? "failed" : "ok");
3781 release_firmware(fw_entry); 3776 release_firmware(fw_entry);
3782 return rc; 3777 return rc;
3783} 3778}
@@ -3873,29 +3868,27 @@ static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
3873 break; 3868 break;
3874 default: 3869 default:
3875 /* unknown...leave generic, but get serial # */ 3870 /* unknown...leave generic, but get serial # */
3876 printk(KERN_INFO "bttv%d: " 3871 pr_info("%d: osprey eeprom: unknown card type 0x%04x\n",
3877 "osprey eeprom: unknown card type 0x%04x\n", 3872 btv->c.nr, type);
3878 btv->c.nr, type);
3879 break; 3873 break;
3880 } 3874 }
3881 serial = get_unaligned_be32((__be32 *)(ee+6)); 3875 serial = get_unaligned_be32((__be32 *)(ee+6));
3882 } 3876 }
3883 3877
3884 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n", 3878 pr_info("%d: osprey eeprom: card=%d '%s' serial=%u\n",
3885 btv->c.nr, cardid, 3879 btv->c.nr, cardid,
3886 cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial); 3880 cardid > 0 ? bttv_tvcards[cardid].name : "Unknown", serial);
3887 3881
3888 if (cardid<0 || btv->c.type == cardid) 3882 if (cardid<0 || btv->c.type == cardid)
3889 return; 3883 return;
3890 3884
3891 /* card type isn't set correctly */ 3885 /* card type isn't set correctly */
3892 if (card[btv->c.nr] < bttv_num_tvcards) { 3886 if (card[btv->c.nr] < bttv_num_tvcards) {
3893 printk(KERN_WARNING "bttv%d: osprey eeprom: " 3887 pr_warn("%d: osprey eeprom: Not overriding user specified card type\n",
3894 "Not overriding user specified card type\n", btv->c.nr); 3888 btv->c.nr);
3895 } else { 3889 } else {
3896 printk(KERN_INFO "bttv%d: osprey eeprom: " 3890 pr_info("%d: osprey eeprom: Changing card type from %d to %d\n",
3897 "Changing card type from %d to %d\n", btv->c.nr, 3891 btv->c.nr, btv->c.type, cardid);
3898 btv->c.type, cardid);
3899 btv->c.type = cardid; 3892 btv->c.type = cardid;
3900 } 3893 }
3901} 3894}
@@ -3938,14 +3931,14 @@ static void __devinit avermedia_eeprom(struct bttv *btv)
3938 if (tuner_format == 0x09) 3931 if (tuner_format == 0x09)
3939 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ 3932 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3940 3933
3941 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", 3934 pr_info("%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3942 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]); 3935 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
3943 if (tuner_type) { 3936 if (tuner_type) {
3944 btv->tuner_type = tuner_type; 3937 btv->tuner_type = tuner_type;
3945 printk(KERN_CONT "%d", tuner_type); 3938 pr_cont("%d", tuner_type);
3946 } else 3939 } else
3947 printk(KERN_CONT "Unknown type"); 3940 pr_cont("Unknown type");
3948 printk(KERN_CONT " radio:%s remote control:%s\n", 3941 pr_cont(" radio:%s remote control:%s\n",
3949 tuner_tv_fm ? "yes" : "no", 3942 tuner_tv_fm ? "yes" : "no",
3950 btv->has_remote ? "yes" : "no"); 3943 btv->has_remote ? "yes" : "no");
3951} 3944}
@@ -3993,8 +3986,8 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3993 if (bttv_gpio) 3986 if (bttv_gpio)
3994 bttv_gpio_tracking(btv,"msp34xx"); 3987 bttv_gpio_tracking(btv,"msp34xx");
3995 if (bttv_verbose) 3988 if (bttv_verbose)
3996 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line " 3989 pr_info("%d: Hauppauge/Voodoo msp34xx: reset line init [%d]\n",
3997 "init [%d]\n", btv->c.nr, pin); 3990 btv->c.nr, pin);
3998} 3991}
3999 3992
4000/* ----------------------------------------------------------------------- */ 3993/* ----------------------------------------------------------------------- */
@@ -4034,7 +4027,7 @@ static void __devinit init_PXC200(struct bttv *btv)
4034 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC); 4027 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4035 4028
4036 /* Initialise MAX517 DAC */ 4029 /* Initialise MAX517 DAC */
4037 printk(KERN_INFO "Setting DAC reference voltage level ...\n"); 4030 pr_info("Setting DAC reference voltage level ...\n");
4038 bttv_I2CWrite(btv,0x5E,0,0x80,1); 4031 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4039 4032
4040 /* Initialise 12C508 PIC */ 4033 /* Initialise 12C508 PIC */
@@ -4043,7 +4036,7 @@ static void __devinit init_PXC200(struct bttv *btv)
4043 * argument so the numbers are different */ 4036 * argument so the numbers are different */
4044 4037
4045 4038
4046 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n"); 4039 pr_info("Initialising 12C508 PIC chip ...\n");
4047 4040
4048 /* First of all, enable the clock line. This is used in the PXC200-F */ 4041 /* First of all, enable the clock line. This is used in the PXC200-F */
4049 val = btread(BT848_GPIO_DMA_CTL); 4042 val = btread(BT848_GPIO_DMA_CTL);
@@ -4062,13 +4055,12 @@ static void __devinit init_PXC200(struct bttv *btv)
4062 for (i = 0; i < ARRAY_SIZE(vals); i++) { 4055 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4063 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1); 4056 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4064 if (tmp != -1) { 4057 if (tmp != -1) {
4065 printk(KERN_INFO 4058 pr_info("I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4066 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4067 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL)); 4059 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4068 } 4060 }
4069 } 4061 }
4070 4062
4071 printk(KERN_INFO "PXC200 Initialised.\n"); 4063 pr_info("PXC200 Initialised\n");
4072} 4064}
4073 4065
4074 4066
@@ -4107,8 +4099,7 @@ init_RTV24 (struct bttv *btv)
4107 uint32_t dataRead = 0; 4099 uint32_t dataRead = 0;
4108 long watchdog_value = 0x0E; 4100 long watchdog_value = 0x0E;
4109 4101
4110 printk (KERN_INFO 4102 pr_info("%d: Adlink RTV-24 initialisation in progress ...\n",
4111 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
4112 btv->c.nr); 4103 btv->c.nr);
4113 4104
4114 btwrite (0x00c3feff, BT848_GPIO_OUT_EN); 4105 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
@@ -4122,8 +4113,7 @@ init_RTV24 (struct bttv *btv)
4122 dataRead = btread (BT848_GPIO_DATA); 4113 dataRead = btread (BT848_GPIO_DATA);
4123 4114
4124 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) { 4115 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4125 printk (KERN_INFO 4116 pr_info("%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4126 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4127 btv->c.nr, dataRead); 4117 btv->c.nr, dataRead);
4128 } 4118 }
4129 4119
@@ -4136,15 +4126,13 @@ init_RTV24 (struct bttv *btv)
4136 dataRead = btread (BT848_GPIO_DATA); 4126 dataRead = btread (BT848_GPIO_DATA);
4137 4127
4138 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) { 4128 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4139 printk (KERN_INFO 4129 pr_info("%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4140 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4141 btv->c.nr, dataRead); 4130 btv->c.nr, dataRead);
4142 4131
4143 return; 4132 return;
4144 } 4133 }
4145 4134
4146 printk (KERN_INFO 4135 pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr);
4147 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
4148} 4136}
4149 4137
4150 4138
@@ -4261,22 +4249,25 @@ static int tea5757_read(struct bttv *btv)
4261 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout)) 4249 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4262 schedule(); 4250 schedule();
4263 if (bus_in(btv,btv->mbox_data)) { 4251 if (bus_in(btv,btv->mbox_data)) {
4264 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr); 4252 pr_warn("%d: tea5757: read timeout\n", btv->c.nr);
4265 return -1; 4253 return -1;
4266 } 4254 }
4267 4255
4268 dprintk("bttv%d: tea5757:",btv->c.nr); 4256 dprintk("%d: tea5757:", btv->c.nr);
4269 for (i = 0; i < 24; i++) { 4257 for (i = 0; i < 24; i++) {
4270 udelay(5); 4258 udelay(5);
4271 bus_high(btv,btv->mbox_clk); 4259 bus_high(btv,btv->mbox_clk);
4272 udelay(5); 4260 udelay(5);
4273 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-'); 4261 dprintk_cont("%c",
4262 bus_in(btv, btv->mbox_most) == 0 ? 'T' : '-');
4274 bus_low(btv,btv->mbox_clk); 4263 bus_low(btv,btv->mbox_clk);
4275 value <<= 1; 4264 value <<= 1;
4276 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */ 4265 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4277 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M'); 4266 dprintk_cont("%c",
4267 bus_in(btv, btv->mbox_most) == 0 ? 'S' : 'M');
4278 } 4268 }
4279 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value); 4269 dprintk_cont("\n");
4270 dprintk("%d: tea5757: read 0x%X\n", btv->c.nr, value);
4280 return value; 4271 return value;
4281} 4272}
4282 4273
@@ -4295,7 +4286,7 @@ static int tea5757_write(struct bttv *btv, int value)
4295 if (bttv_gpio) 4286 if (bttv_gpio)
4296 bttv_gpio_tracking(btv,"tea5757 write"); 4287 bttv_gpio_tracking(btv,"tea5757 write");
4297 4288
4298 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value); 4289 dprintk("%d: tea5757: write 0x%X\n", btv->c.nr, value);
4299 bus_low(btv,btv->mbox_clk); 4290 bus_low(btv,btv->mbox_clk);
4300 bus_high(btv,btv->mbox_we); 4291 bus_high(btv,btv->mbox_we);
4301 for (i = 0; i < 25; i++) { 4292 for (i = 0; i < 25; i++) {
@@ -4547,7 +4538,7 @@ static void picolo_tetra_init(struct bttv *btv)
4547static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input) 4538static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4548{ 4539{
4549 4540
4550 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input); 4541 dprintk("%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input);
4551 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/ 4542 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4552 /*GPIO[20]&GPIO[21] used to choose the right input*/ 4543 /*GPIO[20]&GPIO[21] used to choose the right input*/
4553 btwrite (input<<20,BT848_GPIO_DATA); 4544 btwrite (input<<20,BT848_GPIO_DATA);
@@ -4592,7 +4583,7 @@ static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4592 int key = input % 4; 4583 int key = input % 4;
4593 int matrix = input / 4; 4584 int matrix = input / 4;
4594 4585
4595 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n", 4586 dprintk("%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4596 btv->c.nr, input, matrix, key); 4587 btv->c.nr, input, matrix, key);
4597 4588
4598 /* Handles the input selection on the TDA8540's */ 4589 /* Handles the input selection on the TDA8540's */
@@ -4649,15 +4640,17 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4649 buf[1]=0; 4640 buf[1]=0;
4650 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1); 4641 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4651 if (rc) { 4642 if (rc) {
4652 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc); 4643 pr_debug("%d: PXC200_muxsel: pic cfg write failed:%d\n",
4644 btv->c.nr, rc);
4653 /* not PXC ? do nothing */ 4645 /* not PXC ? do nothing */
4654 return; 4646 return;
4655 } 4647 }
4656 4648
4657 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL); 4649 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4658 if (!(rc & PX_CFG_PXC200F)) { 4650 if (!(rc & PX_CFG_PXC200F)) {
4659 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc); 4651 pr_debug("%d: PXC200_muxsel: not PXC200F rc:%d\n",
4660 return; 4652 btv->c.nr, rc);
4653 return;
4661 } 4654 }
4662 4655
4663 4656
@@ -4696,7 +4689,7 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4696 else /* older device */ 4689 else /* older device */
4697 btand(~BT848_IFORM_MUXSEL,BT848_IFORM); 4690 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4698 4691
4699 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux); 4692 pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux);
4700} 4693}
4701 4694
4702static void phytec_muxsel(struct bttv *btv, unsigned int input) 4695static void phytec_muxsel(struct bttv *btv, unsigned int input)
@@ -4847,29 +4840,27 @@ void __init bttv_check_chipset(void)
4847 4840
4848 /* print warnings about any quirks found */ 4841 /* print warnings about any quirks found */
4849 if (triton1) 4842 if (triton1)
4850 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n"); 4843 pr_info("Host bridge needs ETBF enabled\n");
4851 if (vsfx) 4844 if (vsfx)
4852 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n"); 4845 pr_info("Host bridge needs VSFX enabled\n");
4853 if (pcipci_fail) { 4846 if (pcipci_fail) {
4854 printk(KERN_INFO "bttv: bttv and your chipset may not work " 4847 pr_info("bttv and your chipset may not work together\n");
4855 "together.\n");
4856 if (!no_overlay) { 4848 if (!no_overlay) {
4857 printk(KERN_INFO "bttv: overlay will be disabled.\n"); 4849 pr_info("overlay will be disabled\n");
4858 no_overlay = 1; 4850 no_overlay = 1;
4859 } else { 4851 } else {
4860 printk(KERN_INFO "bttv: overlay forced. Use this " 4852 pr_info("overlay forced. Use this option at your own risk.\n");
4861 "option at your own risk.\n");
4862 } 4853 }
4863 } 4854 }
4864 if (UNSET != latency) 4855 if (UNSET != latency)
4865 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency); 4856 pr_info("pci latency fixup [%d]\n", latency);
4866 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL, 4857 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4867 PCI_DEVICE_ID_INTEL_82441, dev))) { 4858 PCI_DEVICE_ID_INTEL_82441, dev))) {
4868 unsigned char b; 4859 unsigned char b;
4869 pci_read_config_byte(dev, 0x53, &b); 4860 pci_read_config_byte(dev, 0x53, &b);
4870 if (bttv_debug) 4861 if (bttv_debug)
4871 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, " 4862 pr_info("Host bridge: 82441FX Natoma, bufcon=0x%02x\n",
4872 "bufcon=0x%02x\n",b); 4863 b);
4873 } 4864 }
4874} 4865}
4875 4866
@@ -4882,12 +4873,13 @@ int __devinit bttv_handle_chipset(struct bttv *btv)
4882 4873
4883 if (bttv_verbose) { 4874 if (bttv_verbose) {
4884 if (triton1) 4875 if (triton1)
4885 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr); 4876 pr_info("%d: enabling ETBF (430FX/VP3 compatibility)\n",
4877 btv->c.nr);
4886 if (vsfx && btv->id >= 878) 4878 if (vsfx && btv->id >= 878)
4887 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr); 4879 pr_info("%d: enabling VSFX\n", btv->c.nr);
4888 if (UNSET != latency) 4880 if (UNSET != latency)
4889 printk(KERN_INFO "bttv%d: setting pci timer to %d\n", 4881 pr_info("%d: setting pci timer to %d\n",
4890 btv->c.nr,latency); 4882 btv->c.nr, latency);
4891 } 4883 }
4892 4884
4893 if (btv->id < 878) { 4885 if (btv->id < 878) {
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 14444de67d5e..3dd06607aec2 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -34,6 +34,8 @@
34 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 34 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35*/ 35*/
36 36
37#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
38
37#include <linux/init.h> 39#include <linux/init.h>
38#include <linux/module.h> 40#include <linux/module.h>
39#include <linux/delay.h> 41#include <linux/delay.h>
@@ -942,8 +944,8 @@ static
942void free_btres_lock(struct bttv *btv, struct bttv_fh *fh, int bits) 944void free_btres_lock(struct bttv *btv, struct bttv_fh *fh, int bits)
943{ 945{
944 if ((fh->resources & bits) != bits) { 946 if ((fh->resources & bits) != bits) {
945 /* trying to free ressources not allocated by us ... */ 947 /* trying to free resources not allocated by us ... */
946 printk("bttv: BUG! (btres)\n"); 948 pr_err("BUG! (btres)\n");
947 } 949 }
948 fh->resources &= ~bits; 950 fh->resources &= ~bits;
949 btv->resources &= ~bits; 951 btv->resources &= ~bits;
@@ -1000,7 +1002,7 @@ static void set_pll(struct bttv *btv)
1000 return; 1002 return;
1001 1003
1002 if (btv->pll.pll_ofreq == btv->pll.pll_current) { 1004 if (btv->pll.pll_ofreq == btv->pll.pll_current) {
1003 dprintk("bttv%d: PLL: no change required\n",btv->c.nr); 1005 dprintk("%d: PLL: no change required\n", btv->c.nr);
1004 return; 1006 return;
1005 } 1007 }
1006 1008
@@ -1008,21 +1010,23 @@ static void set_pll(struct bttv *btv)
1008 /* no PLL needed */ 1010 /* no PLL needed */
1009 if (btv->pll.pll_current == 0) 1011 if (btv->pll.pll_current == 0)
1010 return; 1012 return;
1011 bttv_printk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n", 1013 if (bttv_verbose)
1012 btv->c.nr,btv->pll.pll_ifreq); 1014 pr_info("%d: PLL can sleep, using XTAL (%d)\n",
1015 btv->c.nr, btv->pll.pll_ifreq);
1013 btwrite(0x00,BT848_TGCTRL); 1016 btwrite(0x00,BT848_TGCTRL);
1014 btwrite(0x00,BT848_PLL_XCI); 1017 btwrite(0x00,BT848_PLL_XCI);
1015 btv->pll.pll_current = 0; 1018 btv->pll.pll_current = 0;
1016 return; 1019 return;
1017 } 1020 }
1018 1021
1019 bttv_printk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->c.nr, 1022 if (bttv_verbose)
1020 btv->pll.pll_ifreq, btv->pll.pll_ofreq); 1023 pr_info("%d: Setting PLL: %d => %d (needs up to 100ms)\n",
1024 btv->c.nr,
1025 btv->pll.pll_ifreq, btv->pll.pll_ofreq);
1021 set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq); 1026 set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq);
1022 1027
1023 for (i=0; i<10; i++) { 1028 for (i=0; i<10; i++) {
1024 /* Let other people run while the PLL stabilizes */ 1029 /* Let other people run while the PLL stabilizes */
1025 bttv_printk(".");
1026 msleep(10); 1030 msleep(10);
1027 1031
1028 if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) { 1032 if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) {
@@ -1030,12 +1034,14 @@ static void set_pll(struct bttv *btv)
1030 } else { 1034 } else {
1031 btwrite(0x08,BT848_TGCTRL); 1035 btwrite(0x08,BT848_TGCTRL);
1032 btv->pll.pll_current = btv->pll.pll_ofreq; 1036 btv->pll.pll_current = btv->pll.pll_ofreq;
1033 bttv_printk(" ok\n"); 1037 if (bttv_verbose)
1038 pr_info("PLL set ok\n");
1034 return; 1039 return;
1035 } 1040 }
1036 } 1041 }
1037 btv->pll.pll_current = -1; 1042 btv->pll.pll_current = -1;
1038 bttv_printk("failed\n"); 1043 if (bttv_verbose)
1044 pr_info("Setting PLL failed\n");
1039 return; 1045 return;
1040} 1046}
1041 1047
@@ -1047,7 +1053,7 @@ static void bt848A_set_timing(struct bttv *btv)
1047 int fsc = bttv_tvnorms[btv->tvnorm].Fsc; 1053 int fsc = bttv_tvnorms[btv->tvnorm].Fsc;
1048 1054
1049 if (btv->input == btv->dig) { 1055 if (btv->input == btv->dig) {
1050 dprintk("bttv%d: load digital timing table (table_idx=%d)\n", 1056 dprintk("%d: load digital timing table (table_idx=%d)\n",
1051 btv->c.nr,table_idx); 1057 btv->c.nr,table_idx);
1052 1058
1053 /* timing change...reset timing generator address */ 1059 /* timing change...reset timing generator address */
@@ -1076,7 +1082,7 @@ static void bt848_bright(struct bttv *btv, int bright)
1076{ 1082{
1077 int value; 1083 int value;
1078 1084
1079 // printk("bttv: set bright: %d\n",bright); // DEBUG 1085 // printk("set bright: %d\n", bright); // DEBUG
1080 btv->bright = bright; 1086 btv->bright = bright;
1081 1087
1082 /* We want -128 to 127 we get 0-65535 */ 1088 /* We want -128 to 127 we get 0-65535 */
@@ -1150,8 +1156,7 @@ video_mux(struct bttv *btv, unsigned int input)
1150 } 1156 }
1151 mux = bttv_muxsel(btv, input); 1157 mux = bttv_muxsel(btv, input);
1152 btaor(mux<<5, ~(3<<5), BT848_IFORM); 1158 btaor(mux<<5, ~(3<<5), BT848_IFORM);
1153 dprintk(KERN_DEBUG "bttv%d: video mux: input=%d mux=%d\n", 1159 dprintk("%d: video mux: input=%d mux=%d\n", btv->c.nr, input, mux);
1154 btv->c.nr,input,mux);
1155 1160
1156 /* card specific hook */ 1161 /* card specific hook */
1157 if(bttv_tvcards[btv->c.type].muxsel_hook) 1162 if(bttv_tvcards[btv->c.type].muxsel_hook)
@@ -1440,7 +1445,7 @@ static void bttv_reinit_bt848(struct bttv *btv)
1440 unsigned long flags; 1445 unsigned long flags;
1441 1446
1442 if (bttv_verbose) 1447 if (bttv_verbose)
1443 printk(KERN_INFO "bttv%d: reset, reinitialize\n",btv->c.nr); 1448 pr_info("%d: reset, reinitialize\n", btv->c.nr);
1444 spin_lock_irqsave(&btv->s_lock,flags); 1449 spin_lock_irqsave(&btv->s_lock,flags);
1445 btv->errors=0; 1450 btv->errors=0;
1446 bttv_set_dma(btv,0); 1451 bttv_set_dma(btv,0);
@@ -1622,8 +1627,8 @@ void bttv_gpio_tracking(struct bttv *btv, char *comment)
1622 unsigned int outbits, data; 1627 unsigned int outbits, data;
1623 outbits = btread(BT848_GPIO_OUT_EN); 1628 outbits = btread(BT848_GPIO_OUT_EN);
1624 data = btread(BT848_GPIO_DATA); 1629 data = btread(BT848_GPIO_DATA);
1625 printk(KERN_DEBUG "bttv%d: gpio: en=%08x, out=%08x in=%08x [%s]\n", 1630 pr_debug("%d: gpio: en=%08x, out=%08x in=%08x [%s]\n",
1626 btv->c.nr,outbits,data & outbits, data & ~outbits, comment); 1631 btv->c.nr, outbits, data & outbits, data & ~outbits, comment);
1627} 1632}
1628 1633
1629static void bttv_field_count(struct bttv *btv) 1634static void bttv_field_count(struct bttv *btv)
@@ -1668,7 +1673,7 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
1668 unsigned long flags; 1673 unsigned long flags;
1669 int retval = 0; 1674 int retval = 0;
1670 1675
1671 dprintk("switch_overlay: enter [new=%p]\n",new); 1676 dprintk("switch_overlay: enter [new=%p]\n", new);
1672 if (new) 1677 if (new)
1673 new->vb.state = VIDEOBUF_DONE; 1678 new->vb.state = VIDEOBUF_DONE;
1674 spin_lock_irqsave(&btv->s_lock,flags); 1679 spin_lock_irqsave(&btv->s_lock,flags);
@@ -1678,7 +1683,8 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
1678 bttv_set_dma(btv, 0x03); 1683 bttv_set_dma(btv, 0x03);
1679 spin_unlock_irqrestore(&btv->s_lock,flags); 1684 spin_unlock_irqrestore(&btv->s_lock,flags);
1680 if (NULL != old) { 1685 if (NULL != old) {
1681 dprintk("switch_overlay: old=%p state is %d\n",old,old->vb.state); 1686 dprintk("switch_overlay: old=%p state is %d\n",
1687 old, old->vb.state);
1682 bttv_dma_free(&fh->cap,btv, old); 1688 bttv_dma_free(&fh->cap,btv, old);
1683 kfree(old); 1689 kfree(old);
1684 } 1690 }
@@ -2029,11 +2035,11 @@ static int bttv_log_status(struct file *file, void *f)
2029 struct bttv_fh *fh = f; 2035 struct bttv_fh *fh = f;
2030 struct bttv *btv = fh->btv; 2036 struct bttv *btv = fh->btv;
2031 2037
2032 printk(KERN_INFO "bttv%d: ======== START STATUS CARD #%d ========\n", 2038 pr_info("%d: ======== START STATUS CARD #%d ========\n",
2033 btv->c.nr, btv->c.nr); 2039 btv->c.nr, btv->c.nr);
2034 bttv_call_all(btv, core, log_status); 2040 bttv_call_all(btv, core, log_status);
2035 printk(KERN_INFO "bttv%d: ======== END STATUS CARD #%d ========\n", 2041 pr_info("%d: ======== END STATUS CARD #%d ========\n",
2036 btv->c.nr, btv->c.nr); 2042 btv->c.nr, btv->c.nr);
2037 return 0; 2043 return 0;
2038} 2044}
2039 2045
@@ -2598,7 +2604,7 @@ static int bttv_s_fmt_vid_overlay(struct file *file, void *priv,
2598 struct bttv *btv = fh->btv; 2604 struct bttv *btv = fh->btv;
2599 2605
2600 if (no_overlay > 0) { 2606 if (no_overlay > 0) {
2601 printk(KERN_ERR "V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); 2607 pr_err("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n");
2602 return -EINVAL; 2608 return -EINVAL;
2603 } 2609 }
2604 2610
@@ -2673,7 +2679,7 @@ static int bttv_enum_fmt_vid_overlay(struct file *file, void *priv,
2673 int rc; 2679 int rc;
2674 2680
2675 if (no_overlay > 0) { 2681 if (no_overlay > 0) {
2676 printk(KERN_ERR "V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); 2682 pr_err("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n");
2677 return -EINVAL; 2683 return -EINVAL;
2678 } 2684 }
2679 2685
@@ -2714,7 +2720,7 @@ static int bttv_overlay(struct file *file, void *f, unsigned int on)
2714 return -EINVAL; 2720 return -EINVAL;
2715 } 2721 }
2716 if (unlikely(!fh->ov.setup_ok)) { 2722 if (unlikely(!fh->ov.setup_ok)) {
2717 dprintk("bttv%d: overlay: !setup_ok\n", btv->c.nr); 2723 dprintk("%d: overlay: !setup_ok\n", btv->c.nr);
2718 retval = -EINVAL; 2724 retval = -EINVAL;
2719 } 2725 }
2720 if (retval) 2726 if (retval)
@@ -3091,8 +3097,8 @@ static ssize_t bttv_read(struct file *file, char __user *data,
3091 3097
3092 if (fh->btv->errors) 3098 if (fh->btv->errors)
3093 bttv_reinit_bt848(fh->btv); 3099 bttv_reinit_bt848(fh->btv);
3094 dprintk("bttv%d: read count=%d type=%s\n", 3100 dprintk("%d: read count=%d type=%s\n",
3095 fh->btv->c.nr,(int)count,v4l2_type_names[fh->type]); 3101 fh->btv->c.nr, (int)count, v4l2_type_names[fh->type]);
3096 3102
3097 switch (fh->type) { 3103 switch (fh->type) {
3098 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 3104 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
@@ -3174,7 +3180,7 @@ static int bttv_open(struct file *file)
3174 struct bttv_fh *fh; 3180 struct bttv_fh *fh;
3175 enum v4l2_buf_type type = 0; 3181 enum v4l2_buf_type type = 0;
3176 3182
3177 dprintk(KERN_DEBUG "bttv: open dev=%s\n", video_device_node_name(vdev)); 3183 dprintk("open dev=%s\n", video_device_node_name(vdev));
3178 3184
3179 if (vdev->vfl_type == VFL_TYPE_GRABBER) { 3185 if (vdev->vfl_type == VFL_TYPE_GRABBER) {
3180 type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 3186 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -3185,8 +3191,8 @@ static int bttv_open(struct file *file)
3185 return -ENODEV; 3191 return -ENODEV;
3186 } 3192 }
3187 3193
3188 dprintk(KERN_DEBUG "bttv%d: open called (type=%s)\n", 3194 dprintk("%d: open called (type=%s)\n",
3189 btv->c.nr,v4l2_type_names[type]); 3195 btv->c.nr, v4l2_type_names[type]);
3190 3196
3191 /* allocate per filehandle data */ 3197 /* allocate per filehandle data */
3192 fh = kmalloc(sizeof(*fh), GFP_KERNEL); 3198 fh = kmalloc(sizeof(*fh), GFP_KERNEL);
@@ -3288,7 +3294,7 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma)
3288{ 3294{
3289 struct bttv_fh *fh = file->private_data; 3295 struct bttv_fh *fh = file->private_data;
3290 3296
3291 dprintk("bttv%d: mmap type=%s 0x%lx+%ld\n", 3297 dprintk("%d: mmap type=%s 0x%lx+%ld\n",
3292 fh->btv->c.nr, v4l2_type_names[fh->type], 3298 fh->btv->c.nr, v4l2_type_names[fh->type],
3293 vma->vm_start, vma->vm_end - vma->vm_start); 3299 vma->vm_start, vma->vm_end - vma->vm_start);
3294 return videobuf_mmap_mapper(bttv_queue(fh),vma); 3300 return videobuf_mmap_mapper(bttv_queue(fh),vma);
@@ -3370,9 +3376,9 @@ static int radio_open(struct file *file)
3370 struct bttv *btv = video_drvdata(file); 3376 struct bttv *btv = video_drvdata(file);
3371 struct bttv_fh *fh; 3377 struct bttv_fh *fh;
3372 3378
3373 dprintk("bttv: open dev=%s\n", video_device_node_name(vdev)); 3379 dprintk("open dev=%s\n", video_device_node_name(vdev));
3374 3380
3375 dprintk("bttv%d: open called (radio)\n",btv->c.nr); 3381 dprintk("%d: open called (radio)\n", btv->c.nr);
3376 3382
3377 /* allocate per filehandle data */ 3383 /* allocate per filehandle data */
3378 fh = kmalloc(sizeof(*fh), GFP_KERNEL); 3384 fh = kmalloc(sizeof(*fh), GFP_KERNEL);
@@ -3616,12 +3622,12 @@ static int bttv_risc_decode(u32 risc)
3616 }; 3622 };
3617 int i; 3623 int i;
3618 3624
3619 printk("0x%08x [ %s", risc, 3625 pr_cont("0x%08x [ %s", risc,
3620 instr[risc >> 28] ? instr[risc >> 28] : "INVALID"); 3626 instr[risc >> 28] ? instr[risc >> 28] : "INVALID");
3621 for (i = ARRAY_SIZE(bits)-1; i >= 0; i--) 3627 for (i = ARRAY_SIZE(bits)-1; i >= 0; i--)
3622 if (risc & (1 << (i + 12))) 3628 if (risc & (1 << (i + 12)))
3623 printk(" %s",bits[i]); 3629 pr_cont(" %s", bits[i]);
3624 printk(" count=%d ]\n", risc & 0xfff); 3630 pr_cont(" count=%d ]\n", risc & 0xfff);
3625 return incr[risc >> 28] ? incr[risc >> 28] : 1; 3631 return incr[risc >> 28] ? incr[risc >> 28] : 1;
3626} 3632}
3627 3633
@@ -3630,16 +3636,18 @@ static void bttv_risc_disasm(struct bttv *btv,
3630{ 3636{
3631 unsigned int i,j,n; 3637 unsigned int i,j,n;
3632 3638
3633 printk("%s: risc disasm: %p [dma=0x%08lx]\n", 3639 pr_info("%s: risc disasm: %p [dma=0x%08lx]\n",
3634 btv->c.v4l2_dev.name, risc->cpu, (unsigned long)risc->dma); 3640 btv->c.v4l2_dev.name, risc->cpu, (unsigned long)risc->dma);
3635 for (i = 0; i < (risc->size >> 2); i += n) { 3641 for (i = 0; i < (risc->size >> 2); i += n) {
3636 printk("%s: 0x%lx: ", btv->c.v4l2_dev.name, 3642 pr_info("%s: 0x%lx: ",
3637 (unsigned long)(risc->dma + (i<<2))); 3643 btv->c.v4l2_dev.name,
3644 (unsigned long)(risc->dma + (i<<2)));
3638 n = bttv_risc_decode(le32_to_cpu(risc->cpu[i])); 3645 n = bttv_risc_decode(le32_to_cpu(risc->cpu[i]));
3639 for (j = 1; j < n; j++) 3646 for (j = 1; j < n; j++)
3640 printk("%s: 0x%lx: 0x%08x [ arg #%d ]\n", 3647 pr_info("%s: 0x%lx: 0x%08x [ arg #%d ]\n",
3641 btv->c.v4l2_dev.name, (unsigned long)(risc->dma + ((i+j)<<2)), 3648 btv->c.v4l2_dev.name,
3642 risc->cpu[i+j], j); 3649 (unsigned long)(risc->dma + ((i+j)<<2)),
3650 risc->cpu[i+j], j);
3643 if (0 == risc->cpu[i]) 3651 if (0 == risc->cpu[i])
3644 break; 3652 break;
3645 } 3653 }
@@ -3647,17 +3655,18 @@ static void bttv_risc_disasm(struct bttv *btv,
3647 3655
3648static void bttv_print_riscaddr(struct bttv *btv) 3656static void bttv_print_riscaddr(struct bttv *btv)
3649{ 3657{
3650 printk(" main: %08Lx\n", 3658 pr_info(" main: %08llx\n", (unsigned long long)btv->main.dma);
3651 (unsigned long long)btv->main.dma); 3659 pr_info(" vbi : o=%08llx e=%08llx\n",
3652 printk(" vbi : o=%08Lx e=%08Lx\n", 3660 btv->cvbi ? (unsigned long long)btv->cvbi->top.dma : 0,
3653 btv->cvbi ? (unsigned long long)btv->cvbi->top.dma : 0, 3661 btv->cvbi ? (unsigned long long)btv->cvbi->bottom.dma : 0);
3654 btv->cvbi ? (unsigned long long)btv->cvbi->bottom.dma : 0); 3662 pr_info(" cap : o=%08llx e=%08llx\n",
3655 printk(" cap : o=%08Lx e=%08Lx\n", 3663 btv->curr.top
3656 btv->curr.top ? (unsigned long long)btv->curr.top->top.dma : 0, 3664 ? (unsigned long long)btv->curr.top->top.dma : 0,
3657 btv->curr.bottom ? (unsigned long long)btv->curr.bottom->bottom.dma : 0); 3665 btv->curr.bottom
3658 printk(" scr : o=%08Lx e=%08Lx\n", 3666 ? (unsigned long long)btv->curr.bottom->bottom.dma : 0);
3659 btv->screen ? (unsigned long long)btv->screen->top.dma : 0, 3667 pr_info(" scr : o=%08llx e=%08llx\n",
3660 btv->screen ? (unsigned long long)btv->screen->bottom.dma : 0); 3668 btv->screen ? (unsigned long long)btv->screen->top.dma : 0,
3669 btv->screen ? (unsigned long long)btv->screen->bottom.dma : 0);
3661 bttv_risc_disasm(btv, &btv->main); 3670 bttv_risc_disasm(btv, &btv->main);
3662} 3671}
3663 3672
@@ -3690,34 +3699,34 @@ static void bttv_print_irqbits(u32 print, u32 mark)
3690{ 3699{
3691 unsigned int i; 3700 unsigned int i;
3692 3701
3693 printk("bits:"); 3702 pr_cont("bits:");
3694 for (i = 0; i < ARRAY_SIZE(irq_name); i++) { 3703 for (i = 0; i < ARRAY_SIZE(irq_name); i++) {
3695 if (print & (1 << i)) 3704 if (print & (1 << i))
3696 printk(" %s",irq_name[i]); 3705 pr_cont(" %s", irq_name[i]);
3697 if (mark & (1 << i)) 3706 if (mark & (1 << i))
3698 printk("*"); 3707 pr_cont("*");
3699 } 3708 }
3700} 3709}
3701 3710
3702static void bttv_irq_debug_low_latency(struct bttv *btv, u32 rc) 3711static void bttv_irq_debug_low_latency(struct bttv *btv, u32 rc)
3703{ 3712{
3704 printk("bttv%d: irq: skipped frame [main=%lx,o_vbi=%lx,o_field=%lx,rc=%lx]\n", 3713 pr_warn("%d: irq: skipped frame [main=%lx,o_vbi=%lx,o_field=%lx,rc=%lx]\n",
3705 btv->c.nr, 3714 btv->c.nr,
3706 (unsigned long)btv->main.dma, 3715 (unsigned long)btv->main.dma,
3707 (unsigned long)le32_to_cpu(btv->main.cpu[RISC_SLOT_O_VBI+1]), 3716 (unsigned long)le32_to_cpu(btv->main.cpu[RISC_SLOT_O_VBI+1]),
3708 (unsigned long)le32_to_cpu(btv->main.cpu[RISC_SLOT_O_FIELD+1]), 3717 (unsigned long)le32_to_cpu(btv->main.cpu[RISC_SLOT_O_FIELD+1]),
3709 (unsigned long)rc); 3718 (unsigned long)rc);
3710 3719
3711 if (0 == (btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC)) { 3720 if (0 == (btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC)) {
3712 printk("bttv%d: Oh, there (temporarely?) is no input signal. " 3721 pr_notice("%d: Oh, there (temporarily?) is no input signal. "
3713 "Ok, then this is harmless, don't worry ;)\n", 3722 "Ok, then this is harmless, don't worry ;)\n",
3714 btv->c.nr); 3723 btv->c.nr);
3715 return; 3724 return;
3716 } 3725 }
3717 printk("bttv%d: Uhm. Looks like we have unusual high IRQ latencies.\n", 3726 pr_notice("%d: Uhm. Looks like we have unusual high IRQ latencies\n",
3718 btv->c.nr); 3727 btv->c.nr);
3719 printk("bttv%d: Lets try to catch the culpit red-handed ...\n", 3728 pr_notice("%d: Lets try to catch the culpit red-handed ...\n",
3720 btv->c.nr); 3729 btv->c.nr);
3721 dump_stack(); 3730 dump_stack();
3722} 3731}
3723 3732
@@ -3798,9 +3807,9 @@ bttv_irq_next_video(struct bttv *btv, struct bttv_buffer_set *set)
3798 } 3807 }
3799 } 3808 }
3800 3809
3801 dprintk("bttv%d: next set: top=%p bottom=%p [screen=%p,irq=%d,%d]\n", 3810 dprintk("%d: next set: top=%p bottom=%p [screen=%p,irq=%d,%d]\n",
3802 btv->c.nr,set->top, set->bottom, 3811 btv->c.nr, set->top, set->bottom,
3803 btv->screen,set->frame_irq,set->top_irq); 3812 btv->screen, set->frame_irq, set->top_irq);
3804 return 0; 3813 return 0;
3805} 3814}
3806 3815
@@ -3815,7 +3824,8 @@ bttv_irq_wakeup_video(struct bttv *btv, struct bttv_buffer_set *wakeup,
3815 if (wakeup->top == wakeup->bottom) { 3824 if (wakeup->top == wakeup->bottom) {
3816 if (NULL != wakeup->top && curr->top != wakeup->top) { 3825 if (NULL != wakeup->top && curr->top != wakeup->top) {
3817 if (irq_debug > 1) 3826 if (irq_debug > 1)
3818 printk("bttv%d: wakeup: both=%p\n",btv->c.nr,wakeup->top); 3827 pr_debug("%d: wakeup: both=%p\n",
3828 btv->c.nr, wakeup->top);
3819 wakeup->top->vb.ts = ts; 3829 wakeup->top->vb.ts = ts;
3820 wakeup->top->vb.field_count = btv->field_count; 3830 wakeup->top->vb.field_count = btv->field_count;
3821 wakeup->top->vb.state = state; 3831 wakeup->top->vb.state = state;
@@ -3824,7 +3834,8 @@ bttv_irq_wakeup_video(struct bttv *btv, struct bttv_buffer_set *wakeup,
3824 } else { 3834 } else {
3825 if (NULL != wakeup->top && curr->top != wakeup->top) { 3835 if (NULL != wakeup->top && curr->top != wakeup->top) {
3826 if (irq_debug > 1) 3836 if (irq_debug > 1)
3827 printk("bttv%d: wakeup: top=%p\n",btv->c.nr,wakeup->top); 3837 pr_debug("%d: wakeup: top=%p\n",
3838 btv->c.nr, wakeup->top);
3828 wakeup->top->vb.ts = ts; 3839 wakeup->top->vb.ts = ts;
3829 wakeup->top->vb.field_count = btv->field_count; 3840 wakeup->top->vb.field_count = btv->field_count;
3830 wakeup->top->vb.state = state; 3841 wakeup->top->vb.state = state;
@@ -3832,7 +3843,8 @@ bttv_irq_wakeup_video(struct bttv *btv, struct bttv_buffer_set *wakeup,
3832 } 3843 }
3833 if (NULL != wakeup->bottom && curr->bottom != wakeup->bottom) { 3844 if (NULL != wakeup->bottom && curr->bottom != wakeup->bottom) {
3834 if (irq_debug > 1) 3845 if (irq_debug > 1)
3835 printk("bttv%d: wakeup: bottom=%p\n",btv->c.nr,wakeup->bottom); 3846 pr_debug("%d: wakeup: bottom=%p\n",
3847 btv->c.nr, wakeup->bottom);
3836 wakeup->bottom->vb.ts = ts; 3848 wakeup->bottom->vb.ts = ts;
3837 wakeup->bottom->vb.field_count = btv->field_count; 3849 wakeup->bottom->vb.field_count = btv->field_count;
3838 wakeup->bottom->vb.state = state; 3850 wakeup->bottom->vb.state = state;
@@ -3866,11 +3878,11 @@ static void bttv_irq_timeout(unsigned long data)
3866 unsigned long flags; 3878 unsigned long flags;
3867 3879
3868 if (bttv_verbose) { 3880 if (bttv_verbose) {
3869 printk(KERN_INFO "bttv%d: timeout: drop=%d irq=%d/%d, risc=%08x, ", 3881 pr_info("%d: timeout: drop=%d irq=%d/%d, risc=%08x, ",
3870 btv->c.nr, btv->framedrop, btv->irq_me, btv->irq_total, 3882 btv->c.nr, btv->framedrop, btv->irq_me, btv->irq_total,
3871 btread(BT848_RISC_COUNT)); 3883 btread(BT848_RISC_COUNT));
3872 bttv_print_irqbits(btread(BT848_INT_STAT),0); 3884 bttv_print_irqbits(btread(BT848_INT_STAT),0);
3873 printk("\n"); 3885 pr_cont("\n");
3874 } 3886 }
3875 3887
3876 spin_lock_irqsave(&btv->s_lock,flags); 3888 spin_lock_irqsave(&btv->s_lock,flags);
@@ -4033,21 +4045,23 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
4033 dstat=btread(BT848_DSTATUS); 4045 dstat=btread(BT848_DSTATUS);
4034 4046
4035 if (irq_debug) { 4047 if (irq_debug) {
4036 printk(KERN_DEBUG "bttv%d: irq loop=%d fc=%d " 4048 pr_debug("%d: irq loop=%d fc=%d riscs=%x, riscc=%08x, ",
4037 "riscs=%x, riscc=%08x, ", 4049 btv->c.nr, count, btv->field_count,
4038 btv->c.nr, count, btv->field_count, 4050 stat>>28, btread(BT848_RISC_COUNT));
4039 stat>>28, btread(BT848_RISC_COUNT));
4040 bttv_print_irqbits(stat,astat); 4051 bttv_print_irqbits(stat,astat);
4041 if (stat & BT848_INT_HLOCK) 4052 if (stat & BT848_INT_HLOCK)
4042 printk(" HLOC => %s", (dstat & BT848_DSTATUS_HLOC) 4053 pr_cont(" HLOC => %s",
4043 ? "yes" : "no"); 4054 dstat & BT848_DSTATUS_HLOC
4055 ? "yes" : "no");
4044 if (stat & BT848_INT_VPRES) 4056 if (stat & BT848_INT_VPRES)
4045 printk(" PRES => %s", (dstat & BT848_DSTATUS_PRES) 4057 pr_cont(" PRES => %s",
4046 ? "yes" : "no"); 4058 dstat & BT848_DSTATUS_PRES
4059 ? "yes" : "no");
4047 if (stat & BT848_INT_FMTCHG) 4060 if (stat & BT848_INT_FMTCHG)
4048 printk(" NUML => %s", (dstat & BT848_DSTATUS_NUML) 4061 pr_cont(" NUML => %s",
4049 ? "625" : "525"); 4062 dstat & BT848_DSTATUS_NUML
4050 printk("\n"); 4063 ? "625" : "525");
4064 pr_cont("\n");
4051 } 4065 }
4052 4066
4053 if (astat&BT848_INT_VSYNC) 4067 if (astat&BT848_INT_VSYNC)
@@ -4075,18 +4089,19 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
4075 audio_mute(btv, btv->mute); /* trigger automute */ 4089 audio_mute(btv, btv->mute); /* trigger automute */
4076 4090
4077 if (astat & (BT848_INT_SCERR|BT848_INT_OCERR)) { 4091 if (astat & (BT848_INT_SCERR|BT848_INT_OCERR)) {
4078 printk(KERN_INFO "bttv%d: %s%s @ %08x,",btv->c.nr, 4092 pr_info("%d: %s%s @ %08x,",
4079 (astat & BT848_INT_SCERR) ? "SCERR" : "", 4093 btv->c.nr,
4080 (astat & BT848_INT_OCERR) ? "OCERR" : "", 4094 (astat & BT848_INT_SCERR) ? "SCERR" : "",
4081 btread(BT848_RISC_COUNT)); 4095 (astat & BT848_INT_OCERR) ? "OCERR" : "",
4096 btread(BT848_RISC_COUNT));
4082 bttv_print_irqbits(stat,astat); 4097 bttv_print_irqbits(stat,astat);
4083 printk("\n"); 4098 pr_cont("\n");
4084 if (bttv_debug) 4099 if (bttv_debug)
4085 bttv_print_riscaddr(btv); 4100 bttv_print_riscaddr(btv);
4086 } 4101 }
4087 if (fdsr && astat & BT848_INT_FDSR) { 4102 if (fdsr && astat & BT848_INT_FDSR) {
4088 printk(KERN_INFO "bttv%d: FDSR @ %08x\n", 4103 pr_info("%d: FDSR @ %08x\n",
4089 btv->c.nr,btread(BT848_RISC_COUNT)); 4104 btv->c.nr, btread(BT848_RISC_COUNT));
4090 if (bttv_debug) 4105 if (bttv_debug)
4091 bttv_print_riscaddr(btv); 4106 bttv_print_riscaddr(btv);
4092 } 4107 }
@@ -4097,11 +4112,11 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
4097 if (count > 8 || !(astat & BT848_INT_GPINT)) { 4112 if (count > 8 || !(astat & BT848_INT_GPINT)) {
4098 btwrite(0, BT848_INT_MASK); 4113 btwrite(0, BT848_INT_MASK);
4099 4114
4100 printk(KERN_ERR 4115 pr_err("%d: IRQ lockup, cleared int mask [",
4101 "bttv%d: IRQ lockup, cleared int mask [", btv->c.nr); 4116 btv->c.nr);
4102 } else { 4117 } else {
4103 printk(KERN_ERR 4118 pr_err("%d: IRQ lockup, clearing GPINT from int mask [",
4104 "bttv%d: IRQ lockup, clearing GPINT from int mask [", btv->c.nr); 4119 btv->c.nr);
4105 4120
4106 btwrite(btread(BT848_INT_MASK) & (-1 ^ BT848_INT_GPINT), 4121 btwrite(btread(BT848_INT_MASK) & (-1 ^ BT848_INT_GPINT),
4107 BT848_INT_MASK); 4122 BT848_INT_MASK);
@@ -4109,7 +4124,7 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)
4109 4124
4110 bttv_print_irqbits(stat,astat); 4125 bttv_print_irqbits(stat,astat);
4111 4126
4112 printk("]\n"); 4127 pr_cont("]\n");
4113 } 4128 }
4114 } 4129 }
4115 btv->irq_total++; 4130 btv->irq_total++;
@@ -4171,7 +4186,7 @@ static void bttv_unregister_video(struct bttv *btv)
4171static int __devinit bttv_register_video(struct bttv *btv) 4186static int __devinit bttv_register_video(struct bttv *btv)
4172{ 4187{
4173 if (no_overlay > 0) 4188 if (no_overlay > 0)
4174 printk("bttv: Overlay support disabled.\n"); 4189 pr_notice("Overlay support disabled\n");
4175 4190
4176 /* video */ 4191 /* video */
4177 btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); 4192 btv->video_dev = vdev_init(btv, &bttv_video_template, "video");
@@ -4181,12 +4196,11 @@ static int __devinit bttv_register_video(struct bttv *btv)
4181 if (video_register_device(btv->video_dev, VFL_TYPE_GRABBER, 4196 if (video_register_device(btv->video_dev, VFL_TYPE_GRABBER,
4182 video_nr[btv->c.nr]) < 0) 4197 video_nr[btv->c.nr]) < 0)
4183 goto err; 4198 goto err;
4184 printk(KERN_INFO "bttv%d: registered device %s\n", 4199 pr_info("%d: registered device %s\n",
4185 btv->c.nr, video_device_node_name(btv->video_dev)); 4200 btv->c.nr, video_device_node_name(btv->video_dev));
4186 if (device_create_file(&btv->video_dev->dev, 4201 if (device_create_file(&btv->video_dev->dev,
4187 &dev_attr_card)<0) { 4202 &dev_attr_card)<0) {
4188 printk(KERN_ERR "bttv%d: device_create_file 'card' " 4203 pr_err("%d: device_create_file 'card' failed\n", btv->c.nr);
4189 "failed\n", btv->c.nr);
4190 goto err; 4204 goto err;
4191 } 4205 }
4192 4206
@@ -4198,8 +4212,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
4198 if (video_register_device(btv->vbi_dev, VFL_TYPE_VBI, 4212 if (video_register_device(btv->vbi_dev, VFL_TYPE_VBI,
4199 vbi_nr[btv->c.nr]) < 0) 4213 vbi_nr[btv->c.nr]) < 0)
4200 goto err; 4214 goto err;
4201 printk(KERN_INFO "bttv%d: registered device %s\n", 4215 pr_info("%d: registered device %s\n",
4202 btv->c.nr, video_device_node_name(btv->vbi_dev)); 4216 btv->c.nr, video_device_node_name(btv->vbi_dev));
4203 4217
4204 if (!btv->has_radio) 4218 if (!btv->has_radio)
4205 return 0; 4219 return 0;
@@ -4210,8 +4224,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
4210 if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO, 4224 if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,
4211 radio_nr[btv->c.nr]) < 0) 4225 radio_nr[btv->c.nr]) < 0)
4212 goto err; 4226 goto err;
4213 printk(KERN_INFO "bttv%d: registered device %s\n", 4227 pr_info("%d: registered device %s\n",
4214 btv->c.nr, video_device_node_name(btv->radio_dev)); 4228 btv->c.nr, video_device_node_name(btv->radio_dev));
4215 4229
4216 /* all done */ 4230 /* all done */
4217 return 0; 4231 return 0;
@@ -4244,10 +4258,10 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4244 4258
4245 if (bttv_num == BTTV_MAX) 4259 if (bttv_num == BTTV_MAX)
4246 return -ENOMEM; 4260 return -ENOMEM;
4247 printk(KERN_INFO "bttv: Bt8xx card found (%d).\n", bttv_num); 4261 pr_info("Bt8xx card found (%d)\n", bttv_num);
4248 bttvs[bttv_num] = btv = kzalloc(sizeof(*btv), GFP_KERNEL); 4262 bttvs[bttv_num] = btv = kzalloc(sizeof(*btv), GFP_KERNEL);
4249 if (btv == NULL) { 4263 if (btv == NULL) {
4250 printk(KERN_ERR "bttv: out of memory.\n"); 4264 pr_err("out of memory\n");
4251 return -ENOMEM; 4265 return -ENOMEM;
4252 } 4266 }
4253 btv->c.nr = bttv_num; 4267 btv->c.nr = bttv_num;
@@ -4277,21 +4291,19 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4277 btv->c.pci = dev; 4291 btv->c.pci = dev;
4278 btv->id = dev->device; 4292 btv->id = dev->device;
4279 if (pci_enable_device(dev)) { 4293 if (pci_enable_device(dev)) {
4280 printk(KERN_WARNING "bttv%d: Can't enable device.\n", 4294 pr_warn("%d: Can't enable device\n", btv->c.nr);
4281 btv->c.nr);
4282 return -EIO; 4295 return -EIO;
4283 } 4296 }
4284 if (pci_set_dma_mask(dev, DMA_BIT_MASK(32))) { 4297 if (pci_set_dma_mask(dev, DMA_BIT_MASK(32))) {
4285 printk(KERN_WARNING "bttv%d: No suitable DMA available.\n", 4298 pr_warn("%d: No suitable DMA available\n", btv->c.nr);
4286 btv->c.nr);
4287 return -EIO; 4299 return -EIO;
4288 } 4300 }
4289 if (!request_mem_region(pci_resource_start(dev,0), 4301 if (!request_mem_region(pci_resource_start(dev,0),
4290 pci_resource_len(dev,0), 4302 pci_resource_len(dev,0),
4291 btv->c.v4l2_dev.name)) { 4303 btv->c.v4l2_dev.name)) {
4292 printk(KERN_WARNING "bttv%d: can't request iomem (0x%llx).\n", 4304 pr_warn("%d: can't request iomem (0x%llx)\n",
4293 btv->c.nr, 4305 btv->c.nr,
4294 (unsigned long long)pci_resource_start(dev,0)); 4306 (unsigned long long)pci_resource_start(dev, 0));
4295 return -EBUSY; 4307 return -EBUSY;
4296 } 4308 }
4297 pci_set_master(dev); 4309 pci_set_master(dev);
@@ -4299,22 +4311,21 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4299 4311
4300 result = v4l2_device_register(&dev->dev, &btv->c.v4l2_dev); 4312 result = v4l2_device_register(&dev->dev, &btv->c.v4l2_dev);
4301 if (result < 0) { 4313 if (result < 0) {
4302 printk(KERN_WARNING "bttv%d: v4l2_device_register() failed\n", btv->c.nr); 4314 pr_warn("%d: v4l2_device_register() failed\n", btv->c.nr);
4303 goto fail0; 4315 goto fail0;
4304 } 4316 }
4305 4317
4306 btv->revision = dev->revision; 4318 btv->revision = dev->revision;
4307 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); 4319 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
4308 printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ", 4320 pr_info("%d: Bt%d (rev %d) at %s, irq: %d, latency: %d, mmio: 0x%llx\n",
4309 bttv_num,btv->id, btv->revision, pci_name(dev)); 4321 bttv_num, btv->id, btv->revision, pci_name(dev),
4310 printk("irq: %d, latency: %d, mmio: 0x%llx\n", 4322 btv->c.pci->irq, lat,
4311 btv->c.pci->irq, lat, 4323 (unsigned long long)pci_resource_start(dev, 0));
4312 (unsigned long long)pci_resource_start(dev,0));
4313 schedule(); 4324 schedule();
4314 4325
4315 btv->bt848_mmio = ioremap(pci_resource_start(dev, 0), 0x1000); 4326 btv->bt848_mmio = ioremap(pci_resource_start(dev, 0), 0x1000);
4316 if (NULL == btv->bt848_mmio) { 4327 if (NULL == btv->bt848_mmio) {
4317 printk("bttv%d: ioremap() failed\n", btv->c.nr); 4328 pr_err("%d: ioremap() failed\n", btv->c.nr);
4318 result = -EIO; 4329 result = -EIO;
4319 goto fail1; 4330 goto fail1;
4320 } 4331 }
@@ -4327,8 +4338,8 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4327 result = request_irq(btv->c.pci->irq, bttv_irq, 4338 result = request_irq(btv->c.pci->irq, bttv_irq,
4328 IRQF_SHARED | IRQF_DISABLED, btv->c.v4l2_dev.name, (void *)btv); 4339 IRQF_SHARED | IRQF_DISABLED, btv->c.v4l2_dev.name, (void *)btv);
4329 if (result < 0) { 4340 if (result < 0) {
4330 printk(KERN_ERR "bttv%d: can't get IRQ %d\n", 4341 pr_err("%d: can't get IRQ %d\n",
4331 bttv_num,btv->c.pci->irq); 4342 bttv_num, btv->c.pci->irq);
4332 goto fail1; 4343 goto fail1;
4333 } 4344 }
4334 4345
@@ -4433,7 +4444,7 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
4433 struct bttv *btv = to_bttv(v4l2_dev); 4444 struct bttv *btv = to_bttv(v4l2_dev);
4434 4445
4435 if (bttv_verbose) 4446 if (bttv_verbose)
4436 printk("bttv%d: unloading\n",btv->c.nr); 4447 pr_info("%d: unloading\n", btv->c.nr);
4437 4448
4438 if (bttv_tvcards[btv->c.type].has_dvb) 4449 if (bttv_tvcards[btv->c.type].has_dvb)
4439 flush_request_modules(btv); 4450 flush_request_modules(btv);
@@ -4481,7 +4492,7 @@ static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
4481 struct bttv_buffer_set idle; 4492 struct bttv_buffer_set idle;
4482 unsigned long flags; 4493 unsigned long flags;
4483 4494
4484 dprintk("bttv%d: suspend %d\n", btv->c.nr, state.event); 4495 dprintk("%d: suspend %d\n", btv->c.nr, state.event);
4485 4496
4486 /* stop dma + irqs */ 4497 /* stop dma + irqs */
4487 spin_lock_irqsave(&btv->s_lock,flags); 4498 spin_lock_irqsave(&btv->s_lock,flags);
@@ -4517,14 +4528,13 @@ static int bttv_resume(struct pci_dev *pci_dev)
4517 unsigned long flags; 4528 unsigned long flags;
4518 int err; 4529 int err;
4519 4530
4520 dprintk("bttv%d: resume\n", btv->c.nr); 4531 dprintk("%d: resume\n", btv->c.nr);
4521 4532
4522 /* restore pci state */ 4533 /* restore pci state */
4523 if (btv->state.disabled) { 4534 if (btv->state.disabled) {
4524 err=pci_enable_device(pci_dev); 4535 err=pci_enable_device(pci_dev);
4525 if (err) { 4536 if (err) {
4526 printk(KERN_WARNING "bttv%d: Can't enable device.\n", 4537 pr_warn("%d: Can't enable device\n", btv->c.nr);
4527 btv->c.nr);
4528 return err; 4538 return err;
4529 } 4539 }
4530 btv->state.disabled = 0; 4540 btv->state.disabled = 0;
@@ -4532,8 +4542,7 @@ static int bttv_resume(struct pci_dev *pci_dev)
4532 err=pci_set_power_state(pci_dev, PCI_D0); 4542 err=pci_set_power_state(pci_dev, PCI_D0);
4533 if (err) { 4543 if (err) {
4534 pci_disable_device(pci_dev); 4544 pci_disable_device(pci_dev);
4535 printk(KERN_WARNING "bttv%d: Can't enable device.\n", 4545 pr_warn("%d: Can't enable device\n", btv->c.nr);
4536 btv->c.nr);
4537 btv->state.disabled = 1; 4546 btv->state.disabled = 1;
4538 return err; 4547 return err;
4539 } 4548 }
@@ -4585,22 +4594,21 @@ static int __init bttv_init_module(void)
4585 4594
4586 bttv_num = 0; 4595 bttv_num = 0;
4587 4596
4588 printk(KERN_INFO "bttv: driver version %s loaded\n", 4597 pr_info("driver version %s loaded\n", BTTV_VERSION);
4589 BTTV_VERSION);
4590 if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME) 4598 if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME)
4591 gbuffers = 2; 4599 gbuffers = 2;
4592 if (gbufsize > BTTV_MAX_FBUF) 4600 if (gbufsize > BTTV_MAX_FBUF)
4593 gbufsize = BTTV_MAX_FBUF; 4601 gbufsize = BTTV_MAX_FBUF;
4594 gbufsize = (gbufsize + PAGE_SIZE - 1) & PAGE_MASK; 4602 gbufsize = (gbufsize + PAGE_SIZE - 1) & PAGE_MASK;
4595 if (bttv_verbose) 4603 if (bttv_verbose)
4596 printk(KERN_INFO "bttv: using %d buffers with %dk (%d pages) each for capture\n", 4604 pr_info("using %d buffers with %dk (%d pages) each for capture\n",
4597 gbuffers, gbufsize >> 10, gbufsize >> PAGE_SHIFT); 4605 gbuffers, gbufsize >> 10, gbufsize >> PAGE_SHIFT);
4598 4606
4599 bttv_check_chipset(); 4607 bttv_check_chipset();
4600 4608
4601 ret = bus_register(&bttv_sub_bus_type); 4609 ret = bus_register(&bttv_sub_bus_type);
4602 if (ret < 0) { 4610 if (ret < 0) {
4603 printk(KERN_WARNING "bttv: bus_register error: %d\n", ret); 4611 pr_warn("bus_register error: %d\n", ret);
4604 return ret; 4612 return ret;
4605 } 4613 }
4606 ret = pci_register_driver(&bttv_pci_driver); 4614 ret = pci_register_driver(&bttv_pci_driver);
diff --git a/drivers/media/video/bt8xx/bttv-gpio.c b/drivers/media/video/bt8xx/bttv-gpio.c
index 13ce72c04b33..922e8233fd0b 100644
--- a/drivers/media/video/bt8xx/bttv-gpio.c
+++ b/drivers/media/video/bt8xx/bttv-gpio.c
@@ -26,6 +26,8 @@
26 26
27*/ 27*/
28 28
29#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30
29#include <linux/module.h> 31#include <linux/module.h>
30#include <linux/init.h> 32#include <linux/init.h>
31#include <linux/delay.h> 33#include <linux/delay.h>
@@ -99,7 +101,7 @@ int bttv_sub_add_device(struct bttv_core *core, char *name)
99 kfree(sub); 101 kfree(sub);
100 return err; 102 return err;
101 } 103 }
102 printk("bttv%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev)); 104 pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev));
103 list_add_tail(&sub->list,&core->subs); 105 list_add_tail(&sub->list,&core->subs);
104 return 0; 106 return 0;
105} 107}
diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c
index d49b675045fe..e3952af7e56e 100644
--- a/drivers/media/video/bt8xx/bttv-i2c.c
+++ b/drivers/media/video/bt8xx/bttv-i2c.c
@@ -27,6 +27,8 @@
27 27
28*/ 28*/
29 29
30#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31
30#include <linux/module.h> 32#include <linux/module.h>
31#include <linux/init.h> 33#include <linux/init.h>
32#include <linux/delay.h> 34#include <linux/delay.h>
@@ -154,9 +156,7 @@ bttv_i2c_sendbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
154 if (retval == 0) 156 if (retval == 0)
155 goto eio; 157 goto eio;
156 if (i2c_debug) { 158 if (i2c_debug) {
157 printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]); 159 pr_cont(" <W %02x %02x", msg->addr << 1, msg->buf[0]);
158 if (!(xmit & BT878_I2C_NOSTOP))
159 printk(" >\n");
160 } 160 }
161 161
162 for (cnt = 1; cnt < msg->len; cnt++ ) { 162 for (cnt = 1; cnt < msg->len; cnt++ ) {
@@ -170,19 +170,18 @@ bttv_i2c_sendbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
170 goto err; 170 goto err;
171 if (retval == 0) 171 if (retval == 0)
172 goto eio; 172 goto eio;
173 if (i2c_debug) { 173 if (i2c_debug)
174 printk(" %02x", msg->buf[cnt]); 174 pr_cont(" %02x", msg->buf[cnt]);
175 if (!(xmit & BT878_I2C_NOSTOP))
176 printk(" >\n");
177 }
178 } 175 }
176 if (!(xmit & BT878_I2C_NOSTOP))
177 pr_cont(">\n");
179 return msg->len; 178 return msg->len;
180 179
181 eio: 180 eio:
182 retval = -EIO; 181 retval = -EIO;
183 err: 182 err:
184 if (i2c_debug) 183 if (i2c_debug)
185 printk(" ERR: %d\n",retval); 184 pr_cont(" ERR: %d\n",retval);
186 return retval; 185 return retval;
187} 186}
188 187
@@ -193,7 +192,7 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
193 u32 cnt; 192 u32 cnt;
194 int retval; 193 int retval;
195 194
196 for(cnt = 0; cnt < msg->len; cnt++) { 195 for (cnt = 0; cnt < msg->len; cnt++) {
197 xmit = (msg->addr << 25) | (1 << 24) | I2C_HW; 196 xmit = (msg->addr << 25) | (1 << 24) | I2C_HW;
198 if (cnt < msg->len-1) 197 if (cnt < msg->len-1)
199 xmit |= BT848_I2C_W3B; 198 xmit |= BT848_I2C_W3B;
@@ -201,6 +200,12 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
201 xmit |= BT878_I2C_NOSTOP; 200 xmit |= BT878_I2C_NOSTOP;
202 if (cnt) 201 if (cnt)
203 xmit |= BT878_I2C_NOSTART; 202 xmit |= BT878_I2C_NOSTART;
203
204 if (i2c_debug) {
205 if (!(xmit & BT878_I2C_NOSTART))
206 pr_cont(" <R %02x", (msg->addr << 1) +1);
207 }
208
204 btwrite(xmit, BT848_I2C); 209 btwrite(xmit, BT848_I2C);
205 retval = bttv_i2c_wait_done(btv); 210 retval = bttv_i2c_wait_done(btv);
206 if (retval < 0) 211 if (retval < 0)
@@ -209,20 +214,20 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
209 goto eio; 214 goto eio;
210 msg->buf[cnt] = ((u32)btread(BT848_I2C) >> 8) & 0xff; 215 msg->buf[cnt] = ((u32)btread(BT848_I2C) >> 8) & 0xff;
211 if (i2c_debug) { 216 if (i2c_debug) {
212 if (!(xmit & BT878_I2C_NOSTART)) 217 pr_cont(" =%02x", msg->buf[cnt]);
213 printk(" <R %02x", (msg->addr << 1) +1);
214 printk(" =%02x", msg->buf[cnt]);
215 if (!(xmit & BT878_I2C_NOSTOP))
216 printk(" >\n");
217 } 218 }
219 if (i2c_debug && !(xmit & BT878_I2C_NOSTOP))
220 pr_cont(" >\n");
218 } 221 }
222
223
219 return msg->len; 224 return msg->len;
220 225
221 eio: 226 eio:
222 retval = -EIO; 227 retval = -EIO;
223 err: 228 err:
224 if (i2c_debug) 229 if (i2c_debug)
225 printk(" ERR: %d\n",retval); 230 pr_cont(" ERR: %d\n",retval);
226 return retval; 231 return retval;
227} 232}
228 233
@@ -234,7 +239,8 @@ static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int
234 int i; 239 int i;
235 240
236 if (i2c_debug) 241 if (i2c_debug)
237 printk("bt-i2c:"); 242 pr_debug("bt-i2c:");
243
238 btwrite(BT848_INT_I2CDONE|BT848_INT_RACK, BT848_INT_STAT); 244 btwrite(BT848_INT_I2CDONE|BT848_INT_RACK, BT848_INT_STAT);
239 for (i = 0 ; i < num; i++) { 245 for (i = 0 ; i < num; i++) {
240 if (msgs[i].flags & I2C_M_RD) { 246 if (msgs[i].flags & I2C_M_RD) {
@@ -271,20 +277,20 @@ int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for)
271 if (0 != btv->i2c_rc) 277 if (0 != btv->i2c_rc)
272 return -1; 278 return -1;
273 if (bttv_verbose && NULL != probe_for) 279 if (bttv_verbose && NULL != probe_for)
274 printk(KERN_INFO "bttv%d: i2c: checking for %s @ 0x%02x... ", 280 pr_info("%d: i2c: checking for %s @ 0x%02x... ",
275 btv->c.nr,probe_for,addr); 281 btv->c.nr, probe_for, addr);
276 btv->i2c_client.addr = addr >> 1; 282 btv->i2c_client.addr = addr >> 1;
277 if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) { 283 if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) {
278 if (NULL != probe_for) { 284 if (NULL != probe_for) {
279 if (bttv_verbose) 285 if (bttv_verbose)
280 printk("not found\n"); 286 pr_cont("not found\n");
281 } else 287 } else
282 printk(KERN_WARNING "bttv%d: i2c read 0x%x: error\n", 288 pr_warn("%d: i2c read 0x%x: error\n",
283 btv->c.nr,addr); 289 btv->c.nr, addr);
284 return -1; 290 return -1;
285 } 291 }
286 if (bttv_verbose && NULL != probe_for) 292 if (bttv_verbose && NULL != probe_for)
287 printk("found\n"); 293 pr_cont("found\n");
288 return buffer; 294 return buffer;
289} 295}
290 296
@@ -335,8 +341,8 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
335 rc = i2c_master_recv(c,&buf,0); 341 rc = i2c_master_recv(c,&buf,0);
336 if (rc < 0) 342 if (rc < 0)
337 continue; 343 continue;
338 printk("%s: i2c scan: found device @ 0x%x [%s]\n", 344 pr_info("%s: i2c scan: found device @ 0x%x [%s]\n",
339 name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???"); 345 name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???");
340 } 346 }
341} 347}
342 348
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index 677d70c0e1ce..ef4c7cd41982 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -18,6 +18,8 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
21#include <linux/module.h> 23#include <linux/module.h>
22#include <linux/init.h> 24#include <linux/init.h>
23#include <linux/delay.h> 25#include <linux/delay.h>
@@ -36,9 +38,10 @@ static int ir_rc5_remote_gap = 885;
36module_param(ir_rc5_remote_gap, int, 0644); 38module_param(ir_rc5_remote_gap, int, 0644);
37 39
38#undef dprintk 40#undef dprintk
39#define dprintk(arg...) do { \ 41#define dprintk(fmt, ...) \
40 if (ir_debug >= 1) \ 42do { \
41 printk(arg); \ 43 if (ir_debug >= 1) \
44 pr_info(fmt, ##__VA_ARGS__); \
42} while (0) 45} while (0)
43 46
44#define DEVNAME "bttv-input" 47#define DEVNAME "bttv-input"
@@ -62,7 +65,7 @@ static void ir_handle_key(struct bttv *btv)
62 65
63 /* extract data */ 66 /* extract data */
64 data = ir_extract_bits(gpio, ir->mask_keycode); 67 data = ir_extract_bits(gpio, ir->mask_keycode);
65 dprintk(KERN_INFO DEVNAME ": irq gpio=0x%x code=%d | %s%s%s\n", 68 dprintk("irq gpio=0x%x code=%d | %s%s%s\n",
66 gpio, data, 69 gpio, data,
67 ir->polling ? "poll" : "irq", 70 ir->polling ? "poll" : "irq",
68 (gpio & ir->mask_keydown) ? " down" : "", 71 (gpio & ir->mask_keydown) ? " down" : "",
@@ -96,7 +99,7 @@ static void ir_enltv_handle_key(struct bttv *btv)
96 keyup = (gpio & ir->mask_keyup) ? 1 << 31 : 0; 99 keyup = (gpio & ir->mask_keyup) ? 1 << 31 : 0;
97 100
98 if ((ir->last_gpio & 0x7f) != data) { 101 if ((ir->last_gpio & 0x7f) != data) {
99 dprintk(KERN_INFO DEVNAME ": gpio=0x%x code=%d | %s\n", 102 dprintk("gpio=0x%x code=%d | %s\n",
100 gpio, data, 103 gpio, data,
101 (gpio & ir->mask_keyup) ? " up" : "up/down"); 104 (gpio & ir->mask_keyup) ? " up" : "up/down");
102 105
@@ -107,7 +110,7 @@ static void ir_enltv_handle_key(struct bttv *btv)
107 if ((ir->last_gpio & 1 << 31) == keyup) 110 if ((ir->last_gpio & 1 << 31) == keyup)
108 return; 111 return;
109 112
110 dprintk(KERN_INFO DEVNAME ":(cnt) gpio=0x%x code=%d | %s\n", 113 dprintk("(cnt) gpio=0x%x code=%d | %s\n",
111 gpio, data, 114 gpio, data,
112 (gpio & ir->mask_keyup) ? " up" : "down"); 115 (gpio & ir->mask_keyup) ? " up" : "down");
113 116
@@ -177,13 +180,12 @@ static u32 bttv_rc5_decode(unsigned int code)
177 rc5 |= 1; 180 rc5 |= 1;
178 break; 181 break;
179 case 3: 182 case 3:
180 dprintk(KERN_INFO DEVNAME ":rc5_decode(%x) bad code\n", 183 dprintk("rc5_decode(%x) bad code\n",
181 org_code); 184 org_code);
182 return 0; 185 return 0;
183 } 186 }
184 } 187 }
185 dprintk(KERN_INFO DEVNAME ":" 188 dprintk("code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
186 "code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
187 "instr=%x\n", rc5, org_code, RC5_START(rc5), 189 "instr=%x\n", rc5, org_code, RC5_START(rc5),
188 RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5)); 190 RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5));
189 return rc5; 191 return rc5;
@@ -212,20 +214,20 @@ static void bttv_rc5_timer_end(unsigned long data)
212 214
213 /* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */ 215 /* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */
214 if (gap < 28000) { 216 if (gap < 28000) {
215 dprintk(KERN_INFO DEVNAME ": spurious timer_end\n"); 217 dprintk("spurious timer_end\n");
216 return; 218 return;
217 } 219 }
218 220
219 if (ir->last_bit < 20) { 221 if (ir->last_bit < 20) {
220 /* ignore spurious codes (caused by light/other remotes) */ 222 /* ignore spurious codes (caused by light/other remotes) */
221 dprintk(KERN_INFO DEVNAME ": short code: %x\n", ir->code); 223 dprintk("short code: %x\n", ir->code);
222 } else { 224 } else {
223 ir->code = (ir->code << ir->shift_by) | 1; 225 ir->code = (ir->code << ir->shift_by) | 1;
224 rc5 = bttv_rc5_decode(ir->code); 226 rc5 = bttv_rc5_decode(ir->code);
225 227
226 /* two start bits? */ 228 /* two start bits? */
227 if (RC5_START(rc5) != ir->start) { 229 if (RC5_START(rc5) != ir->start) {
228 printk(KERN_INFO DEVNAME ":" 230 pr_info(DEVNAME ":"
229 " rc5 start bits invalid: %u\n", RC5_START(rc5)); 231 " rc5 start bits invalid: %u\n", RC5_START(rc5));
230 232
231 /* right address? */ 233 /* right address? */
@@ -235,8 +237,7 @@ static void bttv_rc5_timer_end(unsigned long data)
235 237
236 /* Good code */ 238 /* Good code */
237 rc_keydown(ir->dev, instr, toggle); 239 rc_keydown(ir->dev, instr, toggle);
238 dprintk(KERN_INFO DEVNAME ":" 240 dprintk("instruction %x, toggle %x\n",
239 " instruction %x, toggle %x\n",
240 instr, toggle); 241 instr, toggle);
241 } 242 }
242 } 243 }
@@ -265,7 +266,7 @@ static int bttv_rc5_irq(struct bttv *btv)
265 tv.tv_usec - ir->base_time.tv_usec; 266 tv.tv_usec - ir->base_time.tv_usec;
266 } 267 }
267 268
268 dprintk(KERN_INFO DEVNAME ": RC5 IRQ: gap %d us for %s\n", 269 dprintk("RC5 IRQ: gap %d us for %s\n",
269 gap, (gpio & 0x20) ? "mark" : "space"); 270 gap, (gpio & 0x20) ? "mark" : "space");
270 271
271 /* remote IRQ? */ 272 /* remote IRQ? */
@@ -340,14 +341,14 @@ static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
340 341
341 /* poll IR chip */ 342 /* poll IR chip */
342 if (1 != i2c_master_recv(ir->c, &b, 1)) { 343 if (1 != i2c_master_recv(ir->c, &b, 1)) {
343 dprintk(KERN_INFO DEVNAME ": read error\n"); 344 dprintk("read error\n");
344 return -EIO; 345 return -EIO;
345 } 346 }
346 347
347 /* ignore 0xaa */ 348 /* ignore 0xaa */
348 if (b==0xaa) 349 if (b==0xaa)
349 return 0; 350 return 0;
350 dprintk(KERN_INFO DEVNAME ": key %02x\n", b); 351 dprintk("key %02x\n", b);
351 352
352 /* 353 /*
353 * NOTE: 354 * NOTE:
@@ -517,7 +518,7 @@ int bttv_input_init(struct bttv *btv)
517 break; 518 break;
518 } 519 }
519 if (NULL == ir_codes) { 520 if (NULL == ir_codes) {
520 dprintk(KERN_INFO "Ooops: IR config error [card=%d]\n", btv->c.type); 521 dprintk("Ooops: IR config error [card=%d]\n", btv->c.type);
521 err = -ENODEV; 522 err = -ENODEV;
522 goto err_out_free; 523 goto err_out_free;
523 } 524 }
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c
index 9b57d091da48..82cc47d2e3fa 100644
--- a/drivers/media/video/bt8xx/bttv-risc.c
+++ b/drivers/media/video/bt8xx/bttv-risc.c
@@ -24,6 +24,8 @@
24 24
25*/ 25*/
26 26
27#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
28
27#include <linux/module.h> 29#include <linux/module.h>
28#include <linux/init.h> 30#include <linux/init.h>
29#include <linux/slab.h> 31#include <linux/slab.h>
@@ -473,8 +475,7 @@ bttv_set_dma(struct bttv *btv, int override)
473 capctl |= (btv->cap_ctl & 0x0c) ? 0x0c : 0x00; /* vbi data */ 475 capctl |= (btv->cap_ctl & 0x0c) ? 0x0c : 0x00; /* vbi data */
474 capctl |= override; 476 capctl |= override;
475 477
476 d2printk(KERN_DEBUG 478 d2printk("%d: capctl=%x lirq=%d top=%08llx/%08llx even=%08llx/%08llx\n",
477 "bttv%d: capctl=%x lirq=%d top=%08Lx/%08Lx even=%08Lx/%08Lx\n",
478 btv->c.nr,capctl,btv->loop_irq, 479 btv->c.nr,capctl,btv->loop_irq,
479 btv->cvbi ? (unsigned long long)btv->cvbi->top.dma : 0, 480 btv->cvbi ? (unsigned long long)btv->cvbi->top.dma : 0,
480 btv->curr.top ? (unsigned long long)btv->curr.top->top.dma : 0, 481 btv->curr.top ? (unsigned long long)btv->curr.top->top.dma : 0,
@@ -517,8 +518,8 @@ bttv_risc_init_main(struct bttv *btv)
517 518
518 if ((rc = btcx_riscmem_alloc(btv->c.pci,&btv->main,PAGE_SIZE)) < 0) 519 if ((rc = btcx_riscmem_alloc(btv->c.pci,&btv->main,PAGE_SIZE)) < 0)
519 return rc; 520 return rc;
520 dprintk(KERN_DEBUG "bttv%d: risc main @ %08Lx\n", 521 dprintk("%d: risc main @ %08llx\n",
521 btv->c.nr,(unsigned long long)btv->main.dma); 522 btv->c.nr, (unsigned long long)btv->main.dma);
522 523
523 btv->main.cpu[0] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC | 524 btv->main.cpu[0] = cpu_to_le32(BT848_RISC_SYNC | BT848_RISC_RESYNC |
524 BT848_FIFO_STATUS_VRE); 525 BT848_FIFO_STATUS_VRE);
@@ -557,12 +558,12 @@ bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc,
557 unsigned long next = btv->main.dma + ((slot+2) << 2); 558 unsigned long next = btv->main.dma + ((slot+2) << 2);
558 559
559 if (NULL == risc) { 560 if (NULL == risc) {
560 d2printk(KERN_DEBUG "bttv%d: risc=%p slot[%d]=NULL\n", 561 d2printk("%d: risc=%p slot[%d]=NULL\n", btv->c.nr, risc, slot);
561 btv->c.nr,risc,slot);
562 btv->main.cpu[slot+1] = cpu_to_le32(next); 562 btv->main.cpu[slot+1] = cpu_to_le32(next);
563 } else { 563 } else {
564 d2printk(KERN_DEBUG "bttv%d: risc=%p slot[%d]=%08Lx irq=%d\n", 564 d2printk("%d: risc=%p slot[%d]=%08llx irq=%d\n",
565 btv->c.nr,risc,slot,(unsigned long long)risc->dma,irqflags); 565 btv->c.nr, risc, slot,
566 (unsigned long long)risc->dma, irqflags);
566 cmd = BT848_RISC_JUMP; 567 cmd = BT848_RISC_JUMP;
567 if (irqflags) { 568 if (irqflags) {
568 cmd |= BT848_RISC_IRQ; 569 cmd |= BT848_RISC_IRQ;
@@ -708,8 +709,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
708 const struct bttv_tvnorm *tvnorm = bttv_tvnorms + buf->tvnorm; 709 const struct bttv_tvnorm *tvnorm = bttv_tvnorms + buf->tvnorm;
709 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); 710 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
710 711
711 dprintk(KERN_DEBUG 712 dprintk("%d: buffer field: %s format: %s size: %dx%d\n",
712 "bttv%d: buffer field: %s format: %s size: %dx%d\n",
713 btv->c.nr, v4l2_field_names[buf->vb.field], 713 btv->c.nr, v4l2_field_names[buf->vb.field],
714 buf->fmt->name, buf->vb.width, buf->vb.height); 714 buf->fmt->name, buf->vb.width, buf->vb.height);
715 715
@@ -870,10 +870,9 @@ bttv_overlay_risc(struct bttv *btv,
870 struct bttv_buffer *buf) 870 struct bttv_buffer *buf)
871{ 871{
872 /* check interleave, bottom+top fields */ 872 /* check interleave, bottom+top fields */
873 dprintk(KERN_DEBUG 873 dprintk("%d: overlay fields: %s format: %s size: %dx%d\n",
874 "bttv%d: overlay fields: %s format: %s size: %dx%d\n",
875 btv->c.nr, v4l2_field_names[buf->vb.field], 874 btv->c.nr, v4l2_field_names[buf->vb.field],
876 fmt->name,ov->w.width,ov->w.height); 875 fmt->name, ov->w.width, ov->w.height);
877 876
878 /* calculate geometry */ 877 /* calculate geometry */
879 bttv_calc_geo(btv,&buf->geo,ov->w.width,ov->w.height, 878 bttv_calc_geo(btv,&buf->geo,ov->w.width,ov->w.height,
diff --git a/drivers/media/video/bt8xx/bttv-vbi.c b/drivers/media/video/bt8xx/bttv-vbi.c
index e79a402fa6cd..b433267d9aa9 100644
--- a/drivers/media/video/bt8xx/bttv-vbi.c
+++ b/drivers/media/video/bt8xx/bttv-vbi.c
@@ -23,6 +23,8 @@
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24*/ 24*/
25 25
26#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27
26#include <linux/module.h> 28#include <linux/module.h>
27#include <linux/errno.h> 29#include <linux/errno.h>
28#include <linux/fs.h> 30#include <linux/fs.h>
@@ -65,8 +67,11 @@ MODULE_PARM_DESC(vbi_debug,"vbi code debug messages, default is 0 (no)");
65#ifdef dprintk 67#ifdef dprintk
66# undef dprintk 68# undef dprintk
67#endif 69#endif
68#define dprintk(fmt, arg...) if (vbi_debug) \ 70#define dprintk(fmt, ...) \
69 printk(KERN_DEBUG "bttv%d/vbi: " fmt, btv->c.nr , ## arg) 71do { \
72 if (vbi_debug) \
73 pr_debug("%d: " fmt, btv->c.nr, ##__VA_ARGS__); \
74} while (0)
70 75
71#define IMAGE_SIZE(fmt) \ 76#define IMAGE_SIZE(fmt) \
72 (((fmt)->count[0] + (fmt)->count[1]) * (fmt)->samples_per_line) 77 (((fmt)->count[0] + (fmt)->count[1]) * (fmt)->samples_per_line)
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index 318edf2830b4..db943a8d580d 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -310,9 +310,21 @@ extern unsigned int bttv_gpio;
310extern void bttv_gpio_tracking(struct bttv *btv, char *comment); 310extern void bttv_gpio_tracking(struct bttv *btv, char *comment);
311extern int init_bttv_i2c(struct bttv *btv); 311extern int init_bttv_i2c(struct bttv *btv);
312 312
313#define bttv_printk if (bttv_verbose) printk 313#define dprintk(fmt, ...) \
314#define dprintk if (bttv_debug >= 1) printk 314do { \
315#define d2printk if (bttv_debug >= 2) printk 315 if (bttv_debug >= 1) \
316 pr_debug(fmt, ##__VA_ARGS__); \
317} while (0)
318#define dprintk_cont(fmt, ...) \
319do { \
320 if (bttv_debug >= 1) \
321 pr_cont(fmt, ##__VA_ARGS__); \
322} while (0)
323#define d2printk(fmt, ...) \
324do { \
325 if (bttv_debug >= 2) \
326 printk(fmt, ##__VA_ARGS__); \
327} while (0)
316 328
317#define BTTV_MAX_FBUF 0x208000 329#define BTTV_MAX_FBUF 0x208000
318#define BTTV_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */ 330#define BTTV_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */