summaryrefslogtreecommitdiff
path: root/arch/sandbox/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/include/asm')
-rw-r--r--arch/sandbox/include/asm/sdl.h19
-rw-r--r--arch/sandbox/include/asm/sound.h13
-rw-r--r--arch/sandbox/include/asm/test.h40
3 files changed, 53 insertions, 19 deletions
diff --git a/arch/sandbox/include/asm/sdl.h b/arch/sandbox/include/asm/sdl.h
index 1c4380c592..1027b59e73 100644
--- a/arch/sandbox/include/asm/sdl.h
+++ b/arch/sandbox/include/asm/sdl.h
@@ -54,12 +54,12 @@ int sandbox_sdl_scan_keys(int key[], int max_keys);
int sandbox_sdl_key_pressed(int keycode);
/**
- * sandbox_sdl_sound_start() - start playing a sound
+ * sandbox_sdl_sound_play() - Play a sound
*
- * @frequency: Frequency of sounds in Hertz
- * @return 0 if OK, -ENODEV if no sound is available
+ * @data: Data to play (typically 16-bit)
+ * @count: Number of bytes in data
*/
-int sandbox_sdl_sound_start(uint frequency);
+int sandbox_sdl_sound_play(const void *data, uint count);
/**
* sandbox_sdl_sound_stop() - stop playing a sound
@@ -71,9 +71,11 @@ int sandbox_sdl_sound_stop(void);
/**
* sandbox_sdl_sound_init() - set up the sound system
*
+ * @rate: Sample rate to use
+ * @channels: Number of channels to use (1=mono, 2=stereo)
* @return 0 if OK, -ENODEV if no sound is available
*/
-int sandbox_sdl_sound_init(void);
+int sandbox_sdl_sound_init(int rate, int channels);
#else
static inline int sandbox_sdl_init_display(int width, int height,
@@ -102,12 +104,17 @@ static inline int sandbox_sdl_sound_start(uint frequency)
return -ENODEV;
}
+int sandbox_sdl_sound_play(const void *data, uint count)
+{
+ return -ENODEV;
+}
+
static inline int sandbox_sdl_sound_stop(void)
{
return -ENODEV;
}
-static inline int sandbox_sdl_sound_init(void)
+int sandbox_sdl_sound_init(int rate, int channels)
{
return -ENODEV;
}
diff --git a/arch/sandbox/include/asm/sound.h b/arch/sandbox/include/asm/sound.h
deleted file mode 100644
index a6015b0f60..0000000000
--- a/arch/sandbox/include/asm/sound.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (c) 2013 Google, Inc
- */
-
-#ifndef __SANDBOX_SOUND_H
-#define __SANDBOX_SOUND_H
-
-int sound_play(unsigned int msec, unsigned int frequency);
-
-int sound_init(const void *blob);
-
-#endif
diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index 5e81839295..74f9618822 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -121,4 +121,44 @@ int sandbox_pwm_get_config(struct udevice *dev, uint channel, uint *period_nsp,
*/
void sandbox_sf_set_block_protect(struct udevice *dev, int bp_mask);
+/**
+ * sandbox_get_codec_params() - Read back codec parameters
+ *
+ * This reads back the parameters set by audio_codec_set_params() for the
+ * sandbox audio driver. Arguments are as for that function.
+ */
+void sandbox_get_codec_params(struct udevice *dev, int *interfacep, int *ratep,
+ int *mclk_freqp, int *bits_per_samplep,
+ uint *channelsp);
+
+/**
+ * sandbox_get_i2s_sum() - Read back the sum of the audio data so far
+ *
+ * This data is provided to the sandbox driver by the I2S tx_data() method.
+ *
+ * @dev: Device to check
+ * @return sum of audio data
+ */
+int sandbox_get_i2s_sum(struct udevice *dev);
+
+/**
+ * sandbox_get_setup_called() - Returns the number of times setup(*) was called
+ *
+ * This is used in the sound test
+ *
+ * @dev: Device to check
+ * @return call count for the setup() method
+ */
+int sandbox_get_setup_called(struct udevice *dev);
+
+/**
+ * sandbox_get_sound_sum() - Read back the sum of the sound data so far
+ *
+ * This data is provided to the sandbox driver by the sound play() method.
+ *
+ * @dev: Device to check
+ * @return sum of audio data
+ */
+int sandbox_get_sound_sum(struct udevice *dev);
+
#endif