fc8300_bb.c 169 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745
  1. /*****************************************************************************
  2. Copyright(c) 2013 FCI Inc. All Rights Reserved
  3. File name : fc8300_bb.c
  4. Description : source of baseband driver
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. History :
  17. ----------------------------------------------------------------------
  18. *******************************************************************************/
  19. #include <linux/delay.h>
  20. #include "fci_types.h"
  21. #include "fci_oal.h"
  22. #include "fci_hal.h"
  23. #include "fci_tun.h"
  24. #include "fc8300_regs.h"
  25. #define SCAN_CHK_PERIOD 1 /* 1 ms */
  26. static enum BROADCAST_TYPE broadcast_type;
  27. extern unsigned int bbm_xtal_freq;
  28. static u32 fc8300_get_current_clk(HANDLE handle, DEVICEID devid)
  29. {
  30. u32 pre_sel, post_sel, multi;
  31. u16 pll_set = 0;
  32. bbm_word_read(handle, devid, BBM_PLL1_PRE_POST_SELECTION, &pll_set);
  33. multi = ((pll_set & 0xff00) >> 8) + 2;
  34. pre_sel = pll_set & 0x000f;
  35. post_sel = (pll_set & 0x00f0) >> 4;
  36. return ((bbm_xtal_freq >> pre_sel) * multi) >> post_sel;
  37. }
  38. static u32 fc8300_get_core_clk(HANDLE handle, DEVICEID devid,
  39. enum BROADCAST_TYPE broadcast, u32 freq)
  40. {
  41. u32 clk;
  42. #if (BBM_BAND_WIDTH == 6)
  43. if (bbm_xtal_freq == 16000) {
  44. clk = 100000;
  45. }
  46. else if (bbm_xtal_freq == 16384) {
  47. clk = 98304;
  48. }
  49. else if (bbm_xtal_freq == 18000) {
  50. clk = 99000;
  51. }
  52. else if (bbm_xtal_freq == 19200) {
  53. clk = 100800;
  54. switch (broadcast) {
  55. case ISDBT_1SEG:
  56. case ISDBT_CATV_1SEG:
  57. switch (freq) {
  58. case 503143:
  59. case 605143:
  60. case 707143:
  61. clk = 110400;
  62. }
  63. break;
  64. case ISDBTMM_1SEG:
  65. case ISDBTSB_1SEG:
  66. case ISDBTSB_3SEG:
  67. break;
  68. case ISDBT_13SEG:
  69. case ISDBT_CATV_13SEG:
  70. switch (freq) {
  71. case 503143:
  72. case 605143:
  73. case 707143:
  74. clk = 110400;
  75. }
  76. break;
  77. case ISDBTMM_13SEG:
  78. break;
  79. }
  80. }
  81. else if (bbm_xtal_freq == 24000) {
  82. clk = 99000;
  83. switch (broadcast) {
  84. case ISDBT_1SEG:
  85. case ISDBTMM_1SEG:
  86. case ISDBTSB_1SEG:
  87. case ISDBT_CATV_1SEG:
  88. case ISDBTSB_3SEG:
  89. break;
  90. case ISDBT_13SEG:
  91. case ISDBT_CATV_13SEG:
  92. switch (freq) {
  93. case 497143:
  94. case 593143:
  95. case 695143:
  96. clk = 120000;
  97. }
  98. break;
  99. case ISDBTMM_13SEG:
  100. break;
  101. }
  102. }
  103. else if (bbm_xtal_freq == 24576) {
  104. clk = 98304;
  105. }
  106. else if (bbm_xtal_freq == 26000) {
  107. clk = 100750;
  108. switch (broadcast) {
  109. case ISDBT_1SEG:
  110. case ISDBT_CATV_1SEG:
  111. switch (freq) {
  112. case 479143:
  113. case 503143:
  114. case 521143:
  115. case 569143:
  116. case 605143:
  117. case 653143:
  118. case 707143:
  119. case 731143:
  120. case 755143:
  121. case 773143:
  122. case 809143:
  123. clk = 107250;
  124. }
  125. break;
  126. case ISDBTMM_1SEG:
  127. case ISDBTSB_1SEG:
  128. case ISDBTSB_3SEG:
  129. break;
  130. case ISDBT_13SEG:
  131. case ISDBT_CATV_13SEG:
  132. switch (freq) {
  133. case 479143:
  134. case 503143:
  135. case 521143:
  136. case 569143:
  137. case 605143:
  138. case 653143:
  139. case 707143:
  140. case 731143:
  141. case 755143:
  142. case 773143:
  143. case 803143:
  144. case 809143:
  145. clk = 107250;
  146. }
  147. break;
  148. case ISDBTMM_13SEG:
  149. break;
  150. }
  151. }
  152. else if (bbm_xtal_freq == 27000) {
  153. clk = 97875;
  154. }
  155. else if (bbm_xtal_freq == 27120) {
  156. clk = 98310;
  157. switch (broadcast) {
  158. case ISDBT_1SEG:
  159. case ISDBT_CATV_1SEG:
  160. switch (freq) {
  161. case 491143:
  162. case 587143:
  163. case 689143:
  164. clk = 101700;
  165. }
  166. break;
  167. case ISDBTMM_1SEG:
  168. switch (freq) {
  169. case 221142:
  170. case 221143:
  171. case 221144:
  172. clk = 101700;
  173. }
  174. break;
  175. case ISDBTSB_1SEG:
  176. case ISDBTSB_3SEG:
  177. break;
  178. case ISDBT_13SEG:
  179. case ISDBT_CATV_13SEG:
  180. switch (freq) {
  181. case 491143:
  182. case 587143:
  183. case 689143:
  184. clk = 101700;
  185. }
  186. break;
  187. case ISDBTMM_13SEG:
  188. break;
  189. }
  190. }
  191. else if (bbm_xtal_freq == 32000) {
  192. clk = 100000;
  193. switch (broadcast) {
  194. case ISDBT_1SEG:
  195. case ISDBT_CATV_1SEG:
  196. switch (freq) {
  197. case 683143:
  198. clk = 104000;
  199. }
  200. break;
  201. case ISDBTMM_1SEG:
  202. case ISDBTSB_1SEG:
  203. case ISDBTSB_3SEG:
  204. break;
  205. case ISDBT_13SEG:
  206. switch (freq) {
  207. case 599143:
  208. case 701143:
  209. clk = 116000;
  210. }
  211. break;
  212. case ISDBT_CATV_13SEG:
  213. switch (freq) {
  214. case 99143:
  215. case 153143:
  216. case 201143:
  217. case 231143:
  218. case 249143:
  219. case 297143:
  220. case 303143:
  221. case 351143:
  222. case 399143:
  223. case 497143:
  224. case 503143:
  225. case 533143:
  226. case 551143:
  227. case 599143:
  228. case 635143:
  229. case 653143:
  230. case 749143:
  231. case 767143:
  232. clk = 108000;
  233. break;
  234. case 647143:
  235. case 665143:
  236. case 683143:
  237. clk = 112000;
  238. break;
  239. }
  240. break;
  241. case ISDBTMM_13SEG:
  242. break;
  243. }
  244. }
  245. else if (bbm_xtal_freq == 37200) {
  246. clk = 97650;
  247. switch (broadcast) {
  248. case ISDBT_1SEG:
  249. case ISDBT_CATV_1SEG:
  250. switch (freq) {
  251. case 659143:
  252. clk = 111600;
  253. }
  254. break;
  255. case ISDBTMM_1SEG:
  256. switch (freq) {
  257. case 219856:
  258. case 219857:
  259. case 219858:
  260. clk = 111600;
  261. }
  262. break;
  263. case ISDBTSB_1SEG:
  264. case ISDBTSB_3SEG:
  265. break;
  266. case ISDBT_13SEG:
  267. case ISDBT_CATV_13SEG:
  268. switch (freq) {
  269. case 587143:
  270. case 683143:
  271. clk = 111600;
  272. }
  273. break;
  274. case ISDBTMM_13SEG:
  275. break;
  276. }
  277. }
  278. else if (bbm_xtal_freq == 37400) {
  279. clk = 98175;
  280. switch (broadcast) {
  281. case ISDBT_1SEG:
  282. case ISDBT_CATV_1SEG:
  283. switch (freq) {
  284. case 491143:
  285. clk = 102850;
  286. }
  287. break;
  288. case ISDBTMM_1SEG:
  289. case ISDBTSB_1SEG:
  290. case ISDBTSB_3SEG:
  291. break;
  292. case ISDBT_13SEG:
  293. case ISDBT_CATV_13SEG:
  294. switch (freq) {
  295. case 491143:
  296. case 587143:
  297. case 683143:
  298. clk = 102850;
  299. }
  300. break;
  301. case ISDBTMM_13SEG:
  302. break;
  303. }
  304. }
  305. else { /* (bbm_xtal_freq == 38400) */
  306. clk = 100800;
  307. }
  308. #elif (BBM_BAND_WIDTH == 7)
  309. if (bbm_xtal_freq == 16000)
  310. clk = 116000;
  311. else if (bbm_xtal_freq == 16384)
  312. clk = 114688;
  313. else if (bbm_xtal_freq == 18000)
  314. clk = 117000;
  315. else if (bbm_xtal_freq == 19200)
  316. clk = 115200;
  317. else if (bbm_xtal_freq == 24000)
  318. clk = 114000;
  319. else if (bbm_xtal_freq == 24576)
  320. clk = 116736;
  321. else if (bbm_xtal_freq == 26000)
  322. clk = 117000;
  323. else if (bbm_xtal_freq == 27000)
  324. clk = 114750;
  325. else if (bbm_xtal_freq == 27120)
  326. clk = 115260;
  327. else if (bbm_xtal_freq == 32000)
  328. clk = 116000;
  329. else if (bbm_xtal_freq == 37200)
  330. clk = 116250;
  331. else if (bbm_xtal_freq == 37400)
  332. clk = 116875;
  333. else /* (bbm_xtal_freq == 38400) */
  334. clk = 115200;
  335. #else /* (BBM_BAND_WIDTH == 8) */
  336. if (bbm_xtal_freq == 16000)
  337. clk = 132000;
  338. else if (bbm_xtal_freq == 16384)
  339. clk = 131072;
  340. else if (bbm_xtal_freq == 18000)
  341. clk = 130500;
  342. else if (bbm_xtal_freq == 19200)
  343. clk = 134400;
  344. else if (bbm_xtal_freq == 24000)
  345. clk = 132000;
  346. else if (bbm_xtal_freq == 24576)
  347. clk = 135168;
  348. else if (bbm_xtal_freq == 26000)
  349. clk = 136500;
  350. else if (bbm_xtal_freq == 27000)
  351. clk = 131625;
  352. else if (bbm_xtal_freq == 27120)
  353. clk = 132210;
  354. else if (bbm_xtal_freq == 32000)
  355. clk = 132000;
  356. else if (bbm_xtal_freq == 37200)
  357. clk = 130200;
  358. else if (bbm_xtal_freq == 37400)
  359. clk = 130900;
  360. else /* (bbm_xtal_freq == 38400) */
  361. clk = 134400;
  362. #endif /* #if (BBM_BAND_WIDTH == 6) */
  363. return clk;
  364. }
  365. static s32 fc8300_set_acif_b31_1seg(HANDLE handle, DEVICEID devid, u32 clk)
  366. {
  367. #if (BBM_BAND_WIDTH == 6)
  368. switch (clk) {
  369. case 100750:
  370. case 100800:
  371. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  372. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040200);
  373. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfcf5f7fe);
  374. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x453c270e);
  375. break;
  376. case 105600:
  377. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  378. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  379. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f6fc);
  380. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x423a2710);
  381. break;
  382. case 110400:
  383. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  384. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  385. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x00f7f6fb);
  386. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x40392712);
  387. break;
  388. case 115200:
  389. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  390. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xff020302);
  391. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x02f8f6fa);
  392. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3e382713);
  393. break;
  394. case 99000:
  395. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  396. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  397. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  398. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x473e270d);
  399. break;
  400. case 102000:
  401. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  402. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040201);
  403. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf5f7fd);
  404. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x443c270f);
  405. break;
  406. case 105000:
  407. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  408. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  409. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  410. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x423b2710);
  411. break;
  412. case 108000:
  413. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  414. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  415. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  416. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  417. break;
  418. case 98310:
  419. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  420. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03030200);
  421. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  422. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x473e260c);
  423. break;
  424. case 101700:
  425. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  426. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040201);
  427. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfcf5f7fd);
  428. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x443c270f);
  429. break;
  430. case 105090:
  431. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  432. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  433. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  434. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x423b2710);
  435. break;
  436. case 108480:
  437. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  438. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  439. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  440. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  441. break;
  442. case 100000:
  443. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  444. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  445. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfbf5f8fe);
  446. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x463d270d);
  447. break;
  448. case 104000:
  449. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  450. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  451. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  452. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b2710);
  453. break;
  454. /*case 108000:
  455. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  456. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  457. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  458. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  459. break;*/
  460. case 112000:
  461. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  462. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  463. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x01f7f6fa);
  464. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3f392712);
  465. break;
  466. case 97650:
  467. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  468. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x030301ff);
  469. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf9f4f9ff);
  470. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x483e260b);
  471. break;
  472. case 102300:
  473. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  474. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040201);
  475. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf5f7fd);
  476. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x443c270f);
  477. break;
  478. case 106950:
  479. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  480. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  481. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  482. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  483. break;
  484. case 111600:
  485. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  486. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  487. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x00f7f6fa);
  488. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3f392712);
  489. break;
  490. case 98175:
  491. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  492. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03030100);
  493. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  494. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x483e260c);
  495. break;
  496. case 102850:
  497. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  498. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02030301);
  499. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf5f7fd);
  500. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b270f);
  501. break;
  502. case 107250:
  503. case 107525:
  504. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  505. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  506. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  507. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  508. break;
  509. case 112200:
  510. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  511. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  512. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x01f7f6fa);
  513. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3f392712);
  514. break;
  515. default:
  516. return BBM_NOK;
  517. }
  518. #elif (BBM_BAND_WIDTH == 7)
  519. switch (clk) {
  520. case 115200:
  521. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  522. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  523. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  524. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x473e260c);
  525. break;
  526. case 120000:
  527. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  528. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02030301);
  529. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf5f7fd);
  530. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b270f);
  531. break;
  532. case 124800:
  533. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  534. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  535. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  536. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  537. break;
  538. case 129600:
  539. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  540. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  541. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x00f7f6fb);
  542. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x40392712);
  543. break;
  544. case 114000:
  545. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  546. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03030100);
  547. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf9f4f9ff);
  548. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x483e260c);
  549. break;
  550. case 117000:
  551. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  552. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040200);
  553. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfbf5f7fe);
  554. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x453d270e);
  555. break;
  556. /*case 120000:
  557. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  558. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02030301);
  559. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf5f7fd);
  560. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b270f);
  561. break;*/
  562. case 126000:
  563. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  564. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  565. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  566. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  567. break;
  568. case 115260:
  569. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  570. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  571. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  572. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x473e260c);
  573. break;
  574. case 118650:
  575. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  576. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040201);
  577. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfcf5f7fd);
  578. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x443c270f);
  579. break;
  580. case 122040:
  581. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  582. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  583. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  584. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x423b2710);
  585. break;
  586. case 125430:
  587. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  588. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  589. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  590. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  591. break;
  592. case 116000:
  593. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  594. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  595. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfbf5f8fe);
  596. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x463d270d);
  597. break;
  598. /*case 120000:
  599. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  600. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02030301);
  601. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf5f7fd);
  602. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b270f);
  603. break;*/
  604. case 124000:
  605. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  606. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  607. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fc);
  608. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x423a2711);
  609. break;
  610. case 128000:
  611. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  612. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  613. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x00f7f6fb);
  614. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x40392712);
  615. break;
  616. case 116250:
  617. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  618. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  619. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfbf5f8fe);
  620. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x463d270d);
  621. break;
  622. case 120900:
  623. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ff0000);
  624. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  625. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  626. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b2710);
  627. break;
  628. case 125550:
  629. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  630. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  631. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  632. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  633. break;
  634. case 130200:
  635. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  636. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  637. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x00f7f6fa);
  638. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3f392712);
  639. break;
  640. case 116875:
  641. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  642. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  643. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfbf5f8fe);
  644. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x463d270e);
  645. break;
  646. default:
  647. return BBM_NOK;
  648. }
  649. #else /* BBM_BAND_WIDTH == 8) */
  650. switch (clk) {
  651. case 134400:
  652. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  653. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040200);
  654. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfcf5f7fe);
  655. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x453c270e);
  656. break;
  657. case 139200:
  658. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  659. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  660. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  661. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b2710);
  662. break;
  663. case 144000:
  664. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  665. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  666. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  667. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  668. break;
  669. case 148800:
  670. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  671. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  672. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x00f7f6fa);
  673. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3f392712);
  674. break;
  675. case 132000:
  676. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  677. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  678. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  679. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x473e270d);
  680. break;
  681. case 138000:
  682. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ff0000);
  683. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  684. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf6f7fc);
  685. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x433b2710);
  686. break;
  687. /*case 144000:
  688. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  689. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  690. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  691. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  692. break;*/
  693. case 150000:
  694. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  695. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  696. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x01f7f6fa);
  697. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3f392712);
  698. break;
  699. case 132210:
  700. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  701. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  702. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfbf4f8fe);
  703. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x473d270d);
  704. break;
  705. case 135600:
  706. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  707. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040201);
  708. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfcf5f7fd);
  709. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x443c270f);
  710. break;
  711. case 142380:
  712. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  713. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  714. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  715. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  716. break;
  717. case 149160:
  718. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  719. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030302);
  720. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x01f7f6fa);
  721. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x3f392712);
  722. break;
  723. /*case 132000:
  724. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  725. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03040200);
  726. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  727. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x473e270d);
  728. break;*/
  729. case 136000:
  730. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  731. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040201);
  732. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfdf5f7fd);
  733. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x443c270f);
  734. break;
  735. case 140000:
  736. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  737. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  738. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  739. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x423b2710);
  740. break;
  741. /*case 144000:
  742. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  743. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  744. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  745. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  746. break;*/
  747. case 130200:
  748. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  749. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x030301ff);
  750. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf9f4f9ff);
  751. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x483e260b);
  752. break;
  753. case 134850:
  754. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  755. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02040200);
  756. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfcf5f7fd);
  757. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x453c270e);
  758. break;
  759. case 139500:
  760. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  761. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01030301);
  762. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfef6f7fc);
  763. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x423b2710);
  764. break;
  765. case 144150:
  766. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00ffff00);
  767. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00030301);
  768. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfff6f6fb);
  769. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x413a2711);
  770. break;
  771. case 130900:
  772. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xffff0000);
  773. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03030100);
  774. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xfaf4f8ff);
  775. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x483e260c);
  776. break;
  777. default:
  778. return BBM_NOK;
  779. }
  780. #endif /* #if (BBM_BAND_WIDTH == 6) */
  781. return BBM_OK;
  782. }
  783. static s32 fc8300_set_acif_1seg(HANDLE handle, DEVICEID devid, u32 clk)
  784. {
  785. #if (BBM_BAND_WIDTH == 6)
  786. switch (clk) {
  787. case 100750:
  788. case 100800:
  789. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfeff0001);
  790. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfafbfc);
  791. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120b04ff);
  792. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2624201a);
  793. break;
  794. case 105600:
  795. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfeff00);
  796. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfb);
  797. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  798. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221f19);
  799. break;
  800. case 110400:
  801. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdff00);
  802. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffcfbfb);
  803. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  804. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x22211e19);
  805. break;
  806. case 115200:
  807. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfeff);
  808. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fdfcfb);
  809. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130e0804);
  810. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x201f1d19);
  811. break;
  812. case 99000:
  813. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  814. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  815. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  816. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2725211a);
  817. break;
  818. case 102000:
  819. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  820. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfbfbfc);
  821. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130b0500);
  822. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2524201a);
  823. break;
  824. case 105000:
  825. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0000);
  826. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfb);
  827. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  828. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24221f19);
  829. break;
  830. case 108000:
  831. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  832. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  833. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  834. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  835. break;
  836. case 98310:
  837. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  838. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  839. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  840. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2725211a);
  841. break;
  842. case 101700:
  843. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  844. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfbfbfc);
  845. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130b05ff);
  846. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2524201a);
  847. break;
  848. case 105090:
  849. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0000);
  850. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfb);
  851. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  852. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24221f19);
  853. break;
  854. case 108480:
  855. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  856. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  857. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  858. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x22211e19);
  859. break;
  860. case 100000:
  861. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfeff0101);
  862. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfafbfc);
  863. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120b04ff);
  864. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2625201a);
  865. break;
  866. case 104000:
  867. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0001);
  868. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfc);
  869. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0500);
  870. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24231f1a);
  871. break;
  872. /*case 108000:
  873. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  874. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  875. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  876. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  877. break;*/
  878. case 112000:
  879. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfeff);
  880. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffdfbfb);
  881. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0803);
  882. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x21201d19);
  883. break;
  884. case 97650:
  885. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  886. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  887. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  888. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2726211a);
  889. break;
  890. case 102300:
  891. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  892. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfbfbfc);
  893. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130b0500);
  894. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2524201a);
  895. break;
  896. case 106950:
  897. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  898. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  899. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0601);
  900. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221e19);
  901. break;
  902. case 111600:
  903. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfe00);
  904. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffcfbfb);
  905. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0803);
  906. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x21201d19);
  907. break;
  908. case 98175:
  909. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  910. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  911. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  912. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2725211a);
  913. break;
  914. case 102850:
  915. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  916. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfc);
  917. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0500);
  918. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x25231f1a);
  919. break;
  920. case 107250:
  921. case 107525:
  922. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  923. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  924. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  925. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221e19);
  926. break;
  927. case 112200:
  928. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfeff);
  929. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffdfbfb);
  930. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0803);
  931. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x21201d19);
  932. break;
  933. default:
  934. return BBM_NOK;
  935. }
  936. #elif (BBM_BAND_WIDTH == 7)
  937. switch (clk) {
  938. case 115200:
  939. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  940. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  941. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  942. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2725211a);
  943. break;
  944. case 120000:
  945. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  946. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfc);
  947. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0500);
  948. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x25231f1a);
  949. break;
  950. case 124800:
  951. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  952. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  953. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0601);
  954. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221e19);
  955. break;
  956. case 129600:
  957. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfe00);
  958. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffcfbfb);
  959. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0803);
  960. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x22201d19);
  961. break;
  962. case 114000:
  963. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  964. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  965. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  966. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2726211a);
  967. break;
  968. case 117000:
  969. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfeff0101);
  970. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfafbfc);
  971. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120b04ff);
  972. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2624201a);
  973. break;
  974. /*case 120000:
  975. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  976. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfc);
  977. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0500);
  978. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x25231f1a);
  979. break;*/
  980. case 126000:
  981. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  982. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  983. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  984. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  985. break;
  986. case 115260:
  987. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  988. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  989. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  990. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2725211a);
  991. break;
  992. case 118650:
  993. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  994. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfbfbfc);
  995. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130b05ff);
  996. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2524201a);
  997. break;
  998. case 122040:
  999. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0001);
  1000. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfb);
  1001. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  1002. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24231f19);
  1003. break;
  1004. case 125430:
  1005. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1006. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1007. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1008. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221e19);
  1009. break;
  1010. case 116000:
  1011. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  1012. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  1013. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a04ff);
  1014. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2625201a);
  1015. break;
  1016. /*case 120000:
  1017. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  1018. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfc);
  1019. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0500);
  1020. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x25231f1a);
  1021. break;*/
  1022. case 124000:
  1023. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfeff00);
  1024. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefbfbfb);
  1025. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  1026. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221f19);
  1027. break;
  1028. case 128000:
  1029. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdff00);
  1030. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1031. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1032. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x22211e19);
  1033. break;
  1034. case 116250:
  1035. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfeff0101);
  1036. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  1037. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120b04ff);
  1038. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2625201a);
  1039. break;
  1040. case 120900:
  1041. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0001);
  1042. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfc);
  1043. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0500);
  1044. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24231f1a);
  1045. break;
  1046. case 125550:
  1047. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1048. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1049. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1050. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221e19);
  1051. break;
  1052. case 130200:
  1053. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfe00);
  1054. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffcfbfb);
  1055. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0803);
  1056. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x21201d19);
  1057. break;
  1058. case 116875:
  1059. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfeff0101);
  1060. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfafbfc);
  1061. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120b04ff);
  1062. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2624201a);
  1063. break;
  1064. default:
  1065. return BBM_NOK;
  1066. }
  1067. #else /* BBM_BAND_WIDTH == 8) */
  1068. switch (clk) {
  1069. case 134400:
  1070. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfeff0001);
  1071. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfafbfc);
  1072. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120b04ff);
  1073. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2624201a);
  1074. break;
  1075. case 139200:
  1076. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0001);
  1077. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfb);
  1078. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  1079. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24231f19);
  1080. break;
  1081. case 144000:
  1082. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1083. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1084. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1085. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  1086. break;
  1087. case 148800:
  1088. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfe00);
  1089. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffcfbfb);
  1090. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0803);
  1091. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x21201d19);
  1092. break;
  1093. case 132000:
  1094. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  1095. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  1096. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  1097. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2725211a);
  1098. break;
  1099. case 138000:
  1100. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  1101. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfc);
  1102. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0500);
  1103. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24231f1a);
  1104. break;
  1105. /*case 144000:
  1106. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1107. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1108. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1109. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  1110. break;*/
  1111. case 150000:
  1112. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfeff);
  1113. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffdfbfb);
  1114. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130e0803);
  1115. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x21201d19);
  1116. break;
  1117. case 132210:
  1118. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  1119. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  1120. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a04fe);
  1121. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2625211a);
  1122. break;
  1123. case 135600:
  1124. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  1125. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfbfbfc);
  1126. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130b05ff);
  1127. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2524201a);
  1128. break;
  1129. case 142380:
  1130. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1131. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1132. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0601);
  1133. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23221e19);
  1134. break;
  1135. case 149160:
  1136. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfdfeff);
  1137. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffdfbfb);
  1138. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0803);
  1139. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x21201d19);
  1140. break;
  1141. /*case 132000:
  1142. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  1143. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  1144. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  1145. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2725211a);
  1146. break;*/
  1147. case 136000:
  1148. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  1149. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfbfbfc);
  1150. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130b0500);
  1151. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2524201a);
  1152. break;
  1153. case 140000:
  1154. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0000);
  1155. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfb);
  1156. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  1157. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24221f19);
  1158. break;
  1159. /*case 144000:
  1160. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1161. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1162. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1163. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  1164. break;*/
  1165. case 130200:
  1166. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe000101);
  1167. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfbfafbfc);
  1168. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120a03fe);
  1169. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2726211a);
  1170. break;
  1171. case 134850:
  1172. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdff0001);
  1173. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfcfbfbfc);
  1174. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x120b04ff);
  1175. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x2524201a);
  1176. break;
  1177. case 139500:
  1178. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfdfe0001);
  1179. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfdfbfbfb);
  1180. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130c0601);
  1181. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x24231f19);
  1182. break;
  1183. case 144150:
  1184. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1185. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1186. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1187. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  1188. break;
  1189. case 130900:
  1190. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfcfeff00);
  1191. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefcfbfb);
  1192. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0x130d0702);
  1193. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x23211e19);
  1194. break;
  1195. default:
  1196. return BBM_NOK;
  1197. }
  1198. #endif /* #if (BBM_BAND_WIDTH == 6) */
  1199. return BBM_OK;
  1200. }
  1201. static s32 fc8300_set_acif_3seg(HANDLE handle, DEVICEID devid, u32 clk)
  1202. {
  1203. #if (BBM_BAND_WIDTH == 6)
  1204. switch (clk) {
  1205. case 100750:
  1206. case 100800:
  1207. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1208. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fbfd01);
  1209. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefb0808);
  1210. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x604b1cf6);
  1211. break;
  1212. case 105600:
  1213. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1214. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1215. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef80509);
  1216. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5c491ffa);
  1217. break;
  1218. case 110400:
  1219. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x01020100);
  1220. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fffcfe);
  1221. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff50208);
  1222. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x584721fe);
  1223. break;
  1224. case 115200:
  1225. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xff010200);
  1226. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0701fdfd);
  1227. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f3fe07);
  1228. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x53452302);
  1229. break;
  1230. case 99000:
  1231. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1232. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1233. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0807);
  1234. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1bf5);
  1235. break;
  1236. case 102000:
  1237. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1238. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfd01);
  1239. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefa0708);
  1240. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5f4a1df7);
  1241. break;
  1242. case 105000:
  1243. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020100ff);
  1244. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1245. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef80609);
  1246. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ef9);
  1247. break;
  1248. /*case 108000:
  1249. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1250. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1251. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1252. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1253. break;*/
  1254. case 98310:
  1255. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1256. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1257. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0907);
  1258. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x624b1bf5);
  1259. break;
  1260. case 101700:
  1261. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1262. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfd01);
  1263. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefa0708);
  1264. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5f4b1df7);
  1265. break;
  1266. case 105090:
  1267. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1268. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1269. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef80609);
  1270. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d491ef9);
  1271. break;
  1272. case 108480:
  1273. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1274. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fefcff);
  1275. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60309);
  1276. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1277. break;
  1278. case 100000:
  1279. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1280. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fbfd01);
  1281. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefb0808);
  1282. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x604b1cf6);
  1283. break;
  1284. case 104000:
  1285. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1286. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1287. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef90608);
  1288. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ef8);
  1289. break;
  1290. case 108000:
  1291. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1292. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1293. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1294. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1295. break;
  1296. case 112000:
  1297. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00020100);
  1298. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0600fcfd);
  1299. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf0f40108);
  1300. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x564722ff);
  1301. break;
  1302. case 97650:
  1303. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1304. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefbfe02);
  1305. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefd0907);
  1306. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x624c1af4);
  1307. break;
  1308. case 102300:
  1309. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1310. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfd01);
  1311. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefa0708);
  1312. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5f4a1df7);
  1313. break;
  1314. case 106950:
  1315. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1316. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fdfcff);
  1317. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef70409);
  1318. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5b491ffb);
  1319. break;
  1320. case 111600:
  1321. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00020100);
  1322. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fffcfd);
  1323. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff40108);
  1324. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722ff);
  1325. break;
  1326. case 98175:
  1327. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1328. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1329. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0907);
  1330. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x624c1bf5);
  1331. break;
  1332. case 102850:
  1333. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1334. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfc01);
  1335. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef90708);
  1336. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1df8);
  1337. break;
  1338. case 107250:
  1339. case 107525:
  1340. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1341. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1342. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef70409);
  1343. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  1344. break;
  1345. case 112200:
  1346. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00020100);
  1347. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0600fcfd);
  1348. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf0f40008);
  1349. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x564622ff);
  1350. break;
  1351. default:
  1352. return BBM_NOK;
  1353. }
  1354. #elif (BBM_BAND_WIDTH == 7)
  1355. switch (clk) {
  1356. case 115200:
  1357. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1358. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1359. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0807);
  1360. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1bf5);
  1361. break;
  1362. case 120000:
  1363. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1364. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfc01);
  1365. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef90708);
  1366. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1df8);
  1367. break;
  1368. case 124800:
  1369. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1370. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fdfcff);
  1371. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef70409);
  1372. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5b491ffb);
  1373. break;
  1374. case 129600:
  1375. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x01020100);
  1376. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fffcfe);
  1377. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff50108);
  1378. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722fe);
  1379. break;
  1380. case 114000:
  1381. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1382. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1383. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefd0907);
  1384. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x624c1af4);
  1385. break;
  1386. case 117000:
  1387. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1388. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fbfd01);
  1389. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefb0808);
  1390. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x604b1cf6);
  1391. break;
  1392. /*case 120000:
  1393. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1394. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfc01);
  1395. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef90708);
  1396. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1df8);
  1397. break;*/
  1398. case 126000:
  1399. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1400. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1401. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1402. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1403. break;
  1404. case 115260:
  1405. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1406. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1407. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0807);
  1408. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1bf5);
  1409. break;
  1410. case 118650:
  1411. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1412. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfd01);
  1413. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefa0708);
  1414. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5f4b1df7);
  1415. break;
  1416. case 122040:
  1417. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020100ff);
  1418. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1419. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef80609);
  1420. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ef9);
  1421. break;
  1422. case 125430:
  1423. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1424. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fdfcff);
  1425. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef70409);
  1426. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  1427. break;
  1428. case 116000:
  1429. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1430. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfd02);
  1431. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefb0808);
  1432. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1bf5);
  1433. break;
  1434. /*case 120000:
  1435. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1436. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfc01);
  1437. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef90708);
  1438. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1df8);
  1439. break;*/
  1440. case 124000:
  1441. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1442. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fdfcff);
  1443. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef70509);
  1444. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5c491ffa);
  1445. break;
  1446. case 128000:
  1447. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x010201ff);
  1448. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fefcfe);
  1449. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff50208);
  1450. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x584821fd);
  1451. break;
  1452. case 116250:
  1453. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1454. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fbfd01);
  1455. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefb0808);
  1456. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1cf6);
  1457. break;
  1458. case 120900:
  1459. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1460. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fcfc00);
  1461. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef90608);
  1462. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1ef8);
  1463. break;
  1464. case 125550:
  1465. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1466. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1467. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef70409);
  1468. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  1469. break;
  1470. case 130200:
  1471. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00020100);
  1472. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fffcfd);
  1473. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff40108);
  1474. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722ff);
  1475. break;
  1476. case 116875:
  1477. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1478. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fbfd01);
  1479. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefb0808);
  1480. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x604b1cf6);
  1481. break;
  1482. default:
  1483. return BBM_NOK;
  1484. }
  1485. #else /* BBM_BAND_WIDTH == 8) */
  1486. switch (clk) {
  1487. case 134400:
  1488. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1489. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fbfd01);
  1490. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefb0808);
  1491. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x604b1cf6);
  1492. break;
  1493. case 139200:
  1494. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020100ff);
  1495. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1496. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef80609);
  1497. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ef9);
  1498. break;
  1499. case 144000:
  1500. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1501. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1502. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1503. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1504. break;
  1505. case 148800:
  1506. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00020100);
  1507. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fffcfd);
  1508. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff40108);
  1509. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722ff);
  1510. break;
  1511. case 132000:
  1512. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1513. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1514. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0807);
  1515. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1bf5);
  1516. break;
  1517. case 138000:
  1518. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1519. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fcfc00);
  1520. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef90608);
  1521. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1ef8);
  1522. break;
  1523. /*case 144000:
  1524. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1525. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1526. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1527. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1528. break;*/
  1529. case 150000:
  1530. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00020100);
  1531. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0600fcfd);
  1532. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf0f40008);
  1533. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x56462200);
  1534. break;
  1535. case 132210:
  1536. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1537. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfd02);
  1538. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0807);
  1539. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1bf5);
  1540. break;
  1541. case 135600:
  1542. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1543. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfd01);
  1544. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefa0708);
  1545. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5f4b1df7);
  1546. break;
  1547. case 142380:
  1548. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1549. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fdfcff);
  1550. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef70509);
  1551. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5b491ffb);
  1552. break;
  1553. case 149160:
  1554. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00020100);
  1555. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fffcfd);
  1556. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf0f40108);
  1557. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x564722ff);
  1558. break;
  1559. /*case 132000:
  1560. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1561. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfffbfe02);
  1562. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefc0807);
  1563. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x614b1bf5);
  1564. break;*/
  1565. case 136000:
  1566. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1567. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x01fbfd01);
  1568. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefa0708);
  1569. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5f4a1df7);
  1570. break;
  1571. case 140000:
  1572. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020100ff);
  1573. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1574. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef80609);
  1575. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ef9);
  1576. break;
  1577. /*case 144000:
  1578. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1579. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1580. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1581. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1582. break;*/
  1583. case 130200:
  1584. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0200ffff);
  1585. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0xfefbfe02);
  1586. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefd0907);
  1587. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x624c1af4);
  1588. break;
  1589. case 134850:
  1590. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0201ffff);
  1591. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x00fbfd01);
  1592. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeefa0708);
  1593. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x604b1cf7);
  1594. break;
  1595. case 139500:
  1596. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020100ff);
  1597. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fcfc00);
  1598. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef80609);
  1599. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ef9);
  1600. break;
  1601. case 144150:
  1602. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1603. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1604. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1605. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1606. break;
  1607. case 130900:
  1608. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020200ff);
  1609. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fdfcff);
  1610. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef60409);
  1611. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4820fc);
  1612. break;
  1613. default:
  1614. return BBM_NOK;
  1615. }
  1616. #endif /* #if (BBM_BAND_WIDTH == 6) */
  1617. return BBM_OK;
  1618. }
  1619. static s32 fc8300_set_acif_13seg(HANDLE handle, DEVICEID devid, u32 clk)
  1620. {
  1621. #if (BBM_BAND_WIDTH == 6)
  1622. switch (clk) {
  1623. case 100750:
  1624. case 100800:
  1625. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040400fd);
  1626. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fbf9fe);
  1627. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf6050b);
  1628. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5b4920fa);
  1629. break;
  1630. case 105600:
  1631. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x010503ff);
  1632. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x07fff9fb);
  1633. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef3010a);
  1634. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722fe);
  1635. break;
  1636. case 110400:
  1637. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe030402);
  1638. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0902fbfa);
  1639. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf0f1fe08);
  1640. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x53452402);
  1641. break;
  1642. case 115200:
  1643. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfc010403);
  1644. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0905fefa);
  1645. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf2f0fb06);
  1646. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x50432606);
  1647. break;
  1648. case 99000:
  1649. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0504fffc);
  1650. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fafa00);
  1651. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf7070b);
  1652. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ff9);
  1653. break;
  1654. case 102000:
  1655. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030501fd);
  1656. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fcf9fe);
  1657. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5040b);
  1658. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  1659. break;
  1660. case 105000:
  1661. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020503ff);
  1662. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x07fef9fc);
  1663. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef4020a);
  1664. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722fe);
  1665. break;
  1666. case 108000:
  1667. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1668. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafa);
  1669. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  1670. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462301);
  1671. break;
  1672. case 120000:
  1673. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfbfe0304);
  1674. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x090700fb);
  1675. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf4f0f803);
  1676. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x4d422709);
  1677. break;
  1678. case 98310:
  1679. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0503fffc);
  1680. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fafa00);
  1681. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf8070b);
  1682. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ef8);
  1683. break;
  1684. case 101700:
  1685. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040401fd);
  1686. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fcf9fe);
  1687. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5050b);
  1688. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  1689. break;
  1690. case 105090:
  1691. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020503ff);
  1692. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x07fef9fc);
  1693. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef3020a);
  1694. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722fe);
  1695. break;
  1696. case 108480:
  1697. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xff040401);
  1698. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0801fafa);
  1699. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  1700. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x54462401);
  1701. break;
  1702. case 100000:
  1703. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040400fd);
  1704. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fbf9ff);
  1705. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf7060b);
  1706. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5c4a1ffa);
  1707. break;
  1708. case 104000:
  1709. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020502fe);
  1710. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fdf9fc);
  1711. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef4030a);
  1712. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x584821fd);
  1713. break;
  1714. /*case 108000:
  1715. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1716. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafa);
  1717. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  1718. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462301);
  1719. break;*/
  1720. case 112000:
  1721. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfd020402);
  1722. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1723. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f1fd07);
  1724. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x52452504);
  1725. break;
  1726. case 97650:
  1727. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0503fefc);
  1728. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fafa01);
  1729. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf8080a);
  1730. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1ef8);
  1731. break;
  1732. case 102300:
  1733. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030501fd);
  1734. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fcf9fd);
  1735. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5040b);
  1736. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4921fc);
  1737. break;
  1738. case 106950:
  1739. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1740. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafb);
  1741. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff3000a);
  1742. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x56472300);
  1743. break;
  1744. case 111600:
  1745. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfd020402);
  1746. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1747. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f1fd07);
  1748. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x52452503);
  1749. break;
  1750. case 116000:
  1751. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfc000404);
  1752. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0905fefa);
  1753. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf3f0fa05);
  1754. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x4f432606);
  1755. break;
  1756. case 98175:
  1757. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0503fffc);
  1758. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fafa00);
  1759. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf8070b);
  1760. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1ef8);
  1761. break;
  1762. case 102850:
  1763. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030501fe);
  1764. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fdf9fd);
  1765. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5040b);
  1766. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x594821fc);
  1767. break;
  1768. case 107250:
  1769. case 107525:
  1770. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1771. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafb);
  1772. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff20009);
  1773. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462300);
  1774. break;
  1775. case 112200:
  1776. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfd020402);
  1777. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1778. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f1fc07);
  1779. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x52452504);
  1780. break;
  1781. default:
  1782. return BBM_NOK;
  1783. }
  1784. #elif (BBM_BAND_WIDTH == 7)
  1785. switch (clk) {
  1786. case 115200:
  1787. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0504fffc);
  1788. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fafa00);
  1789. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf8070b);
  1790. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ff9);
  1791. break;
  1792. case 120000:
  1793. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030501fe);
  1794. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fdf9fd);
  1795. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5040b);
  1796. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x594821fc);
  1797. break;
  1798. case 124800:
  1799. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1800. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafb);
  1801. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff30009);
  1802. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x56472300);
  1803. break;
  1804. case 129600:
  1805. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe030402);
  1806. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1807. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf0f1fd08);
  1808. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x52452403);
  1809. break;
  1810. case 114000:
  1811. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0503fefc);
  1812. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fafa01);
  1813. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf8080a);
  1814. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1ef8);
  1815. break;
  1816. case 117000:
  1817. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040400fd);
  1818. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fbf9ff);
  1819. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf6060b);
  1820. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5c4920fa);
  1821. break;
  1822. /*case 120000:
  1823. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030501fe);
  1824. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fdf9fd);
  1825. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5040b);
  1826. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x594821fc);
  1827. break;*/
  1828. case 126000:
  1829. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1830. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafa);
  1831. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  1832. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462301);
  1833. break;
  1834. case 115260:
  1835. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0504fffc);
  1836. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fafa00);
  1837. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf7070b);
  1838. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ff9);
  1839. break;
  1840. case 118650:
  1841. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040401fd);
  1842. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fcf9fe);
  1843. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5050b);
  1844. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  1845. break;
  1846. case 122040:
  1847. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020502fe);
  1848. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x07fef9fc);
  1849. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef4020a);
  1850. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x584822fe);
  1851. break;
  1852. case 125430:
  1853. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1854. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafb);
  1855. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff20009);
  1856. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462300);
  1857. break;
  1858. case 116000:
  1859. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0504fffd);
  1860. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fafaff);
  1861. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf7060b);
  1862. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5c4a1ff9);
  1863. break;
  1864. /*case 120000:
  1865. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030501fe);
  1866. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fdf9fd);
  1867. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5040b);
  1868. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x594821fc);
  1869. break;*/
  1870. case 124000:
  1871. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x010403ff);
  1872. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x08fffafb);
  1873. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef3010a);
  1874. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x564723ff);
  1875. break;
  1876. case 128000:
  1877. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfe030401);
  1878. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0902fbfa);
  1879. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf0f2fe08);
  1880. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x53452402);
  1881. break;
  1882. case 116250:
  1883. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0404fffd);
  1884. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fbfaff);
  1885. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf7060b);
  1886. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5c4a1ff9);
  1887. break;
  1888. case 120900:
  1889. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020502fe);
  1890. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fdf9fd);
  1891. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf4030a);
  1892. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x594821fd);
  1893. break;
  1894. case 125550:
  1895. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1896. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafb);
  1897. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff20009);
  1898. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462300);
  1899. break;
  1900. case 130200:
  1901. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfd020402);
  1902. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1903. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f1fd07);
  1904. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x52452503);
  1905. break;
  1906. case 116875:
  1907. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040400fd);
  1908. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fbf9ff);
  1909. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf7060b);
  1910. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5c491ffa);
  1911. break;
  1912. default:
  1913. return BBM_NOK;
  1914. }
  1915. #else /* BBM_BAND_WIDTH == 8) */
  1916. switch (clk) {
  1917. case 134400:
  1918. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040400fd);
  1919. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fbf9fe);
  1920. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf6050b);
  1921. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5b4920fa);
  1922. break;
  1923. case 139200:
  1924. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020502fe);
  1925. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x07fef9fc);
  1926. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef4020a);
  1927. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x584822fd);
  1928. break;
  1929. case 144000:
  1930. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1931. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafa);
  1932. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  1933. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462301);
  1934. break;
  1935. case 148800:
  1936. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfd020402);
  1937. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1938. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f1fd07);
  1939. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x52452503);
  1940. break;
  1941. case 132000:
  1942. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0504fffc);
  1943. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fafa00);
  1944. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf7070b);
  1945. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ff9);
  1946. break;
  1947. case 138000:
  1948. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030502fe);
  1949. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x06fdf9fd);
  1950. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf4030a);
  1951. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x594821fd);
  1952. break;
  1953. /*case 144000:
  1954. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  1955. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafa);
  1956. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  1957. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462301);
  1958. break;*/
  1959. case 150000:
  1960. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfd020403);
  1961. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1962. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f1fc07);
  1963. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x51442504);
  1964. break;
  1965. case 132210:
  1966. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0504fffc);
  1967. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fafa00);
  1968. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf7070b);
  1969. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ff9);
  1970. break;
  1971. case 135600:
  1972. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040401fd);
  1973. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fcf9fe);
  1974. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5050b);
  1975. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  1976. break;
  1977. case 142380:
  1978. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040300);
  1979. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafb);
  1980. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff3000a);
  1981. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x56472300);
  1982. break;
  1983. case 149160:
  1984. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xfd020402);
  1985. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0903fcfa);
  1986. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xf1f1fd07);
  1987. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x52452503);
  1988. break;
  1989. /*case 132000:
  1990. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0504fffc);
  1991. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x03fafa00);
  1992. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf7070b);
  1993. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5d4a1ff9);
  1994. break;*/
  1995. case 136000:
  1996. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x030501fd);
  1997. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x05fcf9fe);
  1998. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf5040b);
  1999. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5a4920fb);
  2000. break;
  2001. case 140000:
  2002. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020503ff);
  2003. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x07fef9fc);
  2004. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef4020a);
  2005. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x574722fe);
  2006. break;
  2007. /*case 144000:
  2008. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x00040400);
  2009. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0800fafa);
  2010. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  2011. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462301);
  2012. break;*/
  2013. case 130200:
  2014. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0503fefc);
  2015. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fafa01);
  2016. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf8080a);
  2017. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1ef8);
  2018. break;
  2019. case 134850:
  2020. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x040400fd);
  2021. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x04fbf9fe);
  2022. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xedf6050b);
  2023. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5b4920fb);
  2024. break;
  2025. case 139500:
  2026. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x020502fe);
  2027. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x07fef9fc);
  2028. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeef4020a);
  2029. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x584822fe);
  2030. break;
  2031. case 144150:
  2032. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0xff040400);
  2033. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x0801fafa);
  2034. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xeff2ff09);
  2035. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x55462301);
  2036. break;
  2037. case 130900:
  2038. bbm_long_write(handle, devid, BBM_ACIF_COEF_00, 0x0503fffc);
  2039. bbm_long_write(handle, devid, BBM_ACIF_COEF_04, 0x02fafa00);
  2040. bbm_long_write(handle, devid, BBM_ACIF_COEF_08, 0xecf8070b);
  2041. bbm_long_write(handle, devid, BBM_ACIF_COEF_12, 0x5e4a1ef8);
  2042. break;
  2043. default:
  2044. return BBM_NOK;
  2045. }
  2046. #endif /* #if (BBM_BAND_WIDTH == 6) */
  2047. return BBM_OK;
  2048. }
  2049. static s32 fc8300_set_cal_front_1seg(HANDLE handle, DEVICEID devid, u32 clk)
  2050. {
  2051. #if (BBM_BAND_WIDTH == 6)
  2052. switch (clk) {
  2053. case 97650:
  2054. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2fd1);
  2055. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fead);
  2056. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x200a999a);
  2057. break;
  2058. case 97875:
  2059. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2fb5);
  2060. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fc53);
  2061. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x201d8000);
  2062. break;
  2063. case 98175:
  2064. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2f90);
  2065. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f935);
  2066. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2036b333);
  2067. break;
  2068. case 98304:
  2069. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2f80);
  2070. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7df);
  2071. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20418937);
  2072. break;
  2073. case 98310:
  2074. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2f7f);
  2075. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7d0);
  2076. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20420a3d);
  2077. break;
  2078. case 99000:
  2079. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2f2b);
  2080. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f0bb);
  2081. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x207c0000);
  2082. break;
  2083. case 100000:
  2084. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2eb2);
  2085. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3e6a5);
  2086. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20d00000);
  2087. break;
  2088. case 100750:
  2089. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2e59);
  2090. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3df36);
  2091. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x210f0000);
  2092. break;
  2093. case 100800:
  2094. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2e53);
  2095. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3deb8);
  2096. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21133333);
  2097. break;
  2098. case 101250:
  2099. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2e1e);
  2100. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3da51);
  2101. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21390000);
  2102. break;
  2103. case 101376:
  2104. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2e10);
  2105. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d917);
  2106. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21439581);
  2107. break;
  2108. case 101700:
  2109. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2dea);
  2110. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d5f3);
  2111. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x215ecccd);
  2112. break;
  2113. case 102400:
  2114. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2d9a);
  2115. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3cf3d);
  2116. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2199999a);
  2117. break;
  2118. case 102850:
  2119. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2d67);
  2120. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3caf9);
  2121. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21bf6666);
  2122. break;
  2123. case 103125:
  2124. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2d48);
  2125. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c862);
  2126. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21d68000);
  2127. break;
  2128. case 104000:
  2129. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2ce6);
  2130. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c03c);
  2131. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x22200000);
  2132. break;
  2133. case 105600:
  2134. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2c38);
  2135. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3b1af);
  2136. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x22a66666);
  2137. break;
  2138. case 107250:
  2139. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2b8a);
  2140. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3a323);
  2141. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x23310000);
  2142. break;
  2143. case 107525:
  2144. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2b6d);
  2145. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3a0c1);
  2146. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2348199a);
  2147. break;
  2148. case 108000:
  2149. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2b3c);
  2150. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x39cac);
  2151. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x23700000);
  2152. break;
  2153. case 110400:
  2154. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2a4c);
  2155. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x38892);
  2156. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2439999a);
  2157. break;
  2158. case 111600:
  2159. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x29d7);
  2160. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x37ed8);
  2161. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x249e6666);
  2162. break;
  2163. case 112000:
  2164. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x29b1);
  2165. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x37ba5);
  2166. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x24c00000);
  2167. break;
  2168. case 112200:
  2169. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x299e);
  2170. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x37a0f);
  2171. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x24d0cccd);
  2172. break;
  2173. default:
  2174. return BBM_NOK;
  2175. }
  2176. #elif (BBM_BAND_WIDTH == 7)
  2177. switch (clk) {
  2178. case 114000:
  2179. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x28f6);
  2180. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fe01);
  2181. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20100000);
  2182. break;
  2183. case 114688:
  2184. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x28b7);
  2185. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7df);
  2186. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20418937);
  2187. break;
  2188. case 114750:
  2189. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x28b1);
  2190. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f753);
  2191. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20460000);
  2192. break;
  2193. case 115200:
  2194. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2889);
  2195. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f35c);
  2196. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20666666);
  2197. break;
  2198. case 115260:
  2199. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2883);
  2200. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f2d5);
  2201. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x206ab852);
  2202. break;
  2203. case 115625:
  2204. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2862);
  2205. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3efa4);
  2206. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20850000);
  2207. break;
  2208. case 116000:
  2209. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2841);
  2210. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ec62);
  2211. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20a00000);
  2212. break;
  2213. case 116250:
  2214. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x282b);
  2215. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ea39);
  2216. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20b20000);
  2217. break;
  2218. case 116736:
  2219. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2800);
  2220. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3e60d);
  2221. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20d4fdf4);
  2222. break;
  2223. case 116875:
  2224. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x27f4);
  2225. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x35674);
  2226. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x26598000);
  2227. break;
  2228. case 117000:
  2229. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x27e9);
  2230. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3e3cc);
  2231. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20e80000);
  2232. break;
  2233. case 118125:
  2234. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2788);
  2235. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3da51);
  2236. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21390000);
  2237. break;
  2238. case 118650:
  2239. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x275b);
  2240. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d5f3);
  2241. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x215ecccd);
  2242. break;
  2243. case 118750:
  2244. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2752);
  2245. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d520);
  2246. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21660000);
  2247. break;
  2248. case 118784:
  2249. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x274f);
  2250. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d4d8);
  2251. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x216872b0);
  2252. break;
  2253. case 120000:
  2254. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x26e9);
  2255. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3cae7);
  2256. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21c00000);
  2257. break;
  2258. case 120900:
  2259. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x269f);
  2260. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c3ad);
  2261. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2200cccd);
  2262. break;
  2263. default:
  2264. return BBM_NOK;
  2265. }
  2266. #else /* (BBM_BAND_WIDTH == 8) */
  2267. switch (clk) {
  2268. case 130200:
  2269. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x23dd);
  2270. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fead);
  2271. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x200a999a);
  2272. break;
  2273. case 130500:
  2274. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x23c8);
  2275. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fc53);
  2276. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x201d8000);
  2277. break;
  2278. case 130900:
  2279. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x23ac);
  2280. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x2fae8);
  2281. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2af3999a);
  2282. break;
  2283. case 131072:
  2284. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x23a0);
  2285. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7df);
  2286. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20418937);
  2287. break;
  2288. case 131250:
  2289. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2394);
  2290. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f67f);
  2291. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x204cc000);
  2292. break;
  2293. case 131625:
  2294. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x237a);
  2295. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f39b);
  2296. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20646000);
  2297. break;
  2298. case 132000:
  2299. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2360);
  2300. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f0bb);
  2301. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x207c0000);
  2302. break;
  2303. case 132210:
  2304. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2351);
  2305. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ef21);
  2306. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x20893ae1);
  2307. break;
  2308. case 134400:
  2309. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x22be);
  2310. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3deb8);
  2311. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21133333);
  2312. break;
  2313. case 134850:
  2314. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x22a0);
  2315. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3db69);
  2316. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x212f8ccd);
  2317. break;
  2318. case 135000:
  2319. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2297);
  2320. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3da51);
  2321. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21390000);
  2322. break;
  2323. case 135168:
  2324. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x228c);
  2325. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d917);
  2326. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21439581);
  2327. break;
  2328. case 135600:
  2329. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x226f);
  2330. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d5f3);
  2331. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x215ecccd);
  2332. break;
  2333. case 136000:
  2334. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2256);
  2335. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d310);
  2336. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21780000);
  2337. break;
  2338. case 136500:
  2339. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2235);
  2340. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3cf7a);
  2341. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21978000);
  2342. break;
  2343. case 137500:
  2344. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x21f6);
  2345. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c862);
  2346. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21d68000);
  2347. break;
  2348. case 138000:
  2349. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x21d6);
  2350. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c4e0);
  2351. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x21f60000);
  2352. break;
  2353. case 139200:
  2354. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x218b);
  2355. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3bc8e);
  2356. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2241999a);
  2357. break;
  2358. case 139264:
  2359. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2188);
  2360. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3bc1e);
  2361. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x2245a1cb);
  2362. break;
  2363. case 139500:
  2364. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x2179);
  2365. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ba80);
  2366. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x22548000);
  2367. break;
  2368. case 141312:
  2369. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x210b);
  2370. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ae42);
  2371. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x22c6a7f0);
  2372. break;
  2373. case 141750:
  2374. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x20f1);
  2375. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ab59);
  2376. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x22e24000);
  2377. break;
  2378. case 143000:
  2379. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x20a7);
  2380. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3a323);
  2381. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x23310000);
  2382. break;
  2383. default:
  2384. return BBM_NOK;
  2385. }
  2386. #endif
  2387. return BBM_OK;
  2388. }
  2389. static s32 fc8300_set_cal_front_3seg(HANDLE handle, DEVICEID devid, u32 clk)
  2390. {
  2391. #if (BBM_BAND_WIDTH == 6)
  2392. switch (clk) {
  2393. case 97650:
  2394. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7dd6);
  2395. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fead);
  2396. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10054ccd);
  2397. break;
  2398. case 97875:
  2399. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7d8c);
  2400. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fc53);
  2401. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x100ec000);
  2402. break;
  2403. case 98175:
  2404. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7d2a);
  2405. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f935);
  2406. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x101b599a);
  2407. break;
  2408. case 98304:
  2409. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7d00);
  2410. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7df);
  2411. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1020c49c);
  2412. break;
  2413. case 98310:
  2414. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7cfe);
  2415. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7d0);
  2416. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1021051f);
  2417. break;
  2418. case 99000:
  2419. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7c1f);
  2420. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f0bb);
  2421. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x103e0000);
  2422. break;
  2423. case 100000:
  2424. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7ae1);
  2425. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3e6a5);
  2426. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10680000);
  2427. break;
  2428. case 100750:
  2429. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x79f7);
  2430. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3df36);
  2431. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10878000);
  2432. break;
  2433. case 100800:
  2434. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x79e8);
  2435. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3deb8);
  2436. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1089999a);
  2437. break;
  2438. case 101250:
  2439. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x795d);
  2440. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3da51);
  2441. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x109c8000);
  2442. break;
  2443. case 101376:
  2444. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7936);
  2445. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d917);
  2446. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10a1cac1);
  2447. break;
  2448. case 101700:
  2449. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x78d3);
  2450. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d5f3);
  2451. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10af6666);
  2452. break;
  2453. case 102000:
  2454. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7878);
  2455. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d310);
  2456. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10bc0000);
  2457. break;
  2458. case 102300:
  2459. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x781e);
  2460. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d031);
  2461. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10c8999a);
  2462. break;
  2463. case 102400:
  2464. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7800);
  2465. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3cf3d);
  2466. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10cccccd);
  2467. break;
  2468. case 102850:
  2469. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x777a);
  2470. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3caf9);
  2471. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10dfb333);
  2472. break;
  2473. case 103125:
  2474. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7728);
  2475. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c862);
  2476. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10eb4000);
  2477. break;
  2478. case 103500:
  2479. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x76ba);
  2480. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c4e0);
  2481. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10fb0000);
  2482. break;
  2483. case 104000:
  2484. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7627);
  2485. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c03c);
  2486. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11100000);
  2487. break;
  2488. case 105600:
  2489. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x745d);
  2490. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3b1af);
  2491. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11533333);
  2492. break;
  2493. case 107250:
  2494. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7293);
  2495. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3a323);
  2496. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11988000);
  2497. break;
  2498. case 107525:
  2499. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x7248);
  2500. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3a0c1);
  2501. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11a40ccd);
  2502. break;
  2503. case 108000:
  2504. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x71c7);
  2505. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x39cac);
  2506. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11b80000);
  2507. break;
  2508. case 112000:
  2509. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6db7);
  2510. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x37ba5);
  2511. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12600000);
  2512. break;
  2513. case 112200:
  2514. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6d85);
  2515. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x37a0f);
  2516. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12686666);
  2517. break;
  2518. default:
  2519. return BBM_NOK;
  2520. }
  2521. #elif (BBM_BAND_WIDTH == 7)
  2522. switch (clk) {
  2523. case 114000:
  2524. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6bca);
  2525. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fe01);
  2526. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10080000);
  2527. break;
  2528. case 114688:
  2529. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6b25);
  2530. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7df);
  2531. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1020c49c);
  2532. break;
  2533. case 114750:
  2534. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6b16);
  2535. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f753);
  2536. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10230000);
  2537. break;
  2538. case 115200:
  2539. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6aab);
  2540. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f35c);
  2541. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10333333);
  2542. break;
  2543. case 115260:
  2544. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6a9c);
  2545. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f2d5);
  2546. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10355c29);
  2547. break;
  2548. case 115625:
  2549. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6a46);
  2550. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3efa4);
  2551. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10428000);
  2552. break;
  2553. case 116000:
  2554. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x69ee);
  2555. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ec62);
  2556. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10500000);
  2557. break;
  2558. case 116250:
  2559. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x69b4);
  2560. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ea39);
  2561. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10590000);
  2562. break;
  2563. case 116736:
  2564. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6943);
  2565. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3e60d);
  2566. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x106a7efa);
  2567. break;
  2568. case 116875:
  2569. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6923);
  2570. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x35674);
  2571. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x132cc000);
  2572. break;
  2573. case 117000:
  2574. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6907);
  2575. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3e3cc);
  2576. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10740000);
  2577. break;
  2578. case 118125:
  2579. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6807);
  2580. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3da51);
  2581. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x109c8000);
  2582. break;
  2583. case 118650:
  2584. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6791);
  2585. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d5f3);
  2586. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10af6666);
  2587. break;
  2588. case 118750:
  2589. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x677a);
  2590. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d520);
  2591. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10b30000);
  2592. break;
  2593. case 118784:
  2594. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6773);
  2595. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d4d8);
  2596. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10b43958);
  2597. break;
  2598. case 119808:
  2599. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6690);
  2600. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3cc76);
  2601. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10d91687);
  2602. break;
  2603. case 120000:
  2604. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6666);
  2605. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3cae7);
  2606. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10e00000);
  2607. break;
  2608. case 120250:
  2609. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6630);
  2610. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c8e3);
  2611. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10e90000);
  2612. break;
  2613. case 120900:
  2614. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x65a3);
  2615. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3c3ad);
  2616. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11006666);
  2617. break;
  2618. case 121500:
  2619. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x6523);
  2620. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3beeb);
  2621. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11160000);
  2622. break;
  2623. default:
  2624. return BBM_NOK;
  2625. }
  2626. #else /* BBM_BAND_WIDTH == 8) */
  2627. switch (clk) {
  2628. case 130200:
  2629. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5e61);
  2630. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fead);
  2631. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10054ccd);
  2632. break;
  2633. case 130500:
  2634. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5e29);
  2635. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3fc53);
  2636. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x100ec000);
  2637. break;
  2638. case 130900:
  2639. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5de0);
  2640. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x2fae8);
  2641. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1579cccd);
  2642. break;
  2643. case 131072:
  2644. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5dc0);
  2645. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f7df);
  2646. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1020c49c);
  2647. break;
  2648. case 131250:
  2649. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5d9f);
  2650. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f67f);
  2651. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10266000);
  2652. break;
  2653. case 131625:
  2654. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5d5b);
  2655. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f39b);
  2656. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10323000);
  2657. break;
  2658. case 132000:
  2659. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5d17);
  2660. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3f0bb);
  2661. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x103e0000);
  2662. break;
  2663. case 132210:
  2664. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5cf1);
  2665. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ef21);
  2666. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10449d71);
  2667. break;
  2668. case 134400:
  2669. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5b6e);
  2670. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3deb8);
  2671. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1089999a);
  2672. break;
  2673. case 135168:
  2674. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5ae9);
  2675. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3d917);
  2676. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10a1cac1);
  2677. break;
  2678. case 136500:
  2679. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x5a06);
  2680. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3cf7a);
  2681. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10cbc000);
  2682. break;
  2683. case 141312:
  2684. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x56f5);
  2685. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3ae42);
  2686. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x116353f8);
  2687. break;
  2688. case 143000:
  2689. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x55ee);
  2690. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0x3a323);
  2691. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11988000);
  2692. break;
  2693. default:
  2694. return BBM_NOK;
  2695. }
  2696. #endif /* #if (BBM_BAND_WIDTH == 6) */
  2697. return BBM_OK;
  2698. }
  2699. static s32 fc8300_set_cal_front_13seg(HANDLE handle, DEVICEID devid, u32 clk)
  2700. {
  2701. #if (BBM_BAND_WIDTH == 6)
  2702. switch (clk) {
  2703. case 97650:
  2704. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2705. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xffab);
  2706. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10054ccd);
  2707. break;
  2708. case 97875:
  2709. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2710. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xff15);
  2711. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x100ec000);
  2712. break;
  2713. case 98175:
  2714. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2715. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfe4d);
  2716. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x101b599a);
  2717. break;
  2718. case 98304:
  2719. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2720. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfdf8);
  2721. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1020c49c);
  2722. break;
  2723. case 98310:
  2724. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2725. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfdf4);
  2726. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1021051f);
  2727. break;
  2728. case 99000:
  2729. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2730. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfc2f);
  2731. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x103e0000);
  2732. break;
  2733. case 100000:
  2734. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2735. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf9a9);
  2736. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10680000);
  2737. break;
  2738. case 100750:
  2739. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2740. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf7cd);
  2741. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10878000);
  2742. break;
  2743. case 100800:
  2744. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2745. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf7ae);
  2746. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1089999a);
  2747. break;
  2748. case 101250:
  2749. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2750. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf694);
  2751. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x109c8000);
  2752. break;
  2753. case 101376:
  2754. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2755. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf646);
  2756. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10a1cac1);
  2757. break;
  2758. case 101700:
  2759. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2760. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf57d);
  2761. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10af6666);
  2762. break;
  2763. case 102000:
  2764. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2765. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf4c4);
  2766. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10bc0000);
  2767. break;
  2768. case 102300:
  2769. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2770. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf40c);
  2771. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10c8999a);
  2772. break;
  2773. case 102400:
  2774. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2775. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf3cf);
  2776. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10cccccd);
  2777. break;
  2778. case 102850:
  2779. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2780. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf2be);
  2781. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10dfb333);
  2782. break;
  2783. case 103125:
  2784. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2785. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf218);
  2786. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10eb4000);
  2787. break;
  2788. case 103500:
  2789. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2790. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf138);
  2791. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10fb0000);
  2792. break;
  2793. case 104000:
  2794. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2795. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf00f);
  2796. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11100000);
  2797. break;
  2798. case 104448:
  2799. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2800. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xef07);
  2801. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1122d0e5);
  2802. break;
  2803. case 104625:
  2804. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2805. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xeea0);
  2806. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x112a4000);
  2807. break;
  2808. case 105000:
  2809. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2810. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xedc6);
  2811. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x113a0000);
  2812. break;
  2813. case 105090:
  2814. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2815. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xed92);
  2816. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x113dc7ae);
  2817. break;
  2818. case 105600:
  2819. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2820. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xec6c);
  2821. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11533333);
  2822. break;
  2823. case 106250:
  2824. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2825. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xeafa);
  2826. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x116e8000);
  2827. break;
  2828. case 106496:
  2829. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2830. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xea6f);
  2831. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1178d4fe);
  2832. break;
  2833. case 106950:
  2834. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2835. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe970);
  2836. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x118be666);
  2837. break;
  2838. case 107250:
  2839. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2840. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe8c9);
  2841. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11988000);
  2842. break;
  2843. case 107525:
  2844. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2845. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe830);
  2846. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11a40ccd);
  2847. break;
  2848. case 108000:
  2849. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2850. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe72b);
  2851. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11b80000);
  2852. break;
  2853. case 108480:
  2854. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2855. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe625);
  2856. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11cc28f6);
  2857. break;
  2858. case 109375:
  2859. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2860. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe443);
  2861. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11f1c000);
  2862. break;
  2863. case 110400:
  2864. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2865. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe224);
  2866. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x121ccccd);
  2867. break;
  2868. case 110500:
  2869. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2870. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe1f0);
  2871. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12210000);
  2872. break;
  2873. case 110592:
  2874. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2875. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe1c0);
  2876. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1224dd2f);
  2877. break;
  2878. case 111600:
  2879. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2880. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdfb6);
  2881. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x124f3333);
  2882. break;
  2883. case 112000:
  2884. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2885. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdee9);
  2886. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12600000);
  2887. break;
  2888. case 112200:
  2889. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2890. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xde84);
  2891. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12686666);
  2892. break;
  2893. case 112500:
  2894. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2895. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xddec);
  2896. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12750000);
  2897. break;
  2898. case 114000:
  2899. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2900. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdb00);
  2901. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12b40000);
  2902. break;
  2903. case 114750:
  2904. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2905. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd992);
  2906. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12d38000);
  2907. break;
  2908. case 115200:
  2909. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2910. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd8b8);
  2911. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12e66666);
  2912. break;
  2913. case 116000:
  2914. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2915. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd73a);
  2916. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13080000);
  2917. break;
  2918. case 117000:
  2919. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2920. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd563);
  2921. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13320000);
  2922. break;
  2923. case 118125:
  2924. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2925. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd35a);
  2926. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13614000);
  2927. break;
  2928. case 118750:
  2929. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2930. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd23e);
  2931. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x137b8000);
  2932. break;
  2933. case 120000:
  2934. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2935. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd00d);
  2936. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13b00000);
  2937. break;
  2938. case 120250:
  2939. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2940. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xcf9e);
  2941. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13ba8000);
  2942. break;
  2943. default:
  2944. return BBM_NOK;
  2945. }
  2946. #elif (BBM_BAND_WIDTH == 7)
  2947. switch (clk) {
  2948. case 114000:
  2949. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2950. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xff80);
  2951. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10080000);
  2952. break;
  2953. case 114688:
  2954. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2955. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfdf8);
  2956. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1020c49c);
  2957. break;
  2958. case 114750:
  2959. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2960. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfdd5);
  2961. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10230000);
  2962. break;
  2963. case 115200:
  2964. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2965. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfcd7);
  2966. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10333333);
  2967. break;
  2968. case 115260:
  2969. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2970. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfcb5);
  2971. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10355c29);
  2972. break;
  2973. case 115625:
  2974. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2975. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfbe9);
  2976. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10428000);
  2977. break;
  2978. case 116000:
  2979. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2980. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfb19);
  2981. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10500000);
  2982. break;
  2983. case 116250:
  2984. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2985. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfa8e);
  2986. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10590000);
  2987. break;
  2988. case 116736:
  2989. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2990. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf983);
  2991. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x106a7efa);
  2992. break;
  2993. case 116875:
  2994. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  2995. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd59d);
  2996. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x132cc000);
  2997. break;
  2998. case 117000:
  2999. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3000. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf8f3);
  3001. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10740000);
  3002. break;
  3003. case 118125:
  3004. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3005. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf694);
  3006. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x109c8000);
  3007. break;
  3008. case 118650:
  3009. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3010. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf57d);
  3011. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10af6666);
  3012. break;
  3013. case 118750:
  3014. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3015. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf548);
  3016. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10b30000);
  3017. break;
  3018. case 118784:
  3019. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3020. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf536);
  3021. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10b43958);
  3022. break;
  3023. case 119808:
  3024. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3025. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf31d);
  3026. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10d91687);
  3027. break;
  3028. case 120000:
  3029. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3030. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf2ba);
  3031. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10e00000);
  3032. break;
  3033. case 120250:
  3034. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3035. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf239);
  3036. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10e90000);
  3037. break;
  3038. case 120900:
  3039. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3040. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf0eb);
  3041. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11006666);
  3042. break;
  3043. case 121500:
  3044. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3045. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xefbb);
  3046. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11160000);
  3047. break;
  3048. case 121875:
  3049. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3050. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xeefe);
  3051. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11238000);
  3052. break;
  3053. case 122040:
  3054. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3055. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xeeab);
  3056. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x112970a4);
  3057. break;
  3058. case 122880:
  3059. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3060. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xed09);
  3061. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1147ae14);
  3062. break;
  3063. case 123500:
  3064. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3065. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xebd9);
  3066. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x115e0000);
  3067. break;
  3068. case 124000:
  3069. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3070. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xeae5);
  3071. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11700000);
  3072. break;
  3073. case 124800:
  3074. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3075. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe964);
  3076. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x118ccccd);
  3077. break;
  3078. case 124875:
  3079. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3080. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe940);
  3081. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x118f8000);
  3082. break;
  3083. case 125000:
  3084. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3085. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe904);
  3086. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11940000);
  3087. break;
  3088. case 125430:
  3089. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3090. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe838);
  3091. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11a37ae1);
  3092. break;
  3093. case 125550:
  3094. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3095. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe7ff);
  3096. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11a7cccd);
  3097. break;
  3098. case 126000:
  3099. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3100. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe72b);
  3101. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11b80000);
  3102. break;
  3103. case 126750:
  3104. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3105. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe5cd);
  3106. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11d30000);
  3107. break;
  3108. case 126976:
  3109. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3110. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe564);
  3111. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11db22d1);
  3112. break;
  3113. case 128000:
  3114. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3115. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe38e);
  3116. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12000000);
  3117. break;
  3118. case 128250:
  3119. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3120. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe31d);
  3121. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12090000);
  3122. break;
  3123. case 128820:
  3124. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3125. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe21b);
  3126. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x121d851f);
  3127. break;
  3128. case 129024:
  3129. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3130. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe1c0);
  3131. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1224dd2f);
  3132. break;
  3133. case 129600:
  3134. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3135. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe0bf);
  3136. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1239999a);
  3137. break;
  3138. case 130000:
  3139. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3140. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe00e);
  3141. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12480000);
  3142. break;
  3143. case 130200:
  3144. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3145. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdfb6);
  3146. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x124f3333);
  3147. break;
  3148. case 130500:
  3149. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3150. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdf32);
  3151. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x125a0000);
  3152. break;
  3153. case 131072:
  3154. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3155. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xde39);
  3156. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x126e978d);
  3157. break;
  3158. case 131250:
  3159. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3160. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xddec);
  3161. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12750000);
  3162. break;
  3163. case 131625:
  3164. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3165. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdd4a);
  3166. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12828000);
  3167. break;
  3168. case 132000:
  3169. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3170. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdca9);
  3171. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12900000);
  3172. break;
  3173. case 132210:
  3174. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3175. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdc4f);
  3176. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12978f5c);
  3177. break;
  3178. case 134400:
  3179. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3180. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd8b8);
  3181. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12e66666);
  3182. break;
  3183. case 134850:
  3184. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3185. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd7ff);
  3186. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12f6999a);
  3187. break;
  3188. case 135000:
  3189. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3190. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd7c2);
  3191. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12fc0000);
  3192. break;
  3193. case 135168:
  3194. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3195. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd77d);
  3196. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13020c4a);
  3197. break;
  3198. case 136000:
  3199. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3200. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd62c);
  3201. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13200000);
  3202. break;
  3203. case 136500:
  3204. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3205. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd563);
  3206. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13320000);
  3207. break;
  3208. case 139200:
  3209. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3210. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd13f);
  3211. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13933333);
  3212. break;
  3213. case 139500:
  3214. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3215. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd0cc);
  3216. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x139e0000);
  3217. break;
  3218. case 140000:
  3219. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3220. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd00d);
  3221. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13b00000);
  3222. break;
  3223. case 141750:
  3224. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3225. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xcd7b);
  3226. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13ef0000);
  3227. break;
  3228. default:
  3229. return BBM_NOK;
  3230. }
  3231. #else /* BBM_BAND_WIDTH == 8) */
  3232. switch (clk) {
  3233. case 130200:
  3234. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3235. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xffab);
  3236. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10054ccd);
  3237. break;
  3238. case 130500:
  3239. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3240. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xff15);
  3241. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x100ec000);
  3242. break;
  3243. case 130900:
  3244. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3245. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xbeba);
  3246. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1579cccd);
  3247. break;
  3248. case 131072:
  3249. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3250. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfdf8);
  3251. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1020c49c);
  3252. break;
  3253. case 131250:
  3254. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3255. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfda0);
  3256. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10266000);
  3257. break;
  3258. case 131625:
  3259. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3260. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfce7);
  3261. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10323000);
  3262. break;
  3263. case 132000:
  3264. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3265. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfc2f);
  3266. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x103e0000);
  3267. break;
  3268. case 132210:
  3269. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3270. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xfbc8);
  3271. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10449d71);
  3272. break;
  3273. case 134400:
  3274. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3275. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf7ae);
  3276. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1089999a);
  3277. break;
  3278. case 134850:
  3279. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3280. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf6da);
  3281. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1097c666);
  3282. break;
  3283. case 135000:
  3284. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3285. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf694);
  3286. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x109c8000);
  3287. break;
  3288. case 135168:
  3289. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3290. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf646);
  3291. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10a1cac1);
  3292. break;
  3293. case 135600:
  3294. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3295. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf57d);
  3296. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10af6666);
  3297. break;
  3298. case 136000:
  3299. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3300. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf4c4);
  3301. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10bc0000);
  3302. break;
  3303. case 136500:
  3304. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3305. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf3de);
  3306. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10cbc000);
  3307. break;
  3308. case 137500:
  3309. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3310. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf218);
  3311. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10eb4000);
  3312. break;
  3313. case 138000:
  3314. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3315. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xf138);
  3316. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x10fb0000);
  3317. break;
  3318. case 139200:
  3319. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3320. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xef24);
  3321. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1120cccd);
  3322. break;
  3323. case 139264:
  3324. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3325. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xef07);
  3326. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1122d0e5);
  3327. break;
  3328. case 139500:
  3329. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3330. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xeea0);
  3331. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x112a4000);
  3332. break;
  3333. case 140000:
  3334. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3335. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xedc6);
  3336. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x113a0000);
  3337. break;
  3338. case 141312:
  3339. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3340. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xeb91);
  3341. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x116353f8);
  3342. break;
  3343. case 141750:
  3344. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3345. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xead6);
  3346. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11712000);
  3347. break;
  3348. case 142380:
  3349. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3350. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe9cc);
  3351. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1184f852);
  3352. break;
  3353. case 143000:
  3354. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3355. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe8c9);
  3356. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11988000);
  3357. break;
  3358. case 143360:
  3359. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3360. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe833);
  3361. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11a3d70a);
  3362. break;
  3363. case 143750:
  3364. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3365. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe792);
  3366. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11b02000);
  3367. break;
  3368. case 144000:
  3369. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3370. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe72b);
  3371. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11b80000);
  3372. break;
  3373. case 144150:
  3374. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3375. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe6ed);
  3376. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x11bcb99a);
  3377. break;
  3378. case 147456:
  3379. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3380. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe1c0);
  3381. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1224dd2f);
  3382. break;
  3383. case 148500:
  3384. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3385. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xe02a);
  3386. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1245c000);
  3387. break;
  3388. case 149500:
  3389. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3390. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdeaa);
  3391. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12654000);
  3392. break;
  3393. case 150000:
  3394. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3395. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xddec);
  3396. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12750000);
  3397. break;
  3398. case 152000:
  3399. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3400. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xdb00);
  3401. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12b40000);
  3402. break;
  3403. case 153000:
  3404. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3405. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd992);
  3406. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12d38000);
  3407. break;
  3408. case 153450:
  3409. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3410. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd8ee);
  3411. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12e1accd);
  3412. break;
  3413. case 153600:
  3414. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3415. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd8b8);
  3416. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x12e66666);
  3417. break;
  3418. case 156000:
  3419. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3420. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd563);
  3421. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13320000);
  3422. break;
  3423. case 156250:
  3424. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3425. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd50b);
  3426. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x1339e000);
  3427. break;
  3428. case 157500:
  3429. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3430. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd35a);
  3431. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13614000);
  3432. break;
  3433. case 158100:
  3434. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3435. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd28d);
  3436. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13742666);
  3437. break;
  3438. case 158400:
  3439. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3440. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd227);
  3441. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x137d999a);
  3442. break;
  3443. case 159744:
  3444. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3445. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xd062);
  3446. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13a7ef9e);
  3447. break;
  3448. case 162000:
  3449. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3450. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xcd7b);
  3451. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13ef0000);
  3452. break;
  3453. case 162500:
  3454. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3455. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xccda);
  3456. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x13fec000);
  3457. break;
  3458. case 165888:
  3459. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3460. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xc8ab);
  3461. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x146978d5);
  3462. break;
  3463. case 169000:
  3464. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3465. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xc4f9);
  3466. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x14cb8000);
  3467. break;
  3468. case 172032:
  3469. bbm_word_write(handle, devid, BBM_LOW_IF_VALUE, 0x0);
  3470. bbm_long_write(handle, devid, BBM_FREQ_COMPEN_VAL0, 0xc180);
  3471. bbm_long_write(handle, devid, BBM_NCO_OFFSET, 0x152b020c);
  3472. break;
  3473. default:
  3474. return BBM_NOK;
  3475. }
  3476. #endif /* #if (BBM_BAND_WIDTH == 6) */
  3477. return BBM_OK;
  3478. }
  3479. static s32 fc8300_set_default_core_clk(HANDLE handle, DEVICEID devid)
  3480. {
  3481. u16 pll_set = 0x1a11;
  3482. #if (BBM_BAND_WIDTH == 6)
  3483. if (bbm_xtal_freq == 16000)
  3484. pll_set = 0x1711;
  3485. else if (bbm_xtal_freq == 16384)
  3486. pll_set = 0x1611;
  3487. else if (bbm_xtal_freq == 18000)
  3488. pll_set = 0x1411;
  3489. else if (bbm_xtal_freq == 19200)
  3490. pll_set = 0x1311;
  3491. else if (bbm_xtal_freq == 24000)
  3492. pll_set = 0x1f12;
  3493. else if (bbm_xtal_freq == 24576)
  3494. pll_set = 0x1e12;
  3495. else if (bbm_xtal_freq == 26000)
  3496. pll_set = 0x1d12;
  3497. else if(bbm_xtal_freq == 27000)
  3498. pll_set = 0x1b12;
  3499. else if (bbm_xtal_freq == 27120)
  3500. pll_set = 0x1b12;
  3501. else if (bbm_xtal_freq == 32000)
  3502. pll_set = 0x1712;
  3503. else if (bbm_xtal_freq == 37200)
  3504. pll_set = 0x1312;
  3505. else if (bbm_xtal_freq == 37400)
  3506. pll_set = 0x1312;
  3507. else if (bbm_xtal_freq == 38400)
  3508. pll_set = 0x1312;
  3509. #elif (BBM_BAND_WIDTH == 7)
  3510. if (bbm_xtal_freq == 16000)
  3511. pll_set = 0x1b11;
  3512. else if(bbm_xtal_freq == 16384)
  3513. pll_set = 0x1a11;
  3514. else if (bbm_xtal_freq == 18000)
  3515. pll_set = 0x1811;
  3516. else if (bbm_xtal_freq == 19200)
  3517. pll_set = 0x1611;
  3518. else if (bbm_xtal_freq == 24000)
  3519. pll_set = 0x2412;
  3520. else if (bbm_xtal_freq == 24576)
  3521. pll_set = 0x2412;
  3522. else if (bbm_xtal_freq == 26000)
  3523. pll_set = 0x2212;
  3524. else if (bbm_xtal_freq == 27000)
  3525. pll_set = 0x2012;
  3526. else if (bbm_xtal_freq == 27120)
  3527. pll_set = 0x2012;
  3528. else if (bbm_xtal_freq == 32000)
  3529. pll_set = 0x1b12;
  3530. else if (bbm_xtal_freq == 37200)
  3531. pll_set = 0x1712;
  3532. else if (bbm_xtal_freq == 37400)
  3533. pll_set = 0x1712;
  3534. else if (bbm_xtal_freq == 38400)
  3535. pll_set = 0x1612;
  3536. #else /* BBM_BAND_WIDTH == 8 */
  3537. if (bbm_xtal_freq == 16000)
  3538. pll_set = 0x1f11;
  3539. else if (bbm_xtal_freq == 16384)
  3540. pll_set = 0x1e11;
  3541. else if (bbm_xtal_freq == 18000)
  3542. pll_set = 0x1b11;
  3543. else if(bbm_xtal_freq == 19200)
  3544. pll_set = 0x1a11;
  3545. else if (bbm_xtal_freq == 24000)
  3546. pll_set = 0x1402;
  3547. else if (bbm_xtal_freq == 24576)
  3548. pll_set = 0x1402;
  3549. else if (bbm_xtal_freq == 26000)
  3550. pll_set = 0x1302;
  3551. else if (bbm_xtal_freq == 27000)
  3552. pll_set = 0x2512;
  3553. else if (bbm_xtal_freq == 27120)
  3554. pll_set = 0x2512;
  3555. else if (bbm_xtal_freq == 32000)
  3556. pll_set = 0x1f12;
  3557. else if(bbm_xtal_freq == 37200)
  3558. pll_set = 0x1a12;
  3559. else if (bbm_xtal_freq == 37400)
  3560. pll_set = 0x1a12;
  3561. else if (bbm_xtal_freq == 38400)
  3562. pll_set = 0x1a12;
  3563. #endif /* BBM_BAND_WIDTH */
  3564. bbm_byte_write(handle, devid, BBM_PLL_SEL, 0x00);
  3565. bbm_byte_write(handle, devid, BBM_PLL1_RESET, 0x01);
  3566. bbm_word_write(handle, devid, BBM_PLL1_PRE_POST_SELECTION, pll_set);
  3567. bbm_byte_write(handle, devid, BBM_PLL1_RESET, 0x00);
  3568. msWait(1);
  3569. bbm_byte_write(handle, devid, BBM_PLL_SEL, 0x01);
  3570. return fc8300_get_current_clk(handle, devid);
  3571. }
  3572. #ifdef BBM_I2C_TSIF
  3573. static s32 fc8300_set_tsif_clk(HANDLE handle, DEVICEID devid)
  3574. {
  3575. bbm_byte_write(handle, devid, BBM_TS_CLK_DIV, 0x00);
  3576. #ifdef BBM_TSIF_CLK_ARBITRARY
  3577. u32 pre_sel, post_sel = 0, multi = 0, div_sel;
  3578. u32 input_freq;
  3579. u32 multi_3, multi_2, multi_1;
  3580. if (bbm_xtal_freq <= 10000)
  3581. pre_sel = 0;
  3582. else if (bbm_xtal_freq <= 20000)
  3583. pre_sel = 1;
  3584. else if (bbm_xtal_freq <= 40000)
  3585. pre_sel = 2;
  3586. else
  3587. pre_sel = 3;
  3588. input_freq = bbm_xtal_freq >> pre_sel;
  3589. multi_3 = (BBM_TSIF_CLK << 3) / input_freq;
  3590. multi_2 = (BBM_TSIF_CLK << 2) / input_freq;
  3591. multi_1 = (BBM_TSIF_CLK << 1) / input_freq;
  3592. if (multi_3 >= 10 && multi_3 <= 40) {
  3593. post_sel = 3;
  3594. multi = multi_3;
  3595. } else if (multi_2 >= 10 && multi_2 <= 40) {
  3596. post_sel = 2;
  3597. multi = multi_2;
  3598. } else if (multi_1 >= 10 && multi_1 <= 40) {
  3599. post_sel = 1;
  3600. multi = multi_1;
  3601. } else { /* post_sel == 0 */
  3602. multi = BBM_TSIF_CLK / input_freq;
  3603. }
  3604. div_sel = multi - 2;
  3605. /*pll_out = (input_freq * multi) >> post_sel;*/
  3606. bbm_byte_write(handle, devid, BBM_PLL2_ENABLE, 0x01);
  3607. bbm_byte_write(handle, devid, BBM_PLL2_PD, 0x00);
  3608. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION,
  3609. (post_sel << 4) | pre_sel | (div_sel << 8));
  3610. #else
  3611. bbm_byte_write(handle, devid, BBM_PLL2_ENABLE, 0x01);
  3612. bbm_byte_write(handle, devid, BBM_PLL2_PD, 0x00);
  3613. #if (BBM_TSIF_CLK == 48000)
  3614. if (bbm_xtal_freq == 16000)
  3615. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1621);
  3616. else if (bbm_xtal_freq == 16384)
  3617. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1521);
  3618. else if (bbm_xtal_freq == 18000)
  3619. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1321);
  3620. else if (bbm_xtal_freq == 19200)
  3621. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1221);
  3622. else if (bbm_xtal_freq == 24000)
  3623. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1e22);
  3624. else if (bbm_xtal_freq == 24576)
  3625. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1d22);
  3626. else if (bbm_xtal_freq == 26000)
  3627. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1c22);
  3628. else if (bbm_xtal_freq == 27000)
  3629. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1b22);
  3630. else if (bbm_xtal_freq == 27120)
  3631. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1a22);
  3632. else if (bbm_xtal_freq == 32000)
  3633. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1622);
  3634. else if (bbm_xtal_freq == 37200)
  3635. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1322);
  3636. else if (bbm_xtal_freq == 37400)
  3637. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1322);
  3638. else if (bbm_xtal_freq == 38400)
  3639. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1222);
  3640. #elif (BBM_TSIF_CLK == 32000)
  3641. if (bbm_xtal_freq == 16000)
  3642. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0e21);
  3643. else if (bbm_xtal_freq == 16384)
  3644. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0e21);
  3645. else if (bbm_xtal_freq == 18000)
  3646. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0c21);
  3647. else if (bbm_xtal_freq == 19200)
  3648. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0b21);
  3649. else if (bbm_xtal_freq == 24000)
  3650. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1322);
  3651. else if (bbm_xtal_freq == 24576)
  3652. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1322);
  3653. else if (bbm_xtal_freq == 26000)
  3654. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1222);
  3655. else if (bbm_xtal_freq == 27000)
  3656. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1122);
  3657. else if (bbm_xtal_freq == 27120)
  3658. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x1122);
  3659. else if (bbm_xtal_freq == 32000)
  3660. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0e22);
  3661. else if (bbm_xtal_freq == 37200)
  3662. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0c22);
  3663. else if (bbm_xtal_freq == 37400)
  3664. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0c22);
  3665. else if (bbm_xtal_freq == 38400)
  3666. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0b22);
  3667. #else /* (BBM_TSIF_CLK == 26000) */
  3668. if (bbm_xtal_freq == 16000)
  3669. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0b21);
  3670. else if (bbm_xtal_freq == 16384)
  3671. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0b21);
  3672. else if (bbm_xtal_freq == 18000)
  3673. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0921);
  3674. else if (bbm_xtal_freq == 19200)
  3675. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0921);
  3676. else if (bbm_xtal_freq == 24000)
  3677. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0f22);
  3678. else if (bbm_xtal_freq == 24576)
  3679. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0f22);
  3680. else if (bbm_xtal_freq == 26000)
  3681. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0e22);
  3682. else if (bbm_xtal_freq == 27000)
  3683. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0d22);
  3684. else if (bbm_xtal_freq == 27120)
  3685. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0d22);
  3686. else if (bbm_xtal_freq == 32000)
  3687. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0b22);
  3688. else if (bbm_xtal_freq == 37200)
  3689. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0922);
  3690. else if (bbm_xtal_freq == 37400)
  3691. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0922);
  3692. else if (bbm_xtal_freq == 38400)
  3693. bbm_word_write(handle, devid, BBM_PLL2_PRE_POST_SELECTION, 0x0922);
  3694. #endif /* #if (BBM_TSIF_CLK == 48000) */
  3695. #endif /* #ifdef BBM_TSIF_CLK_ARBITRARY */
  3696. bbm_byte_write(handle, devid, BBM_PLL2_RESET, 0x00);
  3697. return BBM_OK;
  3698. }
  3699. #endif /* #ifdef BBM_I2C_TSIF */
  3700. s32 fc8300_reset(HANDLE handle, DEVICEID devid)
  3701. {
  3702. bbm_byte_write(handle, DIV_BROADCAST, BBM_SW_RESET, 0x7f);
  3703. msWait(2);
  3704. bbm_byte_write(handle, DIV_BROADCAST, BBM_SW_RESET, 0xcf);
  3705. msWait(2);
  3706. bbm_byte_write(handle, DIV_MASTER, BBM_SW_RESET, 0xff);
  3707. msWait(2);
  3708. return BBM_OK;
  3709. }
  3710. s32 fc8300_probe(HANDLE handle, DEVICEID devid)
  3711. {
  3712. u16 ver;
  3713. print_log(0," %s\n",__func__);
  3714. bbm_word_read(handle, devid, BBM_CHIP_ID, &ver);
  3715. return (ver == 0x8300) ? BBM_OK : BBM_NOK;
  3716. }
  3717. s32 fc8300_set_core_clk(HANDLE handle, DEVICEID devid,
  3718. enum BROADCAST_TYPE broadcast, u32 freq)
  3719. {
  3720. u32 input_freq, new_pll_clk;
  3721. u32 pre_sel, post_sel = 0, multi = 0, div_sel;
  3722. u32 current_clk, new_clk, pll_set;
  3723. u32 multi_3, multi_2, multi_1;
  3724. s32 res = BBM_OK;
  3725. current_clk = fc8300_get_current_clk(handle, devid);
  3726. new_clk = fc8300_get_core_clk(handle, devid, broadcast, freq);
  3727. if (new_clk == current_clk)
  3728. return BBM_OK;
  3729. if (bbm_xtal_freq <= 10000)
  3730. pre_sel = 0;
  3731. else if (bbm_xtal_freq <= 20000)
  3732. pre_sel = 1;
  3733. else if (bbm_xtal_freq <= 40000)
  3734. pre_sel = 2;
  3735. else
  3736. pre_sel = 3;
  3737. input_freq = bbm_xtal_freq >> pre_sel;
  3738. multi_3 = (new_clk << 3) / input_freq;
  3739. multi_2 = (new_clk << 2) / input_freq;
  3740. multi_1 = (new_clk << 1) / input_freq;
  3741. if (multi_3 >= 10 && multi_3 <= 40) {
  3742. post_sel = 3;
  3743. multi = multi_3;
  3744. } else if (multi_2 >= 10 && multi_2 <= 40) {
  3745. post_sel = 2;
  3746. multi = multi_2;
  3747. } else if (multi_1 >= 10 && multi_1 <= 40) {
  3748. post_sel = 1;
  3749. multi = multi_1;
  3750. } else { /* post_sel == 0 */
  3751. multi = new_clk / input_freq;
  3752. }
  3753. new_pll_clk = (input_freq * multi) >> post_sel;
  3754. if (new_clk != new_pll_clk)
  3755. return BBM_NOK;
  3756. div_sel = multi - 2;
  3757. bbm_byte_write(handle, devid, BBM_PLL_SEL, 0x00);
  3758. bbm_byte_write(handle, devid, BBM_PLL1_RESET, 0x01);
  3759. pll_set = (div_sel << 8) | (post_sel << 4) | pre_sel;
  3760. bbm_word_write(handle, devid, BBM_PLL1_PRE_POST_SELECTION, pll_set);
  3761. bbm_byte_write(handle, devid, BBM_PLL1_RESET, 0x00);
  3762. msWait(1);
  3763. bbm_byte_write(handle, devid, BBM_PLL_SEL, 0x01);
  3764. switch (broadcast) {
  3765. case ISDBT_1SEG:
  3766. case ISDBTMM_1SEG:
  3767. case ISDBTSB_1SEG:
  3768. case ISDBT_CATV_1SEG:
  3769. res |= fc8300_set_cal_front_1seg(handle, devid, new_clk);
  3770. break;
  3771. case ISDBTSB_3SEG:
  3772. res |= fc8300_set_cal_front_3seg(handle, devid, new_clk);
  3773. break;
  3774. case ISDBT_13SEG:
  3775. case ISDBTMM_13SEG:
  3776. case ISDBT_CATV_13SEG:
  3777. res |= fc8300_set_cal_front_13seg(handle, devid, new_clk);
  3778. break;
  3779. }
  3780. switch (broadcast) {
  3781. case ISDBT_1SEG:
  3782. case ISDBT_CATV_1SEG:
  3783. res |= fc8300_set_acif_b31_1seg(handle, devid, new_clk);
  3784. break;
  3785. case ISDBTMM_1SEG:
  3786. case ISDBTSB_1SEG:
  3787. res |= fc8300_set_acif_1seg(handle, devid, new_clk);
  3788. break;
  3789. case ISDBTSB_3SEG:
  3790. res |= fc8300_set_acif_3seg(handle, devid, new_clk);
  3791. break;
  3792. case ISDBT_13SEG:
  3793. case ISDBTMM_13SEG:
  3794. case ISDBT_CATV_13SEG:
  3795. res |= fc8300_set_acif_13seg(handle, devid, new_clk);
  3796. break;
  3797. }
  3798. return res;
  3799. }
  3800. s32 fc8300_init(HANDLE handle, DEVICEID devid)
  3801. {
  3802. #if defined(BBM_4_DIVERSITY) /* Don't change following lines */
  3803. bbm_byte_write(handle, DIV_MASTER, BBM_XTAL_OUTBUF_EN, 0x01);
  3804. msWait(1);
  3805. bbm_byte_write(handle, DIV_SLAVE2, BBM_XTAL_OUTBUF_EN, 0x01);
  3806. msWait(1);
  3807. bbm_byte_write(handle, DIV_SLAVE1, BBM_XTAL_OUTBUF_EN, 0x01);
  3808. msWait(1);
  3809. #ifdef BBM_I2C_TSIF
  3810. #ifdef BBM_TS_204
  3811. bbm_byte_write(handle, DIV_MASTER, BBM_TS_SEL, 0xc0);
  3812. #else
  3813. bbm_byte_write(handle, DIV_MASTER, BBM_TS_SEL, 0x80);
  3814. #endif /* #ifdef BBM_TS_204 */
  3815. #endif /* #ifdef BBM_I2C_TSIF */
  3816. #else
  3817. #ifdef BBM_I2C_TSIF
  3818. #ifdef BBM_TS_204
  3819. bbm_byte_write(handle, DIV_MASTER, BBM_TS_SEL, 0xc0);
  3820. #else
  3821. bbm_byte_write(handle, DIV_MASTER, BBM_TS_SEL, 0x80);
  3822. #endif /* #ifdef BBM_TS_204 */
  3823. #endif /* #ifdef BBM_I2C_TSIF */
  3824. #if defined(BBM_2_DIVERSITY)
  3825. bbm_byte_write(handle, DIV_MASTER, BBM_XTAL_OUTBUF_EN, 0x01);
  3826. msWait(1);
  3827. #endif /* #ifdef BBM_2_DIVERSITY */
  3828. #endif
  3829. if (bbm_xtal_freq < 30000)
  3830. bbm_byte_write(handle, DIV_BROADCAST, BBM_FUSELOAD, 0x03);
  3831. else
  3832. bbm_byte_write(handle, DIV_BROADCAST, BBM_FUSELOAD, 0x07);
  3833. msWait(1);
  3834. bbm_byte_write(handle, DIV_BROADCAST, BBM_FUSELOAD, 0x00);
  3835. bbm_byte_write(handle, DIV_BROADCAST, BBM_PLL1_ENABLE, 0x01);
  3836. bbm_byte_write(handle, DIV_BROADCAST, BBM_PLL1_PD, 0x00);
  3837. fc8300_set_default_core_clk(handle, DIV_BROADCAST);
  3838. #ifdef BBM_I2C_TSIF
  3839. fc8300_set_tsif_clk(handle, DIV_MASTER);
  3840. #endif
  3841. #ifdef BBM_2_DIVERSITY
  3842. bbm_byte_write(handle, DIV_MASTER, BBM_DIVERSITY_DEVICE_SEL, 0x01);
  3843. bbm_byte_write(handle, DIV_MASTER, BBM_DIVERSITY_MODE, 0x00);
  3844. bbm_byte_write(handle, DIV_SLAVE0, BBM_DIVERSITY_DEVICE_SEL, 0x02);
  3845. bbm_byte_write(handle, DIV_SLAVE0, BBM_DIVERSITY_MODE, 0x01);
  3846. bbm_byte_write(handle, DIV_SLAVE0, BBM_RESYNC_ENABLE, 0x8f);
  3847. bbm_byte_write(handle, DIV_BROADCAST, BBM_DIVERSITY_EN, 0x21);
  3848. bbm_byte_write(handle, DIV_SLAVE0, BBM_RESTART_BY_TS_EN, 0x00);
  3849. #endif /* BBM_2_DIVERSITY */
  3850. #ifdef BBM_4_DIVERSITY /* I2C+TSIF or I2C+SPI */
  3851. bbm_byte_write(handle, DIV_MASTER, BBM_DIVERSITY_DEVICE_SEL, 0x01);
  3852. bbm_byte_write(handle, DIV_MASTER, BBM_DIVERSITY_MODE, 0x00);
  3853. /* end slave */
  3854. bbm_byte_write(handle, DIV_SLAVE0, BBM_DIVERSITY_DEVICE_SEL, 0x02);
  3855. bbm_byte_write(handle, DIV_SLAVE0, BBM_DIVERSITY_MODE, 0x03);
  3856. bbm_byte_write(handle, DIV_SLAVE0, BBM_RESYNC_ENABLE, 0x8f);
  3857. /* 2nd slave */
  3858. bbm_byte_write(handle, DIV_SLAVE1, BBM_DIVERSITY_DEVICE_SEL, 0x03);
  3859. bbm_byte_write(handle, DIV_SLAVE1, BBM_DIVERSITY_MODE, 0x02);
  3860. bbm_byte_write(handle, DIV_SLAVE1, BBM_RESYNC_ENABLE, 0x8f);
  3861. bbm_word_write(handle, DIV_SLAVE1, BBM_D_SYNC_TIME_OUT_TH, 0x0100);
  3862. /* 1st slave */
  3863. bbm_byte_write(handle, DIV_SLAVE2, BBM_DIVERSITY_DEVICE_SEL, 0x03);
  3864. bbm_byte_write(handle, DIV_SLAVE2, BBM_DIVERSITY_MODE, 0x01);
  3865. bbm_byte_write(handle, DIV_SLAVE2, BBM_RESYNC_ENABLE, 0x8f);
  3866. bbm_word_write(handle, DIV_SLAVE2, BBM_D_SYNC_TIME_OUT_TH, 0x0200);
  3867. bbm_byte_write(handle, DIV_BROADCAST, BBM_DIVERSITY_EN, 0x41);
  3868. bbm_byte_write(handle, DIV_SLAVE0, BBM_RESTART_BY_TS_EN, 0x00);
  3869. bbm_byte_write(handle, DIV_SLAVE1, BBM_RESTART_BY_TS_EN, 0x00);
  3870. bbm_byte_write(handle, DIV_SLAVE2, BBM_RESTART_BY_TS_EN, 0x00);
  3871. #endif /* BBM_4_DIVERSITY */
  3872. fc8300_reset(handle, DIV_BROADCAST);
  3873. bbm_byte_write(handle, DIV_BROADCAST, BBM_ADC_PWRDN, 0x00);
  3874. bbm_byte_write(handle, DIV_BROADCAST, BBM_ADC_RST, 0x00);
  3875. bbm_byte_write(handle, DIV_BROADCAST, BBM_ADC_BIAS, 0x06);
  3876. bbm_byte_write(handle, DIV_BROADCAST, BBM_BB2RF_RFEN, 0x01);
  3877. bbm_byte_write(handle, DIV_BROADCAST, BBM_RF_RST, 0x00);
  3878. bbm_byte_write(handle, DIV_BROADCAST, BBM_RF_POWER_SAVE, 0x00);
  3879. bbm_long_write(handle, DIV_BROADCAST, BBM_MEMORY_RWM0, 0x07777777);
  3880. bbm_byte_write(handle, DIV_BROADCAST, BBM_IQC_EN, 0x71);
  3881. bbm_byte_write(handle, DIV_BROADCAST, BBM_CSF_GAIN_MAX, 0x0a);
  3882. bbm_byte_write(handle, DIV_BROADCAST, BBM_ADC_CTRL, 0x27);
  3883. bbm_byte_write(handle, DIV_BROADCAST, BBM_PSAT_ON_REF_1SEG_QPSK, 0x16);
  3884. bbm_byte_write(handle, DIV_BROADCAST, BBM_PSAT_ON_REF_1SEG_16QAM, 0x16);
  3885. bbm_byte_write(handle, DIV_BROADCAST, BBM_HOLD_RST_EN, 0x06);
  3886. bbm_word_write(handle, DIV_BROADCAST, BBM_REF_DELAY_POST, 0x1900);
  3887. bbm_word_write(handle, DIV_BROADCAST, BBM_REF_AMP, 0x03e0);
  3888. bbm_word_write(handle, DIV_BROADCAST, BBM_AD_GAIN_PERIOD, 0x003f);
  3889. bbm_word_write(handle, DIV_BROADCAST, BBM_FD_RD_LATENCY_1SEG, 0x0620);
  3890. bbm_byte_write(handle, DIV_MASTER, BBM_FD_OUT_MODE, 0x02);
  3891. bbm_byte_write(handle, DIV_MASTER, BBM_DIV_START_MODE, 0x16);
  3892. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_TS0_START, TS0_BUF_START);
  3893. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_TS0_END, TS0_BUF_END);
  3894. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_TS0_THR, TS0_BUF_THR);
  3895. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_A_START,
  3896. AC_A_BUF_START);
  3897. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_A_END, AC_A_BUF_END);
  3898. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_A_THR, AC_A_BUF_THR);
  3899. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_B_START,
  3900. AC_B_BUF_START);
  3901. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_B_END, AC_B_BUF_END);
  3902. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_B_THR, AC_B_BUF_THR);
  3903. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_C_START,
  3904. AC_C_BUF_START);
  3905. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_C_END, AC_C_BUF_END);
  3906. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_C_THR, AC_C_BUF_THR);
  3907. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_D_START,
  3908. AC_D_BUF_START);
  3909. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_D_END, AC_D_BUF_END);
  3910. bbm_word_write(handle, DIV_BROADCAST, BBM_BUF_AC_D_THR, AC_D_BUF_THR);
  3911. #ifdef BBM_I2C_SPI
  3912. bbm_byte_write(handle, DIV_MASTER, BBM_BUF_SPIOUT, 0x10);
  3913. #endif
  3914. #ifdef BBM_I2C_PARALLEL_TSIF
  3915. bbm_byte_write(handle, DIV_MASTER, BBM_TS_CTRL, 0x8e);
  3916. #endif
  3917. #ifdef BBM_AUX_INT
  3918. bbm_byte_write(handle, DIV_MASTER, BBM_SYS_MD_INT_EN, 0x7f);
  3919. bbm_byte_write(handle, DIV_MASTER, BBM_AUX_INT_EN, 0xff);
  3920. bbm_byte_write(handle, DIV_MASTER, BBM_FEC_INT_EN, 0x07);
  3921. bbm_byte_write(handle, DIV_MASTER, BBM_BER_AUTO_UP, 0xff);
  3922. bbm_byte_write(handle, DIV_MASTER, BBM_OSS_CFG_EN, 0x01);
  3923. #endif
  3924. #ifdef BBM_NULL_PID_FILTER
  3925. bbm_byte_write(handle, DIV_MASTER, BBM_NULL_PID_FILTERING, 0x01);
  3926. #endif
  3927. #ifdef BBM_FAIL_FRAME
  3928. bbm_byte_write(handle, DIV_MASTER, BBM_FAIL_FRAME_TX, 0x07);
  3929. #endif
  3930. #ifdef BBM_TS_204
  3931. bbm_byte_write(handle, DIV_MASTER, BBM_FEC_CTRL_A, 0x03);
  3932. bbm_byte_write(handle, DIV_MASTER, BBM_FEC_CTRL_B, 0x03);
  3933. bbm_byte_write(handle, DIV_MASTER, BBM_FEC_CTRL_C, 0x03);
  3934. bbm_byte_write(handle, DIV_MASTER, BBM_FEC_CTRL, 0x03);
  3935. #endif
  3936. bbm_byte_write(handle, DIV_BROADCAST, BBM_FAIP_MTD_SR_SHIFT_VALUE, 0x10);
  3937. bbm_byte_write(handle, DIV_BROADCAST, BBM_CIR_THR_23, 0x02);
  3938. #ifdef BBM_INT_LOW_ACTIVE
  3939. bbm_byte_write(handle, DIV_BROADCAST, BBM_INT_POLAR_SEL, 0x00);
  3940. #endif
  3941. #ifdef BBM_SPI_30M
  3942. bbm_byte_write(handle, DIV_BROADCAST, BBM_MD_MISO, 0x1f);
  3943. #endif
  3944. #ifdef BBM_DESCRAMBLER
  3945. bbm_byte_write(handle, DIV_BROADCAST, BBM_BCAS_ENABLE, 0x01);
  3946. #else
  3947. bbm_byte_write(handle, DIV_BROADCAST, BBM_BCAS_ENABLE, 0x00);
  3948. #endif
  3949. bbm_word_write(handle, DIV_BROADCAST, 0x30b6, 0x0500);
  3950. bbm_byte_write(handle, DIV_BROADCAST, 0x30b8, 0x0f);
  3951. bbm_byte_write(handle, DIV_MASTER, BBM_INT_AUTO_CLEAR, 0x01);
  3952. bbm_byte_write(handle, DIV_MASTER, BBM_BUF_ENABLE, 0x01);
  3953. bbm_byte_write(handle, DIV_MASTER, BBM_BUF_INT_ENABLE, 0x01);
  3954. bbm_byte_write(handle, DIV_MASTER, BBM_INT_MASK, 0x01);
  3955. bbm_byte_write(handle, DIV_MASTER, BBM_INT_STS_EN, 0x01);
  3956. return BBM_OK;
  3957. }
  3958. s32 fc8300_deinit(HANDLE handle, DEVICEID devid)
  3959. {
  3960. #ifdef BBM_I2C_TSIF
  3961. bbm_byte_write(handle, DIV_MASTER, BBM_TS_SEL, 0x00);
  3962. msWait(24);
  3963. #endif
  3964. bbm_byte_write(handle, devid, BBM_SW_RESET, 0x00);
  3965. return BBM_OK;
  3966. }
  3967. #if defined(BBM_2_DIVERSITY) || defined(BBM_4_DIVERSITY)
  3968. s32 fc8300_scan_status(HANDLE handle, DEVICEID devid)
  3969. {
  3970. u32 ifagc_timeout = 70;
  3971. u32 ofdm_timeout = 160;
  3972. u32 ffs_lock_timeout = 100;
  3973. u32 cfs_timeout = 120;
  3974. u32 tmcc_timeout = 1050;
  3975. u32 ts_err_free_timeout = 0;
  3976. u32 data = 0;
  3977. u8 a, run;
  3978. u32 i;
  3979. #ifdef BBM_2_DIVERSITY
  3980. u8 done = 0x03;
  3981. #else
  3982. u8 done = 0x0f;
  3983. #endif
  3984. print_log(0,"ISDBT fc8300_scan_status BBM_2_DIVERSITY\n");
  3985. for (i = 0; i < ifagc_timeout; i++) {
  3986. bbm_byte_read(handle, DIV_MASTER, 0x3025, &a);
  3987. if (a & 0x01)
  3988. break;
  3989. bbm_byte_read(handle, DIV_SLAVE0, 0x3025, &a);
  3990. if (a & 0x01)
  3991. break;
  3992. #ifdef BBM_4_DIVERSITY
  3993. bbm_byte_read(handle, DIV_SLAVE1, 0x3025, &a);
  3994. if (a & 0x01)
  3995. break;
  3996. bbm_byte_read(handle, DIV_SLAVE2, 0x3025, &a);
  3997. if (a & 0x01)
  3998. break;
  3999. #endif
  4000. msWait(SCAN_CHK_PERIOD);
  4001. }
  4002. if (i == ifagc_timeout)
  4003. return BBM_NOK;
  4004. for (run = done; i < ofdm_timeout; i++) {
  4005. if (run & 0x01) {
  4006. bbm_byte_read(handle, DIV_MASTER, 0x3025, &a);
  4007. if (a & 0x08) {
  4008. if (a & 0x04)
  4009. break;
  4010. run -= 0x01; /* master done */
  4011. }
  4012. }
  4013. if (run & 0x02) {
  4014. bbm_byte_read(handle, DIV_SLAVE0, 0x3025, &a);
  4015. if (a & 0x08) {
  4016. if (a & 0x04)
  4017. break;
  4018. run -= 0x02; /* slave0 done */
  4019. }
  4020. }
  4021. #ifdef BBM_4_DIVERSITY
  4022. if (run & 0x04) {
  4023. bbm_byte_read(handle, DIV_SLAVE1, 0x3025, &a);
  4024. if (a & 0x08) {
  4025. if (a & 0x04)
  4026. break;
  4027. run -= 0x04; /* slave1 done */
  4028. }
  4029. }
  4030. if (run & 0x08) {
  4031. bbm_byte_read(handle, DIV_SLAVE2, 0x3025, &a);
  4032. if (a & 0x08) {
  4033. if (a & 0x04)
  4034. break;
  4035. run -= 0x08; /* slave2 done */
  4036. }
  4037. }
  4038. #endif
  4039. if (run == 0)
  4040. return BBM_NOK;
  4041. msWait(SCAN_CHK_PERIOD);
  4042. }
  4043. if (i == ofdm_timeout)
  4044. return BBM_NOK;
  4045. for (; i < ffs_lock_timeout; i++) {
  4046. bbm_byte_read(handle, DIV_MASTER, 0x3026, &a);
  4047. if ((a & 0x11) == 0x11)
  4048. break;
  4049. bbm_byte_read(handle, DIV_SLAVE0, 0x3026, &a);
  4050. if ((a & 0x11) == 0x11)
  4051. break;
  4052. #ifdef BBM_4_DIVERSITY
  4053. bbm_byte_read(handle, DIV_SLAVE1, 0x3026, &a);
  4054. if ((a & 0x11) == 0x11)
  4055. break;
  4056. bbm_byte_read(handle, DIV_SLAVE2, 0x3026, &a);
  4057. if ((a & 0x11) == 0x11)
  4058. break;
  4059. #endif
  4060. msWait(SCAN_CHK_PERIOD);
  4061. }
  4062. if (i == ffs_lock_timeout)
  4063. return BBM_NOK;
  4064. for (i = 0, run = done; i < cfs_timeout; i++) {
  4065. if (run & 0x01) {
  4066. bbm_byte_read(handle, DIV_MASTER, 0x3025, &a);
  4067. if (a & 0x40) {
  4068. bbm_byte_read(handle, DIV_MASTER, 0x2023, &a);
  4069. if ((a & 0x01) == 0x00)
  4070. break;
  4071. run -= 0x01; /* master done */
  4072. }
  4073. }
  4074. if (run & 0x02) {
  4075. bbm_byte_read(handle, DIV_SLAVE0, 0x3025, &a);
  4076. if (a & 0x40) {
  4077. bbm_byte_read(handle, DIV_SLAVE0, 0x2023, &a);
  4078. if ((a & 0x01) == 0x00)
  4079. break;
  4080. run -= 0x02; /* slave0 done */
  4081. }
  4082. }
  4083. #ifdef BBM_4_DIVERSITY
  4084. if (run & 0x04) {
  4085. bbm_byte_read(handle, DIV_SLAVE1, 0x3025, &a);
  4086. if (a & 0x40) {
  4087. bbm_byte_read(handle, DIV_SLAVE1, 0x2023, &a);
  4088. if ((a & 0x01) == 0x00)
  4089. break;
  4090. run -= 0x04; /* slave1 done */
  4091. }
  4092. }
  4093. if (run & 0x08) {
  4094. bbm_byte_read(handle, DIV_SLAVE2, 0x3025, &a);
  4095. if (a & 0x40) {
  4096. bbm_byte_read(handle, DIV_SLAVE2, 0x2023, &a);
  4097. if ((a & 0x01) == 0x00)
  4098. break;
  4099. run -= 0x08; /* slave2 done */
  4100. }
  4101. }
  4102. #endif
  4103. if (run == 0)
  4104. return BBM_NOK;
  4105. msWait(SCAN_CHK_PERIOD);
  4106. }
  4107. if (i == cfs_timeout)
  4108. return BBM_NOK;
  4109. for (i = 0; i < tmcc_timeout; i++) {
  4110. bbm_byte_read(handle, DIV_MASTER, 0x3026, &a);
  4111. if (a & 0x02) {
  4112. bbm_long_read(handle, DIV_MASTER, 0x4113, &data);
  4113. break;
  4114. }
  4115. bbm_byte_read(handle, DIV_SLAVE0, 0x3026, &a);
  4116. if (a & 0x02) {
  4117. bbm_long_read(handle, DIV_SLAVE0, 0x4113, &data);
  4118. break;
  4119. }
  4120. #ifdef BBM_4_DIVERSITY
  4121. bbm_byte_read(handle, DIV_SLAVE1, 0x3026, &a);
  4122. if (a & 0x02) {
  4123. bbm_long_read(handle, DIV_SLAVE1, 0x4113, &data);
  4124. break;
  4125. }
  4126. bbm_byte_read(handle, DIV_SLAVE2, 0x3026, &a);
  4127. if (a & 0x02) {
  4128. bbm_long_read(handle, DIV_SLAVE2, 0x4113, &data);
  4129. break;
  4130. }
  4131. #endif
  4132. msWait(SCAN_CHK_PERIOD);
  4133. }
  4134. if (i == tmcc_timeout)
  4135. return BBM_NOK;
  4136. ts_err_free_timeout = 950;
  4137. switch (broadcast_type) {
  4138. case ISDBT_1SEG:
  4139. if ((data & 0x00000008) == 0x00000000)
  4140. return BBM_NOK;
  4141. if ((data & 0x00001c70) == 0x00001840)
  4142. ts_err_free_timeout = 700;
  4143. break;
  4144. case ISDBTMM_1SEG:
  4145. if ((data & 0x00001c70) == 0x00001820)
  4146. ts_err_free_timeout = 700;
  4147. break;
  4148. case ISDBTSB_1SEG:
  4149. break;
  4150. case ISDBTSB_3SEG:
  4151. break;
  4152. case ISDBT_13SEG:
  4153. if ((data & 0x3f8e1c78) == 0x0d0c1848)
  4154. ts_err_free_timeout = 700;
  4155. break;
  4156. case ISDBTMM_13SEG:
  4157. if ((data & 0x3f8e1c78) == 0x0f041828)
  4158. ts_err_free_timeout = 700;
  4159. break;
  4160. case ISDBT_CATV_13SEG:
  4161. if ((data & 0x3f8e1c78) == 0x0d0c1848)
  4162. ts_err_free_timeout = 700;
  4163. break;
  4164. case ISDBT_CATV_1SEG:
  4165. if ((data & 0x00000008) == 0x00000000)
  4166. return BBM_NOK;
  4167. if ((data & 0x00001c70) == 0x00001840)
  4168. ts_err_free_timeout = 700;
  4169. break;
  4170. default:
  4171. break;
  4172. }
  4173. for (i = 0; i < ts_err_free_timeout; i++) {
  4174. bbm_byte_read(handle, DIV_MASTER, 0x50c5, &a);
  4175. if (a)
  4176. break;
  4177. msWait(SCAN_CHK_PERIOD);
  4178. }
  4179. if (i == ts_err_free_timeout)
  4180. return BBM_NOK;
  4181. return BBM_OK;
  4182. }
  4183. #else /* SINGLE */
  4184. s32 fc8300_scan_status(HANDLE handle, DEVICEID devid)
  4185. {
  4186. u32 ifagc_timeout = 70;
  4187. u32 ofdm_timeout = 160;
  4188. u32 ffs_lock_timeout = 100;
  4189. u32 cfs_timeout = 120;
  4190. u32 tmcc_timeout = 1050;
  4191. u32 ts_err_free_timeout = 0;
  4192. u32 data = 0;
  4193. u8 a;
  4194. u32 i;
  4195. pr_info("ISDBT fc8300_scan_status \n");
  4196. for (i = 0; i < ifagc_timeout; i++) {
  4197. bbm_byte_read(handle, DIV_MASTER, 0x3025, &a);
  4198. if (a & 0x01)
  4199. break;
  4200. msWait(SCAN_CHK_PERIOD);
  4201. }
  4202. if (i == ifagc_timeout)
  4203. {
  4204. pr_info("ifagc_timeout returning error\n");
  4205. return BBM_NOK;
  4206. }
  4207. for (; i < ofdm_timeout; i++) {
  4208. bbm_byte_read(handle, DIV_MASTER, 0x3025, &a);
  4209. pr_debug("ofdm loop: a=0x%x\n",a);
  4210. if (a & 0x08)
  4211. break;
  4212. msWait(SCAN_CHK_PERIOD);
  4213. }
  4214. if (i == ofdm_timeout)
  4215. {
  4216. pr_info("ISDBT ofdm_timeout \n");
  4217. return BBM_NOK;
  4218. }
  4219. if (0 == (a & 0x04))
  4220. return BBM_NOK;
  4221. for (; i < ffs_lock_timeout; i++) {
  4222. bbm_byte_read(handle, DIV_MASTER, 0x3026, &a);
  4223. pr_debug("ffs loop: a=0x%x\n",a);
  4224. if ((a & 0x11) == 0x11)
  4225. break;
  4226. msWait(SCAN_CHK_PERIOD);
  4227. }
  4228. if (i == ffs_lock_timeout)
  4229. {
  4230. pr_info("ISDBT ffs_lock_timeout \n");
  4231. return BBM_NOK;
  4232. }
  4233. for (i = 0; i < cfs_timeout; i++) {
  4234. bbm_byte_read(handle, DIV_MASTER, 0x3025, &a);
  4235. pr_debug("cfs loop: a=0x%x\n",a);
  4236. if (a & 0x40)
  4237. break;
  4238. msWait(SCAN_CHK_PERIOD);
  4239. }
  4240. if (i == cfs_timeout)
  4241. {
  4242. pr_info("ISDBT cfs_timeout \n");
  4243. return BBM_NOK;
  4244. }
  4245. bbm_byte_read(handle, DIV_MASTER, 0x2023, &a);
  4246. if (a & 0x01)
  4247. {
  4248. pr_debug("ISDBT a & 0x01 = 1 return BBM_NOK \n");
  4249. return BBM_NOK;
  4250. }
  4251. for (i = 0; i < tmcc_timeout; i++) {
  4252. bbm_byte_read(handle, DIV_MASTER, 0x3026, &a);
  4253. pr_debug("tmcc loop: a=0x%x\n",a);
  4254. if (a & 0x02)
  4255. break;
  4256. msWait(SCAN_CHK_PERIOD);
  4257. }
  4258. if (i == tmcc_timeout)
  4259. {
  4260. pr_info("ISDBT tmcc_timeout \n");
  4261. return BBM_NOK;
  4262. }
  4263. ts_err_free_timeout = 950;
  4264. switch (broadcast_type) {
  4265. case ISDBT_1SEG:
  4266. bbm_word_read(handle, DIV_MASTER, 0x4113, (u16 *) &data);
  4267. print_log(0,"ISDBT_1SEG\n");
  4268. if ((data & 0x0008) == 0x0000)
  4269. return BBM_NOK;
  4270. if ((data & 0x1c70) == 0x1840)
  4271. ts_err_free_timeout = 700;
  4272. break;
  4273. case ISDBTMM_1SEG:
  4274. print_log(0,"ISDBTMM_1SEG\n");
  4275. bbm_word_read(handle, DIV_MASTER, 0x4113, (u16 *) &data);
  4276. if ((data & 0x1c70) == 0x1820)
  4277. ts_err_free_timeout = 700;
  4278. break;
  4279. case ISDBTSB_1SEG:
  4280. break;
  4281. case ISDBTSB_3SEG:
  4282. break;
  4283. case ISDBT_13SEG:
  4284. bbm_long_read(handle, DIV_MASTER, 0x4113, &data);
  4285. if ((data & 0x3f8e1c78) == 0x0d0c1848)
  4286. ts_err_free_timeout = 700;
  4287. break;
  4288. case ISDBTMM_13SEG:
  4289. bbm_long_read(handle, DIV_MASTER, 0x4113, &data);
  4290. if ((data & 0x3f8e1c78) == 0x0f041828)
  4291. ts_err_free_timeout = 700;
  4292. break;
  4293. case ISDBT_CATV_13SEG:
  4294. bbm_long_read(handle, DIV_MASTER, 0x4113, &data);
  4295. if ((data & 0x3f8e1c78) == 0x0d0c1848)
  4296. ts_err_free_timeout = 700;
  4297. break;
  4298. case ISDBT_CATV_1SEG:
  4299. bbm_word_read(handle, DIV_MASTER, 0x4113, (u16 *) &data);
  4300. if ((data & 0x0008) == 0x0000)
  4301. return BBM_NOK;
  4302. if ((data & 0x1c70) == 0x1840)
  4303. ts_err_free_timeout = 700;
  4304. break;
  4305. default:
  4306. break;
  4307. }
  4308. for (i = 0; i < ts_err_free_timeout; i++) {
  4309. bbm_byte_read(handle, DIV_MASTER, 0x50c5, &a);
  4310. pr_debug( "ts-err loop: a=0x%x\n",a);
  4311. if (a)
  4312. break;
  4313. msWait(SCAN_CHK_PERIOD);
  4314. }
  4315. if (i == ts_err_free_timeout)
  4316. {
  4317. pr_info("ISDBT ts_err_free_timeout\n");
  4318. return BBM_NOK;
  4319. }
  4320. return BBM_OK;
  4321. }
  4322. #endif /* #if defined(BBM_2_DIVERSITY) || defined(BBM_4_DIVERSITY) */
  4323. s32 fc8300_set_broadcast_mode(HANDLE handle, DEVICEID devid,
  4324. enum BROADCAST_TYPE broadcast)
  4325. {
  4326. s32 res = BBM_OK;
  4327. u32 clk = fc8300_set_default_core_clk(handle, devid);
  4328. broadcast_type = broadcast;
  4329. switch (broadcast) {
  4330. case ISDBT_1SEG:
  4331. case ISDBTMM_1SEG:
  4332. case ISDBTSB_1SEG:
  4333. case ISDBT_CATV_1SEG:
  4334. res |= fc8300_set_cal_front_1seg(handle, devid, clk);
  4335. break;
  4336. case ISDBTSB_3SEG:
  4337. res |= fc8300_set_cal_front_3seg(handle, devid, clk);
  4338. break;
  4339. case ISDBT_13SEG:
  4340. case ISDBTMM_13SEG:
  4341. case ISDBT_CATV_13SEG:
  4342. res |= fc8300_set_cal_front_13seg(handle, devid, clk);
  4343. break;
  4344. }
  4345. switch (broadcast) {
  4346. case ISDBT_1SEG:
  4347. case ISDBT_CATV_1SEG:
  4348. res |= fc8300_set_acif_b31_1seg(handle, devid, clk);
  4349. break;
  4350. case ISDBTMM_1SEG:
  4351. case ISDBTSB_1SEG:
  4352. res |= fc8300_set_acif_1seg(handle, devid, clk);
  4353. break;
  4354. case ISDBTSB_3SEG:
  4355. res |= fc8300_set_acif_3seg(handle, devid, clk);
  4356. break;
  4357. case ISDBT_13SEG:
  4358. case ISDBTMM_13SEG:
  4359. case ISDBT_CATV_13SEG:
  4360. res |= fc8300_set_acif_13seg(handle, devid, clk);
  4361. break;
  4362. }
  4363. /* system mode */
  4364. switch (broadcast) {
  4365. case ISDBT_1SEG:
  4366. case ISDBT_CATV_1SEG:
  4367. bbm_byte_write(handle, devid, BBM_CLK_CTRL, 0x05);
  4368. bbm_byte_write(handle, devid, BBM_SYSTEM_MODE, 0x01);
  4369. break;
  4370. case ISDBT_13SEG:
  4371. case ISDBT_CATV_13SEG:
  4372. bbm_byte_write(handle, devid, BBM_CLK_CTRL, 0x07);
  4373. bbm_byte_write(handle, devid, BBM_SYSTEM_MODE, 0x00);
  4374. break;
  4375. case ISDBTMM_1SEG:
  4376. bbm_byte_write(handle, devid, BBM_CLK_CTRL, 0x05);
  4377. bbm_byte_write(handle, devid, BBM_SYSTEM_MODE, 0x02);
  4378. break;
  4379. case ISDBTMM_13SEG:
  4380. bbm_byte_write(handle, devid, BBM_CLK_CTRL, 0x07);
  4381. bbm_byte_write(handle, devid, BBM_SYSTEM_MODE, 0x00);
  4382. break;
  4383. case ISDBTSB_1SEG:
  4384. bbm_byte_write(handle, devid, BBM_CLK_CTRL, 0x05);
  4385. bbm_byte_write(handle, devid, BBM_SYSTEM_MODE, 0x02);
  4386. break;
  4387. case ISDBTSB_3SEG:
  4388. bbm_byte_write(handle, devid, BBM_CLK_CTRL, 0x06);
  4389. bbm_byte_write(handle, devid, BBM_SYSTEM_MODE, 0x03);
  4390. break;
  4391. }
  4392. /* pre-run */
  4393. switch (broadcast) {
  4394. case ISDBT_1SEG:
  4395. case ISDBT_CATV_1SEG:
  4396. bbm_long_write(handle, devid, BBM_MAN_PARTIAL_EN, 0x000c0101);
  4397. bbm_long_write(handle, devid, BBM_MAN_LAYER_A_MOD_TYPE,
  4398. 0x01000301);
  4399. bbm_long_write(handle, devid, BBM_MAN_LAYER_B_CODE_RATE,
  4400. 0x02030002);
  4401. bbm_byte_write(handle, devid, BBM_MAN_LAYER_C_TI_LENGTH, 0x00);
  4402. bbm_word_write(handle, devid, BBM_TDI_PRE_A, 0xc213);
  4403. bbm_byte_write(handle, devid, BBM_TDI_PRE_C, 0x03);
  4404. bbm_byte_write(handle, devid, BBM_FEC_LAYER, 0x01);
  4405. break;
  4406. case ISDBT_13SEG:
  4407. case ISDBT_CATV_13SEG:
  4408. bbm_long_write(handle, devid, BBM_MAN_PARTIAL_EN, 0x000C0101);
  4409. bbm_long_write(handle, devid, BBM_MAN_LAYER_A_MOD_TYPE,
  4410. 0x01000301);
  4411. bbm_long_write(handle, devid, BBM_MAN_LAYER_B_CODE_RATE,
  4412. 0x02030002);
  4413. bbm_byte_write(handle, devid, BBM_MAN_LAYER_C_TI_LENGTH, 0x00);
  4414. bbm_word_write(handle, devid, BBM_TDI_PRE_A, 0xC21B);
  4415. bbm_byte_write(handle, devid, BBM_TDI_PRE_C, 0x03);
  4416. bbm_byte_write(handle, devid, BBM_FEC_LAYER, 0x02);
  4417. break;
  4418. case ISDBTMM_1SEG:
  4419. bbm_long_write(handle, devid, BBM_MAN_PARTIAL_EN, 0x000C0101);
  4420. bbm_long_write(handle, devid, BBM_MAN_LAYER_A_MOD_TYPE,
  4421. 0x00000202);
  4422. bbm_long_write(handle, devid, BBM_MAN_LAYER_B_CODE_RATE,
  4423. 0x03030000);
  4424. bbm_byte_write(handle, devid, BBM_MAN_LAYER_C_TI_LENGTH, 0x00);
  4425. bbm_word_write(handle, devid, BBM_TDI_PRE_A, 0xCB13);
  4426. bbm_byte_write(handle, devid, BBM_TDI_PRE_C, 0x03);
  4427. bbm_byte_write(handle, devid, BBM_FEC_LAYER, 0x01);
  4428. break;
  4429. case ISDBTMM_13SEG:
  4430. bbm_long_write(handle, devid, BBM_MAN_PARTIAL_EN, 0x000C0101);
  4431. bbm_long_write(handle, devid, BBM_MAN_LAYER_A_MOD_TYPE,
  4432. 0x00000202);
  4433. bbm_long_write(handle, devid, BBM_MAN_LAYER_B_CODE_RATE,
  4434. 0x03030000);
  4435. bbm_byte_write(handle, devid, BBM_MAN_LAYER_C_TI_LENGTH, 0x00);
  4436. bbm_word_write(handle, devid, BBM_TDI_PRE_A, 0xCB1B);
  4437. bbm_byte_write(handle, devid, BBM_TDI_PRE_C, 0x03);
  4438. bbm_byte_write(handle, devid, BBM_FEC_LAYER, 0x02);
  4439. break;
  4440. case ISDBTSB_1SEG:
  4441. bbm_long_write(handle, devid, BBM_MAN_PARTIAL_EN, 0x00020101);
  4442. bbm_long_write(handle, devid, BBM_MAN_LAYER_A_MOD_TYPE,
  4443. 0x00000202);
  4444. bbm_long_write(handle, devid, BBM_MAN_LAYER_B_CODE_RATE,
  4445. 0x03030000);
  4446. bbm_byte_write(handle, devid, BBM_MAN_LAYER_C_TI_LENGTH, 0x00);
  4447. bbm_word_write(handle, devid, BBM_TDI_PRE_A, 0x2313);
  4448. bbm_byte_write(handle, devid, BBM_TDI_PRE_C, 0x03);
  4449. bbm_byte_write(handle, devid, BBM_FEC_LAYER, 0x01);
  4450. break;
  4451. case ISDBTSB_3SEG:
  4452. bbm_long_write(handle, devid, BBM_MAN_PARTIAL_EN, 0x00020101);
  4453. bbm_long_write(handle, devid, BBM_MAN_LAYER_A_MOD_TYPE,
  4454. 0x00000202);
  4455. bbm_long_write(handle, devid, BBM_MAN_LAYER_B_CODE_RATE,
  4456. 0x03030000);
  4457. bbm_byte_write(handle, devid, BBM_MAN_LAYER_C_TI_LENGTH, 0x00);
  4458. bbm_word_write(handle, devid, BBM_TDI_PRE_A, 0x2313);
  4459. bbm_byte_write(handle, devid, BBM_TDI_PRE_C, 0x03);
  4460. bbm_byte_write(handle, devid, BBM_FEC_LAYER, 0x02);
  4461. break;
  4462. }
  4463. if (broadcast == ISDBT_13SEG || broadcast == ISDBTMM_13SEG ||
  4464. broadcast == ISDBT_CATV_13SEG)
  4465. bbm_byte_write(handle, devid, BBM_IIFOECFG_EARLYSTOP_THM, 0x18);
  4466. else
  4467. bbm_byte_write(handle, devid, BBM_IIFOECFG_EARLYSTOP_THM, 0x0e);
  4468. switch (broadcast) {
  4469. case ISDBT_1SEG:
  4470. case ISDBTMM_1SEG:
  4471. case ISDBTSB_1SEG:
  4472. case ISDBT_CATV_1SEG:
  4473. bbm_word_write(handle, devid, BBM_MSNR_FREQ_S_POW_MAN_VALUE3,
  4474. 0xb00f);
  4475. break;
  4476. case ISDBTSB_3SEG:
  4477. bbm_word_write(handle, devid, BBM_MSNR_FREQ_S_POW_MAN_VALUE3,
  4478. 0x3030);
  4479. break;
  4480. case ISDBT_13SEG:
  4481. case ISDBTMM_13SEG:
  4482. case ISDBT_CATV_13SEG:
  4483. bbm_word_write(handle, devid, BBM_MSNR_FREQ_S_POW_MAN_VALUE3,
  4484. 0x00c3);
  4485. break;
  4486. }
  4487. switch (broadcast) {
  4488. case ISDBTMM_1SEG:
  4489. case ISDBTMM_13SEG:
  4490. bbm_byte_write(handle, devid, BBM_ECHOC_EN, 0x00);
  4491. break;
  4492. default:
  4493. bbm_byte_write(handle, devid, BBM_ECHOC_EN, 0x01);
  4494. break;
  4495. }
  4496. switch (broadcast) {
  4497. case ISDBT_CATV_13SEG:
  4498. case ISDBT_CATV_1SEG:
  4499. bbm_byte_write(handle, DIV_BROADCAST, BBM_PGA_GAIN_MAX, 0x00);
  4500. break;
  4501. default:
  4502. bbm_byte_write(handle, DIV_BROADCAST, BBM_PGA_GAIN_MAX, 0x0c);
  4503. break;
  4504. }
  4505. return res;
  4506. }