stv0900_init.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. /*
  2. * stv0900_init.h
  3. *
  4. * Driver for ST STV0900 satellite demodulator IC.
  5. *
  6. * Copyright (C) ST Microelectronics.
  7. * Copyright (C) 2009 NetUP Inc.
  8. * Copyright (C) 2009 Igor M. Liplianin <liplianin@netup.ru>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. *
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. */
  25. #ifndef STV0900_INIT_H
  26. #define STV0900_INIT_H
  27. #include "stv0900_priv.h"
  28. /* DVBS2 C/N Look-Up table */
  29. static const struct stv0900_table stv0900_s2_cn = {
  30. 55,
  31. {
  32. { -30, 13348 }, /*C/N=-3dB*/
  33. { -20, 12640 }, /*C/N=-2dB*/
  34. { -10, 11883 }, /*C/N=-1dB*/
  35. { 0, 11101 }, /*C/N=-0dB*/
  36. { 5, 10718 }, /*C/N=0.5dB*/
  37. { 10, 10339 }, /*C/N=1.0dB*/
  38. { 15, 9947 }, /*C/N=1.5dB*/
  39. { 20, 9552 }, /*C/N=2.0dB*/
  40. { 25, 9183 }, /*C/N=2.5dB*/
  41. { 30, 8799 }, /*C/N=3.0dB*/
  42. { 35, 8422 }, /*C/N=3.5dB*/
  43. { 40, 8062 }, /*C/N=4.0dB*/
  44. { 45, 7707 }, /*C/N=4.5dB*/
  45. { 50, 7353 }, /*C/N=5.0dB*/
  46. { 55, 7025 }, /*C/N=5.5dB*/
  47. { 60, 6684 }, /*C/N=6.0dB*/
  48. { 65, 6331 }, /*C/N=6.5dB*/
  49. { 70, 6036 }, /*C/N=7.0dB*/
  50. { 75, 5727 }, /*C/N=7.5dB*/
  51. { 80, 5437 }, /*C/N=8.0dB*/
  52. { 85, 5164 }, /*C/N=8.5dB*/
  53. { 90, 4902 }, /*C/N=9.0dB*/
  54. { 95, 4653 }, /*C/N=9.5dB*/
  55. { 100, 4408 }, /*C/N=10.0dB*/
  56. { 105, 4187 }, /*C/N=10.5dB*/
  57. { 110, 3961 }, /*C/N=11.0dB*/
  58. { 115, 3751 }, /*C/N=11.5dB*/
  59. { 120, 3558 }, /*C/N=12.0dB*/
  60. { 125, 3368 }, /*C/N=12.5dB*/
  61. { 130, 3191 }, /*C/N=13.0dB*/
  62. { 135, 3017 }, /*C/N=13.5dB*/
  63. { 140, 2862 }, /*C/N=14.0dB*/
  64. { 145, 2710 }, /*C/N=14.5dB*/
  65. { 150, 2565 }, /*C/N=15.0dB*/
  66. { 160, 2300 }, /*C/N=16.0dB*/
  67. { 170, 2058 }, /*C/N=17.0dB*/
  68. { 180, 1849 }, /*C/N=18.0dB*/
  69. { 190, 1663 }, /*C/N=19.0dB*/
  70. { 200, 1495 }, /*C/N=20.0dB*/
  71. { 210, 1349 }, /*C/N=21.0dB*/
  72. { 220, 1222 }, /*C/N=22.0dB*/
  73. { 230, 1110 }, /*C/N=23.0dB*/
  74. { 240, 1011 }, /*C/N=24.0dB*/
  75. { 250, 925 }, /*C/N=25.0dB*/
  76. { 260, 853 }, /*C/N=26.0dB*/
  77. { 270, 789 }, /*C/N=27.0dB*/
  78. { 280, 734 }, /*C/N=28.0dB*/
  79. { 290, 690 }, /*C/N=29.0dB*/
  80. { 300, 650 }, /*C/N=30.0dB*/
  81. { 310, 619 }, /*C/N=31.0dB*/
  82. { 320, 593 }, /*C/N=32.0dB*/
  83. { 330, 571 }, /*C/N=33.0dB*/
  84. { 400, 498 }, /*C/N=40.0dB*/
  85. { 450, 484 }, /*C/N=45.0dB*/
  86. { 500, 481 } /*C/N=50.0dB*/
  87. }
  88. };
  89. /* RF level C/N Look-Up table */
  90. static const struct stv0900_table stv0900_rf = {
  91. 14,
  92. {
  93. { -5, 0xCAA1 }, /*-5dBm*/
  94. { -10, 0xC229 }, /*-10dBm*/
  95. { -15, 0xBB08 }, /*-15dBm*/
  96. { -20, 0xB4BC }, /*-20dBm*/
  97. { -25, 0xAD5A }, /*-25dBm*/
  98. { -30, 0xA298 }, /*-30dBm*/
  99. { -35, 0x98A8 }, /*-35dBm*/
  100. { -40, 0x8389 }, /*-40dBm*/
  101. { -45, 0x59BE }, /*-45dBm*/
  102. { -50, 0x3A14 }, /*-50dBm*/
  103. { -55, 0x2D11 }, /*-55dBm*/
  104. { -60, 0x210D }, /*-60dBm*/
  105. { -65, 0xA14F }, /*-65dBm*/
  106. { -70, 0x7AA } /*-70dBm*/
  107. }
  108. };
  109. struct stv0900_car_loop_optim {
  110. enum fe_stv0900_modcode modcode;
  111. u8 car_loop_pilots_on_2;
  112. u8 car_loop_pilots_off_2;
  113. u8 car_loop_pilots_on_5;
  114. u8 car_loop_pilots_off_5;
  115. u8 car_loop_pilots_on_10;
  116. u8 car_loop_pilots_off_10;
  117. u8 car_loop_pilots_on_20;
  118. u8 car_loop_pilots_off_20;
  119. u8 car_loop_pilots_on_30;
  120. u8 car_loop_pilots_off_30;
  121. };
  122. struct stv0900_short_frames_car_loop_optim {
  123. enum fe_stv0900_modulation modulation;
  124. u8 car_loop_cut12_2; /* Cut 1.2, SR<=3msps */
  125. u8 car_loop_cut20_2; /* Cut 2.0, SR<3msps */
  126. u8 car_loop_cut12_5; /* Cut 1.2, 3<SR<=7msps */
  127. u8 car_loop_cut20_5; /* Cut 2.0, 3<SR<=7msps */
  128. u8 car_loop_cut12_10; /* Cut 1.2, 7<SR<=15msps */
  129. u8 car_loop_cut20_10; /* Cut 2.0, 7<SR<=15msps */
  130. u8 car_loop_cut12_20; /* Cut 1.2, 10<SR<=25msps */
  131. u8 car_loop_cut20_20; /* Cut 2.0, 10<SR<=25msps */
  132. u8 car_loop_cut12_30; /* Cut 1.2, 25<SR<=45msps */
  133. u8 car_loop_cut20_30; /* Cut 2.0, 10<SR<=45msps */
  134. };
  135. struct stv0900_short_frames_car_loop_optim_vs_mod {
  136. enum fe_stv0900_modulation modulation;
  137. u8 car_loop_2; /* SR<3msps */
  138. u8 car_loop_5; /* 3<SR<=7msps */
  139. u8 car_loop_10; /* 7<SR<=15msps */
  140. u8 car_loop_20; /* 10<SR<=25msps */
  141. u8 car_loop_30; /* 10<SR<=45msps */
  142. };
  143. /* Cut 1.x Tracking carrier loop carrier QPSK 1/2 to 8PSK 9/10 long Frame */
  144. static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoop[14] = {
  145. /*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
  146. 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
  147. { STV0900_QPSK_12, 0x1C, 0x0D, 0x1B, 0x2C, 0x3A,
  148. 0x1C, 0x2A, 0x3B, 0x2A, 0x1B },
  149. { STV0900_QPSK_35, 0x2C, 0x0D, 0x2B, 0x2C, 0x3A,
  150. 0x0C, 0x3A, 0x2B, 0x2A, 0x0B },
  151. { STV0900_QPSK_23, 0x2C, 0x0D, 0x2B, 0x2C, 0x0B,
  152. 0x0C, 0x3A, 0x1B, 0x2A, 0x3A },
  153. { STV0900_QPSK_34, 0x3C, 0x0D, 0x3B, 0x1C, 0x0B,
  154. 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
  155. { STV0900_QPSK_45, 0x3C, 0x0D, 0x3B, 0x1C, 0x0B,
  156. 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
  157. { STV0900_QPSK_56, 0x0D, 0x0D, 0x3B, 0x1C, 0x0B,
  158. 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
  159. { STV0900_QPSK_89, 0x0D, 0x0D, 0x3B, 0x1C, 0x1B,
  160. 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
  161. { STV0900_QPSK_910, 0x1D, 0x0D, 0x3B, 0x1C, 0x1B,
  162. 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
  163. { STV0900_8PSK_35, 0x29, 0x3B, 0x09, 0x2B, 0x38,
  164. 0x0B, 0x18, 0x1A, 0x08, 0x0A },
  165. { STV0900_8PSK_23, 0x0A, 0x3B, 0x29, 0x2B, 0x19,
  166. 0x0B, 0x38, 0x1A, 0x18, 0x0A },
  167. { STV0900_8PSK_34, 0x3A, 0x3B, 0x2A, 0x2B, 0x39,
  168. 0x0B, 0x19, 0x1A, 0x38, 0x0A },
  169. { STV0900_8PSK_56, 0x1B, 0x3B, 0x0B, 0x2B, 0x1A,
  170. 0x0B, 0x39, 0x1A, 0x19, 0x0A },
  171. { STV0900_8PSK_89, 0x3B, 0x3B, 0x0B, 0x2B, 0x2A,
  172. 0x0B, 0x39, 0x1A, 0x29, 0x39 },
  173. { STV0900_8PSK_910, 0x3B, 0x3B, 0x0B, 0x2B, 0x2A,
  174. 0x0B, 0x39, 0x1A, 0x29, 0x39 }
  175. };
  176. /* Cut 2.0 Tracking carrier loop carrier QPSK 1/2 to 8PSK 9/10 long Frame */
  177. static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoopCut20[14] = {
  178. /* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
  179. 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
  180. { STV0900_QPSK_12, 0x1F, 0x3F, 0x1E, 0x3F, 0x3D,
  181. 0x1F, 0x3D, 0x3E, 0x3D, 0x1E },
  182. { STV0900_QPSK_35, 0x2F, 0x3F, 0x2E, 0x2F, 0x3D,
  183. 0x0F, 0x0E, 0x2E, 0x3D, 0x0E },
  184. { STV0900_QPSK_23, 0x2F, 0x3F, 0x2E, 0x2F, 0x0E,
  185. 0x0F, 0x0E, 0x1E, 0x3D, 0x3D },
  186. { STV0900_QPSK_34, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E,
  187. 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
  188. { STV0900_QPSK_45, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E,
  189. 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
  190. { STV0900_QPSK_56, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E,
  191. 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
  192. { STV0900_QPSK_89, 0x3F, 0x3F, 0x3E, 0x1F, 0x1E,
  193. 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
  194. { STV0900_QPSK_910, 0x3F, 0x3F, 0x3E, 0x1F, 0x1E,
  195. 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
  196. { STV0900_8PSK_35, 0x3c, 0x0c, 0x1c, 0x3b, 0x0c,
  197. 0x3b, 0x2b, 0x2b, 0x1b, 0x2b },
  198. { STV0900_8PSK_23, 0x1d, 0x0c, 0x3c, 0x0c, 0x2c,
  199. 0x3b, 0x0c, 0x2b, 0x2b, 0x2b },
  200. { STV0900_8PSK_34, 0x0e, 0x1c, 0x3d, 0x0c, 0x0d,
  201. 0x3b, 0x2c, 0x3b, 0x0c, 0x2b },
  202. { STV0900_8PSK_56, 0x2e, 0x3e, 0x1e, 0x2e, 0x2d,
  203. 0x1e, 0x3c, 0x2d, 0x2c, 0x1d },
  204. { STV0900_8PSK_89, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d,
  205. 0x1e, 0x0d, 0x2d, 0x3c, 0x1d },
  206. { STV0900_8PSK_910, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d,
  207. 0x1e, 0x1d, 0x2d, 0x0d, 0x1d },
  208. };
  209. /* Cut 2.0 Tracking carrier loop carrier 16APSK 2/3 to 32APSK 9/10 long Frame */
  210. static const struct stv0900_car_loop_optim FE_STV0900_S2APSKCarLoopCut20[11] = {
  211. /* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
  212. 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
  213. { STV0900_16APSK_23, 0x0C, 0x0C, 0x0C, 0x0C, 0x1D,
  214. 0x0C, 0x3C, 0x0C, 0x2C, 0x0C },
  215. { STV0900_16APSK_34, 0x0C, 0x0C, 0x0C, 0x0C, 0x0E,
  216. 0x0C, 0x2D, 0x0C, 0x1D, 0x0C },
  217. { STV0900_16APSK_45, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E,
  218. 0x0C, 0x3D, 0x0C, 0x2D, 0x0C },
  219. { STV0900_16APSK_56, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E,
  220. 0x0C, 0x3D, 0x0C, 0x2D, 0x0C },
  221. { STV0900_16APSK_89, 0x0C, 0x0C, 0x0C, 0x0C, 0x2E,
  222. 0x0C, 0x0E, 0x0C, 0x3D, 0x0C },
  223. { STV0900_16APSK_910, 0x0C, 0x0C, 0x0C, 0x0C, 0x2E,
  224. 0x0C, 0x0E, 0x0C, 0x3D, 0x0C },
  225. { STV0900_32APSK_34, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
  226. 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
  227. { STV0900_32APSK_45, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
  228. 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
  229. { STV0900_32APSK_56, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
  230. 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
  231. { STV0900_32APSK_89, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
  232. 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
  233. { STV0900_32APSK_910, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
  234. 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
  235. };
  236. /* Cut 2.0 Tracking carrier loop carrier QPSK 1/4 to QPSK 2/5 long Frame */
  237. static const struct stv0900_car_loop_optim FE_STV0900_S2LowQPCarLoopCut20[3] = {
  238. /* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
  239. 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
  240. { STV0900_QPSK_14, 0x0F, 0x3F, 0x0E, 0x3F, 0x2D,
  241. 0x2F, 0x2D, 0x1F, 0x3D, 0x3E },
  242. { STV0900_QPSK_13, 0x0F, 0x3F, 0x0E, 0x3F, 0x2D,
  243. 0x2F, 0x3D, 0x0F, 0x3D, 0x2E },
  244. { STV0900_QPSK_25, 0x1F, 0x3F, 0x1E, 0x3F, 0x3D,
  245. 0x1F, 0x3D, 0x3E, 0x3D, 0x2E }
  246. };
  247. /* Cut 2.0 Tracking carrier loop carrier short Frame, cut 1.2 and 2.0 */
  248. static const
  249. struct stv0900_short_frames_car_loop_optim FE_STV0900_S2ShortCarLoop[4] = {
  250. /*Mod 2Mcut1.2 2Mcut2.0 5Mcut1.2 5Mcut2.0 10Mcut1.2
  251. 10Mcut2.0 20Mcut1.2 20M_cut2.0 30Mcut1.2 30Mcut2.0*/
  252. { STV0900_QPSK, 0x3C, 0x2F, 0x2B, 0x2E, 0x0B,
  253. 0x0E, 0x3A, 0x0E, 0x2A, 0x3D },
  254. { STV0900_8PSK, 0x0B, 0x3E, 0x2A, 0x0E, 0x0A,
  255. 0x2D, 0x19, 0x0D, 0x09, 0x3C },
  256. { STV0900_16APSK, 0x1B, 0x1E, 0x1B, 0x1E, 0x1B,
  257. 0x1E, 0x3A, 0x3D, 0x2A, 0x2D },
  258. { STV0900_32APSK, 0x1B, 0x1E, 0x1B, 0x1E, 0x1B,
  259. 0x1E, 0x3A, 0x3D, 0x2A, 0x2D }
  260. };
  261. static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoopCut30[14] = {
  262. /*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
  263. 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
  264. { STV0900_QPSK_12, 0x3C, 0x2C, 0x0C, 0x2C, 0x1B,
  265. 0x2C, 0x1B, 0x1C, 0x0B, 0x3B },
  266. { STV0900_QPSK_35, 0x0D, 0x0D, 0x0C, 0x0D, 0x1B,
  267. 0x3C, 0x1B, 0x1C, 0x0B, 0x3B },
  268. { STV0900_QPSK_23, 0x1D, 0x0D, 0x0C, 0x1D, 0x2B,
  269. 0x3C, 0x1B, 0x1C, 0x0B, 0x3B },
  270. { STV0900_QPSK_34, 0x1D, 0x1D, 0x0C, 0x1D, 0x2B,
  271. 0x3C, 0x1B, 0x1C, 0x0B, 0x3B },
  272. { STV0900_QPSK_45, 0x2D, 0x1D, 0x1C, 0x1D, 0x2B,
  273. 0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
  274. { STV0900_QPSK_56, 0x2D, 0x1D, 0x1C, 0x1D, 0x2B,
  275. 0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
  276. { STV0900_QPSK_89, 0x3D, 0x2D, 0x1C, 0x1D, 0x3B,
  277. 0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
  278. { STV0900_QPSK_910, 0x3D, 0x2D, 0x1C, 0x1D, 0x3B,
  279. 0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
  280. { STV0900_8PSK_35, 0x39, 0x19, 0x39, 0x19, 0x19,
  281. 0x19, 0x19, 0x19, 0x09, 0x19 },
  282. { STV0900_8PSK_23, 0x2A, 0x39, 0x1A, 0x0A, 0x39,
  283. 0x0A, 0x29, 0x39, 0x29, 0x0A },
  284. { STV0900_8PSK_34, 0x0B, 0x3A, 0x0B, 0x0B, 0x3A,
  285. 0x1B, 0x1A, 0x0B, 0x1A, 0x3A },
  286. { STV0900_8PSK_56, 0x0C, 0x1B, 0x3B, 0x2B, 0x1B,
  287. 0x3B, 0x3A, 0x3B, 0x3A, 0x1B },
  288. { STV0900_8PSK_89, 0x2C, 0x2C, 0x2C, 0x1C, 0x2B,
  289. 0x0C, 0x0B, 0x3B, 0x0B, 0x1B },
  290. { STV0900_8PSK_910, 0x2C, 0x3C, 0x2C, 0x1C, 0x3B,
  291. 0x1C, 0x0B, 0x3B, 0x0B, 0x1B }
  292. };
  293. static const
  294. struct stv0900_car_loop_optim FE_STV0900_S2APSKCarLoopCut30[11] = {
  295. /*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
  296. 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
  297. { STV0900_16APSK_23, 0x0A, 0x0A, 0x0A, 0x0A, 0x1A,
  298. 0x0A, 0x3A, 0x0A, 0x2A, 0x0A },
  299. { STV0900_16APSK_34, 0x0A, 0x0A, 0x0A, 0x0A, 0x0B,
  300. 0x0A, 0x3B, 0x0A, 0x1B, 0x0A },
  301. { STV0900_16APSK_45, 0x0A, 0x0A, 0x0A, 0x0A, 0x1B,
  302. 0x0A, 0x3B, 0x0A, 0x2B, 0x0A },
  303. { STV0900_16APSK_56, 0x0A, 0x0A, 0x0A, 0x0A, 0x1B,
  304. 0x0A, 0x3B, 0x0A, 0x2B, 0x0A },
  305. { STV0900_16APSK_89, 0x0A, 0x0A, 0x0A, 0x0A, 0x2B,
  306. 0x0A, 0x0C, 0x0A, 0x3B, 0x0A },
  307. { STV0900_16APSK_910, 0x0A, 0x0A, 0x0A, 0x0A, 0x2B,
  308. 0x0A, 0x0C, 0x0A, 0x3B, 0x0A },
  309. { STV0900_32APSK_34, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
  310. 0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
  311. { STV0900_32APSK_45, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
  312. 0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
  313. { STV0900_32APSK_56, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
  314. 0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
  315. { STV0900_32APSK_89, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
  316. 0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
  317. { STV0900_32APSK_910, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
  318. 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }
  319. };
  320. static const
  321. struct stv0900_car_loop_optim FE_STV0900_S2LowQPCarLoopCut30[3] = {
  322. /*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
  323. 10MPoff 20MPon 20MPoff 30MPon 30MPoff*/
  324. { STV0900_QPSK_14, 0x0C, 0x3C, 0x0B, 0x3C, 0x2A,
  325. 0x2C, 0x2A, 0x1C, 0x3A, 0x3B },
  326. { STV0900_QPSK_13, 0x0C, 0x3C, 0x0B, 0x3C, 0x2A,
  327. 0x2C, 0x3A, 0x0C, 0x3A, 0x2B },
  328. { STV0900_QPSK_25, 0x1C, 0x3C, 0x1B, 0x3C, 0x3A,
  329. 0x1C, 0x3A, 0x3B, 0x3A, 0x2B }
  330. };
  331. static const struct stv0900_short_frames_car_loop_optim_vs_mod
  332. FE_STV0900_S2ShortCarLoopCut30[4] = {
  333. /*Mod 2Mcut3.0 5Mcut3.0 10Mcut3.0 20Mcut3.0 30Mcut3.0*/
  334. { STV0900_QPSK, 0x2C, 0x2B, 0x0B, 0x0B, 0x3A },
  335. { STV0900_8PSK, 0x3B, 0x0B, 0x2A, 0x0A, 0x39 },
  336. { STV0900_16APSK, 0x1B, 0x1B, 0x1B, 0x3A, 0x2A },
  337. { STV0900_32APSK, 0x1B, 0x1B, 0x1B, 0x3A, 0x2A },
  338. };
  339. static const u16 STV0900_InitVal[181][2] = {
  340. { R0900_OUTCFG , 0x00 },
  341. { R0900_AGCRF1CFG , 0x11 },
  342. { R0900_AGCRF2CFG , 0x13 },
  343. { R0900_TSGENERAL1X , 0x14 },
  344. { R0900_TSTTNR2 , 0x21 },
  345. { R0900_TSTTNR4 , 0x21 },
  346. { R0900_P2_DISTXCTL , 0x22 },
  347. { R0900_P2_F22TX , 0xc0 },
  348. { R0900_P2_F22RX , 0xc0 },
  349. { R0900_P2_DISRXCTL , 0x00 },
  350. { R0900_P2_TNRSTEPS , 0x87 },
  351. { R0900_P2_TNRGAIN , 0x09 },
  352. { R0900_P2_DMDCFGMD , 0xF9 },
  353. { R0900_P2_DEMOD , 0x08 },
  354. { R0900_P2_DMDCFG3 , 0xc4 },
  355. { R0900_P2_CARFREQ , 0xed },
  356. { R0900_P2_TNRCFG2 , 0x02 },
  357. { R0900_P2_TNRCFG3 , 0x02 },
  358. { R0900_P2_LDT , 0xd0 },
  359. { R0900_P2_LDT2 , 0xb8 },
  360. { R0900_P2_TMGCFG , 0xd2 },
  361. { R0900_P2_TMGTHRISE , 0x20 },
  362. { R0900_P2_TMGTHFALL , 0x00 },
  363. { R0900_P2_FECSPY , 0x88 },
  364. { R0900_P2_FSPYDATA , 0x3a },
  365. { R0900_P2_FBERCPT4 , 0x00 },
  366. { R0900_P2_FSPYBER , 0x10 },
  367. { R0900_P2_ERRCTRL1 , 0x35 },
  368. { R0900_P2_ERRCTRL2 , 0xc1 },
  369. { R0900_P2_CFRICFG , 0xf8 },
  370. { R0900_P2_NOSCFG , 0x1c },
  371. { R0900_P2_DMDT0M , 0x20 },
  372. { R0900_P2_CORRELMANT , 0x70 },
  373. { R0900_P2_CORRELABS , 0x88 },
  374. { R0900_P2_AGC2O , 0x5b },
  375. { R0900_P2_AGC2REF , 0x38 },
  376. { R0900_P2_CARCFG , 0xe4 },
  377. { R0900_P2_ACLC , 0x1A },
  378. { R0900_P2_BCLC , 0x09 },
  379. { R0900_P2_CARHDR , 0x08 },
  380. { R0900_P2_KREFTMG , 0xc1 },
  381. { R0900_P2_SFRUPRATIO , 0xf0 },
  382. { R0900_P2_SFRLOWRATIO , 0x70 },
  383. { R0900_P2_SFRSTEP , 0x58 },
  384. { R0900_P2_TMGCFG2 , 0x01 },
  385. { R0900_P2_CAR2CFG , 0x26 },
  386. { R0900_P2_BCLC2S2Q , 0x86 },
  387. { R0900_P2_BCLC2S28 , 0x86 },
  388. { R0900_P2_SMAPCOEF7 , 0x77 },
  389. { R0900_P2_SMAPCOEF6 , 0x85 },
  390. { R0900_P2_SMAPCOEF5 , 0x77 },
  391. { R0900_P2_TSCFGL , 0x20 },
  392. { R0900_P2_DMDCFG2 , 0x3b },
  393. { R0900_P2_MODCODLST0 , 0xff },
  394. { R0900_P2_MODCODLST1 , 0xff },
  395. { R0900_P2_MODCODLST2 , 0xff },
  396. { R0900_P2_MODCODLST3 , 0xff },
  397. { R0900_P2_MODCODLST4 , 0xff },
  398. { R0900_P2_MODCODLST5 , 0xff },
  399. { R0900_P2_MODCODLST6 , 0xff },
  400. { R0900_P2_MODCODLST7 , 0xcc },
  401. { R0900_P2_MODCODLST8 , 0xcc },
  402. { R0900_P2_MODCODLST9 , 0xcc },
  403. { R0900_P2_MODCODLSTA , 0xcc },
  404. { R0900_P2_MODCODLSTB , 0xcc },
  405. { R0900_P2_MODCODLSTC , 0xcc },
  406. { R0900_P2_MODCODLSTD , 0xcc },
  407. { R0900_P2_MODCODLSTE , 0xcc },
  408. { R0900_P2_MODCODLSTF , 0xcf },
  409. { R0900_P1_DISTXCTL , 0x22 },
  410. { R0900_P1_F22TX , 0xc0 },
  411. { R0900_P1_F22RX , 0xc0 },
  412. { R0900_P1_DISRXCTL , 0x00 },
  413. { R0900_P1_TNRSTEPS , 0x87 },
  414. { R0900_P1_TNRGAIN , 0x09 },
  415. { R0900_P1_DMDCFGMD , 0xf9 },
  416. { R0900_P1_DEMOD , 0x08 },
  417. { R0900_P1_DMDCFG3 , 0xc4 },
  418. { R0900_P1_DMDT0M , 0x20 },
  419. { R0900_P1_CARFREQ , 0xed },
  420. { R0900_P1_TNRCFG2 , 0x82 },
  421. { R0900_P1_TNRCFG3 , 0x02 },
  422. { R0900_P1_LDT , 0xd0 },
  423. { R0900_P1_LDT2 , 0xb8 },
  424. { R0900_P1_TMGCFG , 0xd2 },
  425. { R0900_P1_TMGTHRISE , 0x20 },
  426. { R0900_P1_TMGTHFALL , 0x00 },
  427. { R0900_P1_SFRUPRATIO , 0xf0 },
  428. { R0900_P1_SFRLOWRATIO , 0x70 },
  429. { R0900_P1_TSCFGL , 0x20 },
  430. { R0900_P1_FECSPY , 0x88 },
  431. { R0900_P1_FSPYDATA , 0x3a },
  432. { R0900_P1_FBERCPT4 , 0x00 },
  433. { R0900_P1_FSPYBER , 0x10 },
  434. { R0900_P1_ERRCTRL1 , 0x35 },
  435. { R0900_P1_ERRCTRL2 , 0xc1 },
  436. { R0900_P1_CFRICFG , 0xf8 },
  437. { R0900_P1_NOSCFG , 0x1c },
  438. { R0900_P1_CORRELMANT , 0x70 },
  439. { R0900_P1_CORRELABS , 0x88 },
  440. { R0900_P1_AGC2O , 0x5b },
  441. { R0900_P1_AGC2REF , 0x38 },
  442. { R0900_P1_CARCFG , 0xe4 },
  443. { R0900_P1_ACLC , 0x1A },
  444. { R0900_P1_BCLC , 0x09 },
  445. { R0900_P1_CARHDR , 0x08 },
  446. { R0900_P1_KREFTMG , 0xc1 },
  447. { R0900_P1_SFRSTEP , 0x58 },
  448. { R0900_P1_TMGCFG2 , 0x01 },
  449. { R0900_P1_CAR2CFG , 0x26 },
  450. { R0900_P1_BCLC2S2Q , 0x86 },
  451. { R0900_P1_BCLC2S28 , 0x86 },
  452. { R0900_P1_SMAPCOEF7 , 0x77 },
  453. { R0900_P1_SMAPCOEF6 , 0x85 },
  454. { R0900_P1_SMAPCOEF5 , 0x77 },
  455. { R0900_P1_DMDCFG2 , 0x3b },
  456. { R0900_P1_MODCODLST0 , 0xff },
  457. { R0900_P1_MODCODLST1 , 0xff },
  458. { R0900_P1_MODCODLST2 , 0xff },
  459. { R0900_P1_MODCODLST3 , 0xff },
  460. { R0900_P1_MODCODLST4 , 0xff },
  461. { R0900_P1_MODCODLST5 , 0xff },
  462. { R0900_P1_MODCODLST6 , 0xff },
  463. { R0900_P1_MODCODLST7 , 0xcc },
  464. { R0900_P1_MODCODLST8 , 0xcc },
  465. { R0900_P1_MODCODLST9 , 0xcc },
  466. { R0900_P1_MODCODLSTA , 0xcc },
  467. { R0900_P1_MODCODLSTB , 0xcc },
  468. { R0900_P1_MODCODLSTC , 0xcc },
  469. { R0900_P1_MODCODLSTD , 0xcc },
  470. { R0900_P1_MODCODLSTE , 0xcc },
  471. { R0900_P1_MODCODLSTF , 0xcf },
  472. { R0900_GENCFG , 0x1d },
  473. { R0900_NBITER_NF4 , 0x37 },
  474. { R0900_NBITER_NF5 , 0x29 },
  475. { R0900_NBITER_NF6 , 0x37 },
  476. { R0900_NBITER_NF7 , 0x33 },
  477. { R0900_NBITER_NF8 , 0x31 },
  478. { R0900_NBITER_NF9 , 0x2f },
  479. { R0900_NBITER_NF10 , 0x39 },
  480. { R0900_NBITER_NF11 , 0x3a },
  481. { R0900_NBITER_NF12 , 0x29 },
  482. { R0900_NBITER_NF13 , 0x37 },
  483. { R0900_NBITER_NF14 , 0x33 },
  484. { R0900_NBITER_NF15 , 0x2f },
  485. { R0900_NBITER_NF16 , 0x39 },
  486. { R0900_NBITER_NF17 , 0x3a },
  487. { R0900_NBITERNOERR , 0x04 },
  488. { R0900_GAINLLR_NF4 , 0x0C },
  489. { R0900_GAINLLR_NF5 , 0x0F },
  490. { R0900_GAINLLR_NF6 , 0x11 },
  491. { R0900_GAINLLR_NF7 , 0x14 },
  492. { R0900_GAINLLR_NF8 , 0x17 },
  493. { R0900_GAINLLR_NF9 , 0x19 },
  494. { R0900_GAINLLR_NF10 , 0x20 },
  495. { R0900_GAINLLR_NF11 , 0x21 },
  496. { R0900_GAINLLR_NF12 , 0x0D },
  497. { R0900_GAINLLR_NF13 , 0x0F },
  498. { R0900_GAINLLR_NF14 , 0x13 },
  499. { R0900_GAINLLR_NF15 , 0x1A },
  500. { R0900_GAINLLR_NF16 , 0x1F },
  501. { R0900_GAINLLR_NF17 , 0x21 },
  502. { R0900_RCCFG2 , 0x20 },
  503. { R0900_P1_FECM , 0x01 }, /*disable DSS modes*/
  504. { R0900_P2_FECM , 0x01 }, /*disable DSS modes*/
  505. { R0900_P1_PRVIT , 0x2F }, /*disable puncture rate 6/7*/
  506. { R0900_P2_PRVIT , 0x2F }, /*disable puncture rate 6/7*/
  507. { R0900_STROUT1CFG , 0x4c },
  508. { R0900_STROUT2CFG , 0x4c },
  509. { R0900_CLKOUT1CFG , 0x50 },
  510. { R0900_CLKOUT2CFG , 0x50 },
  511. { R0900_DPN1CFG , 0x4a },
  512. { R0900_DPN2CFG , 0x4a },
  513. { R0900_DATA71CFG , 0x52 },
  514. { R0900_DATA72CFG , 0x52 },
  515. { R0900_P1_TSCFGM , 0xc0 },
  516. { R0900_P2_TSCFGM , 0xc0 },
  517. { R0900_P1_TSCFGH , 0xe0 }, /* DVB-CI timings */
  518. { R0900_P2_TSCFGH , 0xe0 }, /* DVB-CI timings */
  519. { R0900_P1_TSSPEED , 0x40 },
  520. { R0900_P2_TSSPEED , 0x40 },
  521. };
  522. static const u16 STV0900_Cut20_AddOnVal[32][2] = {
  523. { R0900_P2_DMDCFG3 , 0xe8 },
  524. { R0900_P2_DMDCFG4 , 0x10 },
  525. { R0900_P2_CARFREQ , 0x38 },
  526. { R0900_P2_CARHDR , 0x20 },
  527. { R0900_P2_KREFTMG , 0x5a },
  528. { R0900_P2_SMAPCOEF7 , 0x06 },
  529. { R0900_P2_SMAPCOEF6 , 0x00 },
  530. { R0900_P2_SMAPCOEF5 , 0x04 },
  531. { R0900_P2_NOSCFG , 0x0c },
  532. { R0900_P1_DMDCFG3 , 0xe8 },
  533. { R0900_P1_DMDCFG4 , 0x10 },
  534. { R0900_P1_CARFREQ , 0x38 },
  535. { R0900_P1_CARHDR , 0x20 },
  536. { R0900_P1_KREFTMG , 0x5a },
  537. { R0900_P1_SMAPCOEF7 , 0x06 },
  538. { R0900_P1_SMAPCOEF6 , 0x00 },
  539. { R0900_P1_SMAPCOEF5 , 0x04 },
  540. { R0900_P1_NOSCFG , 0x0c },
  541. { R0900_GAINLLR_NF4 , 0x21 },
  542. { R0900_GAINLLR_NF5 , 0x21 },
  543. { R0900_GAINLLR_NF6 , 0x20 },
  544. { R0900_GAINLLR_NF7 , 0x1F },
  545. { R0900_GAINLLR_NF8 , 0x1E },
  546. { R0900_GAINLLR_NF9 , 0x1E },
  547. { R0900_GAINLLR_NF10 , 0x1D },
  548. { R0900_GAINLLR_NF11 , 0x1B },
  549. { R0900_GAINLLR_NF12 , 0x20 },
  550. { R0900_GAINLLR_NF13 , 0x20 },
  551. { R0900_GAINLLR_NF14 , 0x20 },
  552. { R0900_GAINLLR_NF15 , 0x20 },
  553. { R0900_GAINLLR_NF16 , 0x20 },
  554. { R0900_GAINLLR_NF17 , 0x21 }
  555. };
  556. #endif