[alsa-devel] [v3 05/13] ASoC: Intel: add mrfld DSP defines
Takashi Iwai
tiwai at suse.de
Wed Jul 30 15:39:50 CEST 2014
At Wed, 30 Jul 2014 18:32:22 +0530,
Subhransu S. Prusty wrote:
>
> From: Vinod Koul <vinod.koul at intel.com>
>
> We define the DSP commands,structures here which will be used to send the IPCs
>
> Signed-off-by: Vinod Koul <vinod.koul at intel.com>
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty at intel.com>
> ---
> sound/soc/intel/Makefile | 3 +-
> sound/soc/intel/sst-atom-controls.c | 41 +++++
> sound/soc/intel/sst-atom-controls.h | 286 +++++++++++++++++++++++++++++++-
> sound/soc/intel/sst-mfld-platform-pcm.c | 8 +-
> sound/soc/intel/sst-mfld-platform.h | 3 +
> 5 files changed, 337 insertions(+), 4 deletions(-)
> create mode 100644 sound/soc/intel/sst-atom-controls.c
>
> diff --git a/sound/soc/intel/Makefile b/sound/soc/intel/Makefile
> index 7acbfc43a0c6..f841786dad15 100644
> --- a/sound/soc/intel/Makefile
> +++ b/sound/soc/intel/Makefile
> @@ -2,7 +2,8 @@
> snd-soc-sst-dsp-objs := sst-dsp.o sst-firmware.o
> snd-soc-sst-acpi-objs := sst-acpi.o
>
> -snd-soc-sst-mfld-platform-objs := sst-mfld-platform-pcm.o sst-mfld-platform-compress.o
> +snd-soc-sst-mfld-platform-objs := sst-mfld-platform-pcm.o \
> + sst-mfld-platform-compress.o sst-atom-controls.o
> snd-soc-mfld-machine-objs := mfld_machine.o
>
> obj-$(CONFIG_SND_SST_MFLD_PLATFORM) += snd-soc-sst-mfld-platform.o
> diff --git a/sound/soc/intel/sst-atom-controls.c b/sound/soc/intel/sst-atom-controls.c
> new file mode 100644
> index 000000000000..38731e3e5e95
> --- /dev/null
> +++ b/sound/soc/intel/sst-atom-controls.c
> @@ -0,0 +1,41 @@
> +/*
> + * sst-atom-controls.c - Intel MID Platform driver DPCM ALSA controls for Mrfld
> + *
> + * Copyright (C) 2013-14 Intel Corp
> + * Author: Omair Mohammed Abdullah <omair.m.abdullah at intel.com>
> + * Vinod Koul <vinod.koul at intel.com>
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + *
> + * 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; version 2 of the License.
> + *
> + * 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.
> + *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + */
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> +#include <linux/slab.h>
> +#include <sound/soc.h>
> +#include <sound/tlv.h>
> +#include "sst-mfld-platform.h"
> +#include "sst-atom-controls.h"
> +
> +int sst_dsp_init_v2_dpcm(struct snd_soc_platform *platform)
> +{
> + int ret = 0;
> + struct sst_data *drv = snd_soc_platform_get_drvdata(platform);
> +
> + drv->byte_stream = devm_kzalloc(platform->dev,
> + SST_MAX_BIN_BYTES, GFP_KERNEL);
> + if (!drv->byte_stream) {
> + pr_err("%s: kzalloc failed\n", __func__);
The error message for k*alloc() is often superfluous, as the memory
allocator itself gives the error message.
Takashi
More information about the Alsa-devel
mailing list