qt1010_priv.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Driver for Quantek QT1010 silicon tuner
  3. *
  4. * Copyright (C) 2006 Antti Palosaari <crope@iki.fi>
  5. * Aapo Tahkola <aet@rasterburn.org>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef QT1010_PRIV_H
  22. #define QT1010_PRIV_H
  23. /*
  24. reg def meaning
  25. === === =======
  26. 00 00 ?
  27. 01 a0 ? operation start/stop; start=80, stop=00
  28. 02 00 ?
  29. 03 19 ?
  30. 04 00 ?
  31. 05 00 ? maybe band selection
  32. 06 00 ?
  33. 07 2b set frequency: 32 MHz scale, n*32 MHz
  34. 08 0b ?
  35. 09 10 ? changes every 8/24 MHz; values 1d/1c
  36. 0a 08 set frequency: 4 MHz scale, n*4 MHz
  37. 0b 41 ? changes every 2/2 MHz; values 45/45
  38. 0c e1 ?
  39. 0d 94 ?
  40. 0e b6 ?
  41. 0f 2c ?
  42. 10 10 ?
  43. 11 f1 ? maybe device specified adjustment
  44. 12 11 ? maybe device specified adjustment
  45. 13 3f ?
  46. 14 1f ?
  47. 15 3f ?
  48. 16 ff ?
  49. 17 ff ?
  50. 18 f7 ?
  51. 19 80 ?
  52. 1a d0 set frequency: 125 kHz scale, n*125 kHz
  53. 1b 00 ?
  54. 1c 89 ?
  55. 1d 00 ?
  56. 1e 00 ? looks like operation register; write cmd here, read result from 1f-26
  57. 1f 20 ? chip initialization
  58. 20 e0 ? chip initialization
  59. 21 20 ?
  60. 22 d0 ?
  61. 23 d0 ?
  62. 24 d0 ?
  63. 25 40 ? chip initialization
  64. 26 08 ?
  65. 27 29 ?
  66. 28 55 ?
  67. 29 39 ?
  68. 2a 13 ?
  69. 2b 01 ?
  70. 2c ea ?
  71. 2d 00 ?
  72. 2e 00 ? not used?
  73. 2f 00 ? not used?
  74. */
  75. #define QT1010_STEP 125000 /* 125 kHz used by Windows drivers,
  76. hw could be more precise but we don't
  77. know how to use */
  78. #define QT1010_MIN_FREQ 48000000 /* 48 MHz */
  79. #define QT1010_MAX_FREQ 860000000 /* 860 MHz */
  80. #define QT1010_OFFSET 1246000000 /* 1246 MHz */
  81. #define QT1010_WR 0
  82. #define QT1010_RD 1
  83. #define QT1010_M1 3
  84. typedef struct {
  85. u8 oper, reg, val;
  86. } qt1010_i2c_oper_t;
  87. struct qt1010_priv {
  88. struct qt1010_config *cfg;
  89. struct i2c_adapter *i2c;
  90. u8 reg1f_init_val;
  91. u8 reg20_init_val;
  92. u8 reg25_init_val;
  93. u32 frequency;
  94. };
  95. #endif