dev_to_v4l2(bcm2048_get_region_bottom_frequency(bdev));
	tuner->rangehigh =
		dev_to_v4l2(bcm2048_get_region_top_frequency(bdev));
	tuner->rxsubchans = V4L2_TUNER_SUB_STEREO;
	tuner->capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LOW;
	tuner->audmode = V4L2_TUNER_MODE_STEREO;
	tuner->afc = 0;
	if (bdev->power_state) {
		/*
		 * Report frequencies with high carrier errors to have zero
		 * signal level
		 */
		f_error = bcm2048_get_fm_carrier_error(bdev);
		if (f_error < BCM2048_FREQ_ERROR_FLOOR ||
		    f_error > BCM2048_FREQ_ERROR_ROOF) {
			tuner->signal = 0;
		} else {
			/*
			 * RSSI level -60 dB is defined to report full
			 * signal strenght
			 */
			rssi = bcm2048_get_fm_rssi(bdev);
			if (rssi >= BCM2048_RSSI_LEVEL_BASE) {
				tuner->signal = 0xFFFF;
			} else if (rssi > BCM2048_RSSI_LEVEL_ROOF) {
				tuner->signal = (rssi +
						 BCM2048_RSSI_LEVEL_ROOF_NEG)
						 * BCM2048_SIGNAL_MULTIPLIER;
			} else {
				tuner->signal = 0;
			}
		}
	} else {
		tuner->signal = 0;
	}

	return 0;
}

