unsigned char buffer[4]; 
unsigned char buffer[4]; 
static void default_set_tv_freq(struct i2c_client *c, unsigned int freq){	struct tuner *t = i2c_get_clientdata(c);	u8 config;	u16 div;	struct tunertype *tun;        unsigned char buffer[4];	int rc;	tun = &tuners[t->type];	if (freq < tun->thresh1) {		config = tun->VHF_L;		tuner_dbg("tv: VHF lowrange\n");	} else if (freq < tun->thresh2) {		config = tun->VHF_H;		tuner_dbg("tv: VHF high range\n");	} else {		config = tun->UHF;		tuner_dbg("tv: UHF range\n");	}	/* tv norm specific stuff for multi-norm tuners */	switch (t->type) {	case TUNER_PHILIPS_SECAM: // FI1216MF		/* 0x01 -> ??? no change ??? */		/* 0x02 -> PAL BDGHI / SECAM L */		/* 0x04 -> ??? PAL others / SECAM others ??? */		config &= ~0x02;		if (t->std & V4L2_STD_SECAM)			config |= 0x02;		break;	case TUNER_TEMIC_4046FM5:		config &= ~0x0f;		if (t->std & V4L2_STD_PAL_BG) {			config |= TEMIC_SET_PAL_BG;		} else if (t->std & V4L2_STD_PAL_I) {			config |= TEMIC_SET_PAL_I;		} else if (t->std & V4L2_STD_PAL_DK) {			config |= TEMIC_SET_PAL_DK;		} else if (t->std & V4L2_STD_SECAM_L) {			config |= TEMIC_SET_PAL_L;		}		break;	case TUNER_PHILIPS_FQ1216ME:		config &= ~0x0f;		if (t->std & (V4L2_STD_PAL_BG|V4L2_STD_PAL_DK)) {			config |= PHILIPS_SET_PAL_BGDK;		} else if (t->std & V4L2_STD_PAL_I) {			config |= PHILIPS_SET_PAL_I;		} else if (t->std & V4L2_STD_SECAM_L) {			config |= PHILIPS_SET_PAL_L;		}		break;	case TUNER_PHILIPS_ATSC:		/* 0x00 -> ATSC antenna input 1 */		/* 0x01 -> ATSC antenna input 2 */		/* 0x02 -> NTSC antenna input 1 */		/* 0x03 -> NTSC antenna input 2 */		config &= ~0x03;		if (!(t->std & V4L2_STD_ATSC))			config |= 2;		/* FIXME: input */		break;	case TUNER_MICROTUNE_4042FI5:		/* Set the charge pump for fast tuning */		tun->config |= TUNER_CHARGE_PUMP;		break;	case TUNER_PHILIPS_TUV1236D:		/* 0x40 -> ATSC antenna input 1 */		/* 0x48 -> ATSC antenna input 2 */		/* 0x00 -> NTSC antenna input 1 */		/* 0x08 -> NTSC antenna input 2 */		config &= ~0x40;		if (t->std & V4L2_STD_ATSC)			config |= 0x40;		/* FIXME: input */		break;	}	/*	 * Philips FI1216MK2 remark from specification :	 * for channel selection involving band switching, and to ensure	 * smooth tuning to the desired channel without causing	 * unnecessary charge pump action, it is recommended to consider	 * the difference between wanted channel frequency and the	 * current channel frequency.  Unnecessary charge pump action	 * will result in very low tuning voltage which may drive the	 * oscillator to extreme conditions.	 *	 * Progfou: specification says to send config data before	 * frequency in case (wanted frequency < current frequency).	 */	div=freq + tun->IFPCoff;	if (t->type == TUNER_PHILIPS_SECAM && freq < t->freq) {		buffer[0] = tun->config;		buffer[1] = config;		buffer[2] = (div>>8) & 0x7f;		buffer[3] = div      & 0xff;	} else {		buffer[0] = (div>>8) & 0x7f;		buffer[1] = div      & 0xff;		buffer[2] = tun->config;		buffer[3] = config;	}	tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",		  buffer[0],buffer[1],buffer[2],buffer[3]);        if (4 != (rc = i2c_master_send(c,buffer,4)))		tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);	if (t->type == TUNER_MICROTUNE_4042FI5) {		// FIXME - this may also work for other tuners		unsigned long timeout = jiffies + msecs_to_jiffies(1);		u8 status_byte = 0;		/* Wait until the PLL locks */		for (;;) {			if (time_after(jiffies,timeout))				return;			if (1 != (rc = i2c_master_recv(c,&status_byte,1))) {				tuner_warn("i2c i/o read error: rc == %d (should be 1)\n",rc);				break;			}			if (status_byte & TUNER_PLL_LOCKED)				break;			udelay(10);		}		/* Set the charge pump for optimized phase noise figure */		tun->config &= ~TUNER_CHARGE_PUMP;		buffer[0] = (div>>8) & 0x7f;		buffer[1] = div      & 0xff;		buffer[2] = tun->config;		buffer[3] = config;		tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",		       buffer[0],buffer[1],buffer[2],buffer[3]);		if (4 != (rc = i2c_master_send(c,buffer,4)))			tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/tuner-simple.c/clean/drivers/media/video/tuner-simple.c