qcacmn: Clamp the FFT bin values before filling SAMP message

Each FFT bin value is represented as an 8 bit integer
in SAMP message. But depending on the configuration,
the FFT bin value reported by HW might exceed 8 bits.
Clamp the FFT bin value between the min and max value
which can be represented by 8 bits. For linear mode,
min and max FFT bin value which can be represented by
8 bit is 0 and U8_MAX respectively. For dBm mode,  min
and max FFT bin value which can be represented by 8 bit
is S8_MIN and S8_MAX respectively.

CRs-Fixed: 3056458
Change-Id: I9ec75f781a130d3ed0d0d9393975fd5874961ce0
This commit is contained in:
Edayilliam Jayadev
2021-10-20 14:03:24 +05:30
کامیت شده توسط Madan Koyyalamudi
والد b94a1425ae
کامیت 31da41ae4e
4فایلهای تغییر یافته به همراه76 افزوده شده و 19 حذف شده

مشاهده پرونده

@@ -117,6 +117,16 @@ enum spectral_report_mode {
SPECTRAL_REPORT_MODE_MAX,
};
/**
* enum spectral_pwr_format: Spectral FFT bin pwr format
* @SPECTRAL_PWR_FORMAT_LINEAR: Linear mode
* @SPECTRAL_PWR_FORMAT_DBM: dBm mode
*/
enum spectral_pwr_format {
SPECTRAL_PWR_FORMAT_LINEAR = 0,
SPECTRAL_PWR_FORMAT_DBM = 1,
};
/**
* enum spectral_scan_priority: Spectral scan priority
* @SPECTRAL_SCAN_PRIORITY_LOW: Low priority Spectral scan