ath5k: fix interpolation with equal power levels
When the EEPROM contains weird values for the power levels we have to fix the interpolation process. Signed-off-by: Fabio Rossi <rossi.f@inwind.it> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
910cfee363
commit
64cdb0e3b8
@ -1487,28 +1487,35 @@ ath5k_get_linear_pcdac_min(const u8 *stepL, const u8 *stepR,
|
|||||||
{
|
{
|
||||||
s8 tmp;
|
s8 tmp;
|
||||||
s16 min_pwrL, min_pwrR;
|
s16 min_pwrL, min_pwrR;
|
||||||
s16 pwr_i = pwrL[0];
|
s16 pwr_i;
|
||||||
|
|
||||||
do {
|
if (pwrL[0] == pwrL[1])
|
||||||
pwr_i--;
|
min_pwrL = pwrL[0];
|
||||||
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
|
else {
|
||||||
pwrL[0], pwrL[1],
|
pwr_i = pwrL[0];
|
||||||
stepL[0], stepL[1]);
|
do {
|
||||||
|
pwr_i--;
|
||||||
|
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
|
||||||
|
pwrL[0], pwrL[1],
|
||||||
|
stepL[0], stepL[1]);
|
||||||
|
} while (tmp > 1);
|
||||||
|
|
||||||
} while (tmp > 1);
|
min_pwrL = pwr_i;
|
||||||
|
}
|
||||||
|
|
||||||
min_pwrL = pwr_i;
|
if (pwrR[0] == pwrR[1])
|
||||||
|
min_pwrR = pwrR[0];
|
||||||
|
else {
|
||||||
|
pwr_i = pwrR[0];
|
||||||
|
do {
|
||||||
|
pwr_i--;
|
||||||
|
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
|
||||||
|
pwrR[0], pwrR[1],
|
||||||
|
stepR[0], stepR[1]);
|
||||||
|
} while (tmp > 1);
|
||||||
|
|
||||||
pwr_i = pwrR[0];
|
min_pwrR = pwr_i;
|
||||||
do {
|
}
|
||||||
pwr_i--;
|
|
||||||
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
|
|
||||||
pwrR[0], pwrR[1],
|
|
||||||
stepR[0], stepR[1]);
|
|
||||||
|
|
||||||
} while (tmp > 1);
|
|
||||||
|
|
||||||
min_pwrR = pwr_i;
|
|
||||||
|
|
||||||
/* Keep the right boundary so that it works for both curves */
|
/* Keep the right boundary so that it works for both curves */
|
||||||
return max(min_pwrL, min_pwrR);
|
return max(min_pwrL, min_pwrR);
|
||||||
|
Loading…
Reference in New Issue
Block a user