From patchwork Fri Aug 19 10:12:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengdong.lin@linux.intel.com X-Patchwork-Id: 9289977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B78BF60574 for ; Fri, 19 Aug 2016 10:08:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4F5D29337 for ; Fri, 19 Aug 2016 10:08:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94BED29393; Fri, 19 Aug 2016 10:08:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D841429337 for ; Fri, 19 Aug 2016 10:08:05 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F2449266D17; Fri, 19 Aug 2016 12:08:04 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2B9E2266C1C; Fri, 19 Aug 2016 12:07:25 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4B332266C1E; Fri, 19 Aug 2016 12:07:24 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 0917F266B76 for ; Fri, 19 Aug 2016 12:07:03 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 19 Aug 2016 03:07:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,544,1464678000"; d="scan'208";a="868160570" Received: from amanda-haswell-pc.sh.intel.com ([10.239.159.21]) by orsmga003.jf.intel.com with ESMTP; 19 Aug 2016 03:07:00 -0700 From: mengdong.lin@linux.intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Fri, 19 Aug 2016 18:12:55 +0800 Message-Id: <24428c2714d09062f3ace5803679c743d36afb04.1471599648.git.mengdong.lin@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: Cc: Mengdong Lin , tiwai@suse.de, mengdong.lin@intel.com, guneshwor.o.singh@intel.com, liam.r.girdwood@linux.intel.com, vinod.koul@intel.com, hardik.t.shah@intel.com Subject: [alsa-devel] [PATCH 03/13] ASoC: topology: ABI - Define DPCM trigger ordering for PCM X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mengdong Lin Definition of dynamic PCM trigger ordering is exposed to uapi asoc.h, and topology allows user space to define the trigger ordering for PCM (FE links). Signed-off-by: Mengdong Lin diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 8060590..428ae95 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h @@ -52,19 +52,6 @@ enum snd_soc_dpcm_state { }; /* - * Dynamic PCM trigger ordering. Triggering flexibility is required as some - * DSPs require triggering before/after their CPU platform and DAIs. - * - * i.e. some clients may want to manually order this call in their PCM - * trigger() whilst others will just use the regular core ordering. - */ -enum snd_soc_dpcm_trigger { - SND_SOC_DPCM_TRIGGER_PRE = 0, - SND_SOC_DPCM_TRIGGER_POST, - SND_SOC_DPCM_TRIGGER_BESPOKE, -}; - -/* * Dynamic PCM link * This links together a FE and BE DAI at runtime and stores the link * state information and the hw_params configuration. diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 33d00a4..db0edfb 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -131,6 +131,19 @@ #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) /* + * Dynamic PCM trigger ordering. Triggering flexibility is required as some + * DSPs require triggering before/after their CPU platform and DAIs. + * + * i.e. some clients may want to manually order this call in their PCM + * trigger() whilst others will just use the regular core ordering. + */ +enum snd_soc_dpcm_trigger { + SND_SOC_DPCM_TRIGGER_PRE = 0, + SND_SOC_DPCM_TRIGGER_POST, + SND_SOC_DPCM_TRIGGER_BESPOKE, +}; + +/* * Block Header. * This header precedes all object and object arrays below. */ @@ -440,6 +453,7 @@ struct snd_soc_tplg_pcm { struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */ __le32 num_streams; /* number of streams */ struct snd_soc_tplg_stream_caps caps[2]; /* playback and capture for DAI */ + __le32 trigger[2]; /* SND_SOC_DPCM_TRIGGER_ trigger flag for playback & capture */ } __attribute__((packed)); diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index b271248..6802151 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1645,6 +1645,9 @@ static int soc_tplg_link_create(struct soc_tplg *tplg, link->dpcm_playback = pcm->playback; link->dpcm_capture = pcm->capture; + link->trigger[0] = pcm->trigger[0]; + link->trigger[1] = pcm->trigger[1]; + /* pass control to component driver for optional further init */ ret = soc_tplg_dai_link_load(tplg, link); if (ret < 0) {