aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu/sdl.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-14sandbox: Correct SDL build flagsSimon Glass1-1/+1
The check for CONFIG_SANDBOX_SDL in config.mk does not work since the build config is not available by the time that file is included. Remove it so that we always call sdl-config except when NO_SDL is used. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sandbox: Allow selection of sample rate and channelsSimon Glass1-7/+3
At present these parameters are hard-coded in the sdl interface code. Allow them to be specified by the driver instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sound: Complete migration to driver modelSimon Glass1-1/+0
All users of sound are converted to use driver model. Drop the old code and the CONFIG_DM_SOUND option. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sandbox: sound: Convert to use driver modelSimon Glass1-11/+26
Update sandbox's device tree and config to use driver model for sound. Use the double buffer for sound output so that we don't need to wait for the sound to complete before returning. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13dm: sandbox: Update sound to use two buffersSimon Glass1-25/+63
At present we use a single buffer for sound which means we cannot be playing one sound while queueing up the next. This wouldn't matter except that a long sound (more than a second) has to be created as a single buffer, thus using a lot of memory. To better mimic what real sound drivers do, add support for double buffering in sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29sandbox: Enable soundSimon Glass1-19/+0
Now that the buffer-overflow bug is fixed, we can enable sound on sandbox. Drop the code which exits early. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29sound: sandbox: Use the correct frequencySimon Glass1-2/+9
At present we request a particular frequency but we may not get the exact same frequency in response. So use the actual frequency for generation of the square wave. This ensures that the pitch remains accurate on all host machines. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29sound: Add sample rate as a parameter for square waveSimon Glass1-1/+1
At present this value is hard-coded in the function that generates a square wave. Since sample rates vary between different hardware, it makes more sense to have this as a parameter. Update the function and its users. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2014-03-17sandbox: Add SDL library for LCD, keyboard, audioSimon Glass1-0/+341
SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which provides simple graphics and sound features. It works under X11 and also with a simple frame buffer interface. It is ideally suited to sandbox U-Boot since it fits nicely with the low-level feature set required by U-Boot. For example, U-Boot has its own font drawing routines, its own keyboard processing and just needs raw sound output. We can use SDL to provide emulation of these basic functions for sandbox. This significantly expands the testing that is possible with sandbox. Add a basic SDL library which we will use in future commits. Tested-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>