diff options
author | Simon Glass <sjg@chromium.org> | 2018-12-10 10:37:51 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-12-13 16:37:10 -0700 |
commit | f987177db9c988142032ed8142a093cce2378a90 (patch) | |
tree | 9d4f5d9b057a749742e9dcead3cfa41c4ddae5ea /include | |
parent | e221cdcf44c80a6de78fd9285c5325db231ed20c (diff) | |
download | u-boot-f987177db9c988142032ed8142a093cce2378a90.tar.gz u-boot-f987177db9c988142032ed8142a093cce2378a90.tar.bz2 u-boot-f987177db9c988142032ed8142a093cce2378a90.zip |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/sound.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/sound.h b/include/sound.h index 02acefd34f..b7959cc260 100644 --- a/include/sound.h +++ b/include/sound.h @@ -37,13 +37,14 @@ struct sound_uc_priv { /** * Generates square wave sound data for 1 second * - * @param sample_rate Sample rate in Hz - * @param data data buffer pointer - * @param size size of the buffer in bytes - * @param freq frequency of the wave + * @sample_rate: Sample rate in Hz + * @data: data buffer pointer + * @size: size of the buffer in bytes + * @freq: frequency of the wave + * @channels: Number of channels to use */ void sound_create_square_wave(uint sample_rate, unsigned short *data, int size, - uint freq); + uint freq, uint channels); /* * The sound uclass brings together a data transport (currently only I2C) and a |