From patchwork Fri Mar 20 20:55:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11450363 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1709813B1 for ; Fri, 20 Mar 2020 20:58:02 +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 A0A8820709 for ; Fri, 20 Mar 2020 20:58:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="eHiqzVYa"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ryUfaQrL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0A8820709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 E45B41660; Fri, 20 Mar 2020 21:57:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E45B41660 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1584737880; bh=RdNeXXUyLBybOER72zpbOAGcVvspmC7/yJuhrWyolRw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eHiqzVYaKVjJNLRM8bUYJXqxOVzYoMcSUu0Ta9XLcKwycl4zAzfy6t2yzjqQAlY9P CKGVN+/8V/FXtaC/6Y9/aqMxCKLZrwCmYHH0TFflTasK+lmsFl3dagUYh317eOAHAz Uez/GHddCy2B5tCytgoQ0i7eMTlOcsAXZnJSluUo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AE787F801F9; Fri, 20 Mar 2020 21:56:22 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5C4D1F80162; Fri, 20 Mar 2020 21:56:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 B419EF80126 for ; Fri, 20 Mar 2020 21:56:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B419EF80126 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ryUfaQrL" Received: by mail-lf1-x142.google.com with SMTP id c20so5669756lfb.0 for ; Fri, 20 Mar 2020 13:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z9bVlt9J+drXkckOzEfmQ7Nr2T5UaZ8eTOrZjkCCIRI=; b=ryUfaQrL0Q5vr3B5n7MyuIZSXWMM0WtOIYrcnmF7prGWtEqhrXWMoXEvVHIJ7CeTin SZqVToNvK9DElziI+cDv9Kwse5rzlO5PKeO9sqxvrY6aSgUS0cGfRj82oi6Gh+bUgW3p FGEIMvKzfLG5beSjDhb51mKVIiNA83nQWzNF9QO4W0/KhXYnfHxyd+rIncHhWc4ROYL6 gdgD8bFTEMDTW10/5m4UtBBxWKMScKvlRQebVXgEsw8P0caHFL1iAig/2LgVBXHKyVpA qNWB9n1GNaFI/i4fdhZ7AYI43E3lkpGnSKiXpr1TFCKUlqZwISKAIhIvCTi32fvy2/kK mpww== 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=z9bVlt9J+drXkckOzEfmQ7Nr2T5UaZ8eTOrZjkCCIRI=; b=fsX3cWB/wTap2GQ3UWdEvQrJHmQ8juoiQ7orjk1IZVsSs4JAifC9bey1zXDdX1g33k IF1wN9q7CAnEEsXmFpY3Zqwh87HhBBbHLk2OijHSIpOm2XBzFglEMw1eEPQ0oVAOuxWO Jq/9Dc3gPSIhKtjX+oZ+zelQYyH+URlhjfpI+hlTqtMlQQMHnZGLHVh5HoUzOJTMqCJP 86fqCu7iucQkeCwgAWtCeKaI6y0Nz1JfOf53mtSqud7+nde5WpAfXXrmEykT8t2ZgeBM AYZdzfv11WgMRblTcGc5paFJUZtZp0jsdK87MLWwEwctx0bAAPI4eG6zi/L2rx7gEIbD DKwg== X-Gm-Message-State: ANhLgQ3hBxChIxLoy5WENrWGanw1/qeikeAdQC3gW5vjab3CrjtBDXB9 OLYfk37gg1R/qgxBBJI49z8= X-Google-Smtp-Source: ADFU+vughOvcS0nxYLm8TI0hZE316VSnBaspUKHj3rqn6C2EVcQR2cAQHbYoZ7Zu4ztnWJt/mEHu9w== X-Received: by 2002:ac2:54af:: with SMTP id w15mr6443768lfk.17.1584737775436; Fri, 20 Mar 2020 13:56:15 -0700 (PDT) Received: from localhost.localdomain (94-29-39-224.dynamic.spd-mgts.ru. [94.29.39.224]) by smtp.gmail.com with ESMTPSA id 1sm3873356lft.47.2020.03.20.13.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 13:56:15 -0700 (PDT) From: Dmitry Osipenko To: Rob Herring , Mark Brown , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Stephen Warren , Jonathan Hunter Subject: [PATCH v1 1/2] dt-bindings: sound: tegra-wm8903: Document built-in microphone audio source Date: Fri, 20 Mar 2020 23:55:03 +0300 Message-Id: <20200320205504.30466-2-digetx@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200320205504.30466-1-digetx@gmail.com> References: <20200320205504.30466-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org 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" The internal microphone source is needed in order to be able to describe the hardware audio routing for devices that have the built-in microphone in addition to the external Mic Jack. Signed-off-by: Dmitry Osipenko --- .../devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt index b795d282818d..a8f2b0c56c79 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt @@ -18,6 +18,7 @@ Required properties: * Headphone Jack * Int Spk * Mic Jack + * Int Mic - nvidia,i2s-controller : The phandle of the Tegra I2S1 controller - nvidia,audio-codec : The phandle of the WM8903 audio codec From patchwork Fri Mar 20 20:55:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11450365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19C9713B1 for ; Fri, 20 Mar 2020 20:58: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 A1F7C20709 for ; Fri, 20 Mar 2020 20:58: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="SVc4zrQv"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uJ662SXh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1F7C20709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 86AE8166F; Fri, 20 Mar 2020 21:58:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 86AE8166F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1584737927; bh=VZYqMg+388ubn9qo9sEi5m8itQMIvAwFL3qPzdXbemU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SVc4zrQvhFGBdqFZHhdz+tiubRcSXyO2hwUbYrM+xOufomRMIy6h4goPeLL+RtMdd hx3SH31KcIUWt4jODUJveqm3mj7EgostvQhSA0d1lK6KcuZY2swaLXUOi6MSDhJiYZ ZNKsXOZhRebX8wq8GElu62bd2aOoKPOZa7sByiqA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C0ACEF80227; Fri, 20 Mar 2020 21:56:23 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49B87F8015B; Fri, 20 Mar 2020 21:56:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,PRX_BODY_30,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) (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 A1748F800C0 for ; Fri, 20 Mar 2020 21:56:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A1748F800C0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uJ662SXh" Received: by mail-lf1-x144.google.com with SMTP id i1so4938930lfo.1 for ; Fri, 20 Mar 2020 13:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q9oV0Jet7GMraR3xqtV0h+iLCecJI0XRcctkMuUHagA=; b=uJ662SXhR9zxkO088xiUitQhQMrirDeOS3TUScosTIg4zji4P6drAcNKY1fliPnOLy TC7gD8qUZrOf1kuPbaPvTabKzsGP3+LRRZmLE0lz5JSMe2wWs6GT1/UeTu/8K8YKM5m4 QNZb+C04XDHdbjfO/nfKsjrFOVGlNAOS/9jFz5LPgWs5XULwEAd1K7SS0CJu4qR0hIUv JCHHsgdq+nftXyM2M0XI0YNoWXCN8k5JOVmv1ksoWcXG3XVNO5y3cZQmcnOXhKmfoqvb XeFq5/4B0ZHYZNQgch62LqTbYyHVxUMhRXFH9qnpo1VFSWMHdosYyFV0p96nS/DjKEUd vFuw== 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=q9oV0Jet7GMraR3xqtV0h+iLCecJI0XRcctkMuUHagA=; b=rOePwN+9Y9l5RulFtv8XRLSF04IVKRBys8dlqkFm4aD7JLN8+wBpJZbLjH93fAHNF9 EVMYV7EiVuYmeB+5q+CcWhvvnGrrBv+ptLrven1QcPyRCI04mwXTVMxfTrqCrqnO5o97 ZNHg5m3NaCHbRILnkZdXptFtxxPPIbznJONcqPHeIJ7lCWBM9c2n9ob8zJcAXUV5MVr6 7EdE9YcX9MPRPGmgnpl8AietF1/ZBOEc2Trocl1MTLvPv7AGdD35XO9DR9mWxzuE79Bw Alihe0TdZywpq8z2DQLmCcUSG6kbhg23DuBIxbNYuKz4xHCAgYLxRzYrRSAQnXGoW916 L+SQ== X-Gm-Message-State: ANhLgQ3VFVJ/FxYUpB2/3wDk3uzQuWsW6nQ1A1vh9Ui4FrqxRKiTwL3O +L6v5Bc0LL4DLe+/NPlngsg= X-Google-Smtp-Source: ADFU+vsLajssmyb9pDEbtINGlaD8mIM0RtJt8T7pAoYMTjD1DsK8CE1iAEpQ1DTyU2ucTWgIXn+98g== X-Received: by 2002:a05:6512:108a:: with SMTP id j10mr6566513lfg.35.1584737776522; Fri, 20 Mar 2020 13:56:16 -0700 (PDT) Received: from localhost.localdomain (94-29-39-224.dynamic.spd-mgts.ru. [94.29.39.224]) by smtp.gmail.com with ESMTPSA id 1sm3873356lft.47.2020.03.20.13.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 13:56:15 -0700 (PDT) From: Dmitry Osipenko To: Rob Herring , Mark Brown , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Stephen Warren , Jonathan Hunter Subject: [PATCH v1 2/2] ASoC: tegra: tegra_wm8903: Support DAPM events for built-in microphone Date: Fri, 20 Mar 2020 23:55:04 +0300 Message-Id: <20200320205504.30466-3-digetx@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200320205504.30466-1-digetx@gmail.com> References: <20200320205504.30466-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org 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" The enable-GPIO needs to be toggled on a DAPM event in order to turn microphone ON/OFF, otherwise microphone won't work. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra_wm8903.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index f08d3489c3cf..071c7d2de77c 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c @@ -143,14 +143,32 @@ static int tegra_wm8903_event_hp(struct snd_soc_dapm_widget *w, return 0; } +static int tegra_wm8903_event_int_mic(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *k, int event) +{ + struct snd_soc_dapm_context *dapm = w->dapm; + struct snd_soc_card *card = dapm->card; + struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card); + + if (!gpio_is_valid(machine->gpio_int_mic_en)) + return 0; + + gpio_set_value_cansleep(machine->gpio_int_mic_en, + SND_SOC_DAPM_EVENT_ON(event)); + + return 0; +} + static const struct snd_soc_dapm_widget tegra_wm8903_dapm_widgets[] = { SND_SOC_DAPM_SPK("Int Spk", tegra_wm8903_event_int_spk), SND_SOC_DAPM_HP("Headphone Jack", tegra_wm8903_event_hp), SND_SOC_DAPM_MIC("Mic Jack", NULL), + SND_SOC_DAPM_MIC("Int Mic", tegra_wm8903_event_int_mic), }; static const struct snd_kcontrol_new tegra_wm8903_controls[] = { SOC_DAPM_PIN_SWITCH("Int Spk"), + SOC_DAPM_PIN_SWITCH("Int Mic"), }; static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)