From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 27 Feb 2014 13:26:18 -0700 Subject: [U-Boot] [PATCH v2 24/31] sandbox: Add a simple sound driver In-Reply-To: <1393532785-9020-1-git-send-email-sjg@chromium.org> References: <1393532785-9020-1-git-send-email-sjg@chromium.org> Message-ID: <1393532785-9020-25-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add a sound driver for sandbox, which uses SDL. Tested-by: Che-Liang Chiou Signed-off-by: Simon Glass --- Changes in v2: None arch/sandbox/include/asm/arch-sandbox/sound.h | 14 ++++++++++++++ drivers/sound/Makefile | 2 ++ drivers/sound/sandbox.c | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 arch/sandbox/include/asm/arch-sandbox/sound.h create mode 100644 drivers/sound/sandbox.c diff --git a/arch/sandbox/include/asm/arch-sandbox/sound.h b/arch/sandbox/include/asm/arch-sandbox/sound.h new file mode 100644 index 0000000..a32e8c8 --- /dev/null +++ b/arch/sandbox/include/asm/arch-sandbox/sound.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2013 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#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/drivers/sound/Makefile b/drivers/sound/Makefile index 6d25292..3793f8a 100644 --- a/drivers/sound/Makefile +++ b/drivers/sound/Makefile @@ -7,5 +7,7 @@ obj-$(CONFIG_SOUND) += sound.o obj-$(CONFIG_I2S) += samsung-i2s.o +obj-$(CONFIG_I2S_SAMSUNG) += samsung-i2s.o +obj-$(CONFIG_SOUND_SANDBOX) += sandbox.o obj-$(CONFIG_SOUND_WM8994) += wm8994.o obj-$(CONFIG_SOUND_MAX98095) += max98095.o diff --git a/drivers/sound/sandbox.c b/drivers/sound/sandbox.c new file mode 100644 index 0000000..fe5c9e9 --- /dev/null +++ b/drivers/sound/sandbox.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2013 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include + +int sound_play(uint32_t msec, uint32_t frequency) +{ + sandbox_sdl_sound_start(frequency); + mdelay(msec); + sandbox_sdl_sound_stop(); + + return 0; +} + +int sound_init(const void *blob) +{ + return sandbox_sdl_sound_init(); +} -- 1.9.0.279.gdc9e3eb