Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1553299ybi; Sat, 8 Jun 2019 12:24:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxK+45XROKncFD7pnoHwKHEhD2S/x903b/NZ3vWS/IdvJBz8f6e1LGDFKPNe3P2mMdwe0lp X-Received: by 2002:a17:902:a411:: with SMTP id p17mr3052558plq.104.1560021888914; Sat, 08 Jun 2019 12:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560021888; cv=none; d=google.com; s=arc-20160816; b=ew7tR6xyHc0qKNjjUo/nooRReAIvrMCwTt2iPSQa3MUtgqSyD2Mw/LVllaWzH0xbx7 bWYAX1MdXn9Me8M6LjApAt1u+QtC3Tgz3c2Aej5mAmtZ/qLNPqn/ABfi3U466rD9Z/cj j9pXiC7ZfUE13DW4p0BjFaYM6azWL528k1d+fO2LyD7CCzU7JxkQtrWn0nym5jHMNpZ5 MfKSgCEvdZftGl+0GQhyDvnX9WNH12iuC7FEU8U8dZbYHUk3YGj9NtiM15oNJ/BwLATy c0VTHceadgc1o3xlVrzsLrEcR2Xtnictf949Wa/aNtFm+350MziLHg/+4nygX8NmHjuw fzIA== 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=/3byoXhnQRflQgbN/qZHZmmcYITm4xXX9IB+P2ZoYzs=; b=aZNMFtH6tIgmGlkbLigyDVgucgqtBTpdF2/Rfzr26IiTpHC9q3UN9NuDpLI1X0xf6e 9gnwG003/EjEjYzKWRkjRqZL/QJ7CTs19yYOYYFT/N5JwwRds0R72Ar5UIp+eVLbMKo3 ShgWlXHBkH2JtkpkGwAxV7OBV9A0LXckeS6ibMfxV8ag/2U3myg1Q0qg/2/qeYoXcTon BHSPknI2P7O5xsvCSOHD5a11c4ED0IRcn8544WD3HutwryElzzaPvFJiSg9nAVIxmZs5 LeBUeUTWkoy0YEjcrvbDdkZEk5fnynJSQfoZVuhRD1eWDSLeSdIttSSGUdfnbuxwb2JB YSfg== 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 t2si5156161pgp.343.2019.06.08.12.24.30; Sat, 08 Jun 2019 12:24:48 -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 S1727397AbfFHTWP (ORCPT + 99 others); Sat, 8 Jun 2019 15:22:15 -0400 Received: from mga01.intel.com ([192.55.52.88]:48556 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbfFHTWP (ORCPT ); Sat, 8 Jun 2019 15:22:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2019 12:22:14 -0700 X-ExtLoop1: 1 Received: from crojewsk-mobl1.ger.corp.intel.com (HELO [10.251.93.16]) ([10.251.93.16]) by orsmga006.jf.intel.com with ESMTP; 08 Jun 2019 12:22:10 -0700 Subject: Re: [RFC PATCH 1/6] ASoC: core: add support to snd_soc_dai_get_sdw_stream() To: Srinivas Kandagatla Cc: broonie@kernel.org, vkoul@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, mark.rutland@arm.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20190607085643.932-1-srinivas.kandagatla@linaro.org> <20190607085643.932-2-srinivas.kandagatla@linaro.org> From: Cezary Rojewski Message-ID: <13bfb632-f743-c416-2224-c7acb5b28604@intel.com> Date: Sat, 8 Jun 2019 21:22:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190607085643.932-2-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-06-07 10:56, 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 f5d70041108f..9f90b936fd9a 100644 > --- a/include/sound/soc-dai.h > +++ b/include/sound/soc-dai.h > @@ -177,6 +177,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. > @@ -385,4 +386,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) Exceeds character limit? > +{ > + if (dai->driver->ops->get_sdw_stream) > + return dai->driver->ops->get_sdw_stream(dai, direction); > + else > + return NULL; set_ equivalent returns -ENOTSUPP instead. ERR_PTR seems to make more sense here. > + Unnecessary newline. > +} > + > #endif >