From patchwork Mon Mar 30 20:40:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11466305 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 C4ED392C for ; Mon, 30 Mar 2020 20:44:49 +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 5BBBB20757 for ; Mon, 30 Mar 2020 20:44: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="u2D9Gwc5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A66f6X8l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BBBB20757 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 B8B9E1657; Mon, 30 Mar 2020 22:44:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B8B9E1657 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1585601087; bh=cA27puQRFgBTKbojz7exIJnEkulsBuEkNT7iyHXs+14=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=u2D9Gwc5mxOxEhKnBXtvMabrudbjgoA2QgnADXQF3M4oxXd9orB64Mj8KMBeRceaE 0R6hGXEveN/tLNxku2xGyrfXfittAA9dbGKvhyHybuvntIs+GJLDCx+jTjvlUgqSOo WH/5cZiEVLYoTmJr62TLSHUqsGaBmFU8b2x/C4N8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 252C9F8028C; Mon, 30 Mar 2020 22:43:10 +0200 (CEST) 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 616C5F800EB; Mon, 30 Mar 2020 22:42:56 +0200 (CEST) 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-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) (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 9E2E5F800EB for ; Mon, 30 Mar 2020 22:42:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9E2E5F800EB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A66f6X8l" Received: by mail-lj1-x244.google.com with SMTP id f20so19671041ljm.0 for ; Mon, 30 Mar 2020 13:42:49 -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=Q9dmJd31XEhMYenYHGxi8YuYhFyxM6XMQHq+VN0FDTA=; b=A66f6X8lQNBIne5NO0ntEAJDEDYnNwBIz73Tdrfxf3GiMPg1AB2mXl5GB40UwzKxa7 bZWbkxfhEKJpGG7P6OLuY8UDztGFJ/JfZAhT0FyWHnr0Ht25MLHgspwJV+wnfrWFq46j MpcbwYhUJXs1pWmyeW/AdT2yPjCpymvJanazaVokahWPFoh1bXLTDU6pZCuWIwNIPdYP v4gflHBdWxYiKfeBsyBVtAg+5+eRX7zlIclt7vDgnJCYz+VAJb4JjmgZ+2Mcc74Vd0dp i8Mye5k72gPGFnijorIDp3Q66t2tLmlSuSkElwpdzQ51T+ypjl+8FVNHzdHj8xucT4mj Xt+A== 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=Q9dmJd31XEhMYenYHGxi8YuYhFyxM6XMQHq+VN0FDTA=; b=VE0+o0/tniTs6kj9HxUB9XqBonhbKKhDxROO8pKwdqr2N+i25tnCWh/q3xR5HKNSKM hVysov/fCXt+cc/p0SDwfa6dFjdalXBatXPR/s5pbTsJWii4X6pZz20XzanjxklmLHOW EtmrXDVxEhIRSlvaJI20hGpvlp8fAEOKnWbIDizjxWu/cyIXahLlFuV+mudDUNWLdTMw w5C1GDqcDsjPpKqqKT5HBYgiotcz3z/942zffkRH68kBjNLpnzGDOuWsPCqupJmVAnkd XRjFCFhu9QL51h6XjbKRsK+V97qjHZ+mbsvkUEQ3cr/zZeoItYfr/53E4zmKny3GMvBl g5mA== X-Gm-Message-State: AGi0PuZJsHeH7LuP4RlGDiOUIQYxXZEECqP+yqNZ3OKsIpYe1dh8s5dB 6kSLP9i1a5nhRoXvTq5Bc+g= X-Google-Smtp-Source: APiQypJfqcBA7TyhBQLhNFsjLxFmFe3JYTbJlcU1IjgTFoLg6D02DeJMCMcDI1MOWqZjd6xZNkUSsw== X-Received: by 2002:a2e:94c8:: with SMTP id r8mr8112416ljh.28.1585600964401; Mon, 30 Mar 2020 13:42:44 -0700 (PDT) Received: from localhost.localdomain (ppp91-78-208-152.pppoe.mtu-net.ru. [91.78.208.152]) by smtp.gmail.com with ESMTPSA id v22sm7287988ljj.67.2020.03.30.13.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 13:42:43 -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 new nvidia, headset property Date: Mon, 30 Mar 2020 23:40:10 +0300 Message-Id: <20200330204011.18465-2-digetx@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200330204011.18465-1-digetx@gmail.com> References: <20200330204011.18465-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" Some devices have a 4-pin headset jack instead of 3-pin microphone jack. The new boolean nvidia,headset property tells that the Mic Jack represents the state of a headset microphone. This additional hardware description is needed because microphone detection procedure differs in a case of a 4-pin jack from a 3-pin jack. Signed-off-by: Dmitry Osipenko Acked-by: Rob Herring --- .../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 a8f2b0c56c79..bbd581a8c5bc 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt @@ -29,6 +29,7 @@ Optional properties: - nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in - nvidia,int-mic-en-gpios : The GPIO that enables the internal microphone - nvidia,ext-mic-en-gpios : The GPIO that enables the external microphone +- nvidia,headset : The Mic Jack represents state of the headset microphone pin Example: From patchwork Mon Mar 30 20:40:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11466307 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 9AA1B92C for ; Mon, 30 Mar 2020 20:45:31 +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 3141920757 for ; Mon, 30 Mar 2020 20:45:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="iHnqxjLs"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oh689xve" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3141920757 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 D077E167A; Mon, 30 Mar 2020 22:44:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D077E167A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1585601127; bh=y0An0/glDFapFI2Vu6Gx7gNwNWWhP+tT6d44HQq8wUE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iHnqxjLsMZqnz5oU12HJjxjKQrbN2c2zQUnWcje+St/F28Te3Bdk9HY6VrRRjCyAD 2cCjsbVMjxroFjnQvUgM8IcqtfdNU/Wf2u4BKnsF/LuK0NtIABjdFYLRVR4y8YB7Nt Lv1Trj7SlLUGrTJZ1dj8W9AHaD+XIF9eBUAPQeLE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8F6F2F80290; Mon, 30 Mar 2020 22:43:11 +0200 (CEST) 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 A0BD0F8010C; Mon, 30 Mar 2020 22:42:57 +0200 (CEST) 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-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 785E0F80145 for ; Mon, 30 Mar 2020 22:42:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 785E0F80145 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oh689xve" Received: by mail-lf1-x144.google.com with SMTP id u15so6316731lfi.3 for ; Mon, 30 Mar 2020 13:42:50 -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=9UkrNjDcajPGTgBBKiQQcXEwPOc4ohLFowCr4Ks0haU=; b=oh689xveR36/57W4/RPGauOKst42L1S+MXOTtXleBkLzOiJ+NL6bEEF08gPLfBCf0w 9Pjkq3FiUE6g4iYJ8R39BdR0UWMSKcTcSnno1jANPY0fk/zWl1BAJFlujrzpTgHKkSGV gObEjTicF1K/HwtUIdhfSUayjN79qoBwC316M9dZthNujLGmduxoHiokK5om+GbTi3AS L/Dxvq4qgEZhv5U/aZrx6fSyXGwCCMliWGEcViF4NUEropR1GG3/uqfvnR5+yzLKHgyT aXNT0WT7NKJmJsVH/dDsGFZR3FUZqlExP3CH+UOkUsLNUYXSPO1fGkEna1DVIH04DUpT cdTw== 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=9UkrNjDcajPGTgBBKiQQcXEwPOc4ohLFowCr4Ks0haU=; b=AkwROSvbIj3RXY/jtCaMZz7zUTYIFuqKFwX9jZ5CKon3rf/teiI2BPxwRZuven2dz+ yhMdLeceHJdKnrjFm+pPS2tSg/Hj8qjeFjjHxr5iWxJWk2PQ8xd4x5I9m5hXP1h9P90s kXbB3fox/+r/cNVN65K2Mal4if5K2rE7V6evGYfNn5GZcVXlmPWSUkDDxSoE1hcBXjoG u34Bx4p/pw5ACiXboAreQ1FwkOclxFWizyW92BGA+gUeDPrT+xsOzf8dn4vhFCyFnDIp OgokA/N1uFMVumIMqZcqPChldpdYDpGsWMux0tajMioNHIzMtNuOo+SOFBFWaFyJoHPY 9QMQ== X-Gm-Message-State: AGi0PuYI8gUexI1iUeP9ERfv5GqHV/g0FCpWnI0sOf5df+AvwGpTXj7y sTsHSYmoIUQk0WTuApalifs= X-Google-Smtp-Source: APiQypLLLnVzRTLcP4jabC1fU1WzfNOMcZ3hKwFpODI7tRHqByybGrOo5XBHUG6/XotAfAYXhdyTvQ== X-Received: by 2002:ac2:4c88:: with SMTP id d8mr9381636lfl.100.1585600965414; Mon, 30 Mar 2020 13:42:45 -0700 (PDT) Received: from localhost.localdomain (ppp91-78-208-152.pppoe.mtu-net.ru. [91.78.208.152]) by smtp.gmail.com with ESMTPSA id v22sm7287988ljj.67.2020.03.30.13.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 13:42:44 -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 nvidia, headset property Date: Mon, 30 Mar 2020 23:40:11 +0300 Message-Id: <20200330204011.18465-3-digetx@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200330204011.18465-1-digetx@gmail.com> References: <20200330204011.18465-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 microphone-jack state needs to be masked in a case of a 4-pin jack when microphone and ground pins are shorted. Presence of nvidia,headset tells that WM8903 CODEC driver should mask microphone's status if short circuit is detected, i.e headphones are inserted. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra_wm8903.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 071c7d2de77c..e756dc8eeca4 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c @@ -177,6 +177,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) struct snd_soc_component *component = codec_dai->component; struct snd_soc_card *card = rtd->card; struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card); + int shrt = 0; if (gpio_is_valid(machine->gpio_hp_det)) { tegra_wm8903_hp_jack_gpio.gpio = machine->gpio_hp_det; @@ -189,12 +190,15 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) &tegra_wm8903_hp_jack_gpio); } + if (of_property_read_bool(card->dev->of_node, "nvidia,headset")) + shrt = SND_JACK_MICROPHONE; + snd_soc_card_jack_new(rtd->card, "Mic Jack", SND_JACK_MICROPHONE, &tegra_wm8903_mic_jack, tegra_wm8903_mic_jack_pins, ARRAY_SIZE(tegra_wm8903_mic_jack_pins)); wm8903_mic_detect(component, &tegra_wm8903_mic_jack, SND_JACK_MICROPHONE, - 0); + shrt); snd_soc_dapm_force_enable_pin(&card->dapm, "MICBIAS");