Lines Matching full:state
115 static int PowerScan(struct tda_state *state,
138 static int WriteRegs(struct tda_state *state, in WriteRegs() argument
145 return i2c_write(state->i2c, state->adr, data, nRegs+1); in WriteRegs()
148 static int WriteReg(struct tda_state *state, u8 SubAddr, u8 Reg) in WriteReg() argument
152 return i2c_write(state->i2c, state->adr, msg, 2); in WriteReg()
155 static int Read(struct tda_state *state, u8 * Regs) in Read() argument
157 return i2c_readn(state->i2c, state->adr, Regs, 16); in Read()
160 static int ReadExtented(struct tda_state *state, u8 * Regs) in ReadExtented() argument
162 return i2c_readn(state->i2c, state->adr, Regs, NUM_REGS); in ReadExtented()
165 static int UpdateRegs(struct tda_state *state, u8 RegFrom, u8 RegTo) in UpdateRegs() argument
167 return WriteRegs(state, RegFrom, in UpdateRegs()
168 &state->m_Regs[RegFrom], RegTo-RegFrom+1); in UpdateRegs()
170 static int UpdateReg(struct tda_state *state, u8 Reg) in UpdateReg() argument
172 return WriteReg(state, Reg, state->m_Regs[Reg]); in UpdateReg()
177 static void reset(struct tda_state *state) in reset() argument
189 state->m_Frequency = 0; in reset()
190 state->m_SettlingTime = 100; in reset()
191 state->m_IFLevelAnalog = (ulIFLevelAnalog & 0x07) << 2; in reset()
192 state->m_IFLevelDigital = (ulIFLevelDigital & 0x07) << 2; in reset()
193 state->m_IFLevelDVBC = (ulIFLevelDVBC & 0x07) << 2; in reset()
194 state->m_IFLevelDVBT = (ulIFLevelDVBT & 0x07) << 2; in reset()
196 state->m_EP4 = 0x20; in reset()
198 state->m_EP4 |= 0x40; in reset()
200 state->m_EP3_Standby = ((ulStandbyMode & 0x07) << 5) | 0x0F; in reset()
201 state->m_bMaster = (ulSlave == 0); in reset()
203 state->m_SettlingTime = ulSettlingTime; in reset()
205 state->m_bFMInput = (ulFMInput == 2); in reset()
263 static int ThermometerRead(struct tda_state *state, u8 *pTM_Value) in ThermometerRead() argument
269 state->m_Regs[TM] |= 0x10; in ThermometerRead()
270 status = UpdateReg(state, TM); in ThermometerRead()
273 status = Read(state, Regs); in ThermometerRead()
278 state->m_Regs[TM] ^= 0x20; in ThermometerRead()
279 status = UpdateReg(state, TM); in ThermometerRead()
283 status = Read(state, Regs); in ThermometerRead()
290 state->m_Regs[TM] &= ~0x10; /* Thermometer off */ in ThermometerRead()
291 status = UpdateReg(state, TM); in ThermometerRead()
294 state->m_Regs[EP4] &= ~0x03; /* CAL_mode = 0 ????????? */ in ThermometerRead()
295 status = UpdateReg(state, EP4); in ThermometerRead()
303 static int StandBy(struct tda_state *state) in StandBy() argument
307 state->m_Regs[EB12] &= ~0x20; /* PD_AGC1_Det = 0 */ in StandBy()
308 status = UpdateReg(state, EB12); in StandBy()
311 state->m_Regs[EB18] &= ~0x83; /* AGC1_loop_off = 0, AGC1_Gain = 6 dB */ in StandBy()
312 status = UpdateReg(state, EB18); in StandBy()
315 state->m_Regs[EB21] |= 0x03; /* AGC2_Gain = -6 dB */ in StandBy()
316 state->m_Regs[EP3] = state->m_EP3_Standby; in StandBy()
317 status = UpdateReg(state, EP3); in StandBy()
320 state->m_Regs[EB23] &= ~0x06; /* ForceLP_Fc2_En = 0, LP_Fc[2] = 0 */ in StandBy()
321 status = UpdateRegs(state, EB21, EB23); in StandBy()
328 static int CalcMainPLL(struct tda_state *state, u32 freq) in CalcMainPLL() argument
344 state->m_Regs[MPD] = PostDiv & 0x77; in CalcMainPLL()
345 state->m_Regs[MD1] = ((MainDiv >> 16) & 0x7F); in CalcMainPLL()
346 state->m_Regs[MD2] = ((MainDiv >> 8) & 0xFF); in CalcMainPLL()
347 state->m_Regs[MD3] = (MainDiv & 0xFF); in CalcMainPLL()
349 return UpdateRegs(state, MPD, MD3); in CalcMainPLL()
352 static int CalcCalPLL(struct tda_state *state, u32 freq) in CalcCalPLL() argument
368 state->m_Regs[CPD] = PostDiv; in CalcCalPLL()
369 state->m_Regs[CD1] = ((CalDiv >> 16) & 0xFF); in CalcCalPLL()
370 state->m_Regs[CD2] = ((CalDiv >> 8) & 0xFF); in CalcCalPLL()
371 state->m_Regs[CD3] = (CalDiv & 0xFF); in CalcCalPLL()
373 return UpdateRegs(state, CPD, CD3); in CalcCalPLL()
376 static int CalibrateRF(struct tda_state *state, in CalibrateRF() argument
387 state->m_Regs[EP4] &= ~0x03; /* CAL_mode = 0 */ in CalibrateRF()
388 status = UpdateReg(state, EP4); in CalibrateRF()
391 state->m_Regs[EB18] |= 0x03; /* AGC1_Gain = 3 */ in CalibrateRF()
392 status = UpdateReg(state, EB18); in CalibrateRF()
398 if (state->m_Regs[ID] != 0x83) /* C1: ID == 83, C2: ID == 84 */ in CalibrateRF()
399 state->m_Regs[EP3] |= 0x40; /* SM_LT = 1 */ in CalibrateRF()
406 state->m_Regs[EP1] = (state->m_Regs[EP1] & ~0x07) | BP_Filter; in CalibrateRF()
407 state->m_Regs[EP2] = (RFBand << 5) | GainTaper; in CalibrateRF()
409 state->m_Regs[EB13] = (state->m_Regs[EB13] & ~0x7C) | (RFC_K << 4) | (RFC_M << 2); in CalibrateRF()
411 status = UpdateRegs(state, EP1, EP3); in CalibrateRF()
414 status = UpdateReg(state, EB13); in CalibrateRF()
418 state->m_Regs[EB4] |= 0x20; /* LO_ForceSrce = 1 */ in CalibrateRF()
419 status = UpdateReg(state, EB4); in CalibrateRF()
423 state->m_Regs[EB7] |= 0x20; /* CAL_ForceSrce = 1 */ in CalibrateRF()
424 status = UpdateReg(state, EB7); in CalibrateRF()
428 state->m_Regs[EB14] = 0; /* RFC_Cprog = 0 */ in CalibrateRF()
429 status = UpdateReg(state, EB14); in CalibrateRF()
433 state->m_Regs[EB20] &= ~0x20; /* ForceLock = 0; */ in CalibrateRF()
434 status = UpdateReg(state, EB20); in CalibrateRF()
438 state->m_Regs[EP4] |= 0x03; /* CAL_Mode = 3 */ in CalibrateRF()
439 status = UpdateRegs(state, EP4, EP5); in CalibrateRF()
443 status = CalcCalPLL(state, freq); in CalibrateRF()
446 status = CalcMainPLL(state, freq + 1000000); in CalibrateRF()
451 status = UpdateReg(state, EP2); in CalibrateRF()
454 status = UpdateReg(state, EP1); in CalibrateRF()
457 status = UpdateReg(state, EP2); in CalibrateRF()
460 status = UpdateReg(state, EP1); in CalibrateRF()
464 state->m_Regs[EB4] &= ~0x20; /* LO_ForceSrce = 0 */ in CalibrateRF()
465 status = UpdateReg(state, EB4); in CalibrateRF()
469 state->m_Regs[EB7] &= ~0x20; /* CAL_ForceSrce = 0 */ in CalibrateRF()
470 status = UpdateReg(state, EB7); in CalibrateRF()
475 state->m_Regs[EB20] |= 0x20; /* ForceLock = 1; */ in CalibrateRF()
476 status = UpdateReg(state, EB20); in CalibrateRF()
481 state->m_Regs[EP4] &= ~0x03; /* CAL_Mode = 0 */ in CalibrateRF()
482 state->m_Regs[EP3] &= ~0x40; /* SM_LT = 0 */ in CalibrateRF()
483 state->m_Regs[EB18] &= ~0x03; /* AGC1_Gain = 0 */ in CalibrateRF()
484 status = UpdateReg(state, EB18); in CalibrateRF()
487 status = UpdateRegs(state, EP3, EP4); in CalibrateRF()
490 status = UpdateReg(state, EP1); in CalibrateRF()
494 status = ReadExtented(state, Regs); in CalibrateRF()
504 static int RFTrackingFiltersInit(struct tda_state *state, in RFTrackingFiltersInit() argument
521 state->m_RF_A1[RFBand] = 0; in RFTrackingFiltersInit()
522 state->m_RF_B1[RFBand] = 0; in RFTrackingFiltersInit()
523 state->m_RF_A2[RFBand] = 0; in RFTrackingFiltersInit()
524 state->m_RF_B2[RFBand] = 0; in RFTrackingFiltersInit()
527 status = PowerScan(state, RFBand, RF1, &RF1, &bcal); in RFTrackingFiltersInit()
531 status = CalibrateRF(state, RFBand, RF1, &Cprog_cal1); in RFTrackingFiltersInit()
538 state->m_RF_B1[RFBand] = Cprog_cal1 - Cprog_table1; in RFTrackingFiltersInit()
539 /* state->m_RF_A1[RF_Band] = ???? */ in RFTrackingFiltersInit()
544 status = PowerScan(state, RFBand, RF2, &RF2, &bcal); in RFTrackingFiltersInit()
548 status = CalibrateRF(state, RFBand, RF2, &Cprog_cal2); in RFTrackingFiltersInit()
556 state->m_RF_A1[RFBand] = in RFTrackingFiltersInit()
563 status = PowerScan(state, RFBand, RF3, &RF3, &bcal); in RFTrackingFiltersInit()
567 status = CalibrateRF(state, RFBand, RF3, &Cprog_cal3); in RFTrackingFiltersInit()
574 …state->m_RF_A2[RFBand] = (Cprog_cal3 - Cprog_table3 - Cprog_cal2 + Cprog_table2) / ((s32)(RF3) - (… in RFTrackingFiltersInit()
575 state->m_RF_B2[RFBand] = Cprog_cal2 - Cprog_table2; in RFTrackingFiltersInit()
579 state->m_RF1[RFBand] = RF1; in RFTrackingFiltersInit()
580 state->m_RF2[RFBand] = RF2; in RFTrackingFiltersInit()
581 state->m_RF3[RFBand] = RF3; in RFTrackingFiltersInit()
585 RFBand, RF1, state->m_RF_A1[RFBand], state->m_RF_B1[RFBand], RF2, in RFTrackingFiltersInit()
586 state->m_RF_A2[RFBand], state->m_RF_B2[RFBand], RF3); in RFTrackingFiltersInit()
592 static int PowerScan(struct tda_state *state, in PowerScan() argument
616 state->m_Regs[EP2] = (RFBand << 5) | Gain_Taper; in PowerScan()
617 state->m_Regs[EB14] = (RFC_Cprog); in PowerScan()
618 status = UpdateReg(state, EP2); in PowerScan()
621 status = UpdateReg(state, EB14); in PowerScan()
626 status = CalcMainPLL(state, freq_MainPLL); in PowerScan()
630 state->m_Regs[EP4] = (state->m_Regs[EP4] & ~0x03) | 1; /* CAL_mode = 1 */ in PowerScan()
631 status = UpdateReg(state, EP4); in PowerScan()
634 status = UpdateReg(state, EP2); /* Launch power measurement */ in PowerScan()
637 status = ReadExtented(state, Regs); in PowerScan()
641 state->m_Regs[ID] = Regs[ID]; /* Chip version, (needed for C1 workarround in CalibrateRF) */ in PowerScan()
647 status = CalcMainPLL(state, freq_MainPLL); in PowerScan()
652 status = UpdateReg(state, EP2); /* Launch power measurement */ in PowerScan()
655 status = ReadExtented(state, Regs); in PowerScan()
683 static int PowerScanInit(struct tda_state *state) in PowerScanInit() argument
687 state->m_Regs[EP3] = (state->m_Regs[EP3] & ~0x1F) | 0x12; in PowerScanInit()
688 state->m_Regs[EP4] = (state->m_Regs[EP4] & ~0x1F); /* If level = 0, Cal mode = 0 */ in PowerScanInit()
689 status = UpdateRegs(state, EP3, EP4); in PowerScanInit()
692 state->m_Regs[EB18] = (state->m_Regs[EB18] & ~0x03); /* AGC 1 Gain = 0 */ in PowerScanInit()
693 status = UpdateReg(state, EB18); in PowerScanInit()
696 state->m_Regs[EB21] = (state->m_Regs[EB21] & ~0x03); /* AGC 2 Gain = 0 (Datasheet = 3) */ in PowerScanInit()
697 state->m_Regs[EB23] = (state->m_Regs[EB23] | 0x06); /* ForceLP_Fc2_En = 1, LPFc[2] = 1 */ in PowerScanInit()
698 status = UpdateRegs(state, EB21, EB23); in PowerScanInit()
705 static int CalcRFFilterCurve(struct tda_state *state) in CalcRFFilterCurve() argument
710 status = PowerScanInit(state); in CalcRFFilterCurve()
713 status = RFTrackingFiltersInit(state, 0); in CalcRFFilterCurve()
716 status = RFTrackingFiltersInit(state, 1); in CalcRFFilterCurve()
719 status = RFTrackingFiltersInit(state, 2); in CalcRFFilterCurve()
722 status = RFTrackingFiltersInit(state, 3); in CalcRFFilterCurve()
725 status = RFTrackingFiltersInit(state, 4); in CalcRFFilterCurve()
728 status = RFTrackingFiltersInit(state, 5); in CalcRFFilterCurve()
731 status = RFTrackingFiltersInit(state, 6); in CalcRFFilterCurve()
734 status = ThermometerRead(state, &state->m_TMValue_RFCal); /* also switches off Cal mode !!! */ in CalcRFFilterCurve()
742 static int FixedContentsI2CUpdate(struct tda_state *state) in FixedContentsI2CUpdate() argument
757 memcpy(&state->m_Regs[TM], InitRegs, EB23 - TM + 1); in FixedContentsI2CUpdate()
759 status = UpdateRegs(state, TM, EB23); in FixedContentsI2CUpdate()
764 state->m_Regs[EB17] = 0x00; in FixedContentsI2CUpdate()
765 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
768 state->m_Regs[EB17] = 0x03; in FixedContentsI2CUpdate()
769 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
772 state->m_Regs[EB17] = 0x43; in FixedContentsI2CUpdate()
773 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
776 state->m_Regs[EB17] = 0x4C; in FixedContentsI2CUpdate()
777 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
782 state->m_Regs[EP3] = 0x1F; in FixedContentsI2CUpdate()
783 state->m_Regs[EP4] = 0x66; in FixedContentsI2CUpdate()
784 state->m_Regs[EP5] = 0x81; in FixedContentsI2CUpdate()
785 state->m_Regs[CPD] = 0xCC; in FixedContentsI2CUpdate()
786 state->m_Regs[CD1] = 0x6C; in FixedContentsI2CUpdate()
787 state->m_Regs[CD2] = 0x00; in FixedContentsI2CUpdate()
788 state->m_Regs[CD3] = 0x00; in FixedContentsI2CUpdate()
789 state->m_Regs[MPD] = 0xC5; in FixedContentsI2CUpdate()
790 state->m_Regs[MD1] = 0x77; in FixedContentsI2CUpdate()
791 state->m_Regs[MD2] = 0x08; in FixedContentsI2CUpdate()
792 state->m_Regs[MD3] = 0x00; in FixedContentsI2CUpdate()
793 status = UpdateRegs(state, EP2, MD3); /* diff between sw and datasheet (ep3-md3) */ in FixedContentsI2CUpdate()
798 state->m_Regs[EB4] = 0x61; /* missing in sw */ in FixedContentsI2CUpdate()
799 status = UpdateReg(state, EB4); in FixedContentsI2CUpdate()
803 state->m_Regs[EB4] = 0x41; in FixedContentsI2CUpdate()
804 status = UpdateReg(state, EB4); in FixedContentsI2CUpdate()
810 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
815 state->m_Regs[EP5] = 0x85; in FixedContentsI2CUpdate()
816 state->m_Regs[CPD] = 0xCB; in FixedContentsI2CUpdate()
817 state->m_Regs[CD1] = 0x66; in FixedContentsI2CUpdate()
818 state->m_Regs[CD2] = 0x70; in FixedContentsI2CUpdate()
819 status = UpdateRegs(state, EP3, CD3); in FixedContentsI2CUpdate()
823 status = UpdateReg(state, EP2); in FixedContentsI2CUpdate()
829 state->m_Regs[EP5] = 0x82; in FixedContentsI2CUpdate()
830 state->m_Regs[CPD] = 0xA8; in FixedContentsI2CUpdate()
831 state->m_Regs[CD2] = 0x00; in FixedContentsI2CUpdate()
832 state->m_Regs[MPD] = 0xA1; /* Datasheet = 0xA9 */ in FixedContentsI2CUpdate()
833 state->m_Regs[MD1] = 0x73; in FixedContentsI2CUpdate()
834 state->m_Regs[MD2] = 0x1A; in FixedContentsI2CUpdate()
835 status = UpdateRegs(state, EP3, MD3); in FixedContentsI2CUpdate()
840 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
845 state->m_Regs[EP5] = 0x86; in FixedContentsI2CUpdate()
846 state->m_Regs[CPD] = 0xA8; in FixedContentsI2CUpdate()
847 state->m_Regs[CD1] = 0x66; in FixedContentsI2CUpdate()
848 state->m_Regs[CD2] = 0xA0; in FixedContentsI2CUpdate()
849 status = UpdateRegs(state, EP3, CD3); in FixedContentsI2CUpdate()
853 status = UpdateReg(state, EP2); in FixedContentsI2CUpdate()
859 state->m_Regs[EP5] = 0x83; in FixedContentsI2CUpdate()
860 state->m_Regs[CPD] = 0x98; in FixedContentsI2CUpdate()
861 state->m_Regs[CD1] = 0x65; in FixedContentsI2CUpdate()
862 state->m_Regs[CD2] = 0x00; in FixedContentsI2CUpdate()
863 state->m_Regs[MPD] = 0x91; /* Datasheet = 0x91 */ in FixedContentsI2CUpdate()
864 state->m_Regs[MD1] = 0x71; in FixedContentsI2CUpdate()
865 state->m_Regs[MD2] = 0xCD; in FixedContentsI2CUpdate()
866 status = UpdateRegs(state, EP3, MD3); in FixedContentsI2CUpdate()
870 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
874 state->m_Regs[EP5] = 0x87; in FixedContentsI2CUpdate()
875 state->m_Regs[CD1] = 0x65; in FixedContentsI2CUpdate()
876 state->m_Regs[CD2] = 0x50; in FixedContentsI2CUpdate()
877 status = UpdateRegs(state, EP3, CD3); in FixedContentsI2CUpdate()
881 status = UpdateReg(state, EP2); in FixedContentsI2CUpdate()
887 state->m_Regs[EP4] = 0x64; in FixedContentsI2CUpdate()
888 status = UpdateReg(state, EP4); in FixedContentsI2CUpdate()
891 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
899 static int InitCal(struct tda_state *state) in InitCal() argument
904 status = FixedContentsI2CUpdate(state); in InitCal()
907 status = CalcRFFilterCurve(state); in InitCal()
910 status = StandBy(state); in InitCal()
918 static int RFTrackingFiltersCorrection(struct tda_state *state, in RFTrackingFiltersCorrection() argument
934 u32 RF1 = state->m_RF1[RFBand]; in RFTrackingFiltersCorrection()
935 u32 RF2 = state->m_RF1[RFBand]; in RFTrackingFiltersCorrection()
936 u32 RF3 = state->m_RF1[RFBand]; in RFTrackingFiltersCorrection()
937 s32 RF_A1 = state->m_RF_A1[RFBand]; in RFTrackingFiltersCorrection()
938 s32 RF_B1 = state->m_RF_B1[RFBand]; in RFTrackingFiltersCorrection()
939 s32 RF_A2 = state->m_RF_A2[RFBand]; in RFTrackingFiltersCorrection()
940 s32 RF_B2 = state->m_RF_B2[RFBand]; in RFTrackingFiltersCorrection()
944 state->m_Regs[EP3] &= ~0xE0; /* Power up */ in RFTrackingFiltersCorrection()
945 status = UpdateReg(state, EP3); in RFTrackingFiltersCorrection()
949 status = ThermometerRead(state, &TMValue_Current); in RFTrackingFiltersCorrection()
958 TComp = (int)(dCoverdT) * ((int)(TMValue_Current) - (int)(state->m_TMValue_RFCal))/1000; in RFTrackingFiltersCorrection()
970 state->m_Regs[EB14] = Capprox; in RFTrackingFiltersCorrection()
972 status = UpdateReg(state, EB14); in RFTrackingFiltersCorrection()
980 static int ChannelConfiguration(struct tda_state *state, in ChannelConfiguration() argument
992 state->IF = IntermediateFrequency; in ChannelConfiguration()
1006 state->m_Regs[EP3] = (state->m_Regs[EP3] & ~0x1F) | m_StandardTable[Standard].m_EP3_4_0; in ChannelConfiguration()
1007 state->m_Regs[EP3] &= ~0x04; /* switch RFAGC to high speed mode */ in ChannelConfiguration()
1010 …state->m_Regs[EP4] = state->m_EP4 | ((Standard > HF_AnalogMax) ? state->m_IFLevelDigital : state->… in ChannelConfiguration()
1011 /* state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelDigital; */ in ChannelConfiguration()
1013 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelAnalog; in ChannelConfiguration()
1015 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelDVBT; in ChannelConfiguration()
1017 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelDVBC; in ChannelConfiguration()
1019 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelDigital; in ChannelConfiguration()
1021 if ((Standard == HF_FM_Radio) && state->m_bFMInput) in ChannelConfiguration()
1022 state->m_Regs[EP4] |= 80; in ChannelConfiguration()
1024 state->m_Regs[MPD] &= ~0x80; in ChannelConfiguration()
1026 state->m_Regs[MPD] |= 0x80; /* Add IF_notch for digital */ in ChannelConfiguration()
1028 state->m_Regs[EB22] = m_StandardTable[Standard].m_EB22; in ChannelConfiguration()
1032 state->m_Regs[EB23] |= 0x06; /* ForceLP_Fc2_En = 1, LPFc[2] = 1 */ in ChannelConfiguration()
1034 state->m_Regs[EB23] &= ~0x06; /* ForceLP_Fc2_En = 0, LPFc[2] = 0 */ in ChannelConfiguration()
1036 status = UpdateRegs(state, EB22, EB23); in ChannelConfiguration()
1040 …state->m_Regs[EP1] = (state->m_Regs[EP1] & ~0x07) | 0x40 | BP_Filter; /* Dis_Power_level = 1, Fi… in ChannelConfiguration()
1041 state->m_Regs[EP5] = (state->m_Regs[EP5] & ~0x07) | IR_Meas; in ChannelConfiguration()
1042 state->m_Regs[EP2] = (RF_Band << 5) | GainTaper; in ChannelConfiguration()
1044 state->m_Regs[EB1] = (state->m_Regs[EB1] & ~0x07) | in ChannelConfiguration()
1045 (state->m_bMaster ? 0x04 : 0x00); /* CALVCO_FortLOn = MS */ in ChannelConfiguration()
1048 status = UpdateReg(state, EB1); in ChannelConfiguration()
1052 if (state->m_bMaster) { in ChannelConfiguration()
1053 status = CalcMainPLL(state, Frequency + IntermediateFrequency); in ChannelConfiguration()
1056 status = UpdateRegs(state, TM, EP5); in ChannelConfiguration()
1059 state->m_Regs[EB4] |= 0x20; /* LO_forceSrce = 1 */ in ChannelConfiguration()
1060 status = UpdateReg(state, EB4); in ChannelConfiguration()
1064 state->m_Regs[EB4] &= ~0x20; /* LO_forceSrce = 0 */ in ChannelConfiguration()
1065 status = UpdateReg(state, EB4); in ChannelConfiguration()
1071 status = CalcCalPLL(state, Frequency + IntermediateFrequency); in ChannelConfiguration()
1076 state->m_Regs[MPD] = (state->m_Regs[MPD] & ~0x7F) | (PostDiv & 0x77); in ChannelConfiguration()
1077 status = UpdateReg(state, MPD); in ChannelConfiguration()
1080 status = UpdateRegs(state, TM, EP5); in ChannelConfiguration()
1084 state->m_Regs[EB7] |= 0x20; /* CAL_forceSrce = 1 */ in ChannelConfiguration()
1085 status = UpdateReg(state, EB7); in ChannelConfiguration()
1089 state->m_Regs[EB7] &= ~0x20; /* CAL_forceSrce = 0 */ in ChannelConfiguration()
1090 status = UpdateReg(state, EB7); in ChannelConfiguration()
1096 state->m_Regs[EP3] |= 0x04; /* RFAGC to normal mode */ in ChannelConfiguration()
1097 status = UpdateReg(state, EP3); in ChannelConfiguration()
1107 struct tda_state *state = fe->tuner_priv; in sleep() local
1109 StandBy(state); in sleep()
1128 struct tda_state *state = fe->tuner_priv; in set_params() local
1134 state->m_Frequency = fe->dtv_property_cache.frequency; in set_params()
1165 status = RFTrackingFiltersCorrection(state, state->m_Frequency); in set_params()
1168 status = ChannelConfiguration(state, state->m_Frequency, in set_params()
1173 msleep(state->m_SettlingTime); /* Allow AGC's to settle down */ in set_params()
1195 struct tda_state *state = fe->tuner_priv; in get_if_frequency() local
1197 *frequency = state->IF; in get_if_frequency()
1203 /* struct tda_state *state = fe->tuner_priv; */ in get_bandwidth()
1227 struct tda_state *state; in tda18271c2dd_attach() local
1229 state = kzalloc(sizeof(struct tda_state), GFP_KERNEL); in tda18271c2dd_attach()
1230 if (!state) in tda18271c2dd_attach()
1233 fe->tuner_priv = state; in tda18271c2dd_attach()
1234 state->adr = adr; in tda18271c2dd_attach()
1235 state->i2c = i2c; in tda18271c2dd_attach()
1237 reset(state); in tda18271c2dd_attach()
1238 InitCal(state); in tda18271c2dd_attach()