aboutsummaryrefslogtreecommitdiff
path: root/cmd/sound.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-12-10 10:37:47 -0700
committerSimon Glass <sjg@chromium.org>2018-12-13 16:36:41 -0700
commitf2b25c9bf8212139f43ded090c78d604babc4337 (patch)
tree8da5a8bcb40cf982708cfb9af886f94c9f6364c1 /cmd/sound.c
parent1e224fef9446e8c0cde57636dd8a36d0ebc85437 (diff)
downloadu-boot-f2b25c9bf8212139f43ded090c78d604babc4337.zip
u-boot-f2b25c9bf8212139f43ded090c78d604babc4337.tar.gz
u-boot-f2b25c9bf8212139f43ded090c78d604babc4337.tar.bz2
dm: sound: Complete migration to driver model
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>
Diffstat (limited to 'cmd/sound.c')
-rw-r--r--cmd/sound.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/cmd/sound.c b/cmd/sound.c
index 77f5152..638f29d 100644
--- a/cmd/sound.c
+++ b/cmd/sound.c
@@ -15,18 +15,12 @@ DECLARE_GLOBAL_DATA_PTR;
/* Initilaise sound subsystem */
static int do_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
-#ifdef CONFIG_DM_SOUND
struct udevice *dev;
-#endif
int ret;
-#ifdef CONFIG_DM_SOUND
ret = uclass_first_device_err(UCLASS_SOUND, &dev);
if (!ret)
ret = sound_setup(dev);
-#else
- ret = sound_init(gd->fdt_blob);
-#endif
if (ret) {
printf("Initialise Audio driver failed (ret=%d)\n", ret);
return CMD_RET_FAILURE;
@@ -38,9 +32,7 @@ static int do_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
/* play sound from buffer */
static int do_play(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
-#ifdef CONFIG_DM_SOUND
struct udevice *dev;
-#endif
int ret = 0;
int msec = 1000;
int freq = 400;
@@ -50,13 +42,9 @@ static int do_play(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
if (argc > 2)
freq = simple_strtoul(argv[2], NULL, 10);
-#ifdef CONFIG_DM_SOUND
ret = uclass_first_device_err(UCLASS_SOUND, &dev);
if (!ret)
ret = sound_beep(dev, msec, freq);
-#else
- ret = sound_play(msec, freq);
-#endif
if (ret) {
printf("Sound device failed to play (err=%d)\n", ret);
return CMD_RET_FAILURE;