Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8af443e5 authored by Joe Perches's avatar Joe Perches Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d8a10ac9
Loading
Loading
Loading
Loading
+117 −125
Original line number Original line Diff line number Diff line
@@ -25,6 +25,8 @@


*/
*/


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/kmod.h>
#include <linux/kmod.h>
@@ -2905,19 +2907,17 @@ void __devinit bttv_idcard(struct bttv *btv)


		if (type != -1) {
		if (type != -1) {
			/* found it */
			/* found it */
			printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
			pr_info("%d: detected: %s [card=%d], PCI subsystem ID is %04x:%04x\n",
			       "PCI subsystem ID is %04x:%04x\n",
				btv->c.nr, cards[type].name, cards[type].cardnr,
				btv->c.nr, cards[type].name, cards[type].cardnr,
				btv->cardid & 0xffff,
				btv->cardid & 0xffff,
				(btv->cardid >> 16) & 0xffff);
				(btv->cardid >> 16) & 0xffff);
			btv->c.type = cards[type].cardnr;
			btv->c.type = cards[type].cardnr;
		} else {
		} else {
			/* 404 */
			/* 404 */
			printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
			pr_info("%d: subsystem: %04x:%04x (UNKNOWN)\n",
				btv->c.nr, btv->cardid & 0xffff,
				btv->c.nr, btv->cardid & 0xffff,
				(btv->cardid >> 16) & 0xffff);
				(btv->cardid >> 16) & 0xffff);
			printk(KERN_DEBUG "please mail id, board name and "
			pr_debug("please mail id, board name and the correct card= insmod option to linux-media@vger.kernel.org\n");
			       "the correct card= insmod option to linux-media@vger.kernel.org\n");
		}
		}
	}
	}


@@ -2926,8 +2926,8 @@ void __devinit bttv_idcard(struct bttv *btv)
		btv->c.type=card[btv->c.nr];
		btv->c.type=card[btv->c.nr];


	/* print which card config we are using */
	/* print which card config we are using */
	printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
	pr_info("%d: using: %s [card=%d,%s]\n",
	       bttv_tvcards[btv->c.type].name, btv->c.type,
		btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type,
		card[btv->c.nr] < bttv_num_tvcards
		card[btv->c.nr] < bttv_num_tvcards
		? "insmod option" : "autodetected");
		? "insmod option" : "autodetected");


@@ -2948,12 +2948,13 @@ void __devinit bttv_idcard(struct bttv *btv)
		}
		}
	}
	}
	bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
	bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
	printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
	pr_info("%d: gpio config override: mask=0x%x, mux=",
		btv->c.nr, bttv_tvcards[btv->c.type].gpiomask);
		btv->c.nr, bttv_tvcards[btv->c.type].gpiomask);
	for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
	for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
		printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
		pr_cont("%s0x%x",
			i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
	}
	}
	printk("\n");
	pr_cont("\n");
}
}


/*
/*
@@ -2974,7 +2975,7 @@ static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])


	if (-1 != type) {
	if (-1 != type) {
		btv->c.type = type;
		btv->c.type = type;
		printk("bttv%d: detected by eeprom: %s [card=%d]\n",
		pr_info("%d: detected by eeprom: %s [card=%d]\n",
			btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
			btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
	}
	}
}
}
@@ -3019,7 +3020,7 @@ static void flyvideo_gpio(struct bttv *btv)
		tuner_type = 3;  /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
		tuner_type = 3;  /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
		break;
		break;
	default:
	default:
		printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
		pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr);
		break;
		break;
	}
	}


@@ -3036,10 +3037,10 @@ static void flyvideo_gpio(struct bttv *btv)
	if (is_capture_only)
	if (is_capture_only)
		tuner_type = TUNER_ABSENT; /* No tuner present */
		tuner_type = TUNER_ABSENT; /* No tuner present */


	printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
	pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
		btv->c.nr, has_radio ? "yes" : "no",
		btv->c.nr, has_radio ? "yes" : "no",
		has_remote ? "yes" : "no", tuner_type, gpio);
		has_remote ? "yes" : "no", tuner_type, gpio);
	printk(KERN_INFO "bttv%d: FlyVideo  LR90=%s tda9821/tda9820=%s capture_only=%s\n",
	pr_info("%d: FlyVideo  LR90=%s tda9821/tda9820=%s capture_only=%s\n",
		btv->c.nr, is_lr90 ? "yes" : "no",
		btv->c.nr, is_lr90 ? "yes" : "no",
		has_tda9820_tda9821 ? "yes" : "no",
		has_tda9820_tda9821 ? "yes" : "no",
		is_capture_only ? "yes" : "no");
		is_capture_only ? "yes" : "no");
