Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp9038559ybi; Fri, 7 Jun 2019 02:30:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMDlrYfifsJpQ4b+lKvjhMUqZG58IRWhKUjS+3249X9fKr/jsw52DBT0Nj4Bo4p1vpW67t X-Received: by 2002:a63:70f:: with SMTP id 15mr1818224pgh.432.1559899835985; Fri, 07 Jun 2019 02:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559899835; cv=none; d=google.com; s=arc-20160816; b=ZdZtWfwuKXF1x/7EIjaxbnrvRKk9MWsGweVdX+RUdJFoaxpFWcW3vGR2SUAFIwXfuV lsxEs5PrFO5c1lVFQoZaAcpBu//R/rs9jubLYk4DiiPew+7UoY6K8UAbeJwf1G2i6AZU vfolFTeuFlernfJFyFayr7Rd1FlGFZJQMxdL5H7LagXYqalZ6z/4GOGH22x7M29kah98 C9txbFFwLFCd3ldIxU1GNOz+RRaxgIaz22xQpzfHppjMOyYN1HgEEhVyFjyWd7MpB7XJ AD53K2ksFCrXrq/uFtBMtQrLJjWDzSxaa8mLKLO4cvCYRS7myyGelp2b22jBsWXCw1w1 7L9w== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3Nk/ajWW2fVH/9L9yBJ6zZfHfEglcI3MSG9DcJjyJ+A=; b=YEDiHj9M8wgoi75S1qsSrOBORi0MlQqZlV3v4pmAQ/fTW1HsWbprevstORgYxmvR6b 6Hba8XSYfk4up0h9y21+WWPau28jt+d3m9dLFUC1JQ8ZGFFdOBWtOjD/ti9HI5reZJh0 0GRGBCFiVIvWEXNlOhtCy3T0bTiT6NSAkLN137ZBG3nAaE8QhXf02Uu5J7PN3kSU4E4H COGoho8PD9to0VgrLE/ggUBCJsPL55w6E40YBZKfpr8KyqZ92+NNTndgB6BCjr20esPJ 6PCSo4p5gMcmLazfNs+K89SXCCekosYVQ84VF7tVQzMFGQ2aEEGdpp+YuY5EFK1YPs72 o+Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lGf990GU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si1286943plm.331.2019.06.07.02.30.19; Fri, 07 Jun 2019 02:30:35 -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; dkim=pass header.i=@linaro.org header.s=google header.b=lGf990GU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727672AbfFGI5M (ORCPT + 99 others); Fri, 7 Jun 2019 04:57:12 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42608 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727267AbfFGI5K (ORCPT ); Fri, 7 Jun 2019 04:57:10 -0400 Received: by mail-wr1-f67.google.com with SMTP id x17so1304794wrl.9 for ; Fri, 07 Jun 2019 01:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Nk/ajWW2fVH/9L9yBJ6zZfHfEglcI3MSG9DcJjyJ+A=; b=lGf990GUa32z0NWIrq3IT6/tA3Tr8dWI3lrZM3jaURZmclg6wXHKJYFjEWQHzF3XIg /m/7PkryJ8qIuEbig95LkE1ACJ7vLBmvws+COjHV+uc5rLqRm40f7TDDINmKXQquq7s7 W5SkXYwzLakiKIMVw/RMB9xwCfM0uhLqzlxAULjh8N78xMuyizZS4nojgOYLt0c9LUjn qZrx1OdGESo+38kl0Enl+Gp4WMpsRkxPx/y60Vd8NvYLkHJs0Cfq0ZhqWjYwlw606Pos wS77pebk39PKtajivrkP1jwJ1U94AyJUtC+grClHgRgbn0tbUqbqnTvZlInDE8HmL6N7 ETyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3Nk/ajWW2fVH/9L9yBJ6zZfHfEglcI3MSG9DcJjyJ+A=; b=jf7GBbNzpBorf09ULwE+Cq9b2UWT2Yw/6Lm3sB5cQkOenwOYrmZfGq6LUuRkU+Z5hY h655xtQ4vRuf5E6vew0VpNopSWXEzNVTkWm3/ueyJHeI/XTl8tAdnSHXLzzA3hVzrQTb dGmczsGxLDX3bxmOKgqBuPUcA2xZ/i/iqGGUrPc7NbD+r7b4/3Vgd0lOYW3UXjK4f4ps yFbBA3u3gwh66fsLAFsMEYhf1tscW3rugtACvqVi9OYlDzBhO52qk/hgC6lpDUE1zsBt 2hzIYwvVHtrPTMTsXDbF0s/j9xcKkZFzVOmlSBA0C+8tYLi+E0+N988ttbrNoVjzx7+9 OeDw== X-Gm-Message-State: APjAAAVl3U5zTLqycvLZDtny697iUtsFNzxKHMu00wGNIOxWAbApIFWY Jt3DiZd1/PYNcAt4f8y6/EZqKg== X-Received: by 2002:adf:ee49:: with SMTP id w9mr9789849wro.112.1559897828100; Fri, 07 Jun 2019 01:57:08 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id d10sm2035308wrh.91.2019.06.07.01.57.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 01:57:07 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, vkoul@kernel.org Cc: 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, Srinivas Kandagatla Subject: [RFC PATCH 1/6] ASoC: core: add support to snd_soc_dai_get_sdw_stream() Date: Fri, 7 Jun 2019 09:56:38 +0100 Message-Id: <20190607085643.932-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607085643.932-1-srinivas.kandagatla@linaro.org> References: <20190607085643.932-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) +{ + if (dai->driver->ops->get_sdw_stream) + return dai->driver->ops->get_sdw_stream(dai, direction); + else + return NULL; + +} + #endif -- 2.21.0