struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; 
struct nxt2002_state* state = fe->demodulator_priv; 
static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr){	struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv;	u8 b[2];	u16 temp = 0, temp2;	u32 snrdb = 0;	/* setup to read cluster variance */	b[0] = 0x00;	i2c_writebytes(state,0xA1,b,1);	/* get multreg val from 0xA6 */	nxt2002_readreg_multibyte(state,0xA6,b,2);	temp = (b[0] << 8) | b[1];	temp2 = 0x7FFF - temp;	/* snr will be in db */	if (temp2 > 0x7F00)		snrdb = 1000*24 + ( 1000*(30-24) * ( temp2 - 0x7F00 ) / ( 0x7FFF - 0x7F00 ) );	else if (temp2 > 0x7EC0)		snrdb = 1000*18 + ( 1000*(24-18) * ( temp2 - 0x7EC0 ) / ( 0x7F00 - 0x7EC0 ) );	else if (temp2 > 0x7C00)		snrdb = 1000*12 + ( 1000*(18-12) * ( temp2 - 0x7C00 ) / ( 0x7EC0 - 0x7C00 ) );	else		snrdb = 1000*0 + ( 1000*(12-0) * ( temp2 - 0 ) / ( 0x7C00 - 0 ) );        /* the value reported back from the frontend will be FFFF=32db 0000=0db */	*snr = snrdb * (0xFFFF/32000);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b8742700f13163ffa00cddce2a3c940b9ab2ab5a/nxt2002.c/clean/drivers/media/dvb/frontends/nxt2002.c