@@ -3091,8 +3092,7 @@ static void miro_pinnacle_gpio(struct bttv *btv)
			if (btv->c.type == BTTV_BOARD_PINNACLE)
			if (btv->c.type == BTTV_BOARD_PINNACLE)
				btv->c.type = BTTV_BOARD_PINNACLEPRO;
				btv->c.type = BTTV_BOARD_PINNACLEPRO;
		}
		}
		printk(KERN_INFO
		pr_info("%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
		       "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
			btv->c.nr, id+1, btv->tuner_type,
			btv->c.nr, id+1, btv->tuner_type,
			!btv->has_radio ? "no" :
			!btv->has_radio ? "no" :
			(btv->has_matchbox ? "matchbox" : "fmtuner"),
			(btv->has_matchbox ? "matchbox" : "fmtuner"),
@@ -3138,8 +3138,7 @@ static void miro_pinnacle_gpio(struct bttv *btv)
		}
		}
		if (-1 != msp)
		if (-1 != msp)
			btv->c.type = BTTV_BOARD_PINNACLEPRO;
			btv->c.type = BTTV_BOARD_PINNACLEPRO;
		printk(KERN_INFO
		pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
		       "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
			btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
			btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
		btv->tuner_type = TUNER_MT2032;
		btv->tuner_type = TUNER_MT2032;
	}
	}
@@ -3202,7 +3201,7 @@ static void gvc1100_muxsel(struct bttv *btv, unsigned int input)


static void init_lmlbt4x(struct bttv *btv)
static void init_lmlbt4x(struct bttv *btv)
{
{
	printk(KERN_DEBUG "LMLBT4x init\n");
	pr_debug("LMLBT4x init\n");
	btwrite(0x000000, BT848_GPIO_REG_INP);
	btwrite(0x000000, BT848_GPIO_REG_INP);
	gpio_inout(0xffffff, 0x0006C0);
	gpio_inout(0xffffff, 0x0006C0);
	gpio_write(0x000000);
	gpio_write(0x000000);
@@ -3246,7 +3245,7 @@ static void bttv_reset_audio(struct bttv *btv)
		return;
		return;


	if (bttv_debug)
	if (bttv_debug)
		printk("bttv%d: BT878A ARESET\n",btv->c.nr);
		pr_debug("%d: BT878A ARESET\n", btv->c.nr);
	btwrite((1<<7), 0x058);
	btwrite((1<<7), 0x058);
	udelay(10);
	udelay(10);
	btwrite(     0, 0x058);
	btwrite(     0, 0x058);
@@ -3349,7 +3348,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
	case BTTV_BOARD_MAGICTVIEW061:
	case BTTV_BOARD_MAGICTVIEW061:
		if (btv->cardid == 0x3002144f) {
		if (btv->cardid == 0x3002144f) {
			btv->has_radio=1;
			btv->has_radio=1;
			printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
			pr_info("%d: radio detected by subsystem id (CPH05x)\n",
				btv->c.nr);
		}
		}
		break;
		break;
	case BTTV_BOARD_STB2:
	case BTTV_BOARD_STB2:
@@ -3438,17 +3438,16 @@ void __devinit bttv_init_card2(struct bttv *btv)
		btv->tuner_type = tuner[btv->c.nr];
		btv->tuner_type = tuner[btv->c.nr];


	if (btv->tuner_type == TUNER_ABSENT)
	if (btv->tuner_type == TUNER_ABSENT)
		printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
		pr_info("%d: tuner absent\n", btv->c.nr);
	else if (btv->tuner_type == UNSET)
	else if (btv->tuner_type == UNSET)
		printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
		pr_warn("%d: tuner type unset\n", btv->c.nr);
	else
	else
		printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
		pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type);
		       btv->tuner_type);


	if (autoload != UNSET) {
	if (autoload != UNSET) {
		printk(KERN_WARNING "bttv%d: the autoload option is obsolete.\n", btv->c.nr);
		pr_warn("%d: the autoload option is obsolete\n", btv->c.nr);
		printk(KERN_WARNING "bttv%d: use option msp3400, tda7432 or tvaudio to\n", btv->c.nr);
		pr_warn("%d: use option msp3400, tda7432 or tvaudio to override which audio module should be used\n",
		printk(KERN_WARNING "bttv%d: override which audio module should be used.\n", btv->c.nr);
			btv->c.nr);
	}
	}


	if (UNSET == btv->tuner_type)
	if (UNSET == btv->tuner_type)
@@ -3541,8 +3540,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
	}
	}


	default:
	default:
		printk(KERN_WARNING "bttv%d: unknown audiodev value!\n",
		pr_warn("%d: unknown audiodev value!\n", btv->c.nr);
			btv->c.nr);
		return;
		return;
	}
	}


@@ -3585,8 +3583,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
		return;
		return;


no_audio:
no_audio:
	printk(KERN_WARNING "bttv%d: audio absent, no audio device found!\n",
	pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr);
			btv->c.nr);
}
}




