dm: sound: Use the correct number of channels for sound
At present the 'beep' sound generates a waveform for only one channel even
if two are being used. This means that the beep is twice the frequency it
should be. Correct this by making it a parameter.
The fix in a previous commit was correct for sandbox but not for other
boards.
Fixes: 03f11e87a8 ("sound: Correct data output in sound_create_square_wave()")
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/sound/sound-uclass.c b/drivers/sound/sound-uclass.c
index 71e753c..2b83626 100644
--- a/drivers/sound/sound-uclass.c
+++ b/drivers/sound/sound-uclass.c
@@ -53,7 +53,7 @@
}
sound_create_square_wave(i2s_uc_priv->samplingrate, data, data_size,
- frequency_hz);
+ frequency_hz, i2s_uc_priv->channels);
while (msecs >= 1000) {
ret = sound_play(dev, data, data_size);