亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cx24110.c

?? trident tm5600的linux驅(qū)動
?? C
?? 第 1 頁 / 共 2 頁
字號:
	/*    cx24110 - Single Chip Satellite Channel Receiver driver module    Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@htp-tel.de> based on    work    Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#include <linux/slab.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/init.h>#include "dvb_frontend.h"#include "cx24110.h"struct cx24110_state {	struct i2c_adapter* i2c;	const struct cx24110_config* config;	struct dvb_frontend frontend;	u32 lastber;	u32 lastbler;	u32 lastesn0;};static int debug;#define dprintk(args...) \	do { \		if (debug) printk(KERN_DEBUG "cx24110: " args); \	} while (0)static struct {u8 reg; u8 data;} cx24110_regdata[]=		      /* Comments beginning with @ denote this value should			 be the default */	{{0x09,0x01}, /* SoftResetAll */	 {0x09,0x00}, /* release reset */	 {0x01,0xe8}, /* MSB of code rate 27.5MS/s */	 {0x02,0x17}, /* middle byte " */	 {0x03,0x29}, /* LSB         " */	 {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */	 {0x06,0xa5}, /* @ PLL 60MHz */	 {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */	 {0x0a,0x00}, /* @ partial chip disables, do not set */	 {0x0b,0x01}, /* set output clock in gapped mode, start signal low			 active for first byte */	 {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */	 {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */	 {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 1			 to avoid starting the BER counter. Reset the			 CRC test bit. Finite counting selected */	 {0x15,0xff}, /* @ size of the limited time window for RS BER			 estimation. It is <value>*256 RS blocks, this			 gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */	 {0x16,0x00}, /* @ enable all RS output ports */	 {0x17,0x04}, /* @ time window allowed for the RS to sync */	 {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned			 for automatically */		      /* leave the current code rate and normalization			 registers as they are after reset... */	 {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting			 only once */	 {0x23,0x18}, /* @ size of the limited time window for Viterbi BER			 estimation. It is <value>*65536 channel bits, i.e.			 approx. 38ms at 27.5MS/s, rate 3/4 */	 {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */		      /* leave front-end AGC parameters at default values */		      /* leave decimation AGC parameters at default values */	 {0x35,0x40}, /* disable all interrupts. They are not connected anyway */	 {0x36,0xff}, /* clear all interrupt pending flags */	 {0x37,0x00}, /* @ fully enable AutoAcqq state machine */	 {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */		      /* leave the equalizer parameters on their default values */		      /* leave the final AGC parameters on their default values */	 {0x41,0x00}, /* @ MSB of front-end derotator frequency */	 {0x42,0x00}, /* @ middle bytes " */	 {0x43,0x00}, /* @ LSB          " */		      /* leave the carrier tracking loop parameters on default */		      /* leave the bit timing loop parameters at gefault */	 {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */		      /* the cx24108 data sheet for symbol rates above 15MS/s */	 {0x57,0x00}, /* @ Filter sigma delta enabled, positive */	 {0x61,0x95}, /* GPIO pins 1-4 have special function */	 {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */	 {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */	 {0x64,0x20}, /* GPIO 6 is input, all others are outputs */	 {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */	 {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */	 {0x73,0x00}, /* @ disable several demod bypasses */	 {0x74,0x00}, /* @  " */	 {0x75,0x00}  /* @  " */		      /* the remaining registers are for SEC */	};static int cx24110_writereg (struct cx24110_state* state, int reg, int data){	u8 buf [] = { reg, data };	struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };	int err;	if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {		dprintk ("%s: writereg error (err == %i, reg == 0x%02x,"			 " data == 0x%02x)\n", __func__, err, reg, data);		return -EREMOTEIO;	}	return 0;}static int cx24110_readreg (struct cx24110_state* state, u8 reg){	int ret;	u8 b0 [] = { reg };	u8 b1 [] = { 0 };	struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 },			   { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };	ret = i2c_transfer(state->i2c, msg, 2);	if (ret != 2) return ret;	return b1[0];}static int cx24110_set_inversion (struct cx24110_state* state, fe_spectral_inversion_t inversion){/* fixme (low): error handling */	switch (inversion) {	case INVERSION_OFF:		cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);		/* AcqSpectrInvDis on. No idea why someone should want this */		cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)&0xf7);		/* Initial value 0 at start of acq */		cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)&0xef);		/* current value 0 */		/* The cx24110 manual tells us this reg is read-only.		   But what the heck... set it ayways */		break;	case INVERSION_ON:		cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);		/* AcqSpectrInvDis on. No idea why someone should want this */		cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)|0x08);		/* Initial value 1 at start of acq */		cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)|0x10);		/* current value 1 */		break;	case INVERSION_AUTO:		cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xfe);		/* AcqSpectrInvDis off. Leave initial & current states as is */		break;	default:		return -EINVAL;	}	return 0;}static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec){/* fixme (low): error handling */	static const int rate[]={-1,1,2,3,5,7,-1};	static const int g1[]={-1,0x01,0x02,0x05,0x15,0x45,-1};	static const int g2[]={-1,0x01,0x03,0x06,0x1a,0x7a,-1};	/* Well, the AutoAcq engine of the cx24106 and 24110 automatically	   searches all enabled viterbi rates, and can handle non-standard	   rates as well. */	if (fec>FEC_AUTO)		fec=FEC_AUTO;	if (fec==FEC_AUTO) { /* (re-)establish AutoAcq behaviour */		cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xdf);		/* clear AcqVitDis bit */		cx24110_writereg(state,0x18,0xae);		/* allow all DVB standard code rates */		cx24110_writereg(state,0x05,(cx24110_readreg(state,0x05)&0xf0)|0x3);		/* set nominal Viterbi rate 3/4 */		cx24110_writereg(state,0x22,(cx24110_readreg(state,0x22)&0xf0)|0x3);		/* set current Viterbi rate 3/4 */		cx24110_writereg(state,0x1a,0x05); cx24110_writereg(state,0x1b,0x06);		/* set the puncture registers for code rate 3/4 */		return 0;	} else {		cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x20);		/* set AcqVitDis bit */		if(rate[fec]>0) {			cx24110_writereg(state,0x05,(cx24110_readreg(state,0x05)&0xf0)|rate[fec]);			/* set nominal Viterbi rate */			cx24110_writereg(state,0x22,(cx24110_readreg(state,0x22)&0xf0)|rate[fec]);			/* set current Viterbi rate */			cx24110_writereg(state,0x1a,g1[fec]);			cx24110_writereg(state,0x1b,g2[fec]);			/* not sure if this is the right way: I always used AutoAcq mode */	   } else		   return -EOPNOTSUPP;/* fixme (low): which is the correct return code? */	};	return 0;}static fe_code_rate_t cx24110_get_fec (struct cx24110_state* state){	int i;	i=cx24110_readreg(state,0x22)&0x0f;	if(!(i&0x08)) {		return FEC_1_2 + i - 1;	} else {/* fixme (low): a special code rate has been selected. In theory, we need to   return a denominator value, a numerator value, and a pair of puncture   maps to correctly describe this mode. But this should never happen in   practice, because it cannot be set by cx24110_get_fec. */	   return FEC_NONE;	}}static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate){/* fixme (low): add error handling */	u32 ratio;	u32 tmp, fclk, BDRI;	static const u32 bands[]={5000000UL,15000000UL,90999000UL/2};	int i;	dprintk("cx24110 debug: entering %s(%d)\n",__func__,srate);	if (srate>90999000UL/2)		srate=90999000UL/2;	if (srate<500000)		srate=500000;	for(i = 0; (i < ARRAY_SIZE(bands)) && (srate>bands[i]); i++)		;	/* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz,	   and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult,	   R06[3:0] PLLphaseDetGain */	tmp=cx24110_readreg(state,0x07)&0xfc;	if(srate<90999000UL/4) { /* sample rate 45MHz*/		cx24110_writereg(state,0x07,tmp);		cx24110_writereg(state,0x06,0x78);		fclk=90999000UL/2;	} else if(srate<60666000UL/2) { /* sample rate 60MHz */		cx24110_writereg(state,0x07,tmp|0x1);		cx24110_writereg(state,0x06,0xa5);		fclk=60666000UL;	} else if(srate<80888000UL/2) { /* sample rate 80MHz */		cx24110_writereg(state,0x07,tmp|0x2);		cx24110_writereg(state,0x06,0x87);		fclk=80888000UL;	} else { /* sample rate 90MHz */		cx24110_writereg(state,0x07,tmp|0x3);		cx24110_writereg(state,0x06,0x78);		fclk=90999000UL;	};	dprintk("cx24110 debug: fclk %d Hz\n",fclk);	/* we need to divide two integers with approx. 27 bits in 32 bit	   arithmetic giving a 25 bit result */	/* the maximum dividend is 90999000/2, 0x02b6446c, this number is	   also the most complex divisor. Hence, the dividend has,	   assuming 32bit unsigned arithmetic, 6 clear bits on top, the	   divisor 2 unused bits at the bottom. Also, the quotient is	   always less than 1/2. Borrowed from VES1893.c, of course */	tmp=srate<<6;	BDRI=fclk>>2;	ratio=(tmp/BDRI);	tmp=(tmp%BDRI)<<8;	ratio=(ratio<<8)+(tmp/BDRI);	tmp=(tmp%BDRI)<<8;	ratio=(ratio<<8)+(tmp/BDRI);	tmp=(tmp%BDRI)<<1;	ratio=(ratio<<1)+(tmp/BDRI);	dprintk("srate= %d (range %d, up to %d)\n", srate,i,bands[i]);	dprintk("fclk = %d\n", fclk);	dprintk("ratio= %08x\n", ratio);	cx24110_writereg(state, 0x1, (ratio>>16)&0xff);	cx24110_writereg(state, 0x2, (ratio>>8)&0xff);	cx24110_writereg(state, 0x3, (ratio)&0xff);	return 0;}static int _cx24110_pll_write (struct dvb_frontend* fe, u8 *buf, int len){	struct cx24110_state *state = fe->demodulator_priv;	if (len != 3)		return -EINVAL;/* tuner data is 21 bits long, must be left-aligned in data *//* tuner cx24108 is written through a dedicated 3wire interface on the demod chip *//* FIXME (low): add error handling, avoid infinite loops if HW fails... */	cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */	cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */	/* if the auto tuner writer is still busy, clear it out */	while (cx24110_readreg(state,0x6d)&0x80)		cx24110_writereg(state,0x72,0);	/* write the topmost 8 bits */	cx24110_writereg(state,0x72,buf[0]);	/* wait for the send to be completed */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本久久电影网| 99久久婷婷国产精品综合| 亚洲国产精品av| 欧美精品精品一区| 在线观看亚洲一区| 欧美乱妇23p| 91成人免费网站| 欧美在线你懂的| 91麻豆精品91久久久久同性| 欧美优质美女网站| 色香色香欲天天天影视综合网| 成人精品视频一区二区三区| 成人午夜碰碰视频| 91欧美一区二区| av欧美精品.com| 91在线观看视频| 色综合久久99| 欧美一区二区免费观在线| 欧美一区二区在线免费播放| 欧美一级理论性理论a| 日韩欧美的一区| 欧美精品一区二区久久婷婷| 久久精品视频网| 1024国产精品| 蜜臀av一区二区在线免费观看| 国产剧情一区在线| 欧美性大战久久| 国产欧美一区二区精品久导航| 亚洲男人的天堂网| 麻豆国产精品一区二区三区 | 亚洲男人的天堂在线观看| 日韩精品每日更新| 成人的网站免费观看| 日韩午夜电影在线观看| 国产精品无圣光一区二区| 日韩福利电影在线观看| 99久久精品免费观看| 欧美一区二区视频观看视频| 国产精品全国免费观看高清 | 亚洲老妇xxxxxx| 国产在线一区二区| 久久新电视剧免费观看| 性感美女久久精品| 欧美亚洲国产bt| 一区二区在线观看免费视频播放| 国产精品一区二区在线观看网站| 日韩精品一区二区三区中文精品| 一区二区三区波多野结衣在线观看| 国产永久精品大片wwwapp| 欧美一区二区啪啪| 日日摸夜夜添夜夜添亚洲女人| 色婷婷亚洲一区二区三区| 国产精品传媒入口麻豆| 国模套图日韩精品一区二区 | 国产夜色精品一区二区av| 国产成人免费高清| 欧美激情艳妇裸体舞| 成人国产精品免费网站| 亚洲黄色在线视频| 在线播放亚洲一区| 国产九色sp调教91| 亚洲视频你懂的| 欧美精品 日韩| 精品一区二区三区免费播放| 日韩西西人体444www| 国产精品一区在线观看你懂的| 中文字幕一区视频| 9191久久久久久久久久久| 九一九一国产精品| 亚洲免费观看高清完整版在线观看| 97久久精品人人爽人人爽蜜臀| 亚洲小说春色综合另类电影| 欧美一级精品在线| 色婷婷综合激情| 国产一区二区成人久久免费影院| 亚洲欧洲一区二区三区| 欧美一区二区精品| 欧美色综合影院| 国产白丝网站精品污在线入口| 亚洲精品伦理在线| 久久精品一区二区| 欧美四级电影网| 99精品久久99久久久久| 一区二区三区四区蜜桃| 成人午夜免费视频| 国产原创一区二区三区| 天天色综合天天| 一区二区不卡在线视频 午夜欧美不卡在| 日韩一区二区在线免费观看| 欧美亚洲综合久久| 欧美亚洲动漫另类| 欧美系列日韩一区| 99精品久久久久久| 日本高清不卡aⅴ免费网站| 国产成人av一区二区三区在线观看| 日本大胆欧美人术艺术动态| 日韩国产高清在线| 韩日av一区二区| 狠狠色丁香久久婷婷综| 久久99久久久久久久久久久| 久久99蜜桃精品| 国产91色综合久久免费分享| 国产精品 日产精品 欧美精品| 国产精品香蕉一区二区三区| 国产在线精品一区二区不卡了| 偷拍亚洲欧洲综合| 亚洲成a人v欧美综合天堂下载| 亚洲精品视频免费观看| 亚洲精品国产精华液| 国产精品每日更新| 亚洲超碰精品一区二区| 亚洲一区中文日韩| 七七婷婷婷婷精品国产| 亚洲激情男女视频| 日本一道高清亚洲日美韩| 日本三级韩国三级欧美三级| 五月婷婷欧美视频| 毛片av一区二区| 成人美女视频在线看| 欧美日韩1234| 国产精品久久久久影院老司| 亚洲欧美一区二区三区极速播放| 精品欧美一区二区三区精品久久| 日韩精品资源二区在线| 一卡二卡三卡日韩欧美| 日韩**一区毛片| 一本色道久久综合狠狠躁的推荐| 91精品国产手机| 亚洲欧美日韩在线不卡| 日韩精品亚洲一区| 色乱码一区二区三区88| 久久无码av三级| 午夜精品123| 国产91色综合久久免费分享| 欧美一级理论片| 毛片不卡一区二区| 91精品国产一区二区三区蜜臀| 亚洲精品国产无天堂网2021| 成人午夜av影视| 亚洲色图另类专区| 99精品久久免费看蜜臀剧情介绍| 精品少妇一区二区三区免费观看 | www.激情成人| 亚洲国产精品精华液2区45| 国产麻豆精品95视频| 日本一区二区免费在线| 欧美bbbbb| 秋霞成人午夜伦在线观看| 日本丶国产丶欧美色综合| 国产精品国产三级国产a | 色综合网色综合| 国产91丝袜在线18| 日韩欧美国产高清| 另类专区欧美蜜桃臀第一页| 久久精品亚洲乱码伦伦中文 | 99久久精品国产网站| 欧美国产97人人爽人人喊| 91精品国产综合久久久蜜臀图片| 懂色av噜噜一区二区三区av| 99精品视频一区二区| 国产精品一品二品| 秋霞国产午夜精品免费视频| 午夜精品久久久久久久99水蜜桃| 日韩精品乱码免费| 婷婷综合在线观看| 日韩电影在线一区| 成人av中文字幕| 美腿丝袜一区二区三区| 色偷偷88欧美精品久久久| 亚洲成人一二三| 精品国产乱码久久| 欧美影视一区在线| 久久av中文字幕片| 最近日韩中文字幕| 精品国产一二三| 欧美精品亚洲二区| 欧美日韩夫妻久久| 一本色道久久综合亚洲精品按摩| 欧美精品一区在线观看| 日韩欧美国产一二三区| 亚洲444eee在线观看| 国产成人免费在线观看| 欧美国产日本视频| 国产成人一区在线| 久久婷婷色综合| 国产一区二区精品久久99| 国产亚洲精品资源在线26u| 免费视频一区二区| 欧美大片日本大片免费观看| 久久精品国产亚洲5555| 久久日一线二线三线suv| 亚洲成人1区2区| 日韩午夜在线影院| 国内精品第一页| 国产日韩欧美亚洲| 91网址在线看| 一区二区三区91| 欧美一级免费大片| 激情综合色播五月| 欧美精品一区二区三区在线播放 |