fc2580_priv.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * FCI FC2580 silicon tuner driver
  3. *
  4. * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. */
  20. #ifndef FC2580_PRIV_H
  21. #define FC2580_PRIV_H
  22. #include "fc2580.h"
  23. struct fc2580_reg_val {
  24. u8 reg;
  25. u8 val;
  26. };
  27. static const struct fc2580_reg_val fc2580_init_reg_vals[] = {
  28. {0x00, 0x00},
  29. {0x12, 0x86},
  30. {0x14, 0x5c},
  31. {0x16, 0x3c},
  32. {0x1f, 0xd2},
  33. {0x09, 0xd7},
  34. {0x0b, 0xd5},
  35. {0x0c, 0x32},
  36. {0x0e, 0x43},
  37. {0x21, 0x0a},
  38. {0x22, 0x82},
  39. {0x45, 0x10},
  40. {0x4c, 0x00},
  41. {0x3f, 0x88},
  42. {0x02, 0x0e},
  43. {0x58, 0x14},
  44. };
  45. struct fc2580_pll {
  46. u32 freq;
  47. u8 div;
  48. u8 band;
  49. };
  50. static const struct fc2580_pll fc2580_pll_lut[] = {
  51. /* VCO min VCO max */
  52. { 400000000, 12, 0x80}, /* .......... 4800000000 */
  53. {1000000000, 4, 0x00}, /* 1600000000 4000000000 */
  54. {0xffffffff, 2, 0x40}, /* 2000000000 .......... */
  55. };
  56. struct fc2580_if_filter {
  57. u32 freq;
  58. u16 mul;
  59. u8 r36_val;
  60. u8 r39_val;
  61. };
  62. static const struct fc2580_if_filter fc2580_if_filter_lut[] = {
  63. { 6000000, 4400, 0x18, 0x00},
  64. { 7000000, 3910, 0x18, 0x80},
  65. { 8000000, 3300, 0x18, 0x80},
  66. {0xffffffff, 3300, 0x18, 0x80},
  67. };
  68. struct fc2580_freq_regs {
  69. u32 freq;
  70. u8 r25_val;
  71. u8 r27_val;
  72. u8 r28_val;
  73. u8 r29_val;
  74. u8 r2b_val;
  75. u8 r2c_val;
  76. u8 r2d_val;
  77. u8 r30_val;
  78. u8 r44_val;
  79. u8 r50_val;
  80. u8 r53_val;
  81. u8 r5f_val;
  82. u8 r61_val;
  83. u8 r62_val;
  84. u8 r63_val;
  85. u8 r67_val;
  86. u8 r68_val;
  87. u8 r69_val;
  88. u8 r6a_val;
  89. u8 r6b_val;
  90. u8 r6c_val;
  91. u8 r6d_val;
  92. u8 r6e_val;
  93. u8 r6f_val;
  94. };
  95. /* XXX: 0xff is used for don't-care! */
  96. static const struct fc2580_freq_regs fc2580_freq_regs_lut[] = {
  97. { 400000000,
  98. 0xff, 0x77, 0x33, 0x40, 0xff, 0xff, 0xff, 0x09, 0xff, 0x8c,
  99. 0x50, 0x0f, 0x07, 0x00, 0x15, 0x03, 0x05, 0x10, 0x12, 0x08,
  100. 0x0a, 0x78, 0x32, 0x54},
  101. { 538000000,
  102. 0xf0, 0x77, 0x53, 0x60, 0xff, 0xff, 0xff, 0x09, 0xff, 0x8c,
  103. 0x50, 0x13, 0x07, 0x06, 0x15, 0x06, 0x08, 0x10, 0x12, 0x0b,
  104. 0x0c, 0x78, 0x32, 0x14},
  105. { 794000000,
  106. 0xf0, 0x77, 0x53, 0x60, 0xff, 0xff, 0xff, 0x09, 0xff, 0x8c,
  107. 0x50, 0x15, 0x03, 0x03, 0x15, 0x03, 0x05, 0x0c, 0x0e, 0x0b,
  108. 0x0c, 0x78, 0x32, 0x14},
  109. {1000000000,
  110. 0xf0, 0x77, 0x53, 0x60, 0xff, 0xff, 0xff, 0x09, 0xff, 0x8c,
  111. 0x50, 0x15, 0x07, 0x06, 0x15, 0x07, 0x09, 0x10, 0x12, 0x0b,
  112. 0x0c, 0x78, 0x32, 0x14},
  113. {0xffffffff,
  114. 0xff, 0xff, 0xff, 0xff, 0x70, 0x37, 0xe7, 0x09, 0x20, 0x8c,
  115. 0x50, 0x0f, 0x0f, 0x00, 0x13, 0x00, 0x02, 0x0c, 0x0e, 0x08,
  116. 0x0a, 0xa0, 0x50, 0x14},
  117. };
  118. struct fc2580_priv {
  119. const struct fc2580_config *cfg;
  120. struct i2c_adapter *i2c;
  121. };
  122. #endif