Hi Rajeshwari, On Tue, Aug 21, 2012 at 11:44 PM, Rajeshwari Shinde <rajeshwar...@samsung.com> wrote: > This patch adds command to test audio playback. > sound init - Initialises the audio subsystem (i2s and wm8994 codec) > sound play - Plays predefined the audio data. > > Signed-off-by: Rajeshwari Shinde <rajeshwar...@samsung.com> > --- > Changes in V2: > - None > common/Makefile | 1 + > common/cmd_sound.c | 90 > ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 91 insertions(+), 0 deletions(-) > create mode 100644 common/cmd_sound.c > > diff --git a/common/Makefile b/common/Makefile > index 483eb4d..a21cac9 100644 > --- a/common/Makefile > +++ b/common/Makefile > @@ -73,6 +73,7 @@ COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o > COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o > COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o > COBJS-$(CONFIG_CMD_DATE) += cmd_date.o > +COBJS-$(CONFIG_CMD_SOUND) += cmd_sound.o > ifdef CONFIG_4xx > COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o > endif > diff --git a/common/cmd_sound.c b/common/cmd_sound.c > new file mode 100644 > index 0000000..9684435 > --- /dev/null > +++ b/common/cmd_sound.c > @@ -0,0 +1,90 @@ > +/* > + * Copyright (C) 2012 Samsung Electronics > + * Rajeshwari Shinde <rajeshwar...@samsung.com> > + * > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > + > +#include <common.h> > +#include <command.h> > +#include <fdtdec.h> > +#include <sound.h> > + > +/* globaldata */
Maybe remove this comment? > +DECLARE_GLOBAL_DATA_PTR; > + > +/* Initilaise sound subsystem */ > +static int do_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) > +{ > + int ret; > + > + ret = sound_init(); > + if (ret) { > + printf("Initialise Audio driver failed\n"); > + return CMD_RET_FAILURE; > + } > + > + return 0; > +} > + > +/* play sound from buffer */ > +static int do_play(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) > +{ > + int ret = 0; > + > + ret = sound_play(); > + if (ret) { > + printf("play failed"); > + return CMD_RET_FAILURE; > + } > + > + return 0; > +} > + > +static cmd_tbl_t cmd_sound_sub[] = { > + U_BOOT_CMD_MKENT(init, 0, 1, do_init, "", ""), > + U_BOOT_CMD_MKENT(play, 2, 1, do_play, "", ""), > +}; > + > +/* process sound command */ > +static int do_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) > +{ > + cmd_tbl_t *c; > + > + if (argc < 1) > + return CMD_RET_USAGE; > + > + /* Strip off leading 'sound' command argument */ > + argc--; > + argv++; > + > + c = find_cmd_tbl(argv[0], &cmd_sound_sub[0], > ARRAY_SIZE(cmd_sound_sub)); > + > + if (c) > + return c->cmd(cmdtp, flag, argc, argv); > + else > + return CMD_RET_USAGE; > +} > + > +U_BOOT_CMD( > + sound, 3, 1, do_sound, > + "sound sub-system", > + "init - initialise the sound driver\n" > + "sound play - play predefind sound\n" pre-defined > +); > -- > 1.7.4.4 > Regards, Simon _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot