The case is 32kHz/24bit/1channel bit stream, and ssi is in master mode.
The driver will switch to normal mode for 1 channel, so the slot width
is not fixed to 32 bit in this mode, and even in mono mode, the slot
number is 2, but the bit clock calulation still use the bit width=32,
and slot number=1, which cause the output frameclock is not correct.
So there will be noise in output sound.
This patch is to change the bit clock formula of mono mode, which is
2channels * params_width * sample rate.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
/* Prefer the explicitly set bitclock frequency */
if (ssi_private->bitclk_freq)
freq = ssi_private->bitclk_freq;
- else
- freq = params_channels(hw_params) * 32 * params_rate(hw_params);
+ else {
+ if (params_channels(hw_params) == 1)
+ freq = 2 * params_width(hw_params) *
+ params_rate(hw_params);
+ else
+ freq = params_channels(hw_params) * 32 *
+ params_rate(hw_params);
+ }
/* Don't apply it to any non-baudclk circumstance */
if (IS_ERR(ssi_private->baudclk))