MLK-22333: ASoC: fsl_easrc: Support FLOAT_LE
The audio float point data range is (-1, 1), the asrc would output
all zero for float point input and integer output case, that is to
drop the fractional part of the data directly.
In order to support float to int conversion or int to float conversion
we need to do special operation on the coefficient to enlarge/reduce
the data to the expected range.
For float to int case:
Up sampling:
1. Create a 1 tap filter with center tap (only tap) of 2^31
in 64 bits floating point.
double value = (double)(((uint64_t)1) << 31);
2. Program 1 tap prefilter with center tap above.
Down sampling,
1. If the filter is single stage filter, add "shift" to the exponent of
stage 1 coefficients.
2. If the filter is two stage filter , add "shift" to the exponent of
stage 2 coefficients.
The "shift" is 31, same for int16, int24, int32 case.
For int to float case:
Up sampling:
1. Create a 1 tap filter with center tap (only tap) of 2^-31
in 64 bits floating point.
2. Program 1 tap prefilter with center tap above.
Down sampling,
1. If the filter is single stage filter, subtract "shift" to the
exponent of stage 1 coefficients.
2. If the filter is two stage filter , subtract "shift" to the
exponent of stage 2 coefficients.
The "shift" is 15,23,31, different for int16, int24, int32 case.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
8a18a7a2dd1184814c6c61cb116f4d868b003447)