@@ -3639,18 +3636,18 @@ static void modtec_eeprom(struct bttv *btv)
{
{
	if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
	if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
		btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
		btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
		printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
		pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
			btv->c.nr, &eeprom_data[0x1e]);
			btv->c.nr, &eeprom_data[0x1e]);
	} else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
	} else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
		btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
		btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
		printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
		pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
			btv->c.nr, &eeprom_data[0x1e]);
			btv->c.nr, &eeprom_data[0x1e]);
	} else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
	} else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
		btv->tuner_type=TUNER_PHILIPS_NTSC;
		btv->tuner_type=TUNER_PHILIPS_NTSC;
		printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
		pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
			btv->c.nr, &eeprom_data[0x1e]);
			btv->c.nr, &eeprom_data[0x1e]);
	} else {
	} else {
		printk("bttv%d: Modtec: Unknown TunerString: %s\n",
		pr_info("%d: Modtec: Unknown TunerString: %s\n",
			btv->c.nr, &eeprom_data[0x1e]);
			btv->c.nr, &eeprom_data[0x1e]);
	}
	}
}
}
@@ -3663,7 +3660,7 @@ static void __devinit hauppauge_eeprom(struct bttv *btv)
	btv->tuner_type = tv.tuner_type;
	btv->tuner_type = tv.tuner_type;
	btv->has_radio  = tv.has_radio;
	btv->has_radio  = tv.has_radio;


	printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
	pr_info("%d: Hauppauge eeprom indicates model#%d\n",
		btv->c.nr, tv.model);
		btv->c.nr, tv.model);


	/*
	/*
@@ -3671,7 +3668,7 @@ static void __devinit hauppauge_eeprom(struct bttv *btv)
	 * type based on model #.
	 * type based on model #.
	 */
	 */
	if(tv.model == 64900) {
	if(tv.model == 64900) {
		printk("bttv%d: Switching board type from %s to %s\n",
		pr_info("%d: Switching board type from %s to %s\n",
			btv->c.nr,
			btv->c.nr,
			bttv_tvcards[btv->c.type].name,
			bttv_tvcards[btv->c.type].name,
			bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
			bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
@@ -3698,8 +3695,7 @@ static int terratec_active_radio_upgrade(struct bttv *btv)
	freq=88000/62.5;
	freq=88000/62.5;
	tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
	tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
	if (0x1ed8 == tea5757_read(btv)) {
	if (0x1ed8 == tea5757_read(btv)) {
		printk("bttv%d: Terratec Active Radio Upgrade found.\n",
		pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr);
		       btv->c.nr);
		btv->has_radio    = 1;
		btv->has_radio    = 1;
		btv->has_saa6588  = 1;
		btv->has_saa6588  = 1;
		btv->has_matchbox = 1;
		btv->has_matchbox = 1;
@@ -3771,12 +3767,11 @@ static int __devinit pvr_boot(struct bttv *btv)


	rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
	rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
	if (rc != 0) {
	if (rc != 0) {
		printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
		pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr);
		       btv->c.nr);
		return rc;
		return rc;
	}
	}
	rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
	rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
	printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
	pr_info("%d: altera firmware upload %s\n",
		btv->c.nr, (rc < 0) ? "failed" : "ok");
		btv->c.nr, (rc < 0) ? "failed" : "ok");
	release_firmware(fw_entry);
	release_firmware(fw_entry);
	return rc;
	return rc;
@@ -3873,15 +3868,14 @@ static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
			break;
			break;
		default:
		default:
			/* unknown...leave generic, but get serial # */
			/* unknown...leave generic, but get serial # */
			printk(KERN_INFO "bttv%d: "
			pr_info("%d: osprey eeprom: unknown card type 0x%04x\n",
			       "osprey eeprom: unknown card type 0x%04x\n",
				btv->c.nr, type);
				btv->c.nr, type);
			break;
			break;
		}
		}
		serial = get_unaligned_be32((__be32 *)(ee+6));
		serial = get_unaligned_be32((__be32 *)(ee+6));
	}
	}


	printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
	pr_info("%d: osprey eeprom: card=%d '%s' serial=%u\n",
		btv->c.nr, cardid,
		btv->c.nr, cardid,
		cardid > 0 ? bttv_tvcards[cardid].name : "Unknown", serial);
		cardid > 0 ? bttv_tvcards[cardid].name : "Unknown", serial);


@@ -3890,12 +3884,11 @@ static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])


	/* card type isn't set correctly */
	/* card type isn't set correctly */
	if (card[btv->c.nr] < bttv_num_tvcards) {
	if (card[btv->c.nr] < bttv_num_tvcards) {
		printk(KERN_WARNING "bttv%d: osprey eeprom: "
		pr_warn("%d: osprey eeprom: Not overriding user specified card type\n",
		       "Not overriding user specified card type\n", btv->c.nr);
			btv->c.nr);
	} else {
	} else {
		printk(KERN_INFO "bttv%d: osprey eeprom: "
		pr_info("%d: osprey eeprom: Changing card type from %d to %d\n",
		       "Changing card type from %d to %d\n", btv->c.nr,
			btv->c.nr, btv->c.type, cardid);
		       btv->c.type, cardid);
		btv->c.type = cardid;
		btv->c.type = cardid;
	}
	}
}
}
@@ -3938,14 +3931,14 @@ static void __devinit avermedia_eeprom(struct bttv *btv)
		if (tuner_format == 0x09)
		if (tuner_format == 0x09)
			tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
			tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */


	printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
	pr_info("%d: Avermedia eeprom[0x%02x%02x]: tuner=",
		btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
		btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
	if (tuner_type) {
	if (tuner_type) {
		btv->tuner_type = tuner_type;
		btv->tuner_type = tuner_type;
		printk(KERN_CONT "%d", tuner_type);
		pr_cont("%d", tuner_type);
	} else
	} else
		printk(KERN_CONT "Unknown type");
		pr_cont("Unknown type");
	printk(KERN_CONT " radio:%s remote control:%s\n",
	pr_cont(" radio:%s remote control:%s\n",
	       tuner_tv_fm     ? "yes" : "no",
	       tuner_tv_fm     ? "yes" : "no",
	       btv->has_remote ? "yes" : "no");
	       btv->has_remote ? "yes" : "no");
}
}
@@ -3993,8 +3986,8 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin)
	if (bttv_gpio)
	if (bttv_gpio)
		bttv_gpio_tracking(btv,"msp34xx");
		bttv_gpio_tracking(btv,"msp34xx");
	if (bttv_verbose)
	if (bttv_verbose)
		printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
		pr_info("%d: Hauppauge/Voodoo msp34xx: reset line init [%d]\n",
		       "init [%d]\n", btv->c.nr, pin);
			btv->c.nr, pin);
}
}


/* ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------- */
@@ -4034,7 +4027,7 @@ static void __devinit init_PXC200(struct bttv *btv)
	btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
	btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);


	/*	Initialise MAX517 DAC */
	/*	Initialise MAX517 DAC */
	printk(KERN_INFO "Setting DAC reference voltage level ...\n");
	pr_info("Setting DAC reference voltage level ...\n");
	bttv_I2CWrite(btv,0x5E,0,0x80,1);
	bttv_I2CWrite(btv,0x5E,0,0x80,1);


	/*	Initialise 12C508 PIC */
	/*	Initialise 12C508 PIC */
@@ -4043,7 +4036,7 @@ static void __devinit init_PXC200(struct bttv *btv)
	 *	argument so the numbers are different */
	 *	argument so the numbers are different */




	printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
	pr_info("Initialising 12C508 PIC chip ...\n");


	/* First of all, enable the clock line. This is used in the PXC200-F */
	/* First of all, enable the clock line. This is used in the PXC200-F */
	val = btread(BT848_GPIO_DMA_CTL);
	val = btread(BT848_GPIO_DMA_CTL);
@@ -4062,13 +4055,12 @@ static void __devinit init_PXC200(struct bttv *btv)
	for (i = 0; i < ARRAY_SIZE(vals); i++) {
	for (i = 0; i < ARRAY_SIZE(vals); i++) {
		tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
		tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
		if (tmp != -1) {
		if (tmp != -1) {
			printk(KERN_INFO
			pr_info("I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
			       "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
			       vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
			       vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
		}
		}
	}
	}


	printk(KERN_INFO "PXC200 Initialised.\n");
	pr_info("PXC200 Initialised\n");
}
}




@@ -4107,8 +4099,7 @@ init_RTV24 (struct bttv *btv)
	uint32_t dataRead = 0;
	uint32_t dataRead = 0;
	long watchdog_value = 0x0E;
	long watchdog_value = 0x0E;


	printk (KERN_INFO
	pr_info("%d: Adlink RTV-24 initialisation in progress ...\n",
		"bttv%d: Adlink RTV-24 initialisation in progress ...\n",
		btv->c.nr);
		btv->c.nr);


	btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
	btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
@@ -4122,8 +4113,7 @@ init_RTV24 (struct bttv *btv)
	dataRead = btread (BT848_GPIO_DATA);
	dataRead = btread (BT848_GPIO_DATA);


	if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
	if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
		printk (KERN_INFO
		pr_info("%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
			"bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
			btv->c.nr, dataRead);
			btv->c.nr, dataRead);
	}
	}


@@ -4136,15 +4126,13 @@ init_RTV24 (struct bttv *btv)
	dataRead = btread (BT848_GPIO_DATA);
	dataRead = btread (BT848_GPIO_DATA);


	if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
	if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
		printk (KERN_INFO
		pr_info("%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
			"bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
			btv->c.nr, dataRead);
			btv->c.nr, dataRead);


		return;
		return;
	}
	}


	printk (KERN_INFO
	pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr);
		"bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
}
}




