Path: blob/master/sound/aoa/codecs/tas-basstreble.h
10817 views
/*1* This file is only included exactly once!2*3* The tables here are derived from the tas3004 datasheet,4* modulo typo corrections and some smoothing...5*/67#define TAS3004_TREBLE_MIN 08#define TAS3004_TREBLE_MAX 729#define TAS3004_BASS_MIN 010#define TAS3004_BASS_MAX 7211#define TAS3004_TREBLE_ZERO 3612#define TAS3004_BASS_ZERO 361314static u8 tas3004_treble_table[] = {15150, /* -18 dB */16149,17148,18147,19146,20145,21144,22143,23142,24141,25140,26139,27138,28137,29136,30135,31134,32133,33132,34131,35130,36129,37128,38127,39126,40125,41124,42123,43122,44121,45120,46119,47118,48117,49116,50115,51114, /* 0 dB */52113,53112,54111,55109,56108,57107,58105,59104,60103,61101,6299,6398,6496,6593,6691,6789,6886,6983,7081,7177,7274,7371,7467,7563,7659,7754,7849,7944,8038,8132,8226,8319,8410,854,862,871, /* +18 dB */88};8990static inline u8 tas3004_treble(int idx)91{92return tas3004_treble_table[idx];93}9495/* I only save the difference here to the treble table96* so that the binary is smaller...97* I have also ignored completely differences of98* +/- 199*/100static s8 tas3004_bass_diff_to_treble[] = {1012, /* 7 dB, offset 50 */1022,1032,1042,1052,1061,1072,1082,1092,1103,1114,1124,1135,1146,1157,1168,1179,11810,11911,12014,12113,1228,1231, /* 18 dB */124};125126static inline u8 tas3004_bass(int idx)127{128u8 result = tas3004_treble_table[idx];129130if (idx >= 50)131result += tas3004_bass_diff_to_treble[idx-50];132return result;133}134135136