From patchwork Thu Apr 26 13:20:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141609 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2316351lji; Thu, 26 Apr 2018 06:16:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/DO3zRZROdT8Q3A0EM2+9pFmofQuHgucmuoOlJOrRkn4s63QhES2H5KhGMhVGUJkq7KTNm X-Received: by 2002:adf:e1ce:: with SMTP id l14-v6mr28280752wri.148.1524748614787; Thu, 26 Apr 2018 06:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524748614; cv=none; d=google.com; s=arc-20160816; b=NiJqx5OEr4cTSjPxKHpR/X6ZMvGpZaGCqr2EaGGBqhgqMJQHH+BOXvui7u1wGtbLpp 2HjQoQBMGwS7DMES9qtRsCXyYaNC3uh75C8S6oAM4GULmRM1ChhDlnrqf3BmHiOYPU+0 V59ivRQPVajqd+2CMAsoNgJDHmCsHRXelpvJ5/grbs+Q8dKGsaMpRRtHbncI3aSLF9aa Eft9u9i7j5bJwnSyDTC8VlnXxXZkTn/ItAPQaFevxt7DTP4K4chIjawhwOOoaVgVxHbD F6n3zNfO0b17wy5HlL9L4Nnlrn5xPupv28Df3R/TNCoKoHIrNl+DpQQom01sM0CFGe0k +7EA== 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=tfk/ZNQvjwlbj3v/wuaUuNkrhDefyob2gXcwVvTPAwbtGsytnubF1I00+WT39e8FV+ B2unH7VkW4Kyp+iGcvxRz9uuVUhjipA4+uN/oa+tw0isPLCWZpN8zDApR4LVt+qLGmKF tt9XENjUqq4XLsP4zmLoIsGFCjcOWLZHpsPCl8d7swy/ibQvpd4X5RFW3bX98mq2iqAg ZG7fkDYCc5OeJxLjg1pfigQMdO3qgvfnzByqoUFrS9oO+XitWV086dNPNwNjNehj1Ooz 3SC8oNPWJLrPrY0ZcYQWilaeAPdiKYehjvAsLtBw/r1i7nToU4q9gpm8C6ps7vOHvRLZ 9TKQ== 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 w143si10821960wme.14.2018.04.26.06.16.54; Thu, 26 Apr 2018 06:16:54 -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 16C20267873; Thu, 26 Apr 2018 15:16:19 +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 746B1267873; Thu, 26 Apr 2018 15:16: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=-1.0 required=5.0 tests=RCVD_IN_DNSWL_MED autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by alsa0.perex.cz (Postfix) with ESMTP id 50EBC26782F for ; Thu, 26 Apr 2018 15:16:02 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Apr 2018 06:16:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,330,1520924400"; d="scan'208";a="51009931" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by orsmga001.jf.intel.com with ESMTP; 26 Apr 2018 06:15:57 -0700 From: Vinod Koul To: Greg KH Date: Thu, 26 Apr 2018 18:50:04 +0530 Message-Id: <1524748809-21860-9-git-send-email-vkoul@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524748809-21860-1-git-send-email-vkoul@kernel.org> References: <1524748809-21860-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 v6 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 Acked-by: Mark Brown 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