@@ -4261,22 +4249,25 @@ static int tea5757_read(struct bttv *btv)
	while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
	while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
		schedule();
		schedule();
	if (bus_in(btv,btv->mbox_data)) {
	if (bus_in(btv,btv->mbox_data)) {
		printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
		pr_warn("%d: tea5757: read timeout\n", btv->c.nr);
		return -1;
		return -1;
	}
	}


	dprintk("bttv%d: tea5757:",btv->c.nr);
	dprintk("%d: tea5757:", btv->c.nr);
	for (i = 0; i < 24; i++) {
	for (i = 0; i < 24; i++) {
		udelay(5);
		udelay(5);
		bus_high(btv,btv->mbox_clk);
		bus_high(btv,btv->mbox_clk);
		udelay(5);
		udelay(5);
		dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
		dprintk_cont("%c",
			     bus_in(btv, btv->mbox_most) == 0 ? 'T' : '-');
		bus_low(btv,btv->mbox_clk);
		bus_low(btv,btv->mbox_clk);
		value <<= 1;
		value <<= 1;
		value |= (bus_in(btv,btv->mbox_data) == 0)?0:1;  /* MSB first */
		value |= (bus_in(btv,btv->mbox_data) == 0)?0:1;  /* MSB first */
		dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
		dprintk_cont("%c",
			     bus_in(btv, btv->mbox_most) == 0 ? 'S' : 'M');
	}
	}
	dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
	dprintk_cont("\n");
	dprintk("%d: tea5757: read 0x%X\n", btv->c.nr, value);
	return value;
	return value;
}
}


@@ -4295,7 +4286,7 @@ static int tea5757_write(struct bttv *btv, int value)
	if (bttv_gpio)
	if (bttv_gpio)
		bttv_gpio_tracking(btv,"tea5757 write");
		bttv_gpio_tracking(btv,"tea5757 write");


	dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
	dprintk("%d: tea5757: write 0x%X\n", btv->c.nr, value);
	bus_low(btv,btv->mbox_clk);
	bus_low(btv,btv->mbox_clk);
	bus_high(btv,btv->mbox_we);
	bus_high(btv,btv->mbox_we);
	for (i = 0; i < 25; i++) {
	for (i = 0; i < 25; i++) {
@@ -4547,7 +4538,7 @@ static void picolo_tetra_init(struct bttv *btv)
static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
{
{


	dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel =>  input = %d\n",btv->c.nr,input);
	dprintk("%d : picolo_tetra_muxsel =>  input = %d\n", btv->c.nr, input);
	/*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
	/*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
	/*GPIO[20]&GPIO[21] used to choose the right input*/
	/*GPIO[20]&GPIO[21] used to choose the right input*/
	btwrite (input<<20,BT848_GPIO_DATA);
	btwrite (input<<20,BT848_GPIO_DATA);
@@ -4592,7 +4583,7 @@ static void ivc120_muxsel(struct bttv *btv, unsigned int input)
	int key = input % 4;
	int key = input % 4;
	int matrix = input / 4;
	int matrix = input / 4;


	dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
	dprintk("%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
		btv->c.nr, input, matrix, key);
		btv->c.nr, input, matrix, key);


	/* Handles the input selection on the TDA8540's */
	/* Handles the input selection on the TDA8540's */
@@ -4649,14 +4640,16 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
	buf[1]=0;
	buf[1]=0;
	rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
	rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
	if (rc) {
	if (rc) {
	  printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
		pr_debug("%d: PXC200_muxsel: pic cfg write failed:%d\n",
			 btv->c.nr, rc);
	  /* not PXC ? do nothing */
	  /* not PXC ? do nothing */
		return;
		return;
	}
	}


	rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
	rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
	if (!(rc & PX_CFG_PXC200F)) {
	if (!(rc & PX_CFG_PXC200F)) {
	  printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
		pr_debug("%d: PXC200_muxsel: not PXC200F rc:%d\n",
			 btv->c.nr, rc);
		return;
		return;
	}
	}


@@ -4696,7 +4689,7 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
	else /* older device */
	else /* older device */
	  btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
	  btand(~BT848_IFORM_MUXSEL,BT848_IFORM);


	printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
	pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux);
}
}


static void phytec_muxsel(struct bttv *btv, unsigned int input)
static void phytec_muxsel(struct bttv *btv, unsigned int input)
@@ -4847,29 +4840,27 @@ void __init bttv_check_chipset(void)


	/* print warnings about any quirks found */
	/* print warnings about any quirks found */
	if (triton1)
	if (triton1)
		printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
		pr_info("Host bridge needs ETBF enabled\n");
	if (vsfx)
	if (vsfx)
		printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
		pr_info("Host bridge needs VSFX enabled\n");
	if (pcipci_fail) {
	if (pcipci_fail) {
		printk(KERN_INFO "bttv: bttv and your chipset may not work "
		pr_info("bttv and your chipset may not work together\n");
							"together.\n");
		if (!no_overlay) {
		if (!no_overlay) {
			printk(KERN_INFO "bttv: overlay will be disabled.\n");
			pr_info("overlay will be disabled\n");
			no_overlay = 1;
			no_overlay = 1;
		} else {
		} else {
			printk(KERN_INFO "bttv: overlay forced. Use this "
			pr_info("overlay forced. Use this option at your own risk.\n");
						"option at your own risk.\n");
		}
		}
	}
	}
	if (UNSET != latency)
	if (UNSET != latency)
		printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
		pr_info("pci latency fixup [%d]\n", latency);
	while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
	while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
				      PCI_DEVICE_ID_INTEL_82441, dev))) {
				      PCI_DEVICE_ID_INTEL_82441, dev))) {
		unsigned char b;
		unsigned char b;
		pci_read_config_byte(dev, 0x53, &b);
		pci_read_config_byte(dev, 0x53, &b);
		if (bttv_debug)
		if (bttv_debug)
			printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
			pr_info("Host bridge: 82441FX Natoma, bufcon=0x%02x\n",
			       "bufcon=0x%02x\n",b);
				b);
	}
	}
}
}


