From patchwork Mon Feb 3 08:27:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 193698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A3B3C3524D for ; Mon, 3 Feb 2020 08:29:25 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B967220658 for ; Mon, 3 Feb 2020 08:29:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Bvk82LqL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="dHmF7fcp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B967220658 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EA0081685; Mon, 3 Feb 2020 09:28:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EA0081685 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1580718563; bh=hfGcwF3hCb6AvpMEAc2GMl5KvVuuGjZZnxRdrz8F2lk=; h=Date:In-Reply-To:References:From:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Bvk82LqLtM7H6qasGvSSKZR0CdOXZ1Sl7nQRDCiLqiO2f2kh1PsSopA+cE4fcU2q9 3YPzMk6tDNC/QYFQ5Yhp/rHTcNGHa2INjPCe+OzOR36TnVnBesi3qd0fMxIGPKeu2W R2i9n0i0vTVdLUrzLaWsnDO38sdTu69TsXnfcrbg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AC8E2F80150; Mon, 3 Feb 2020 09:27:42 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A8FEAF80233; Mon, 3 Feb 2020 09:27:41 +0100 (CET) Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B01C0F8014C for ; Mon, 3 Feb 2020 09:27:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B01C0F8014C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dHmF7fcp" Received: by mail-pl1-x649.google.com with SMTP id 71so4299977plb.18 for ; Mon, 03 Feb 2020 00:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=nv/gWXMm1LPjD6+In1LaHObzpkMiIoBLQHOZAKjhzFo=; b=dHmF7fcp26TaKEWfqy4GWMSgHDMVu6lP0xdNny1b7CZgldNeXkOvf5w6bNk4yVDynI hz/uJi4LUTbyMBW8vvc5d9ZQEfAnukG0AsM8FXEt2TSV07U9jxwG6sKXH+Xwi+sOazo+ KtC7R7l68Pv4UhE+G9uDMNzpfhs/HgtnAUCD+J8jvuJVY+w1xGWgpZQEyBusrV1FtGr0 5CWDAgjL87EdKTt3vpa3TToMsgP5zAMqGf1hTc+azjqSydE+4KFfLTX2zteZCxXAPVsF nQK/MTzoyQ6C6TVFRhp038P5Fw5I/XmsZmsXQKbWFd9P/aLif2JmZeYdozHV2zcEURWt M4Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=nv/gWXMm1LPjD6+In1LaHObzpkMiIoBLQHOZAKjhzFo=; b=cP7E/e33WXYtZFpbXgf6+SNTGZJkCCkT3TnHgVKq4Q6bjQRqwYdW8bqqMRthPjGwJ3 UVwvRsNqlI6WhJ7/e+b0Eukzi1aUMaOdUjU7b81J9IcnZpDeDPtmP3h8WIooT8w14rFH qnuJlGcMm2ytOJa+AswPZ87v6KZmkgyc2dqf8n8FCNr2usC/zmNqB7acWgI1lO0wDHXC MZrqTVw8J/azvYlBFZnREwoh5WTYEZkbeNcZ3Thn20l7+wQt6Z38QWysrXGtCJU7Ouuz JTTQRHC4lQEg4kQuq+ADVVv6PgTBLCqLjIRrj6Hd+YXyYX3orqLsYLoj7F/cb00wfG5e 4bbw== X-Gm-Message-State: APjAAAUeb4xoFdfZriL7OQyLRkuSEG+LBuQgjekNe0RAoL5QB9BWKx1l QWieUruD7aFzRgHlRamItCoY3Qoyo5W0 X-Google-Smtp-Source: APXvYqzyHmoXCfgMHVHFR6gT9T8Azz/oAlmKEtSegXV43hookvRACho2AUKsE8tr7Kh9t3HI6jjViWjXp/D1 X-Received: by 2002:a63:1e1d:: with SMTP id e29mr24493750pge.347.1580718454675; Mon, 03 Feb 2020 00:27:34 -0800 (PST) Date: Mon, 3 Feb 2020 16:27:15 +0800 In-Reply-To: <20200203082718.59614-1-tzungbi@google.com> Message-Id: <20200203151250.1.Ie5aedb9d34ebfc7f05ceb382bfe346c45331cd63@changeid> Mime-Version: 1.0 References: <20200203082718.59614-1-tzungbi@google.com> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org, dgreid@google.com, cychiang@google.com Subject: [alsa-devel] [PATCH 1/4] ASoC: mediatek: mt8183-da7219: change supported formats of DL2 and UL1 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" DL2 and UL1 are for BTSCO. Provides only 16-bit, mono, 8kHz and 16kHz to userspace. Signed-off-by: Tzung-Bi Shih --- .../mediatek/mt8183/mt8183-da7219-max98357.c | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index c65493721e90..b7d4bfd04b37 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -116,6 +116,46 @@ static int mt8183_i2s_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } +static int +mt8183_da7219_max98357_bt_sco_startup( + struct snd_pcm_substream *substream) +{ + static const unsigned int rates[] = { + 8000, 16000 + }; + static const struct snd_pcm_hw_constraint_list constraints_rates = { + .count = ARRAY_SIZE(rates), + .list = rates, + .mask = 0, + }; + static const unsigned int channels[] = { + 1, + }; + static const struct snd_pcm_hw_constraint_list constraints_channels = { + .count = ARRAY_SIZE(channels), + .list = channels, + .mask = 0, + }; + + struct snd_pcm_runtime *runtime = substream->runtime; + + snd_pcm_hw_constraint_list(runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); + runtime->hw.channels_max = 1; + snd_pcm_hw_constraint_list(runtime, 0, + SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + + runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; + snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16); + + return 0; +} + +static const struct snd_soc_ops mt8183_da7219_max98357_bt_sco_ops = { + .startup = mt8183_da7219_max98357_bt_sco_startup, +}; + /* FE */ SND_SOC_DAILINK_DEFS(playback1, DAILINK_COMP_ARRAY(COMP_CPU("DL1")), @@ -222,6 +262,7 @@ static struct snd_soc_dai_link mt8183_da7219_max98357_dai_links[] = { SND_SOC_DPCM_TRIGGER_PRE}, .dynamic = 1, .dpcm_playback = 1, + .ops = &mt8183_da7219_max98357_bt_sco_ops, SND_SOC_DAILINK_REG(playback2), }, { @@ -240,6 +281,7 @@ static struct snd_soc_dai_link mt8183_da7219_max98357_dai_links[] = { SND_SOC_DPCM_TRIGGER_PRE}, .dynamic = 1, .dpcm_capture = 1, + .ops = &mt8183_da7219_max98357_bt_sco_ops, SND_SOC_DAILINK_REG(capture1), }, { From patchwork Mon Feb 3 08:27:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 193697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A3F0C3524D for ; Mon, 3 Feb 2020 08:30:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA1B920658 for ; Mon, 3 Feb 2020 08:30:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="JFcOya0p"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="Ww9WsRe0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA1B920658 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0D7DB168B; Mon, 3 Feb 2020 09:29:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0D7DB168B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1580718648; bh=Qy9FsU5ewVOVzxfc/uQz4ZDmmpZ4OSrsiw2HQWfHkx4=; h=Date:In-Reply-To:References:From:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JFcOya0p+XLXCUgLkJHOrpNkMihH373x+RQGKcAk9KlrGF1WtlXdjtmbyNc7ldwfo dXwzK89Vj2vDhfsKi3aknjQtGMrdruCcotOELjNcmP9YnJHFSgLhL8kSt3UWfIIgHi l4brFsT8/O9M0t6Vh+WmBBgFM4pGJvgUKdt86h90= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 98211F80279; Mon, 3 Feb 2020 09:27:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63C2CF80279; Mon, 3 Feb 2020 09:27:51 +0100 (CET) Received: from mail-vs1-xe4a.google.com (mail-vs1-xe4a.google.com [IPv6:2607:f8b0:4864:20::e4a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D135CF80273 for ; Mon, 3 Feb 2020 09:27:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D135CF80273 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Ww9WsRe0" Received: by mail-vs1-xe4a.google.com with SMTP id s23so1270497vsl.9 for ; Mon, 03 Feb 2020 00:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=0K1UnRjQODC0nNijTaG1o4tf21ySpZfP140PiAiGiBA=; b=Ww9WsRe0v6oeYy4U9K+OWzzDOZpmpjfnqqIHug84Hw/xdMrOgGYzJMwViYREzKANVh gcvRJQkPjfqooz/oIhEKF2u+OL7sEzlrC+LcT8w5cCeSGrrUYeaVizJwDjhXyRSoWfo4 PU8USp7/i9zcj5blvz3Q8493d748RC7vLVjdSoOoce+UPauxSEbS7kn/tiKaoudNheao rKN029MY4tQMWSFWxDZ6Q/teo1O+ppfvr3jcaSuIHtxUsaqKt7P5M39NJNsQJjZHrLsZ 3bjXv1CPffsIEQSmnYo5DXTA9ey0zz3RvrD3YTUhEAHw5cbWg+IIsS1M43jD9Tvgwbxa +ssA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=0K1UnRjQODC0nNijTaG1o4tf21ySpZfP140PiAiGiBA=; b=tRF29ct1knYKV9a0/HKBzoMMVGHkdtm+lg3F6n7gi+B96hJV3UvUoZiAPqa6PM6o0L 7ip+tlkKL0M9oZvtyMYD/HWlqkzJt/qieKrPxOzRHpl4D8hHsqwJA6o5u7nSfIk2OiiA 1XO49SruKXLBCW8bwdsESoaHyCsCBGZiDfDoNoUoX42zEr8eQjVwLvz+WKkOrO1pghUS tg8JJm4rQg4cVAmfO0WqQ8tl0BjHhlAUmxTHAJhbFX55hqcBMYic5lmm1m+kL3mCweXm AQAH212JGFblik5mYgU0u+pW2f5hUi4X3V0ILJsWW8euOAuByjKCriKWzmBkJJD2xskQ ccqw== X-Gm-Message-State: APjAAAUb67l+3dkCJ6tm+McAL8l4Denpebn/GpVGsMatJJQSyA3jOVdA k6LOagwu4s2i+Tr2d5EvvFIC1JGrBxqb X-Google-Smtp-Source: APXvYqyW6Ill+9/DDHwoTusyeTQLTCQYbQpaPUD9wUms3qnST+9r3Cm81IQdWqLCgAVou+GoVUMQHrqm2zfR X-Received: by 2002:a67:fc96:: with SMTP id x22mr13925669vsp.33.1580718464515; Mon, 03 Feb 2020 00:27:44 -0800 (PST) Date: Mon, 3 Feb 2020 16:27:17 +0800 In-Reply-To: <20200203082718.59614-1-tzungbi@google.com> Message-Id: <20200203151250.3.I30f0b8c87d5ec2a0e5f1b0fabf0a8ccef374f5ea@changeid> Mime-Version: 1.0 References: <20200203082718.59614-1-tzungbi@google.com> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog From: Tzung-Bi Shih To: broonie@kernel.org Cc: tzungbi@google.com, alsa-devel@alsa-project.org, dgreid@google.com, cychiang@google.com Subject: [alsa-devel] [PATCH 3/4] ASoC: mediatek: mt8183-da7219: support TDM out and 8ch I2S out X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Supports TDM out and 8ch I2S out. Signed-off-by: Tzung-Bi Shih --- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index 450fb1efa239..7052210e8325 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -450,6 +450,9 @@ static struct snd_soc_dai_link mt8183_da7219_max98357_dai_links[] = { { .name = "TDM", .no_pcm = 1, + .dai_fmt = SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_IB_IF | + SND_SOC_DAIFMT_CBM_CFM, .dpcm_playback = 1, .ignore_suspend = 1, .be_hw_params_fixup = mt8183_i2s_hw_params_fixup,