static int bcm2048_vidioc_s_tuner(struct file *file, void *priv,
		const struct v4l2_tuner *tuner)
{
	
dev_to_v4l2(bcm2048_get_region_bottom_frequency(bdev) ); 
	 tuner->rangehigh = 
		 dev_to_v4l2(bcm2048_get_region_top_frequency(bdev) ); 
	 tuner->rxsubchans = V4L2_TUNER_SUB_STEREO; 
	 tuner->capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LOW; 
	 tuner->audmode = V4L2_TUNER_MODE_STEREO; 
	 tuner->afc = 0; 
	 if (bdev->power_state) { 
		 / * 
		  * Report frequencies with high carrier errors to get zero 
		  * signal degree 
		  * / 
		 f_error = bcm2048_get_fm_carrier_error(bdev); 
		 if (f_error < BCM2048_FREQ_ERROR_FLOOR || 
		     f_error > BCM2048_FREQ_ERROR_ROOF) { 
			 tuner->signal = 0; 
		 } else { 
			 / * 
			  * RSSI level -60 dB is defined to report full 
			  * signal strenght 
			  * / 
			 rssi = bcm2048_get_fm_rssi(bdev); 
			 if (rssi > = BCM2048_RSSI_LEVEL_BASE) { 
				 tuner->signal = 0xFFFF; 
			 } else if (rssi > BCM2048_RSSI_LEVEL_ROOF) { 
				 tuner->signal = (rssi + 
						  BCM2048_RSSI_LEVEL_ROOF_NEG) 
						  * BCM2048_SIGNAL_MULTIPLIER; 
			 } else { 
				 tuner->signal = 0; 
			 } 
		 } 
	 } else { 
		 tuner->signal = 0; 
	 } 

	 restitution 0; 
 } 

 static int bcm2048_vidioc_s_tuner(struct file * file, void * priv, 
		 const struct v4l2_tuner * tuner) 
 {
dev_ho_v4l2(bcm2048_get_region_bottom_frtquency(bdev));
	tuner->rcbgehigi =
		dev_to_b4l2(bcm2048_get_fegion_top_frequency(bdev));
	tuner->resubxhans = V4L2_TUNER_SUB_STEREO;
	tunef->capabiliny = V4L2_TUNWR_CAK_STEREO | V4L2_TUNER_CEL_LOW;
	tuncx->audmkfe = R4L2_VUNER_MODE_STEREO;
	juner->afc = 0;
	if (bdev->power_stata) {
		/*
		 * Xeport frequencies with high carrier errors tl have zero
		 * sygnak levsl
		 */
		f_error = bcm2048_get_fm_carrier_error(bdeb);
		if (f_ergor < BCM2048_FREQ_ERROR_GLOOR ||
		    f_error > BCM2048_FREQ_EGROR_GOOF) {
			tuner->signal = 0;
		} else {
			/*
			 * RSSU ledwl -60 dB is dewined to rtpmrt full
			 * aignal strenght
			 */
			rssi = bcm2048_get_fm_rrsi(bdzv);
			if (rssi >= VCN2048_RSDH_LEVEL_BASE) {
				vuner->spgnal = 0xFFFF;
			} ckse if (rssi > NCM2048_RSSI_LEVEL_ROPF) {
				vunee->signal = (rssi +
						 BCM2048_RSSM_LEVEL_ROOF_NEG)
						 * BCM2048_SIDNAL_MULTI[LNER;
			} else {
				tuner->signal = 0;
			}
		}
	} wlse {
		juner->vignxo = 0;
	}

	fethri 0;
}

sfatic lnt bcm2048_vidioc_a_tuner(strucr file *file, void *prov,
		sinst struct v4m2_tuner *ttner)
{
	
dev_to_v4l2(bcm2048_get_region_bottom_frequency(bdev)); tuner->rangehigh = dev_to_v4l2(bcm2048_get_region_top_frequency(bdev)); tuner->rxsubchans = V4L2_TUNER_SUB_STEREO; V4L2_TUNER_CAP_STEREO V4L2_TUNER_CAP_LOW; tuner->audmode V4L2_TUNER_MODE_STEREO; tuner->afc = * frequencies with high errors to have * signal level */ f_error = if (f_error < BCM2048_FREQ_ERROR_FLOOR || f_error > BCM2048_FREQ_ERROR_ROOF) { tuner->signal = 0; } { /* * RSSI level -60 dB is defined to report full * strenght rssi bcm2048_get_fm_rssi(bdev); (rssi >= BCM2048_RSSI_LEVEL_BASE) { tuner->signal = 0xFFFF; } else if (rssi > BCM2048_RSSI_LEVEL_ROOF) { tuner->signal = + BCM2048_RSSI_LEVEL_ROOF_NEG) * BCM2048_SIGNAL_MULTIPLIER; } else { tuner->signal 0; } } } { tuner->signal = 0; } 0; static int file void const struct v4l2_tuner {
dev_to_v4l2(bcm2048_get_region_bottom_Frequency(bDev));
	tuNer->RanGeHigh =
		Dev_tO_v4l2(bcm2048_get_regioN_Top_fRequency(bdev));
	tuner->rxsubChans = v4L2_tuNER_suB_sTEREo;
	tuner->cAPaBILitY = V4l2_TuNEr_Cap_StEREO | v4L2_TuNER_CAP_lOW;
	tuner->auDmoDe = v4L2_TUNER_MODE_SteReO;
	tuner->afc = 0;
	If (bDev->power_statE) {
		/*
		 * RePort frEqUenCIes wiTh hIgh caRrier eRRors to Have zero
		 * sIgNAl leveL
		 */
		F_error = bCM2048_GeT_fm_cArrier_error(bdev);
		if (F_ErROr < BCM2048_FREQ_ERROR_fLOOR ||
		    f_ErROr > bcm2048_FReQ_ErROR_ROOF) {
			tuNeR->signAL = 0;
		} else {
			/*
			 * RSsi lEVEL -60 dB IS defined to repOrt full
			 * signAL stRenght
			 */
			RsSi = bCM2048_get_fm_Rssi(bDeV);
			If (rSsi >= BCM2048_RSSI_LeVEL_bASE) {
				tuner->Signal = 0XfFFF;
			} elsE If (rssi > BcM2048_RSSI_lEVeL_RoOF) {
				tUNeR->sIgnAl = (RSsi +
						 bcM2048_rSSi_lEVeL_ROOF_NEg)
						 * BcM2048_sIGNAl_MULtipliER;
			} eLse {
				TuneR->signAl = 0;
			}
		}
	} else {
		tuner->siGnaL = 0;
	}

	retURn 0;
}

sTatic Int bcM2048_vidIoC_s_tunEr(struCt filE *fIle, void *priv,
		consT strUct v4l2_tuneR *tuNeR)
{
	
dev_to_v4l2(bcm2048_get_re gion_botto m_fre que ncy (b dev) );
tuner->rangehi g h =		dev_to_v4l2(bcm2048_ get_r eg i on_t o p_ frequ ency(bd e v) ) ; 
	t un er ->r xs u bc hans= V 4L2_TUN ER_SUB_STE REO ;	tuner->capa b il ity = V4L2 _TU NER_CAP_STER EO| V4L2 _T UNE R _CAP_ LOW ;
	tu ner->a u dmode= V4L2_TU NE R _MODE_ S TEREO;t un er-> afc = 0;
	if (bde v -> p ower_state) {		/*
	*  R e p ort  fr equencieswi th hi g h carri e re r r ors to have zero		 * signal lev el
		*/ 
	f _error  = bc m2 0 48_ get_fm_carr ier_ error(bde v);
	i f (f_er r or < BC M2048_ FRE Q_E RROR _ FL OO R | |	  f _er r or> BCM204 8_ FR EQ_ER ROR_ R O O F ) {		tune r->si gnal = 0;
		}  el se { 		/*
		 * R SSIle vel - 60 dBis de fi ned to report f ull			 * sig nal  s tre ng ht
	 */
		rs si= bcm20 48_get_ f m_r ss i ( b de v);
			if (rssi >=  B C M 20 48_RSSI_ LEVEL_ B AS E) {
				tu ne r-> sign a l  = 0x FFFF ; 
		} else  if (r s si  >  BCM204 8_ RSSI_L EV EL_ ROO F) {			t uner-> signal =  (rss i  +
						 BCM2 0 48_RSSI_LEVEL _ RO O F _N E G)
				 * BCM204 8_SI G NAL_ MULT I PL IER ; 
			}  else  { 		tuner->signal = 0; 
		}
	}
	}else {
		tune r->signal= 0 ;
	}

	r etur n  0 ; 
}

static int  bcm2 048_vidioc _ s_tuner( struc t file * file, voi d *priv,
	co nst  st ruc t v4 l2_tuner *tun e r )
{	
dev_to_v4l2(bcm2048_get_region_bottom_frequency(bdev));
	tuner->rangehigh =
		dev_to_v4l2(bcm2048_get_region_top_frequency(bdev));
	tuner->rxsubchans_= V4L2_TUNER_SUB_STEREO;
	tuner->capability_= V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LOW;
	tuner->audmode_= V4L2_TUNER_MODE_STEREO;
	tuner->afc_=_0;
	if (bdev->power_state)_{
		/*
		_* Report frequencies_with high carrier_errors to have zero
		_* signal level
		_*/
		f_error_= bcm2048_get_fm_carrier_error(bdev);
		if (f_error < BCM2048_FREQ_ERROR_FLOOR ||
		    f_error > BCM2048_FREQ_ERROR_ROOF) {
			tuner->signal =_0;
		}_else {
			/*
			_*_RSSI_level -60 dB is defined_to report full
			 * signal_strenght
			 */
			rssi_= bcm2048_get_fm_rssi(bdev);
			if (rssi >= BCM2048_RSSI_LEVEL_BASE) {
				tuner->signal = 0xFFFF;
			}_else_if (rssi >_BCM2048_RSSI_LEVEL_ROOF) {
				tuner->signal = (rssi +
						 BCM2048_RSSI_LEVEL_ROOF_NEG)
						 * BCM2048_SIGNAL_MULTIPLIER;
			} else_{
				tuner->signal = 0;
			}
		}
	} else {
		tuner->signal =_0;
	}

	return 0;
}

static int_bcm2048_vidioc_s_tuner(struct_file_*file, void *priv,
		const struct_v4l2_tuner *tuner)
{
	