@@ -4882,11 +4873,12 @@ int __devinit bttv_handle_chipset(struct bttv *btv)


	if (bttv_verbose) {
	if (bttv_verbose) {
		if (triton1)
		if (triton1)
			printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
			pr_info("%d: enabling ETBF (430FX/VP3 compatibility)\n",
				btv->c.nr);
		if (vsfx && btv->id >= 878)
		if (vsfx && btv->id >= 878)
			printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
			pr_info("%d: enabling VSFX\n", btv->c.nr);
		if (UNSET != latency)
		if (UNSET != latency)
			printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
			pr_info("%d: setting pci timer to %d\n",
				btv->c.nr, latency);
				btv->c.nr, latency);
	}
	}


+151 −143

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Original line Diff line number Diff line
@@ -26,6 +26,8 @@


*/
*/


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/delay.h>
@@ -99,7 +101,7 @@ int bttv_sub_add_device(struct bttv_core *core, char *name)
		kfree(sub);
		kfree(sub);
		return err;
		return err;
	}
	}
	printk("bttv%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev));
	pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev));
	list_add_tail(&sub->list,&core->subs);
	list_add_tail(&sub->list,&core->subs);
	return 0;
	return 0;
}
}
+31 −25
Original line number Original line Diff line number Diff line
@@ -27,6 +27,8 @@


*/
*/


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/delay.h>
@@ -154,9 +156,7 @@ bttv_i2c_sendbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
	if (retval == 0)
	if (retval == 0)
		goto eio;
		goto eio;
	if (i2c_debug) {
	if (i2c_debug) {
		printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]);
		pr_cont(" <W %02x %02x", msg->addr << 1, msg->buf[0]);
		if (!(xmit & BT878_I2C_NOSTOP))
			printk(" >\n");
	}
	}


	for (cnt = 1; cnt < msg->len; cnt++ ) {
	for (cnt = 1; cnt < msg->len; cnt++ ) {
@@ -170,19 +170,18 @@ bttv_i2c_sendbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
			goto err;
			goto err;
		if (retval == 0)
		if (retval == 0)
			goto eio;
			goto eio;
		if (i2c_debug) {
		if (i2c_debug)
			printk(" %02x", msg->buf[cnt]);
			pr_cont(" %02x", msg->buf[cnt]);
			if (!(xmit & BT878_I2C_NOSTOP))
				printk(" >\n");
		}
	}
	}
	if (!(xmit & BT878_I2C_NOSTOP))
		pr_cont(">\n");
	return msg->len;
	return msg->len;


 eio:
 eio:
	retval = -EIO;
	retval = -EIO;
 err:
 err:
	if (i2c_debug)
	if (i2c_debug)
		printk(" ERR: %d\n",retval);
		pr_cont(" ERR: %d\n",retval);
	return retval;
	return retval;
}
}


@@ -201,6 +200,12 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
			xmit |= BT878_I2C_NOSTOP;
			xmit |= BT878_I2C_NOSTOP;
		if (cnt)
		if (cnt)
			xmit |= BT878_I2C_NOSTART;
			xmit |= BT878_I2C_NOSTART;

		if (i2c_debug) {
			if (!(xmit & BT878_I2C_NOSTART))
				pr_cont(" <R %02x", (msg->addr << 1) +1);
		}

		btwrite(xmit, BT848_I2C);
		btwrite(xmit, BT848_I2C);
		retval = bttv_i2c_wait_done(btv);
		retval = bttv_i2c_wait_done(btv);
		if (retval < 0)
		if (retval < 0)
@@ -209,20 +214,20 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
			goto eio;
			goto eio;
		msg->buf[cnt] = ((u32)btread(BT848_I2C) >> 8) & 0xff;
		msg->buf[cnt] = ((u32)btread(BT848_I2C) >> 8) & 0xff;
		if (i2c_debug) {
		if (i2c_debug) {
			if (!(xmit & BT878_I2C_NOSTART))
			pr_cont(" =%02x", msg->buf[cnt]);
				printk(" <R %02x", (msg->addr << 1) +1);
			printk(" =%02x", msg->buf[cnt]);
			if (!(xmit & BT878_I2C_NOSTOP))
				printk(" >\n");
		}
		}
		if (i2c_debug && !(xmit & BT878_I2C_NOSTOP))
			pr_cont(" >\n");
	}
	}


	return msg->len;
	return msg->len;


 eio:
 eio:
	retval = -EIO;
	retval = -EIO;
 err:
 err:
	if (i2c_debug)
	if (i2c_debug)
		printk(" ERR: %d\n",retval);
		pr_cont(" ERR: %d\n",retval);
	return retval;
	return retval;
}
}


