From: Takashi Iwai Subject: Re: [v3 05/13] ASoC: Intel: add mrfld DSP defines Date: Wed, 30 Jul 2014 15:39:50 +0200 Message-ID: References: <1406725350-23275-1-git-send-email-subhransu.s.prusty@intel.com> <1406725350-23275-6-git-send-email-subhransu.s.prusty@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 37926261A74 for ; Wed, 30 Jul 2014 15:39:51 +0200 (CEST) In-Reply-To: <1406725350-23275-6-git-send-email-subhransu.s.prusty@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Subhransu S. Prusty" Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com, Lars-Peter Clausen List-Id: alsa-devel@alsa-project.org At Wed, 30 Jul 2014 18:32:22 +0530, Subhransu S. Prusty wrote: > > From: Vinod Koul > > We define the DSP commands,structures here which will be used to send the IPCs > > Signed-off-by: Vinod Koul > Signed-off-by: Subhransu S. Prusty > --- > 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 > + * Vinod Koul > + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + * > + * 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 > +#include > +#include > +#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