qt1010_priv.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. #ifndef QT1010_PRIV_H
  18. #define QT1010_PRIV_H
  19. /*
  20. reg def meaning
  21. === === =======
  22. 00 00 ?
  23. 01 a0 ? operation start/stop; start=80, stop=00
  24. 02 00 ?
  25. 03 19 ?
  26. 04 00 ?
  27. 05 00 ? maybe band selection
  28. 06 00 ?
  29. 07 2b set frequency: 32 MHz scale, n*32 MHz
  30. 08 0b ?
  31. 09 10 ? changes every 8/24 MHz; values 1d/1c
  32. 0a 08 set frequency: 4 MHz scale, n*4 MHz
  33. 0b 41 ? changes every 2/2 MHz; values 45/45
  34. 0c e1 ?
  35. 0d 94 ?
  36. 0e b6 ?
  37. 0f 2c ?
  38. 10 10 ?
  39. 11 f1 ? maybe device specified adjustment
  40. 12 11 ? maybe device specified adjustment
  41. 13 3f ?
  42. 14 1f ?
  43. 15 3f ?
  44. 16 ff ?
  45. 17 ff ?
  46. 18 f7 ?
  47. 19 80 ?
  48. 1a d0 set frequency: 125 kHz scale, n*125 kHz
  49. 1b 00 ?
  50. 1c 89 ?
  51. 1d 00 ?
  52. 1e 00 ? looks like operation register; write cmd here, read result from 1f-26
  53. 1f 20 ? chip initialization
  54. 20 e0 ? chip initialization
  55. 21 20 ?
  56. 22 d0 ?
  57. 23 d0 ?
  58. 24 d0 ?
  59. 25 40 ? chip initialization
  60. 26 08 ?
  61. 27 29 ?
  62. 28 55 ?
  63. 29 39 ?
  64. 2a 13 ?
  65. 2b 01 ?
  66. 2c ea ?
  67. 2d 00 ?
  68. 2e 00 ? not used?
  69. 2f 00 ? not used?
  70. */
  71. #define QT1010_STEP 125000 /* 125 kHz used by Windows drivers,
  72. hw could be more precise but we don't
  73. know how to use */
  74. #define QT1010_MIN_FREQ 48000000 /* 48 MHz */
  75. #define QT1010_MAX_FREQ 860000000 /* 860 MHz */
  76. #define QT1010_OFFSET 1246000000 /* 1246 MHz */
  77. #define QT1010_WR 0
  78. #define QT1010_RD 1
  79. #define QT1010_M1 3
  80. typedef struct {
  81. u8 oper, reg, val;
  82. } qt1010_i2c_oper_t;
  83. struct qt1010_priv {
  84. struct qt1010_config *cfg;
  85. struct i2c_adapter *i2c;
  86. u8 reg1f_init_val;
  87. u8 reg20_init_val;
  88. u8 reg25_init_val;
  89. u32 frequency;
  90. };
  91. #endif