m88ds3103_priv.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /*
  2. * Montage M88DS3103 demodulator driver
  3. *
  4. * Copyright (C) 2013 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. #ifndef M88DS3103_PRIV_H
  17. #define M88DS3103_PRIV_H
  18. #include "dvb_frontend.h"
  19. #include "m88ds3103.h"
  20. #include "dvb_math.h"
  21. #include <linux/firmware.h>
  22. #include <linux/i2c-mux.h>
  23. #define M88DS3103_FIRMWARE "dvb-demod-m88ds3103.fw"
  24. #define M88DS3103_MCLK_KHZ 96000
  25. struct m88ds3103_priv {
  26. struct i2c_adapter *i2c;
  27. /* mutex needed due to own tuner I2C adapter */
  28. struct mutex i2c_mutex;
  29. const struct m88ds3103_config *cfg;
  30. struct dvb_frontend fe;
  31. fe_delivery_system_t delivery_system;
  32. fe_status_t fe_status;
  33. bool warm; /* FW running */
  34. struct i2c_adapter *i2c_adapter;
  35. };
  36. struct m88ds3103_reg_val {
  37. u8 reg;
  38. u8 val;
  39. };
  40. static const struct m88ds3103_reg_val m88ds3103_dvbs_init_reg_vals[] = {
  41. {0x23, 0x07},
  42. {0x08, 0x03},
  43. {0x0c, 0x02},
  44. {0x21, 0x54},
  45. {0x25, 0x8a},
  46. {0x27, 0x31},
  47. {0x30, 0x08},
  48. {0x31, 0x40},
  49. {0x32, 0x32},
  50. {0x35, 0xff},
  51. {0x3a, 0x00},
  52. {0x37, 0x10},
  53. {0x38, 0x10},
  54. {0x39, 0x02},
  55. {0x42, 0x60},
  56. {0x4a, 0x80},
  57. {0x4b, 0x04},
  58. {0x4d, 0x91},
  59. {0x5d, 0xc8},
  60. {0x50, 0x36},
  61. {0x51, 0x36},
  62. {0x52, 0x36},
  63. {0x53, 0x36},
  64. {0x56, 0x01},
  65. {0x63, 0x0f},
  66. {0x64, 0x30},
  67. {0x65, 0x40},
  68. {0x68, 0x26},
  69. {0x69, 0x4c},
  70. {0x70, 0x20},
  71. {0x71, 0x70},
  72. {0x72, 0x04},
  73. {0x73, 0x00},
  74. {0x70, 0x40},
  75. {0x71, 0x70},
  76. {0x72, 0x04},
  77. {0x73, 0x00},
  78. {0x70, 0x60},
  79. {0x71, 0x70},
  80. {0x72, 0x04},
  81. {0x73, 0x00},
  82. {0x70, 0x80},
  83. {0x71, 0x70},
  84. {0x72, 0x04},
  85. {0x73, 0x00},
  86. {0x70, 0xa0},
  87. {0x71, 0x70},
  88. {0x72, 0x04},
  89. {0x73, 0x00},
  90. {0x70, 0x1f},
  91. {0x76, 0x38},
  92. {0x77, 0xa6},
  93. {0x78, 0x0c},
  94. {0x79, 0x80},
  95. {0x7f, 0x14},
  96. {0x7c, 0x00},
  97. {0xae, 0x82},
  98. {0x80, 0x64},
  99. {0x81, 0x66},
  100. {0x82, 0x44},
  101. {0x85, 0x04},
  102. {0xcd, 0xf4},
  103. {0x90, 0x33},
  104. {0xa0, 0x44},
  105. {0xc0, 0x08},
  106. {0xc3, 0x10},
  107. {0xc4, 0x08},
  108. {0xc5, 0xf0},
  109. {0xc6, 0xff},
  110. {0xc7, 0x00},
  111. {0xc8, 0x1a},
  112. {0xc9, 0x80},
  113. {0xe0, 0xf8},
  114. {0xe6, 0x8b},
  115. {0xd0, 0x40},
  116. {0xf8, 0x20},
  117. {0xfa, 0x0f},
  118. {0x00, 0x00},
  119. {0xbd, 0x01},
  120. {0xb8, 0x00},
  121. };
  122. static const struct m88ds3103_reg_val m88ds3103_dvbs2_init_reg_vals[] = {
  123. {0x23, 0x07},
  124. {0x08, 0x07},
  125. {0x0c, 0x02},
  126. {0x21, 0x54},
  127. {0x25, 0x8a},
  128. {0x27, 0x31},
  129. {0x30, 0x08},
  130. {0x32, 0x32},
  131. {0x35, 0xff},
  132. {0x3a, 0x00},
  133. {0x37, 0x10},
  134. {0x38, 0x10},
  135. {0x39, 0x02},
  136. {0x42, 0x60},
  137. {0x4a, 0x80},
  138. {0x4b, 0x04},
  139. {0x4d, 0x91},
  140. {0x5d, 0xc8},
  141. {0x50, 0x36},
  142. {0x51, 0x36},
  143. {0x52, 0x36},
  144. {0x53, 0x36},
  145. {0x56, 0x01},
  146. {0x63, 0x0f},
  147. {0x64, 0x10},
  148. {0x65, 0x20},
  149. {0x68, 0x46},
  150. {0x69, 0xcd},
  151. {0x70, 0x20},
  152. {0x71, 0x70},
  153. {0x72, 0x04},
  154. {0x73, 0x00},
  155. {0x70, 0x40},
  156. {0x71, 0x70},
  157. {0x72, 0x04},
  158. {0x73, 0x00},
  159. {0x70, 0x60},
  160. {0x71, 0x70},
  161. {0x72, 0x04},
  162. {0x73, 0x00},
  163. {0x70, 0x80},
  164. {0x71, 0x70},
  165. {0x72, 0x04},
  166. {0x73, 0x00},
  167. {0x70, 0xa0},
  168. {0x71, 0x70},
  169. {0x72, 0x04},
  170. {0x73, 0x00},
  171. {0x70, 0x1f},
  172. {0x76, 0x38},
  173. {0x77, 0xa6},
  174. {0x78, 0x0c},
  175. {0x79, 0x80},
  176. {0x7f, 0x14},
  177. {0x85, 0x08},
  178. {0xcd, 0xf4},
  179. {0x90, 0x33},
  180. {0x86, 0x00},
  181. {0x87, 0x0f},
  182. {0x89, 0x00},
  183. {0x8b, 0x44},
  184. {0x8c, 0x66},
  185. {0x9d, 0xc1},
  186. {0x8a, 0x10},
  187. {0xad, 0x40},
  188. {0xa0, 0x44},
  189. {0xc0, 0x08},
  190. {0xc1, 0x10},
  191. {0xc2, 0x08},
  192. {0xc3, 0x10},
  193. {0xc4, 0x08},
  194. {0xc5, 0xf0},
  195. {0xc6, 0xff},
  196. {0xc7, 0x00},
  197. {0xc8, 0x1a},
  198. {0xc9, 0x80},
  199. {0xca, 0x23},
  200. {0xcb, 0x24},
  201. {0xcc, 0xf4},
  202. {0xce, 0x74},
  203. {0x00, 0x00},
  204. {0xbd, 0x01},
  205. {0xb8, 0x00},
  206. };
  207. #endif