switch (cmd) { 
switch (cmd) { 
tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg){	struct tda9887 *t = i2c_get_clientdata(client);        switch (cmd) {	/* --- configuration --- */	case AUDC_SET_RADIO:	{		t->mode = T_RADIO;		tda9887_configure(t);		break;	}	case TUNER_SET_STANDBY:	{		t->mode = T_STANDBY;		tda9887_configure(t);		break;	}	case AUDC_CONFIG_PINNACLE:	{		int *i = arg;		t->pinnacle_id = *i;		tda9887_configure(t);		break;	}	case TDA9887_SET_CONFIG:	{		int *i = arg;		t->config = *i;		tda9887_configure(t);		break;	}	/* --- v4l ioctls --- */	/* take care: bttv does userspace copying, we'll get a	   kernel pointer here... */	case VIDIOCSCHAN:	{		static const v4l2_std_id map[] = {			[ VIDEO_MODE_PAL   ] = V4L2_STD_PAL,			[ VIDEO_MODE_NTSC  ] = V4L2_STD_NTSC_M,			[ VIDEO_MODE_SECAM ] = V4L2_STD_SECAM,			[ 4 /* bttv */     ] = V4L2_STD_PAL_M,			[ 5 /* bttv */     ] = V4L2_STD_PAL_N,			[ 6 /* bttv */     ] = V4L2_STD_NTSC_M_JP,		};		struct video_channel *vc = arg;		CHECK_V4L2;		t->mode = T_ANALOG_TV;		if (vc->norm < ARRAY_SIZE(map))			t->std = map[vc->norm];		tda9887_fixup_std(t);		tda9887_configure(t);		break;	}	case VIDIOC_S_STD:	{		v4l2_std_id *id = arg;		SWITCH_V4L2;		t->mode = T_ANALOG_TV;		t->std   = *id;		tda9887_fixup_std(t);		tda9887_configure(t);		break;	}	case VIDIOC_S_FREQUENCY:	{		struct v4l2_frequency *f = arg;		SWITCH_V4L2;		if (V4L2_TUNER_ANALOG_TV == f->type) {			if (t->mode == T_ANALOG_TV)				return 0;			t->mode = T_ANALOG_TV;		}		if (V4L2_TUNER_RADIO == f->type) {			if (t->mode == T_RADIO)				return 0;			t->mode = T_RADIO;		}		tda9887_configure(t);		break;	}	case VIDIOC_G_TUNER:	{		static int AFC_BITS_2_kHz[] = {			-12500,  -37500,  -62500,  -97500,			-112500, -137500, -162500, -187500,			187500,  162500,  137500,  112500,			97500 ,  62500,   37500 ,  12500		};		struct v4l2_tuner* tuner = arg;		if (t->mode == T_RADIO) {			__u8 reg = 0;			tuner->afc=0;			if (1 == i2c_master_recv(&t->client,&reg,1))				tuner->afc = AFC_BITS_2_kHz[(reg>>1)&0x0f];		}		break;	}	case VIDIOC_S_TUNER:	{		struct v4l2_tuner* tuner = arg;		if (t->mode == T_RADIO) {			t->radio_mode = tuner->audmode;			tda9887_configure (t);		}		break;	}	case VIDIOC_LOG_STATUS:	{		tda9887_info("Data bytes: b=%02x c=%02x e=%02x\n", t->data[1], t->data[2], t->data[3]);		break;	}	default:		/* nothing */		break;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/tda9887.c/clean/drivers/media/video/tda9887.c