Lines Matching refs:state
101 static int PowerScan(struct tda_state *state,
124 static int WriteRegs(struct tda_state *state, in WriteRegs() argument
138 return i2c_write(state->i2c, state->adr, data, nRegs + 1); in WriteRegs()
141 static int WriteReg(struct tda_state *state, u8 SubAddr, u8 Reg) in WriteReg() argument
145 return i2c_write(state->i2c, state->adr, msg, 2); in WriteReg()
148 static int Read(struct tda_state *state, u8 * Regs) in Read() argument
150 return i2c_readn(state->i2c, state->adr, Regs, 16); in Read()
153 static int ReadExtented(struct tda_state *state, u8 * Regs) in ReadExtented() argument
155 return i2c_readn(state->i2c, state->adr, Regs, NUM_REGS); in ReadExtented()
158 static int UpdateRegs(struct tda_state *state, u8 RegFrom, u8 RegTo) in UpdateRegs() argument
160 return WriteRegs(state, RegFrom, in UpdateRegs()
161 &state->m_Regs[RegFrom], RegTo-RegFrom+1); in UpdateRegs()
163 static int UpdateReg(struct tda_state *state, u8 Reg) in UpdateReg() argument
165 return WriteReg(state, Reg, state->m_Regs[Reg]); in UpdateReg()
170 static void reset(struct tda_state *state) in reset() argument
182 state->m_Frequency = 0; in reset()
183 state->m_SettlingTime = 100; in reset()
184 state->m_IFLevelAnalog = (ulIFLevelAnalog & 0x07) << 2; in reset()
185 state->m_IFLevelDigital = (ulIFLevelDigital & 0x07) << 2; in reset()
186 state->m_IFLevelDVBC = (ulIFLevelDVBC & 0x07) << 2; in reset()
187 state->m_IFLevelDVBT = (ulIFLevelDVBT & 0x07) << 2; in reset()
189 state->m_EP4 = 0x20; in reset()
191 state->m_EP4 |= 0x40; in reset()
193 state->m_EP3_Standby = ((ulStandbyMode & 0x07) << 5) | 0x0F; in reset()
194 state->m_bMaster = (ulSlave == 0); in reset()
196 state->m_SettlingTime = ulSettlingTime; in reset()
198 state->m_bFMInput = (ulFMInput == 2); in reset()
253 static int ThermometerRead(struct tda_state *state, u8 *pTM_Value) in ThermometerRead() argument
259 state->m_Regs[TM] |= 0x10; in ThermometerRead()
260 status = UpdateReg(state, TM); in ThermometerRead()
263 status = Read(state, Regs); in ThermometerRead()
268 state->m_Regs[TM] ^= 0x20; in ThermometerRead()
269 status = UpdateReg(state, TM); in ThermometerRead()
273 status = Read(state, Regs); in ThermometerRead()
280 state->m_Regs[TM] &= ~0x10; /* Thermometer off */ in ThermometerRead()
281 status = UpdateReg(state, TM); in ThermometerRead()
284 state->m_Regs[EP4] &= ~0x03; /* CAL_mode = 0 ????????? */ in ThermometerRead()
285 status = UpdateReg(state, EP4); in ThermometerRead()
293 static int StandBy(struct tda_state *state) in StandBy() argument
297 state->m_Regs[EB12] &= ~0x20; /* PD_AGC1_Det = 0 */ in StandBy()
298 status = UpdateReg(state, EB12); in StandBy()
301 state->m_Regs[EB18] &= ~0x83; /* AGC1_loop_off = 0, AGC1_Gain = 6 dB */ in StandBy()
302 status = UpdateReg(state, EB18); in StandBy()
305 state->m_Regs[EB21] |= 0x03; /* AGC2_Gain = -6 dB */ in StandBy()
306 state->m_Regs[EP3] = state->m_EP3_Standby; in StandBy()
307 status = UpdateReg(state, EP3); in StandBy()
310 state->m_Regs[EB23] &= ~0x06; /* ForceLP_Fc2_En = 0, LP_Fc[2] = 0 */ in StandBy()
311 status = UpdateRegs(state, EB21, EB23); in StandBy()
318 static int CalcMainPLL(struct tda_state *state, u32 freq) in CalcMainPLL() argument
334 state->m_Regs[MPD] = PostDiv & 0x77; in CalcMainPLL()
335 state->m_Regs[MD1] = ((MainDiv >> 16) & 0x7F); in CalcMainPLL()
336 state->m_Regs[MD2] = ((MainDiv >> 8) & 0xFF); in CalcMainPLL()
337 state->m_Regs[MD3] = (MainDiv & 0xFF); in CalcMainPLL()
339 return UpdateRegs(state, MPD, MD3); in CalcMainPLL()
342 static int CalcCalPLL(struct tda_state *state, u32 freq) in CalcCalPLL() argument
358 state->m_Regs[CPD] = PostDiv; in CalcCalPLL()
359 state->m_Regs[CD1] = ((CalDiv >> 16) & 0xFF); in CalcCalPLL()
360 state->m_Regs[CD2] = ((CalDiv >> 8) & 0xFF); in CalcCalPLL()
361 state->m_Regs[CD3] = (CalDiv & 0xFF); in CalcCalPLL()
363 return UpdateRegs(state, CPD, CD3); in CalcCalPLL()
366 static int CalibrateRF(struct tda_state *state, in CalibrateRF() argument
377 state->m_Regs[EP4] &= ~0x03; /* CAL_mode = 0 */ in CalibrateRF()
378 status = UpdateReg(state, EP4); in CalibrateRF()
381 state->m_Regs[EB18] |= 0x03; /* AGC1_Gain = 3 */ in CalibrateRF()
382 status = UpdateReg(state, EB18); in CalibrateRF()
388 if (state->m_Regs[ID] != 0x83) /* C1: ID == 83, C2: ID == 84 */ in CalibrateRF()
389 state->m_Regs[EP3] |= 0x40; /* SM_LT = 1 */ in CalibrateRF()
396 state->m_Regs[EP1] = (state->m_Regs[EP1] & ~0x07) | BP_Filter; in CalibrateRF()
397 state->m_Regs[EP2] = (RFBand << 5) | GainTaper; in CalibrateRF()
399 state->m_Regs[EB13] = (state->m_Regs[EB13] & ~0x7C) | (RFC_K << 4) | (RFC_M << 2); in CalibrateRF()
401 status = UpdateRegs(state, EP1, EP3); in CalibrateRF()
404 status = UpdateReg(state, EB13); in CalibrateRF()
408 state->m_Regs[EB4] |= 0x20; /* LO_ForceSrce = 1 */ in CalibrateRF()
409 status = UpdateReg(state, EB4); in CalibrateRF()
413 state->m_Regs[EB7] |= 0x20; /* CAL_ForceSrce = 1 */ in CalibrateRF()
414 status = UpdateReg(state, EB7); in CalibrateRF()
418 state->m_Regs[EB14] = 0; /* RFC_Cprog = 0 */ in CalibrateRF()
419 status = UpdateReg(state, EB14); in CalibrateRF()
423 state->m_Regs[EB20] &= ~0x20; /* ForceLock = 0; */ in CalibrateRF()
424 status = UpdateReg(state, EB20); in CalibrateRF()
428 state->m_Regs[EP4] |= 0x03; /* CAL_Mode = 3 */ in CalibrateRF()
429 status = UpdateRegs(state, EP4, EP5); in CalibrateRF()
433 status = CalcCalPLL(state, freq); in CalibrateRF()
436 status = CalcMainPLL(state, freq + 1000000); in CalibrateRF()
441 status = UpdateReg(state, EP2); in CalibrateRF()
444 status = UpdateReg(state, EP1); in CalibrateRF()
447 status = UpdateReg(state, EP2); in CalibrateRF()
450 status = UpdateReg(state, EP1); in CalibrateRF()
454 state->m_Regs[EB4] &= ~0x20; /* LO_ForceSrce = 0 */ in CalibrateRF()
455 status = UpdateReg(state, EB4); in CalibrateRF()
459 state->m_Regs[EB7] &= ~0x20; /* CAL_ForceSrce = 0 */ in CalibrateRF()
460 status = UpdateReg(state, EB7); in CalibrateRF()
465 state->m_Regs[EB20] |= 0x20; /* ForceLock = 1; */ in CalibrateRF()
466 status = UpdateReg(state, EB20); in CalibrateRF()
471 state->m_Regs[EP4] &= ~0x03; /* CAL_Mode = 0 */ in CalibrateRF()
472 state->m_Regs[EP3] &= ~0x40; /* SM_LT = 0 */ in CalibrateRF()
473 state->m_Regs[EB18] &= ~0x03; /* AGC1_Gain = 0 */ in CalibrateRF()
474 status = UpdateReg(state, EB18); in CalibrateRF()
477 status = UpdateRegs(state, EP3, EP4); in CalibrateRF()
480 status = UpdateReg(state, EP1); in CalibrateRF()
484 status = ReadExtented(state, Regs); in CalibrateRF()
494 static int RFTrackingFiltersInit(struct tda_state *state, in RFTrackingFiltersInit() argument
511 state->m_RF_A1[RFBand] = 0; in RFTrackingFiltersInit()
512 state->m_RF_B1[RFBand] = 0; in RFTrackingFiltersInit()
513 state->m_RF_A2[RFBand] = 0; in RFTrackingFiltersInit()
514 state->m_RF_B2[RFBand] = 0; in RFTrackingFiltersInit()
517 status = PowerScan(state, RFBand, RF1, &RF1, &bcal); in RFTrackingFiltersInit()
521 status = CalibrateRF(state, RFBand, RF1, &Cprog_cal1); in RFTrackingFiltersInit()
528 state->m_RF_B1[RFBand] = Cprog_cal1 - Cprog_table1; in RFTrackingFiltersInit()
534 status = PowerScan(state, RFBand, RF2, &RF2, &bcal); in RFTrackingFiltersInit()
538 status = CalibrateRF(state, RFBand, RF2, &Cprog_cal2); in RFTrackingFiltersInit()
546 state->m_RF_A1[RFBand] = in RFTrackingFiltersInit()
553 status = PowerScan(state, RFBand, RF3, &RF3, &bcal); in RFTrackingFiltersInit()
557 status = CalibrateRF(state, RFBand, RF3, &Cprog_cal3); in RFTrackingFiltersInit()
564 …state->m_RF_A2[RFBand] = (Cprog_cal3 - Cprog_table3 - Cprog_cal2 + Cprog_table2) / ((s32)(RF3) - (… in RFTrackingFiltersInit()
565 state->m_RF_B2[RFBand] = Cprog_cal2 - Cprog_table2; in RFTrackingFiltersInit()
569 state->m_RF1[RFBand] = RF1; in RFTrackingFiltersInit()
570 state->m_RF2[RFBand] = RF2; in RFTrackingFiltersInit()
571 state->m_RF3[RFBand] = RF3; in RFTrackingFiltersInit()
575 RFBand, RF1, state->m_RF_A1[RFBand], state->m_RF_B1[RFBand], RF2, in RFTrackingFiltersInit()
576 state->m_RF_A2[RFBand], state->m_RF_B2[RFBand], RF3); in RFTrackingFiltersInit()
582 static int PowerScan(struct tda_state *state, in PowerScan() argument
606 state->m_Regs[EP2] = (RFBand << 5) | Gain_Taper; in PowerScan()
607 state->m_Regs[EB14] = (RFC_Cprog); in PowerScan()
608 status = UpdateReg(state, EP2); in PowerScan()
611 status = UpdateReg(state, EB14); in PowerScan()
616 status = CalcMainPLL(state, freq_MainPLL); in PowerScan()
620 state->m_Regs[EP4] = (state->m_Regs[EP4] & ~0x03) | 1; /* CAL_mode = 1 */ in PowerScan()
621 status = UpdateReg(state, EP4); in PowerScan()
624 status = UpdateReg(state, EP2); /* Launch power measurement */ in PowerScan()
627 status = ReadExtented(state, Regs); in PowerScan()
631 state->m_Regs[ID] = Regs[ID]; /* Chip version, (needed for C1 workaround in CalibrateRF) */ in PowerScan()
637 status = CalcMainPLL(state, freq_MainPLL); in PowerScan()
642 status = UpdateReg(state, EP2); /* Launch power measurement */ in PowerScan()
645 status = ReadExtented(state, Regs); in PowerScan()
672 static int PowerScanInit(struct tda_state *state) in PowerScanInit() argument
676 state->m_Regs[EP3] = (state->m_Regs[EP3] & ~0x1F) | 0x12; in PowerScanInit()
677 state->m_Regs[EP4] = (state->m_Regs[EP4] & ~0x1F); /* If level = 0, Cal mode = 0 */ in PowerScanInit()
678 status = UpdateRegs(state, EP3, EP4); in PowerScanInit()
681 state->m_Regs[EB18] = (state->m_Regs[EB18] & ~0x03); /* AGC 1 Gain = 0 */ in PowerScanInit()
682 status = UpdateReg(state, EB18); in PowerScanInit()
685 state->m_Regs[EB21] = (state->m_Regs[EB21] & ~0x03); /* AGC 2 Gain = 0 (Datasheet = 3) */ in PowerScanInit()
686 state->m_Regs[EB23] = (state->m_Regs[EB23] | 0x06); /* ForceLP_Fc2_En = 1, LPFc[2] = 1 */ in PowerScanInit()
687 status = UpdateRegs(state, EB21, EB23); in PowerScanInit()
694 static int CalcRFFilterCurve(struct tda_state *state) in CalcRFFilterCurve() argument
699 status = PowerScanInit(state); in CalcRFFilterCurve()
702 status = RFTrackingFiltersInit(state, 0); in CalcRFFilterCurve()
705 status = RFTrackingFiltersInit(state, 1); in CalcRFFilterCurve()
708 status = RFTrackingFiltersInit(state, 2); in CalcRFFilterCurve()
711 status = RFTrackingFiltersInit(state, 3); in CalcRFFilterCurve()
714 status = RFTrackingFiltersInit(state, 4); in CalcRFFilterCurve()
717 status = RFTrackingFiltersInit(state, 5); in CalcRFFilterCurve()
720 status = RFTrackingFiltersInit(state, 6); in CalcRFFilterCurve()
723 status = ThermometerRead(state, &state->m_TMValue_RFCal); /* also switches off Cal mode !!! */ in CalcRFFilterCurve()
731 static int FixedContentsI2CUpdate(struct tda_state *state) in FixedContentsI2CUpdate() argument
746 memcpy(&state->m_Regs[TM], InitRegs, EB23 - TM + 1); in FixedContentsI2CUpdate()
748 status = UpdateRegs(state, TM, EB23); in FixedContentsI2CUpdate()
753 state->m_Regs[EB17] = 0x00; in FixedContentsI2CUpdate()
754 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
757 state->m_Regs[EB17] = 0x03; in FixedContentsI2CUpdate()
758 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
761 state->m_Regs[EB17] = 0x43; in FixedContentsI2CUpdate()
762 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
765 state->m_Regs[EB17] = 0x4C; in FixedContentsI2CUpdate()
766 status = UpdateReg(state, EB17); in FixedContentsI2CUpdate()
771 state->m_Regs[EP3] = 0x1F; in FixedContentsI2CUpdate()
772 state->m_Regs[EP4] = 0x66; in FixedContentsI2CUpdate()
773 state->m_Regs[EP5] = 0x81; in FixedContentsI2CUpdate()
774 state->m_Regs[CPD] = 0xCC; in FixedContentsI2CUpdate()
775 state->m_Regs[CD1] = 0x6C; in FixedContentsI2CUpdate()
776 state->m_Regs[CD2] = 0x00; in FixedContentsI2CUpdate()
777 state->m_Regs[CD3] = 0x00; in FixedContentsI2CUpdate()
778 state->m_Regs[MPD] = 0xC5; in FixedContentsI2CUpdate()
779 state->m_Regs[MD1] = 0x77; in FixedContentsI2CUpdate()
780 state->m_Regs[MD2] = 0x08; in FixedContentsI2CUpdate()
781 state->m_Regs[MD3] = 0x00; in FixedContentsI2CUpdate()
782 status = UpdateRegs(state, EP2, MD3); /* diff between sw and datasheet (ep3-md3) */ in FixedContentsI2CUpdate()
787 state->m_Regs[EB4] = 0x61; /* missing in sw */ in FixedContentsI2CUpdate()
788 status = UpdateReg(state, EB4); in FixedContentsI2CUpdate()
792 state->m_Regs[EB4] = 0x41; in FixedContentsI2CUpdate()
793 status = UpdateReg(state, EB4); in FixedContentsI2CUpdate()
799 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
804 state->m_Regs[EP5] = 0x85; in FixedContentsI2CUpdate()
805 state->m_Regs[CPD] = 0xCB; in FixedContentsI2CUpdate()
806 state->m_Regs[CD1] = 0x66; in FixedContentsI2CUpdate()
807 state->m_Regs[CD2] = 0x70; in FixedContentsI2CUpdate()
808 status = UpdateRegs(state, EP3, CD3); in FixedContentsI2CUpdate()
812 status = UpdateReg(state, EP2); in FixedContentsI2CUpdate()
818 state->m_Regs[EP5] = 0x82; in FixedContentsI2CUpdate()
819 state->m_Regs[CPD] = 0xA8; in FixedContentsI2CUpdate()
820 state->m_Regs[CD2] = 0x00; in FixedContentsI2CUpdate()
821 state->m_Regs[MPD] = 0xA1; /* Datasheet = 0xA9 */ in FixedContentsI2CUpdate()
822 state->m_Regs[MD1] = 0x73; in FixedContentsI2CUpdate()
823 state->m_Regs[MD2] = 0x1A; in FixedContentsI2CUpdate()
824 status = UpdateRegs(state, EP3, MD3); in FixedContentsI2CUpdate()
829 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
834 state->m_Regs[EP5] = 0x86; in FixedContentsI2CUpdate()
835 state->m_Regs[CPD] = 0xA8; in FixedContentsI2CUpdate()
836 state->m_Regs[CD1] = 0x66; in FixedContentsI2CUpdate()
837 state->m_Regs[CD2] = 0xA0; in FixedContentsI2CUpdate()
838 status = UpdateRegs(state, EP3, CD3); in FixedContentsI2CUpdate()
842 status = UpdateReg(state, EP2); in FixedContentsI2CUpdate()
848 state->m_Regs[EP5] = 0x83; in FixedContentsI2CUpdate()
849 state->m_Regs[CPD] = 0x98; in FixedContentsI2CUpdate()
850 state->m_Regs[CD1] = 0x65; in FixedContentsI2CUpdate()
851 state->m_Regs[CD2] = 0x00; in FixedContentsI2CUpdate()
852 state->m_Regs[MPD] = 0x91; /* Datasheet = 0x91 */ in FixedContentsI2CUpdate()
853 state->m_Regs[MD1] = 0x71; in FixedContentsI2CUpdate()
854 state->m_Regs[MD2] = 0xCD; in FixedContentsI2CUpdate()
855 status = UpdateRegs(state, EP3, MD3); in FixedContentsI2CUpdate()
859 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
863 state->m_Regs[EP5] = 0x87; in FixedContentsI2CUpdate()
864 state->m_Regs[CD1] = 0x65; in FixedContentsI2CUpdate()
865 state->m_Regs[CD2] = 0x50; in FixedContentsI2CUpdate()
866 status = UpdateRegs(state, EP3, CD3); in FixedContentsI2CUpdate()
870 status = UpdateReg(state, EP2); in FixedContentsI2CUpdate()
876 state->m_Regs[EP4] = 0x64; in FixedContentsI2CUpdate()
877 status = UpdateReg(state, EP4); in FixedContentsI2CUpdate()
880 status = UpdateReg(state, EP1); in FixedContentsI2CUpdate()
888 static int InitCal(struct tda_state *state) in InitCal() argument
893 status = FixedContentsI2CUpdate(state); in InitCal()
896 status = CalcRFFilterCurve(state); in InitCal()
899 status = StandBy(state); in InitCal()
907 static int RFTrackingFiltersCorrection(struct tda_state *state, in RFTrackingFiltersCorrection() argument
923 u32 RF1 = state->m_RF1[RFBand]; in RFTrackingFiltersCorrection()
924 u32 RF2 = state->m_RF1[RFBand]; in RFTrackingFiltersCorrection()
925 u32 RF3 = state->m_RF1[RFBand]; in RFTrackingFiltersCorrection()
926 s32 RF_A1 = state->m_RF_A1[RFBand]; in RFTrackingFiltersCorrection()
927 s32 RF_B1 = state->m_RF_B1[RFBand]; in RFTrackingFiltersCorrection()
928 s32 RF_A2 = state->m_RF_A2[RFBand]; in RFTrackingFiltersCorrection()
929 s32 RF_B2 = state->m_RF_B2[RFBand]; in RFTrackingFiltersCorrection()
933 state->m_Regs[EP3] &= ~0xE0; /* Power up */ in RFTrackingFiltersCorrection()
934 status = UpdateReg(state, EP3); in RFTrackingFiltersCorrection()
938 status = ThermometerRead(state, &TMValue_Current); in RFTrackingFiltersCorrection()
947 TComp = (int)(dCoverdT) * ((int)(TMValue_Current) - (int)(state->m_TMValue_RFCal))/1000; in RFTrackingFiltersCorrection()
959 state->m_Regs[EB14] = Capprox; in RFTrackingFiltersCorrection()
961 status = UpdateReg(state, EB14); in RFTrackingFiltersCorrection()
969 static int ChannelConfiguration(struct tda_state *state, in ChannelConfiguration() argument
981 state->IF = IntermediateFrequency; in ChannelConfiguration()
995 state->m_Regs[EP3] = (state->m_Regs[EP3] & ~0x1F) | m_StandardTable[Standard].m_EP3_4_0; in ChannelConfiguration()
996 state->m_Regs[EP3] &= ~0x04; /* switch RFAGC to high speed mode */ in ChannelConfiguration()
999 …state->m_Regs[EP4] = state->m_EP4 | ((Standard > HF_AnalogMax) ? state->m_IFLevelDigital : state->… in ChannelConfiguration()
1002 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelAnalog; in ChannelConfiguration()
1004 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelDVBT; in ChannelConfiguration()
1006 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelDVBC; in ChannelConfiguration()
1008 state->m_Regs[EP4] = state->m_EP4 | state->m_IFLevelDigital; in ChannelConfiguration()
1010 if ((Standard == HF_FM_Radio) && state->m_bFMInput) in ChannelConfiguration()
1011 state->m_Regs[EP4] |= 0x80; in ChannelConfiguration()
1013 state->m_Regs[MPD] &= ~0x80; in ChannelConfiguration()
1015 state->m_Regs[MPD] |= 0x80; /* Add IF_notch for digital */ in ChannelConfiguration()
1017 state->m_Regs[EB22] = m_StandardTable[Standard].m_EB22; in ChannelConfiguration()
1021 state->m_Regs[EB23] |= 0x06; /* ForceLP_Fc2_En = 1, LPFc[2] = 1 */ in ChannelConfiguration()
1023 state->m_Regs[EB23] &= ~0x06; /* ForceLP_Fc2_En = 0, LPFc[2] = 0 */ in ChannelConfiguration()
1025 status = UpdateRegs(state, EB22, EB23); in ChannelConfiguration()
1029 …state->m_Regs[EP1] = (state->m_Regs[EP1] & ~0x07) | 0x40 | BP_Filter; /* Dis_Power_level = 1, Fi… in ChannelConfiguration()
1030 state->m_Regs[EP5] = (state->m_Regs[EP5] & ~0x07) | IR_Meas; in ChannelConfiguration()
1031 state->m_Regs[EP2] = (RF_Band << 5) | GainTaper; in ChannelConfiguration()
1033 state->m_Regs[EB1] = (state->m_Regs[EB1] & ~0x07) | in ChannelConfiguration()
1034 (state->m_bMaster ? 0x04 : 0x00); /* CALVCO_FortLOn = MS */ in ChannelConfiguration()
1037 status = UpdateReg(state, EB1); in ChannelConfiguration()
1041 if (state->m_bMaster) { in ChannelConfiguration()
1042 status = CalcMainPLL(state, Frequency + IntermediateFrequency); in ChannelConfiguration()
1045 status = UpdateRegs(state, TM, EP5); in ChannelConfiguration()
1048 state->m_Regs[EB4] |= 0x20; /* LO_forceSrce = 1 */ in ChannelConfiguration()
1049 status = UpdateReg(state, EB4); in ChannelConfiguration()
1053 state->m_Regs[EB4] &= ~0x20; /* LO_forceSrce = 0 */ in ChannelConfiguration()
1054 status = UpdateReg(state, EB4); in ChannelConfiguration()
1060 status = CalcCalPLL(state, Frequency + IntermediateFrequency); in ChannelConfiguration()
1065 state->m_Regs[MPD] = (state->m_Regs[MPD] & ~0x7F) | (PostDiv & 0x77); in ChannelConfiguration()
1066 status = UpdateReg(state, MPD); in ChannelConfiguration()
1069 status = UpdateRegs(state, TM, EP5); in ChannelConfiguration()
1073 state->m_Regs[EB7] |= 0x20; /* CAL_forceSrce = 1 */ in ChannelConfiguration()
1074 status = UpdateReg(state, EB7); in ChannelConfiguration()
1078 state->m_Regs[EB7] &= ~0x20; /* CAL_forceSrce = 0 */ in ChannelConfiguration()
1079 status = UpdateReg(state, EB7); in ChannelConfiguration()
1085 state->m_Regs[EP3] |= 0x04; /* RFAGC to normal mode */ in ChannelConfiguration()
1086 status = UpdateReg(state, EP3); in ChannelConfiguration()
1096 struct tda_state *state = fe->tuner_priv; in sleep() local
1098 StandBy(state); in sleep()
1116 struct tda_state *state = fe->tuner_priv; in set_params() local
1122 state->m_Frequency = fe->dtv_property_cache.frequency; in set_params()
1154 status = RFTrackingFiltersCorrection(state, state->m_Frequency); in set_params()
1157 status = ChannelConfiguration(state, state->m_Frequency, in set_params()
1162 msleep(state->m_SettlingTime); /* Allow AGC's to settle down */ in set_params()
1184 struct tda_state *state = fe->tuner_priv; in get_if_frequency() local
1186 *frequency = state->IF; in get_if_frequency()
1216 struct tda_state *state; in tda18271c2dd_attach() local
1218 state = kzalloc(sizeof(struct tda_state), GFP_KERNEL); in tda18271c2dd_attach()
1219 if (!state) in tda18271c2dd_attach()
1222 fe->tuner_priv = state; in tda18271c2dd_attach()
1223 state->adr = adr; in tda18271c2dd_attach()
1224 state->i2c = i2c; in tda18271c2dd_attach()
1226 reset(state); in tda18271c2dd_attach()
1227 InitCal(state); in tda18271c2dd_attach()