Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * include/media/si476x-platform.h -- Definitions of the data formats
0004  * returned by debugfs hooks
0005  *
0006  * Copyright (C) 2013 Andrey Smirnov
0007  *
0008  * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
0009  */
0010 
0011 #ifndef __SI476X_REPORTS_H__
0012 #define __SI476X_REPORTS_H__
0013 
0014 /**
0015  * struct si476x_rsq_status - structure containing received signal
0016  * quality
0017  * @multhint:   Multipath Detect High.
0018  *              true  - Indicatedes that the value is below
0019  *                      FM_RSQ_MULTIPATH_HIGH_THRESHOLD
0020  *              false - Indicatedes that the value is above
0021  *                      FM_RSQ_MULTIPATH_HIGH_THRESHOLD
0022  * @multlint:   Multipath Detect Low.
0023  *              true  - Indicatedes that the value is below
0024  *                      FM_RSQ_MULTIPATH_LOW_THRESHOLD
0025  *              false - Indicatedes that the value is above
0026  *                      FM_RSQ_MULTIPATH_LOW_THRESHOLD
0027  * @snrhint:    SNR Detect High.
0028  *              true  - Indicatedes that the value is below
0029  *                      FM_RSQ_SNR_HIGH_THRESHOLD
0030  *              false - Indicatedes that the value is above
0031  *                      FM_RSQ_SNR_HIGH_THRESHOLD
0032  * @snrlint:    SNR Detect Low.
0033  *              true  - Indicatedes that the value is below
0034  *                      FM_RSQ_SNR_LOW_THRESHOLD
0035  *              false - Indicatedes that the value is above
0036  *                      FM_RSQ_SNR_LOW_THRESHOLD
0037  * @rssihint:   RSSI Detect High.
0038  *              true  - Indicatedes that the value is below
0039  *                      FM_RSQ_RSSI_HIGH_THRESHOLD
0040  *              false - Indicatedes that the value is above
0041  *                      FM_RSQ_RSSI_HIGH_THRESHOLD
0042  * @rssilint:   RSSI Detect Low.
0043  *              true  - Indicatedes that the value is below
0044  *                      FM_RSQ_RSSI_LOW_THRESHOLD
0045  *              false - Indicatedes that the value is above
0046  *                      FM_RSQ_RSSI_LOW_THRESHOLD
0047  * @bltf:       Band Limit.
0048  *              Set if seek command hits the band limit or wrapped to
0049  *              the original frequency.
0050  * @snr_ready:  SNR measurement in progress.
0051  * @rssiready:  RSSI measurement in progress.
0052  * @afcrl:      Set if FREQOFF >= MAX_TUNE_ERROR
0053  * @valid:      Set if the channel is valid
0054  *               rssi < FM_VALID_RSSI_THRESHOLD
0055  *               snr  < FM_VALID_SNR_THRESHOLD
0056  *               tune_error < FM_VALID_MAX_TUNE_ERROR
0057  * @readfreq:   Current tuned frequency.
0058  * @freqoff:    Signed frequency offset.
0059  * @rssi:       Received Signal Strength Indicator(dBuV).
0060  * @snr:        RF SNR Indicator(dB).
0061  * @lassi:
0062  * @hassi:      Low/High side Adjacent(100 kHz) Channel Strength Indicator
0063  * @mult:       Multipath indicator
0064  * @dev:        Who knows? But values may vary.
0065  * @readantcap: Antenna tuning capacity value.
0066  * @assi:       Adjacent Channel(+/- 200kHz) Strength Indicator
0067  * @usn:        Ultrasonic Noise Inticator in -DBFS
0068  */
0069 struct si476x_rsq_status_report {
0070     __u8 multhint, multlint;
0071     __u8 snrhint,  snrlint;
0072     __u8 rssihint, rssilint;
0073     __u8 bltf;
0074     __u8 snr_ready;
0075     __u8 rssiready;
0076     __u8 injside;
0077     __u8 afcrl;
0078     __u8 valid;
0079 
0080     __u16 readfreq;
0081     __s8  freqoff;
0082     __s8  rssi;
0083     __s8  snr;
0084     __s8  issi;
0085     __s8  lassi, hassi;
0086     __s8  mult;
0087     __u8  dev;
0088     __u16 readantcap;
0089     __s8  assi;
0090     __s8  usn;
0091 
0092     __u8 pilotdev;
0093     __u8 rdsdev;
0094     __u8 assidev;
0095     __u8 strongdev;
0096     __u16 rdspi;
0097 } __packed;
0098 
0099 /**
0100  * si476x_acf_status_report - ACF report results
0101  *
0102  * @blend_int: If set, indicates that stereo separation has crossed
0103  * below the blend threshold as set by FM_ACF_BLEND_THRESHOLD
0104  * @hblend_int: If set, indicates that HiBlend cutoff frequency is
0105  * lower than threshold as set by FM_ACF_HBLEND_THRESHOLD
0106  * @hicut_int:  If set, indicates that HiCut cutoff frequency is lower
0107  * than the threshold set by ACF_
0108 
0109  */
0110 struct si476x_acf_status_report {
0111     __u8 blend_int;
0112     __u8 hblend_int;
0113     __u8 hicut_int;
0114     __u8 chbw_int;
0115     __u8 softmute_int;
0116     __u8 smute;
0117     __u8 smattn;
0118     __u8 chbw;
0119     __u8 hicut;
0120     __u8 hiblend;
0121     __u8 pilot;
0122     __u8 stblend;
0123 } __packed;
0124 
0125 enum si476x_fmagc {
0126     SI476X_FMAGC_10K_OHM    = 0,
0127     SI476X_FMAGC_800_OHM    = 1,
0128     SI476X_FMAGC_400_OHM    = 2,
0129     SI476X_FMAGC_200_OHM    = 4,
0130     SI476X_FMAGC_100_OHM    = 8,
0131     SI476X_FMAGC_50_OHM = 16,
0132     SI476X_FMAGC_25_OHM = 32,
0133     SI476X_FMAGC_12P5_OHM   = 64,
0134     SI476X_FMAGC_6P25_OHM   = 128,
0135 };
0136 
0137 struct si476x_agc_status_report {
0138     __u8 mxhi;
0139     __u8 mxlo;
0140     __u8 lnahi;
0141     __u8 lnalo;
0142     __u8 fmagc1;
0143     __u8 fmagc2;
0144     __u8 pgagain;
0145     __u8 fmwblang;
0146 } __packed;
0147 
0148 struct si476x_rds_blockcount_report {
0149     __u16 expected;
0150     __u16 received;
0151     __u16 uncorrectable;
0152 } __packed;
0153 
0154 #endif  /* __SI476X_REPORTS_H__ */