From patchwork Wed Apr 25 09:39:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141625 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp627724lji; Wed, 25 Apr 2018 02:36:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrAmIsVbguuYhhDblk0T7FFygqOz4Op+VMVqFPT2GLhoUSoM3VKfhuh3kW8YYBtrPAkZOlD X-Received: by 10.28.16.18 with SMTP id 18mr14720336wmq.81.1524648968541; Wed, 25 Apr 2018 02:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524648968; cv=none; d=google.com; s=arc-20160816; b=So7tai4yrOPF2HBzjn7u/t4B8wU1LR8ia3DBa2Ca039+qVhlIb83HPfIueY3cmNYRS ldIoE6yzcah5jFysasjvuVlugagrgE4nhRRahZxDgBaE3+bzi5K5dFOtlUdNgsRYLSXS ADFJY4LR4XNYvVgEF2p7mHpwqFWVi1YETBheYGf2ODI3NzqB2qhENBnyY2vPo2WJdD2B /LdZIJYu/HGQSaaqf2suOd/d3k18hOVD0lIeNSS4o9wO7bEb4FTeZorfuGECtrEAHhF5 bjWnY/BOUHRuSSxIXB0Hh84P8v6Lh1G54lhujvFJQLqrD9TlYRij7jhpUe4z/wuVThij Sm+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=Nh7dc1Iz84otUp4Ufq43nRW9pghZZK46b2MZJx8nFlI=; b=dHrGIsW0Dtkn2eDgqJA18T/oMD4b9FuNLzNdHlcD9g8akECshfPLx3Mex/Rzyv/kIU pSYJkCMrzhg70On9LJdqV8b2kVvh23rYqGco4BNAKjkWcPm5U4LH3bEVOOT/kkvVf7l8 Q6GZkNTfcOHoNjQAdvZ+ZbulH+6diYbkTggP8S+wrQD6KL7kEVXoyfn2O7z2W3Hjsgd5 RSWyl1q+hBxTinwx3QpgZSMUexRpQrflvwsWZVlpVtls3hMxkmtjXMdeaMf1ay1Qzg9q w0Huctrmuc6HPTjJzDmiDKcbOkkfiFQMN5NLep6UH/2qBnAzQStznK74/4vv6n151lb8 8Iyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id h2si6264859wmc.157.2018.04.25.02.36.08; Wed, 25 Apr 2018 02:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 121EE26777C; Wed, 25 Apr 2018 11:35:16 +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 0CB292677AC; Wed, 25 Apr 2018 11:35:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI autolearn=disabled version=3.4.0 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 81F4426777C for ; Wed, 25 Apr 2018 11:35:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 02:35:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,325,1520924400"; d="scan'208";a="34503896" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by fmsmga007.fm.intel.com with ESMTP; 25 Apr 2018 02:35:04 -0700 From: Vinod Koul To: Greg KH Date: Wed, 25 Apr 2018 15:09:18 +0530 Message-Id: <1524649163-12088-9-git-send-email-vkoul@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524649163-12088-1-git-send-email-vkoul@kernel.org> References: <1524649163-12088-1-git-send-email-vkoul@kernel.org> Cc: ALSA , tiwai@suse.de, Pierre-Louis Bossart , liam.r.girdwood@linux.intel.com, patches.audio@intel.com, Vinod Koul , broonie@kernel.org, Shreyas NC Subject: [alsa-devel] [PATCH v5 08/13] ASoC: Add SoundWire stream programming interface 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 From: Shreyas NC SoundWire stream needs to be propagated to all the DAIs(cpu, codec). So, add a snd_soc_dai_set_sdw_stream() API for the same. Signed-off-by: Shreyas NC Signed-off-by: Vinod Koul --- include/sound/soc-dai.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.7.4 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 58acd00cae19..03ae58c13b49 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -168,6 +168,8 @@ struct snd_soc_dai_ops { unsigned int rx_num, unsigned int *rx_slot); int (*set_tristate)(struct snd_soc_dai *dai, int tristate); + int (*set_sdw_stream)(struct snd_soc_dai *dai, + void *stream, int direction); /* * DAI digital mute - optional. * Called by soc-core to minimise any pops. @@ -359,4 +361,25 @@ static inline void *snd_soc_dai_get_drvdata(struct snd_soc_dai *dai) return dev_get_drvdata(dai->dev); } +/** + * snd_soc_dai_set_sdw_stream() - Configures a DAI for SDW stream operation + * @dai: DAI + * @stream: STREAM + * @direction: Stream direction(Playback/Capture) + * SoundWire subsystem doesn't have a notion of direction and we reuse + * the ASoC stream direction to configure sink/source ports. + * Playback maps to source ports and Capture for sink ports. + * + * This should be invoked with NULL to clear the stream set previously. + * Returns 0 on success, a negative error code otherwise. + */ +static inline int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai, + void *stream, int direction) +{ + if (dai->driver->ops->set_sdw_stream) + return dai->driver->ops->set_sdw_stream(dai, stream, direction); + else + return -ENOTSUPP; +} + #endif