Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1223866ybl; Tue, 13 Aug 2019 09:12:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxu6Z1+gQtZw4tInZ7yXFAKjLuF0LJbu+07HlAl5Oi2fh65J5T/nd/dInfIrrQpmPmM9pqJ X-Received: by 2002:a63:4823:: with SMTP id v35mr35158277pga.138.1565712745056; Tue, 13 Aug 2019 09:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565712745; cv=none; d=google.com; s=arc-20160816; b=KbX5H+4aUVKgRKLSMnpVZiQYfT834H2D3EmUgIXLKjFmZFfsB0G7t31uIK33mnvYkV nTfJMASaZxI/5svvgJm/t1M29McHZjVPtQHQw9MhrlKE/b0jvOAIOEbBrX4I1DYVpVZV QfDtYJINThNfFaIXQIg7UN+k0GPGSmt8y06Aa6hM2WV28eJk3/EXXbmnE3e+2xjApH7a zAkvfVxDFjD7pJe8AzoRO64eOaIAnhfA9sjV0+IV66nfauwfrya9soRAWdvbuW5lZ1GA rk9U1LeRtCetRmM98hZf+rl/IrS3E/39mk25zDbeANZ9Fc6yRdPhrlvc/q/zLWPp9k4U V5jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ypRE8hC4/6Qh7yxiqOmpYqMqOJxs0gOInDlk3jeM3wQ=; b=bc+Tsu2/AIB52/LWi3AARXtrurR6gD7pDfFoiaoDFIgfipFUYJLz0T6Kfty0kp4eGu vuNrl6TOh3R0Qc4Ztd6sEtHpenEpJi4XaKxDKekHA19Ebx9CPNdwkLOxB1d6hC/JVLly RdSOVtz7SkycUqAVtiWdL1QJOJB9Qub3igai11sR9iCYQp6MZvTGjDeVLl963pNaacq0 jzpcniGK25gg0w8U9WRTw368mKb7Kycz/9YYz6k8smgouMIuSFQ5QU9COVOTNQRCJKaJ D/L+bAfsHgbhBHSHJTjhQO/ylMF+X1xNe7zlt33PfbpUXMjFtmRwu4zKh7UxR4WsKrH5 7puA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn16si132218plb.97.2019.08.13.09.12.08; Tue, 13 Aug 2019 09:12:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727893AbfHMQDk (ORCPT + 99 others); Tue, 13 Aug 2019 12:03:40 -0400 Received: from mga12.intel.com ([192.55.52.136]:19105 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727342AbfHMQDk (ORCPT ); Tue, 13 Aug 2019 12:03:40 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Aug 2019 09:03:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,382,1559545200"; d="scan'208";a="177840021" Received: from crojewsk-mobl1.ger.corp.intel.com (HELO [10.252.1.240]) ([10.252.1.240]) by fmsmga007.fm.intel.com with ESMTP; 13 Aug 2019 09:03:36 -0700 Subject: Re: [PATCH v2 3/5] ASoC: core: add support to snd_soc_dai_get_sdw_stream() To: Srinivas Kandagatla Cc: vkoul@kernel.org, broonie@kernel.org, bgoswami@codeaurora.org, plai@codeaurora.org, pierre-louis.bossart@linux.intel.com, robh+dt@kernel.org, devicetree@vger.kernel.org, lgirdwood@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, spapothi@codeaurora.org References: <20190813083550.5877-1-srinivas.kandagatla@linaro.org> <20190813083550.5877-4-srinivas.kandagatla@linaro.org> From: Cezary Rojewski Message-ID: <95c517ab-7c63-5d13-a03a-1db01812bb69@intel.com> Date: Tue, 13 Aug 2019 18:03:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190813083550.5877-4-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-08-13 10:35, Srinivas Kandagatla wrote: > On platforms which have smart speaker amplifiers connected via > soundwire and modeled as aux devices in ASoC, in such usecases machine > driver should be able to get sdw master stream from dai so that it can > use the runtime stream to setup slave streams. > > soundwire already as a set function, get function would provide more > flexibility to above configurations. > > Signed-off-by: Srinivas Kandagatla > --- > include/sound/soc-dai.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h > index dc48fe081a20..1e01f4a302e0 100644 > --- a/include/sound/soc-dai.h > +++ b/include/sound/soc-dai.h > @@ -202,6 +202,7 @@ struct snd_soc_dai_ops { > > int (*set_sdw_stream)(struct snd_soc_dai *dai, > void *stream, int direction); > + void *(*get_sdw_stream)(struct snd_soc_dai *dai, int direction); > /* > * DAI digital mute - optional. > * Called by soc-core to minimise any pops. > @@ -410,4 +411,13 @@ static inline int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai, > return -ENOTSUPP; > } > > +static inline void *snd_soc_dai_get_sdw_stream(struct snd_soc_dai *dai, > + int direction) > +{ > + if (dai->driver->ops->get_sdw_stream) > + return dai->driver->ops->get_sdw_stream(dai, direction); > + else > + return ERR_PTR(-ENOTSUPP); > +} Drop redundant else.