From patchwork Tue Aug 13 08:35:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 171174 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp604701ily; Tue, 13 Aug 2019 01:36:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3QTNKqZFJojaqMsnBZBPLn5v2VYoOV81aln3T33ctyPTReCQATdKTDzptZDAZlS03vFnI X-Received: by 2002:a65:6281:: with SMTP id f1mr31640638pgv.400.1565685363408; Tue, 13 Aug 2019 01:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565685363; cv=none; d=google.com; s=arc-20160816; b=vIBuDNCaD82D4V49zJSSWyNk+f/0hGqHwDYTJNPNzemVGE31dbGLugc2EF7e/wMAlY vP3IHJtUCdt72YEDNQubZLlt1q1CbfONvO9+G4Dvga0ImbsHvK/NG7381XdjV+cG9Sb4 FDCb8Jwt+sz5Cq5P76ep+pG3a9s9ahA1CENT/VdMzxlOF5Sv1giiWIlt7HH+hqDY0vla 9BC9KnGhQoopILXEN4H0FKQPXbqwIJlG/5wLovhUxLJldLFrOTq6w5v10TGKxJzuQQW/ Yp8qB7ET7fUDQ4j4zamvsPXgUqnWsvbsl+ELWYkU7jie8/d+dZZV36ZNz13itZnolyDq R8RQ== 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=B9rsr1/dgfaWkUD61V9rwU3U5jz+C8FjG7cuo0AJp/Q=; b=enHUI3PpXvXdyV54OMP1p6YP7/35EfGdIHKayMGw0KgBZcNDUWYF6gsmp0TwuUagoZ /H7gFNi1G7eM2KD6FybcS5wM7hiRTQPs20fpXTqRbwL4WeH7qz+qiWXb/fjaZ5B0+xnk BsO7cYL9LJGOSkFi2jb1c3zGw3PJ85DyTYHQ+CEqu/qeKgABxGX+gASr3oLOuoHmPUjE cxYgFb804LG0s0plGcDtohPVIRcJAiIKhOCTZpb5ZNa6fqIZ8QLUMEisHq3wpD8+JK+K lyh3aH7G+vrsHyI4H1Ag4rkPs4GtTLcSWBrgRubzxVsYdHK7lSTjSAfo7ShDD44dOkFm eZbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NIbQsuQ2; 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 k98si548029pje.41.2019.08.13.01.36.03; Tue, 13 Aug 2019 01:36:03 -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=NIbQsuQ2; 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 S1728255AbfHMIgB (ORCPT + 28 others); Tue, 13 Aug 2019 04:36:01 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39521 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728192AbfHMIf7 (ORCPT ); Tue, 13 Aug 2019 04:35:59 -0400 Received: by mail-wm1-f65.google.com with SMTP id i63so692241wmg.4 for ; Tue, 13 Aug 2019 01:35:58 -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=B9rsr1/dgfaWkUD61V9rwU3U5jz+C8FjG7cuo0AJp/Q=; b=NIbQsuQ2GpNnu739xoBeBF5FbMINwGQO+uIiIC0oSLND+QmbFVEfIMFPovy+35DF/K wg++6jFE3Z9x5YLYZzPdq3Td/haqQlmOjOe2kkrJEYAeG2DEXu1cUrNyCr8UXuRtNjJ2 M8cpQ+NGVZzfmBjrrbQVSi09Fk1hcLN0wTa2gbd8aT6C4hJ/bV1Ty/wgvnZIzTzLNq1C GMCi/GaYWG04/R8YjyoIM97doonDiD9mxrNim+ql2pMM+zsPLw2Il2hxXPIg5EMx5Sva 4N/VaFxQyREtZdPogXXXuqNfJn5TUJyO7KtYv/4svBoYj4qUzg1iZ2KBR5awYOXaAwFI NSeg== 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=B9rsr1/dgfaWkUD61V9rwU3U5jz+C8FjG7cuo0AJp/Q=; b=XdV6lk+2Hvd8EjY6T2yvYGjdMtsSMDtU5LavmyzgccclHpkNh7/eHb7jr6ICMfOGl/ XznzndzKcEm3mX28/rlHCwJolIyXzwSp0tlkNLitaWH2PCbD/ZdYj5Ol5zQvNharHm9I Kjllnf5Vw6Fp1wyVPZ9lU978j6tRDwTUUxgPBYyZ2yvuvEdtjERPQGxuYqo0cu5TvZQW xIIzsOAR5LVvLZUC7U3EkV+D/uzK6oDyN44IwzlUTDNtYx7MpejM/B5n5KENKNeosoXW 0P9zQ6WQXzhEOSZXXVQhLj0mg2pBn561BrGhhCZw+TLNS0d1AxBwwuKivQ+aYEK11z7n Zu9w== X-Gm-Message-State: APjAAAWMMrOp828Xg3vEnPJB5dcZdt2cq9IxzGlJgK1l/8o1OrH7wU3H zt9lQawVhQUWdCpgxHwFF5SSNA== X-Received: by 2002:a1c:7a12:: with SMTP id v18mr1765791wmc.56.1565685358047; Tue, 13 Aug 2019 01:35:58 -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 o11sm8651822wrw.19.2019.08.13.01.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2019 01:35:57 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, broonie@kernel.org Cc: 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, Srinivas Kandagatla Subject: [PATCH v2 3/5] ASoC: core: add support to snd_soc_dai_get_sdw_stream() Date: Tue, 13 Aug 2019 09:35:48 +0100 Message-Id: <20190813083550.5877-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190813083550.5877-1-srinivas.kandagatla@linaro.org> References: <20190813083550.5877-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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(+) -- 2.21.0 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); +} + #endif