si476x-reports.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * include/media/si476x-platform.h -- Definitions of the data formats
  3. * returned by debugfs hooks
  4. *
  5. * Copyright (C) 2013 Andrey Smirnov
  6. *
  7. * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; version 2 of the License.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. */
  19. #ifndef __SI476X_REPORTS_H__
  20. #define __SI476X_REPORTS_H__
  21. /**
  22. * struct si476x_rsq_status - structure containing received signal
  23. * quality
  24. * @multhint: Multipath Detect High.
  25. * true - Indicatedes that the value is below
  26. * FM_RSQ_MULTIPATH_HIGH_THRESHOLD
  27. * false - Indicatedes that the value is above
  28. * FM_RSQ_MULTIPATH_HIGH_THRESHOLD
  29. * @multlint: Multipath Detect Low.
  30. * true - Indicatedes that the value is below
  31. * FM_RSQ_MULTIPATH_LOW_THRESHOLD
  32. * false - Indicatedes that the value is above
  33. * FM_RSQ_MULTIPATH_LOW_THRESHOLD
  34. * @snrhint: SNR Detect High.
  35. * true - Indicatedes that the value is below
  36. * FM_RSQ_SNR_HIGH_THRESHOLD
  37. * false - Indicatedes that the value is above
  38. * FM_RSQ_SNR_HIGH_THRESHOLD
  39. * @snrlint: SNR Detect Low.
  40. * true - Indicatedes that the value is below
  41. * FM_RSQ_SNR_LOW_THRESHOLD
  42. * false - Indicatedes that the value is above
  43. * FM_RSQ_SNR_LOW_THRESHOLD
  44. * @rssihint: RSSI Detect High.
  45. * true - Indicatedes that the value is below
  46. * FM_RSQ_RSSI_HIGH_THRESHOLD
  47. * false - Indicatedes that the value is above
  48. * FM_RSQ_RSSI_HIGH_THRESHOLD
  49. * @rssilint: RSSI Detect Low.
  50. * true - Indicatedes that the value is below
  51. * FM_RSQ_RSSI_LOW_THRESHOLD
  52. * false - Indicatedes that the value is above
  53. * FM_RSQ_RSSI_LOW_THRESHOLD
  54. * @bltf: Band Limit.
  55. * Set if seek command hits the band limit or wrapped to
  56. * the original frequency.
  57. * @snr_ready: SNR measurement in progress.
  58. * @rssiready: RSSI measurement in progress.
  59. * @afcrl: Set if FREQOFF >= MAX_TUNE_ERROR
  60. * @valid: Set if the channel is valid
  61. * rssi < FM_VALID_RSSI_THRESHOLD
  62. * snr < FM_VALID_SNR_THRESHOLD
  63. * tune_error < FM_VALID_MAX_TUNE_ERROR
  64. * @readfreq: Current tuned frequency.
  65. * @freqoff: Signed frequency offset.
  66. * @rssi: Received Signal Strength Indicator(dBuV).
  67. * @snr: RF SNR Indicator(dB).
  68. * @lassi:
  69. * @hassi: Low/High side Adjacent(100 kHz) Channel Strength Indicator
  70. * @mult: Multipath indicator
  71. * @dev: Who knows? But values may vary.
  72. * @readantcap: Antenna tuning capacity value.
  73. * @assi: Adjacent Channel(+/- 200kHz) Strength Indicator
  74. * @usn: Ultrasonic Noise Inticator in -DBFS
  75. */
  76. struct si476x_rsq_status_report {
  77. __u8 multhint, multlint;
  78. __u8 snrhint, snrlint;
  79. __u8 rssihint, rssilint;
  80. __u8 bltf;
  81. __u8 snr_ready;
  82. __u8 rssiready;
  83. __u8 injside;
  84. __u8 afcrl;
  85. __u8 valid;
  86. __u16 readfreq;
  87. __s8 freqoff;
  88. __s8 rssi;
  89. __s8 snr;
  90. __s8 issi;
  91. __s8 lassi, hassi;
  92. __s8 mult;
  93. __u8 dev;
  94. __u16 readantcap;
  95. __s8 assi;
  96. __s8 usn;
  97. __u8 pilotdev;
  98. __u8 rdsdev;
  99. __u8 assidev;
  100. __u8 strongdev;
  101. __u16 rdspi;
  102. } __packed;
  103. /**
  104. * si476x_acf_status_report - ACF report results
  105. *
  106. * @blend_int: If set, indicates that stereo separation has crossed
  107. * below the blend threshold as set by FM_ACF_BLEND_THRESHOLD
  108. * @hblend_int: If set, indicates that HiBlend cutoff frequency is
  109. * lower than threshold as set by FM_ACF_HBLEND_THRESHOLD
  110. * @hicut_int: If set, indicates that HiCut cutoff frequency is lower
  111. * than the threshold set by ACF_
  112. */
  113. struct si476x_acf_status_report {
  114. __u8 blend_int;
  115. __u8 hblend_int;
  116. __u8 hicut_int;
  117. __u8 chbw_int;
  118. __u8 softmute_int;
  119. __u8 smute;
  120. __u8 smattn;
  121. __u8 chbw;
  122. __u8 hicut;
  123. __u8 hiblend;
  124. __u8 pilot;
  125. __u8 stblend;
  126. } __packed;
  127. enum si476x_fmagc {
  128. SI476X_FMAGC_10K_OHM = 0,
  129. SI476X_FMAGC_800_OHM = 1,
  130. SI476X_FMAGC_400_OHM = 2,
  131. SI476X_FMAGC_200_OHM = 4,
  132. SI476X_FMAGC_100_OHM = 8,
  133. SI476X_FMAGC_50_OHM = 16,
  134. SI476X_FMAGC_25_OHM = 32,
  135. SI476X_FMAGC_12P5_OHM = 64,
  136. SI476X_FMAGC_6P25_OHM = 128,
  137. };
  138. struct si476x_agc_status_report {
  139. __u8 mxhi;
  140. __u8 mxlo;
  141. __u8 lnahi;
  142. __u8 lnalo;
  143. __u8 fmagc1;
  144. __u8 fmagc2;
  145. __u8 pgagain;
  146. __u8 fmwblang;
  147. } __packed;
  148. struct si476x_rds_blockcount_report {
  149. __u16 expected;
  150. __u16 received;
  151. __u16 uncorrectable;
  152. } __packed;
  153. #endif /* __SI476X_REPORTS_H__ */