diff options
author | Johannes Stezenbach <devnull@localhost> | 2005-03-02 21:42:00 +0000 |
---|---|---|
committer | Johannes Stezenbach <devnull@localhost> | 2005-03-02 21:42:00 +0000 |
commit | 22369c7b769f439e3b351ecc9cd396a40b452db1 (patch) | |
tree | d7c330a08914350746300715a74c8fa6dc1fcebf /linux/drivers/media/dvb/frontends/tda10021.c | |
parent | ca7fda81614047eda9a192f937edf43dbbb11e88 (diff) | |
download | mediapointer-dvb-s2-22369c7b769f439e3b351ecc9cd396a40b452db1.tar.gz mediapointer-dvb-s2-22369c7b769f439e3b351ecc9cd396a40b452db1.tar.bz2 |
whitespace cleanup (remove ws at eol, sync with changes in mainline kernel)
Diffstat (limited to 'linux/drivers/media/dvb/frontends/tda10021.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda10021.c | 68 |
1 files changed, 27 insertions, 41 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda10021.c b/linux/drivers/media/dvb/frontends/tda10021.c index 72da8b69e..8bbcec71d 100644 --- a/linux/drivers/media/dvb/frontends/tda10021.c +++ b/linux/drivers/media/dvb/frontends/tda10021.c @@ -1,4 +1,4 @@ -/* +/* TDA10021 - Single Chip Cable Channel Receiver driver module used on the the Siemens DVB-C cards @@ -19,7 +19,7 @@ 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/config.h> #include <linux/delay.h> @@ -35,20 +35,16 @@ struct tda10021_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct tda10021_config* config; - struct dvb_frontend frontend; u8 pwm; u8 reg0; }; - + #if 0 #define dprintk(x...) printk(x) @@ -70,9 +66,9 @@ static u8 tda10021_inittab[0x40]= { 0x73, 0x6a, 0x23, 0x0a, 0x02, 0x37, 0x77, 0x1a, 0x37, 0x6a, 0x17, 0x8a, 0x1e, 0x86, 0x43, 0x40, - 0xb8, 0x3f, 0xa1, 0x00, 0xcd, 0x01, 0x00, 0xff, + 0xb8, 0x3f, 0xa1, 0x00, 0xcd, 0x01, 0x00, 0xff, 0x11, 0x00, 0x7c, 0x31, 0x30, 0x20, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x33, 0x11, 0x0d, 0x95, 0x08, 0x58, 0x00, 0x00, 0x80, 0x00, 0x80, 0xff, 0x00, 0x00, 0x04, 0x2d, 0x2f, 0xff, 0x00, 0x00, 0x00, 0x00, @@ -94,7 +90,6 @@ static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data) return (ret != 1) ? -EREMOTEIO : 0; } - static u8 tda10021_readreg (struct tda10021_state* state, u8 reg) { u8 b0 [] = { reg }; @@ -115,7 +110,7 @@ static int lock_tuner(struct tda10021_state* state) { u8 buf[2] = { 0x0f, tda10021_inittab[0x0f] | 0x80 }; struct i2c_msg msg = {.addr=state->config->demod_address, .flags=0, .buf=buf, .len=2}; - + if(i2c_transfer(state->i2c, &msg, 1) != 1) { printk("tda10021: lock tuner fails\n"); @@ -129,7 +124,7 @@ static int unlock_tuner(struct tda10021_state* state) { u8 buf[2] = { 0x0f, tda10021_inittab[0x0f] & 0x7f }; struct i2c_msg msg_post={.addr=state->config->demod_address, .flags=0, .buf=buf, .len=2}; - + if(i2c_transfer(state->i2c, &msg_post, 1) != 1) { printk("tda10021: unlock tuner fails\n"); @@ -142,12 +137,12 @@ static int tda10021_setup_reg0 (struct tda10021_state* state, u8 reg0, fe_spectral_inversion_t inversion) { reg0 |= state->reg0 & 0x63; - + if (INVERSION_ON == inversion) ENABLE_INVERSION(reg0); else if (INVERSION_OFF == inversion) DISABLE_INVERSION(reg0); - + tda10021_writereg (state, 0x00, reg0 & 0xfe); tda10021_writereg (state, 0x00, reg0 | 0x01); @@ -157,13 +152,13 @@ static int tda10021_setup_reg0 (struct tda10021_state* state, u8 reg0, static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate) { - s32 BDR; + s32 BDR; s32 BDRI; s16 SFIL=0; u16 NDEC = 0; u32 tmp, ratio; - if (symbolrate > XIN/2) + if (symbolrate > XIN/2) symbolrate = XIN/2; if (symbolrate < 500000) symbolrate = 500000; @@ -171,7 +166,7 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate if (symbolrate < XIN/16) NDEC = 1; if (symbolrate < XIN/32) NDEC = 2; if (symbolrate < XIN/64) NDEC = 3; - + if (symbolrate < (u32)(XIN/12.3)) SFIL = 1; if (symbolrate < (u32)(XIN/16)) SFIL = 0; if (symbolrate < (u32)(XIN/24.6)) SFIL = 1; @@ -179,22 +174,22 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate if (symbolrate < (u32)(XIN/49.2)) SFIL = 1; if (symbolrate < (u32)(XIN/64)) SFIL = 0; if (symbolrate < (u32)(XIN/98.4)) SFIL = 1; - + symbolrate <<= NDEC; ratio = (symbolrate << 4) / FIN; tmp = ((symbolrate << 4) % FIN) << 8; ratio = (ratio << 8) + tmp / FIN; tmp = (tmp % FIN) << 8; ratio = (ratio << 8) + (tmp + FIN/2) / FIN; - + BDR = ratio; BDRI = (((XIN << 5) / symbolrate) + 1) / 2; - - if (BDRI > 0xFF) + + if (BDRI > 0xFF) BDRI = 0xFF; - + SFIL = (SFIL << 4) | tda10021_inittab[0x0E]; - + NDEC = (NDEC << 6) | tda10021_inittab[0x03]; tda10021_writereg (state, 0x03, NDEC); @@ -208,20 +203,11 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate return 0; } - - - - - - - - - static int tda10021_init (struct dvb_frontend *fe) { struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; int i; - + dprintk("DVB: TDA10021(%d): init chip\n", fe->adapter->num); //tda10021_writereg (fe, 0, 0); @@ -230,13 +216,13 @@ static int tda10021_init (struct dvb_frontend *fe) tda10021_writereg (state, i, tda10021_inittab[i]); tda10021_writereg (state, 0x34, state->pwm); - + //Comment by markus //0x2A[3-0] == PDIV -> P multiplaying factor (P=PDIV+1)(default 0) //0x2A[4] == BYPPLL -> Power down mode (default 1) //0x2A[5] == LCK -> PLL Lock Flag //0x2A[6] == POLAXIN -> Polarity of the input reference clock (default 0) - + //Activate PLL tda10021_writereg(state, 0x2a, tda10021_inittab[0x2a] & 0xef); @@ -255,7 +241,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe, struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; //table for QAM4-QAM256 ready QAM4 QAM16 QAM32 QAM64 QAM128 QAM256 - //CONF + //CONF static const u8 reg0x00 [] = { 0x14, 0x00, 0x04, 0x08, 0x0c, 0x10 }; //AGCREF value static const u8 reg0x01 [] = { 0x78, 0x8c, 0x8c, 0x6a, 0x78, 0x5c }; @@ -265,7 +251,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe, static const u8 reg0x08 [] = { 0x8c, 0xa2, 0x74, 0x43, 0x34, 0x23 }; //AREF static const u8 reg0x09 [] = { 0x96, 0x91, 0x96, 0x6a, 0x7e, 0x6b }; - + int qam = p->u.qam.modulation; if (qam < 0 || qam > 5) @@ -320,8 +306,8 @@ static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber) struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; u32 _ber = tda10021_readreg(state, 0x14) | - (tda10021_readreg(state, 0x15) << 8) | - ((tda10021_readreg(state, 0x16) & 0x0f) << 16); + (tda10021_readreg(state, 0x15) << 8) | + ((tda10021_readreg(state, 0x16) & 0x0f) << 16); *ber = 10 * _ber; return 0; @@ -367,7 +353,7 @@ static int tda10021_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; int sync; s8 afc = 0; - + sync = tda10021_readreg(state, 0x11); afc = tda10021_readreg(state, 0x19); if (verbose) { @@ -454,7 +440,7 @@ static struct dvb_frontend_ops tda10021_ops = { #endif .caps = 0x400 | //FE_CAN_QAM_4 FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | - FE_CAN_QAM_128 | FE_CAN_QAM_256 | + FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_FEC_AUTO }, |