@@ -234,7 +239,8 @@ static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int
	int i;
	int i;


	if (i2c_debug)
	if (i2c_debug)
		printk("bt-i2c:");
		pr_debug("bt-i2c:");

	btwrite(BT848_INT_I2CDONE|BT848_INT_RACK, BT848_INT_STAT);
	btwrite(BT848_INT_I2CDONE|BT848_INT_RACK, BT848_INT_STAT);
	for (i = 0 ; i < num; i++) {
	for (i = 0 ; i < num; i++) {
		if (msgs[i].flags & I2C_M_RD) {
		if (msgs[i].flags & I2C_M_RD) {
@@ -271,20 +277,20 @@ int bttv_I2CRead(struct bttv *btv, unsigned char addr, char *probe_for)
	if (0 != btv->i2c_rc)
	if (0 != btv->i2c_rc)
		return -1;
		return -1;
	if (bttv_verbose && NULL != probe_for)
	if (bttv_verbose && NULL != probe_for)
		printk(KERN_INFO "bttv%d: i2c: checking for %s @ 0x%02x... ",
		pr_info("%d: i2c: checking for %s @ 0x%02x... ",
			btv->c.nr, probe_for, addr);
			btv->c.nr, probe_for, addr);
	btv->i2c_client.addr = addr >> 1;
	btv->i2c_client.addr = addr >> 1;
	if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) {
	if (1 != i2c_master_recv(&btv->i2c_client, &buffer, 1)) {
		if (NULL != probe_for) {
		if (NULL != probe_for) {
			if (bttv_verbose)
			if (bttv_verbose)
				printk("not found\n");
				pr_cont("not found\n");
		} else
		} else
			printk(KERN_WARNING "bttv%d: i2c read 0x%x: error\n",
			pr_warn("%d: i2c read 0x%x: error\n",
				btv->c.nr, addr);
				btv->c.nr, addr);
		return -1;
		return -1;
	}
	}
	if (bttv_verbose && NULL != probe_for)
	if (bttv_verbose && NULL != probe_for)
		printk("found\n");
		pr_cont("found\n");
	return buffer;
	return buffer;
}
}


@@ -335,7 +341,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
		rc = i2c_master_recv(c,&buf,0);
		rc = i2c_master_recv(c,&buf,0);
		if (rc < 0)
		if (rc < 0)
			continue;
			continue;
		printk("%s: i2c scan: found device @ 0x%x  [%s]\n",
		pr_info("%s: i2c scan: found device @ 0x%x  [%s]\n",
			name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???");
			name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???");
	}
	}
}
}
+19 −18
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/delay.h>
@@ -36,9 +38,10 @@ static int ir_rc5_remote_gap = 885;
module_param(ir_rc5_remote_gap, int, 0644);
module_param(ir_rc5_remote_gap, int, 0644);


#undef dprintk
#undef dprintk
#define dprintk(arg...) do {	\
#define dprintk(fmt, ...)			\
do {						\
	if (ir_debug >= 1)			\
	if (ir_debug >= 1)			\
		printk(arg);	\
		pr_info(fmt, ##__VA_ARGS__);	\
} while (0)
} while (0)


#define DEVNAME "bttv-input"
#define DEVNAME "bttv-input"
@@ -62,7 +65,7 @@ static void ir_handle_key(struct bttv *btv)


	/* extract data */
	/* extract data */
	data = ir_extract_bits(gpio, ir->mask_keycode);
	data = ir_extract_bits(gpio, ir->mask_keycode);
	dprintk(KERN_INFO DEVNAME ": irq gpio=0x%x code=%d | %s%s%s\n",
	dprintk("irq gpio=0x%x code=%d | %s%s%s\n",
		gpio, data,
		gpio, data,
		ir->polling               ? "poll"  : "irq",
		ir->polling               ? "poll"  : "irq",
		(gpio & ir->mask_keydown) ? " down" : "",
		(gpio & ir->mask_keydown) ? " down" : "",
@@ -96,7 +99,7 @@ static void ir_enltv_handle_key(struct bttv *btv)
	keyup = (gpio & ir->mask_keyup) ? 1 << 31 : 0;
	keyup = (gpio & ir->mask_keyup) ? 1 << 31 : 0;


	if ((ir->last_gpio & 0x7f) != data) {
	if ((ir->last_gpio & 0x7f) != data) {
		dprintk(KERN_INFO DEVNAME ": gpio=0x%x code=%d | %s\n",
		dprintk("gpio=0x%x code=%d | %s\n",
			gpio, data,
			gpio, data,
			(gpio & ir->mask_keyup) ? " up" : "up/down");
			(gpio & ir->mask_keyup) ? " up" : "up/down");


@@ -107,7 +110,7 @@ static void ir_enltv_handle_key(struct bttv *btv)
		if ((ir->last_gpio & 1 << 31) == keyup)
		if ((ir->last_gpio & 1 << 31) == keyup)
			return;
			return;


		dprintk(KERN_INFO DEVNAME ":(cnt) gpio=0x%x code=%d | %s\n",
		dprintk("(cnt) gpio=0x%x code=%d | %s\n",
			gpio, data,
			gpio, data,
			(gpio & ir->mask_keyup) ? " up" : "down");
			(gpio & ir->mask_keyup) ? " up" : "down");


@@ -177,13 +180,12 @@ static u32 bttv_rc5_decode(unsigned int code)
			rc5 |= 1;
			rc5 |= 1;
		break;
		break;
		case 3:
		case 3:
			dprintk(KERN_INFO DEVNAME ":rc5_decode(%x) bad code\n",
			dprintk("rc5_decode(%x) bad code\n",
				org_code);
				org_code);
			return 0;
			return 0;
		}
		}
	}
	}
	dprintk(KERN_INFO DEVNAME ":"
	dprintk("code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
		"code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
		"instr=%x\n", rc5, org_code, RC5_START(rc5),
		"instr=%x\n", rc5, org_code, RC5_START(rc5),
		RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5));
		RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5));
	return rc5;
	return rc5;
