hal: send natural value for limiter threshold to adsp for spv3
ADSP requests natural value of limiter threshold in q27 format
instead of dB value.
Change-Id: I1487f282d8a4f525e8c9eeb282f9f4fc501358c3
diff --git a/hal/audio_extn/spkr_protection.c b/hal/audio_extn/spkr_protection.c
index ea4d856..589a391 100644
--- a/hal/audio_extn/spkr_protection.c
+++ b/hal/audio_extn/spkr_protection.c
@@ -70,8 +70,8 @@
#define MIN_RESISTANCE_LOOKUP (3.2)
#define MAX_RESISTANCE_LOOKUP (8)
#define SPV3_LOOKUP_TABLE_ROWS (49)
-/* default limiter threshold is 0dB */
-#define DEFAULT_LIMITER_TH (0x0)
+/* default limiter threshold is 0dB(0x7FFFFFF in natural value) */
+#define DEFAULT_LIMITER_TH (0x07FFFFFF)
#define AFE_API_VERSION_SUPPORT_SPV3 (0x2)
enum spv3_boost_max_state {
BOOST_NO_MAX_STATE,
@@ -275,15 +275,15 @@
/* 3.2ohm : 0.1ohm : 8ohm lookup table */
static int spv3_limiter_th_q27_table[SPV3_LOOKUP_TABLE_ROWS] = {
- -526133494, -508685189, -491236884, -473788580, -457682452, -441576325,
- -426812375, -410706248, -395942298, -382520525, -367756575, -354334802,
- -340913029, -327491256, -315411661, -301989888, -289910292, -277830697,
- -265751101, -255013683, -242934088, -232196669, -221459251, -210721833,
- -199984415, -190589174, -179851756, -170456515, -159719096, -150323855,
- -140928614, -131533373, -122138132, -114085069, -104689828, -95294587,
- -87241523, -79188460, -69793219, -61740155, -53687091, -45634028,
- -37580964, -29527900, -22817014, -14763950, -6710886, 0,
- 0
+ 85469248, 86758070, 88066327, 89394311, 90637910, 91898809,
+ 93070036, 94364769, 95567425, 96674043, 97906130, 99039829,
+ 100186656, 101346763, 102402340, 103588104, 104667026, 105757185,
+ 106858699, 107847451, 108970736, 109979029, 110996653, 112023692,
+ 113060235, 113975074, 115029672, 115960448, 117033416, 117980405,
+ 118935056, 119897432, 120867596, 121705410, 122690202, 123682964,
+ 124540293, 125403565, 126418282, 127294571, 128176935, 129065415,
+ 129960054, 130860894, 131616362, 132528683, 133447328, 134217728,
+ 134217728
};
static struct speaker_prot_session handle;
static int vi_feed_no_channels;