From patchwork Thu Feb 7 17:00:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10801547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20E7C1575 for ; Thu, 7 Feb 2019 17:02:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C62A2E2BF for ; Thu, 7 Feb 2019 17:02:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F41842E2A1; Thu, 7 Feb 2019 17:02:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 902962E206 for ; Thu, 7 Feb 2019 17:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727237AbfBGRBU (ORCPT ); Thu, 7 Feb 2019 12:01:20 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:46784 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbfBGRBQ (ORCPT ); Thu, 7 Feb 2019 12:01:16 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190207170113epoutp024aa7d8f3476b5065c869616cca012776~BI5XpzCzc0530705307epoutp02F; Thu, 7 Feb 2019 17:01:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190207170113epoutp024aa7d8f3476b5065c869616cca012776~BI5XpzCzc0530705307epoutp02F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549558873; bh=tr3teq5FXrCMqB9mlSIoDLcOpZJLhsPkbwRQRaxD5pU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=rT6Tq613RTrenaAOKyAyAwZNpmlzwLktIoz0HRt1G4/dwAF60lBiNG05vf7PfsWIF 2IuLssLsU3oAKZjSaVaLS7s6d2JVmtPxFxVVBVUzqEa7sQ12I3tAdppoSqb1DulQbk MXT9qtiX/KQROFBJhRRa2z5Zm4P/p7TmuUyat1lY= Received: from epsmges1p5.samsung.com (unknown [182.195.42.57]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190207170113epcas1p2778a199eedab4669278b4aea7d717043~BI5XSF0U11808618086epcas1p2W; Thu, 7 Feb 2019 17:01:13 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 55.AE.04206.9546C5C5; Fri, 8 Feb 2019 02:01:13 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190207170112epcas1p31ed740ef43d8a3eb71ca7245fba1bc3d~BI5W66pmw2640626406epcas1p3a; Thu, 7 Feb 2019 17:01:12 +0000 (GMT) X-AuditID: b6c32a39-d7dff7000000106e-5e-5c5c6459dbe3 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id FD.C8.04015.8546C5C5; Fri, 8 Feb 2019 02:01:12 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PMK00MP9F8VXL10@mmp1.samsung.com>; Fri, 08 Feb 2019 02:01:12 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: lgirdwood@gmail.com, krzk@kernel.org, sbkim73@samsung.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH 08/22] ASoC: samsung: i2s: Add widgets and routes for DPCM support Date: Thu, 07 Feb 2019 18:00:16 +0100 Message-id: <20190207170028.720-9-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.20.1 In-reply-to: <20190207170028.720-1-s.nawrocki@samsung.com> MIME-version: 1.0 Content-transfer-encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7bCmvm5kSkyMwZm9bBZXLh5istg4Yz2r xdSHT9gszp/fwG7x7UoHk8XlXXPYLGac38dksfbIXXaLw2/aWS0urvjC5MDlseFzE5vHzll3 2T02repk8+jbsorR4/MmuQDWKC6blNSczLLUIn27BK6MD83N7AUfBCt+dcxjbmD8yNfFyMkh IWAi8XtGI2MXIxeHkMAORok5J9eyQTjfGSXOXfrAAlO18dJKJojEbkaJS43vWCCcX4wSV6cu ZwapYhMwlOg92scIYosIiEncntPJDFLELNDCJDFn7lKwImGBEImuyUfBxrIIqEpMfLyCFcTm FbCUuHawlw1inbzE+d517CA2p4CVxK39O1ggagQlfky+B2YzA9UcvPIc7AoJgQNsEo2v9zJB NLtIPP3yEKiZA8iWlrh01BYiXC2xa3s3M0R9B6NEy4XtzBAJa4nDxy+yQgzlk3j3tYcVopdX oqNNCKLEA+jmFnaIj3sZJSY97mKcwCg1C8lNs5DctICRaRWjWGpBcW56arFhgalecWJucWle ul5yfu4mRnCca1nuYDx2zucQowAHoxIP7wXtmBgh1sSy4srcQ4wSHMxKIryyCUAh3pTEyqrU ovz4otKc1OJ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ef43d8a3eb71ca7245fba1bc3d CMS-TYPE: 101P X-CMS-RootMailID: 20190207170112epcas1p31ed740ef43d8a3eb71ca7245fba1bc3d References: <20190207170028.720-1-s.nawrocki@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds DAPM widgets required to model the internal mixer of the I2S controller merging audio streams from the primary and from the secondary PCM interface. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski --- sound/soc/samsung/i2s.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 978614673ffb..b435e6226ec2 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1116,8 +1116,31 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { .delay = i2s_delay, }; +static const struct snd_soc_dapm_widget samsung_i2s_widgets[] = { + /* Backend DAI */ + SND_SOC_DAPM_AIF_OUT("Mixer DAI TX", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("Mixer DAI RX", NULL, 0, SND_SOC_NOPM, 0, 0), + + /* Playback Mixer */ + SND_SOC_DAPM_MIXER("Playback Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), +}; + +static const struct snd_soc_dapm_route samsung_i2s_dapm_routes[] = { + { "Playback Mixer", NULL, "Primary" }, + { "Playback Mixer", NULL, "Secondary" }, + + { "Mixer DAI TX", NULL, "Playback Mixer" }, + { "Playback Mixer", NULL, "Mixer DAI RX" }, +}; + static const struct snd_soc_component_driver samsung_i2s_component = { - .name = "samsung-i2s", + .name = "samsung-i2s", + + .dapm_widgets = samsung_i2s_widgets, + .num_dapm_widgets = ARRAY_SIZE(samsung_i2s_widgets), + + .dapm_routes = samsung_i2s_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(samsung_i2s_dapm_routes), }; #define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \ @@ -1129,6 +1152,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv, int num_dais) { static const char *dai_names[] = { "samsung-i2s", "samsung-i2s-sec" }; + static const char *stream_names[] = { "Primary", "Secondary" }; struct snd_soc_dai_driver *dai_drv; struct i2s_dai *dai; int i; @@ -1158,6 +1182,7 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv, dai_drv->playback.channels_max = 2; dai_drv->playback.rates = i2s_dai_data->pcm_rates; dai_drv->playback.formats = SAMSUNG_I2S_FMTS; + dai_drv->playback.stream_name = stream_names[i]; dai_drv->id = i + 1; dai_drv->name = dai_names[i];