@@ -212,20 +214,20 @@ static void bttv_rc5_timer_end(unsigned long data)


	/* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */
	/* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */
	if (gap < 28000) {
	if (gap < 28000) {
		dprintk(KERN_INFO DEVNAME ": spurious timer_end\n");
		dprintk("spurious timer_end\n");
		return;
		return;
	}
	}


	if (ir->last_bit < 20) {
	if (ir->last_bit < 20) {
		/* ignore spurious codes (caused by light/other remotes) */
		/* ignore spurious codes (caused by light/other remotes) */
		dprintk(KERN_INFO DEVNAME ": short code: %x\n", ir->code);
		dprintk("short code: %x\n", ir->code);
	} else {
	} else {
		ir->code = (ir->code << ir->shift_by) | 1;
		ir->code = (ir->code << ir->shift_by) | 1;
		rc5 = bttv_rc5_decode(ir->code);
		rc5 = bttv_rc5_decode(ir->code);


		/* two start bits? */
		/* two start bits? */
		if (RC5_START(rc5) != ir->start) {
		if (RC5_START(rc5) != ir->start) {
			printk(KERN_INFO DEVNAME ":"
			pr_info(DEVNAME ":"
			       " rc5 start bits invalid: %u\n", RC5_START(rc5));
			       " rc5 start bits invalid: %u\n", RC5_START(rc5));


			/* right address? */
			/* right address? */
@@ -235,8 +237,7 @@ static void bttv_rc5_timer_end(unsigned long data)


			/* Good code */
			/* Good code */
			rc_keydown(ir->dev, instr, toggle);
			rc_keydown(ir->dev, instr, toggle);
			dprintk(KERN_INFO DEVNAME ":"
			dprintk("instruction %x, toggle %x\n",
				" instruction %x, toggle %x\n",
				instr, toggle);
				instr, toggle);
		}
		}
	}
	}
@@ -265,7 +266,7 @@ static int bttv_rc5_irq(struct bttv *btv)
		    tv.tv_usec - ir->base_time.tv_usec;
		    tv.tv_usec - ir->base_time.tv_usec;
	}
	}


	dprintk(KERN_INFO DEVNAME ": RC5 IRQ: gap %d us for %s\n",
	dprintk("RC5 IRQ: gap %d us for %s\n",
		gap, (gpio & 0x20) ? "mark" : "space");
		gap, (gpio & 0x20) ? "mark" : "space");


	/* remote IRQ? */
	/* remote IRQ? */
@@ -340,14 +341,14 @@ static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)


	/* poll IR chip */
	/* poll IR chip */
	if (1 != i2c_master_recv(ir->c, &b, 1)) {
	if (1 != i2c_master_recv(ir->c, &b, 1)) {
		dprintk(KERN_INFO DEVNAME ": read error\n");
		dprintk("read error\n");
		return -EIO;
		return -EIO;
	}
	}


	/* ignore 0xaa */
	/* ignore 0xaa */
	if (b==0xaa)
	if (b==0xaa)
		return 0;
		return 0;
	dprintk(KERN_INFO DEVNAME ": key %02x\n", b);
	dprintk("key %02x\n", b);


	/*
	/*
	 * NOTE:
	 * NOTE:
@@ -517,7 +518,7 @@ int bttv_input_init(struct bttv *btv)
		break;
		break;
	}
	}
	if (NULL == ir_codes) {
	if (NULL == ir_codes) {
		dprintk(KERN_INFO "Ooops: IR config error [card=%d]\n", btv->c.type);
		dprintk("Ooops: IR config error [card=%d]\n", btv->c.type);
		err = -ENODEV;
		err = -ENODEV;
		goto err_out_free;
		goto err_out_free;
	}
	}
Loading