From patchwork Wed Mar 8 07:34:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66054 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp192177wrd; Tue, 7 Mar 2023 23:40:59 -0800 (PST) X-Google-Smtp-Source: AK7set8yT9e3l2x8LMUGAcyvCp5goWig+0DzZCe/sAwQoz7gN80J+/lBOlS7X0hOVwdzUm3GXXeo X-Received: by 2002:a05:6a21:78a1:b0:cc:2ed0:e1e5 with SMTP id bf33-20020a056a2178a100b000cc2ed0e1e5mr23712152pzc.13.1678261259355; Tue, 07 Mar 2023 23:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678261259; cv=none; d=google.com; s=arc-20160816; b=rbJmBV1/doZvbbhDO5RV53MPyK8R1l1M2BmaRkJRKuSeE39byaK/ZKYDzCsu3XVm8d tNF3Svd/Ah61oHN+hYfAJaZLLxyB0cGng3xcW6MzXAda7rz6dlc4ndls6HiXLbBDJzFG eFMSWa174TeOj2mbKTA9r5dOeXzgMWo6egmq/t2glsi7pQStXTwcYjp9TEVXf3ckHmHH fENje/PN6N1HLby16IzwdiyfYi1pAx/6JOaBcHH/nic6ugmN87nhL3Avpybfy4/PbK35 iRCwRtv4FwGcluKZg/dydxxiAlB9DTIFKiFpREG7Z9VwLmIePud6Azd7NDHnVpdSdM2E IKIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ydV0x0rwcG3ZlgXY+mzQMZLrMJgGqY0Ocp8WqRfbhXI=; b=u99vY+RTgTkUc+c1YsSt1yMAHDHdlDtOLNe5bgyaLj17wBw7iNi9MXrOSbnetnfz3g Yzppu9bnq4qqJulxRllK4OSilWD0eeEveqK5kqYCX7RTpYK6LnQmvSdUB7meNgONdQE+ COqMbdRIYkVKbbTLhppnJHrr9LPlcMn2CdDtNXHPW4p5zpmxvKV9FoMXCydasdllMTB8 TIc38sUfsroD20OLHwM9jBJhE72xWsOWMEpmI3XYjTchjg9tQPA5kfQrtELVMSKYSJOd 0rX/fAE49iqk/I+GwyTqdxNJV284e3f18lNe+3pBQyFNVuLluijsT7pbhXCogZ+HdP9l J/uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gZlq2Kku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 65-20020a630244000000b00502efdcf735si13804810pgc.539.2023.03.07.23.40.46; Tue, 07 Mar 2023 23:40:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gZlq2Kku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbjCHHfq (ORCPT + 99 others); Wed, 8 Mar 2023 02:35:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbjCHHfe (ORCPT ); Wed, 8 Mar 2023 02:35:34 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89CC41F921; Tue, 7 Mar 2023 23:35:25 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id g3so62151220eda.1; Tue, 07 Mar 2023 23:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ydV0x0rwcG3ZlgXY+mzQMZLrMJgGqY0Ocp8WqRfbhXI=; b=gZlq2Kkuk9VLf2wxgDlvBqUxwWF3QUw0OTvuvL7dyaApcUu6d9KZd+JG8HMT8ap3JW Vx0G32zrjk7Qq6UIsYqSLg7fAPNk3ZBBI4Zw+vKtZUNAQELBG8jT55lEvaLIaBFC/4Uw 9RrR5NmXkShLV4u+rXiFjbujReIG/tUArH2pXfQczAe3ObVR6ijZXXziCIXvfCB8ANS4 umNWknNKdgS3mcr1PMkYI0jgoVJCpQx+/HfpsLmCv76fHxfuEShXpo6469Y8iCq/VY8T AE5lBlFm4Luuy/Wu/Mt/aPjTrFrjUP+10XLRw7GfR3/IDq8xLSWJGWlClXgZaqHrQ8vK VofQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ydV0x0rwcG3ZlgXY+mzQMZLrMJgGqY0Ocp8WqRfbhXI=; b=o/MrYbURsT+8kDRdwfPnaF9KRYNNP+R0IAoafhdbEYdSorD+x/eSl2Urq9f8YcmU9A NNAiu3zaHsx7Xg37D5XBLrmascku38V/Pwjfnh0ITEsAp2+h5IiYC/nyFVpTYkFzvCTF /KI4LDoFQOA2pD7zezOpcYLIQEP34U9uanF0TS+C5pbWGyGY5CrEU0GHHW2hKHdk7wbk rYxE0dKQi9SlD32wPnt3CNvzmib2ycb1MIhcRCYm67OeZna5VxUVx/TkqTAe0YxWaDmO JJNBSvq6CSUIA9FIrv0dVLiFFsELxQR8ooQ31INwqeJQ+tZddKxKzLGudd+HpwGU8T6+ l0ZA== X-Gm-Message-State: AO0yUKU8Ld/UwrjBDUma2RUTPRjy32OM6tc5A1sfNuG9lChb6Qsb8xbe 1yU+IwHyBzlh866O1Q95joo= X-Received: by 2002:a17:907:7e82:b0:8f4:6efd:833f with SMTP id qb2-20020a1709077e8200b008f46efd833fmr21620650ejc.3.1678260924049; Tue, 07 Mar 2023 23:35:24 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:23 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 1/8] dt-bindings: sound: nvidia,tegra-audio-common: add coupled-mic-hp-detect property Date: Wed, 8 Mar 2023 09:34:55 +0200 Message-Id: <20230308073502.5421-2-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759784478449927401?= X-GMAIL-MSGID: =?utf-8?q?1759784478449927401?= Add nvidia,coupled-mic-hp-det property to use Mic detect GPIO only if HP GPIO is in active state. Acked-by: Rob Herring Signed-off-by: Svyatoslav Ryhel --- .../devicetree/bindings/sound/nvidia,tegra-audio-common.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-common.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-common.yaml index 82801b4f46dd..7c1e9895ce85 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-common.yaml +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-common.yaml @@ -80,4 +80,8 @@ properties: type: boolean description: The Mic Jack represents state of the headset microphone pin + nvidia,coupled-mic-hp-det: + type: boolean + description: The Mic detect GPIO is viable only if HP detect GPIO is active + additionalProperties: true From patchwork Wed Mar 8 07:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp192082wrd; Tue, 7 Mar 2023 23:40:43 -0800 (PST) X-Google-Smtp-Source: AK7set9S6djp3ljs33RjMqtgyIX5H9fXNjRyXxQ3NjtJYdVxdKrIAXdSL3qu4DPVg8bD1KKLqm1m X-Received: by 2002:a17:902:ee45:b0:19e:6c7a:481 with SMTP id 5-20020a170902ee4500b0019e6c7a0481mr14705037plo.68.1678261243535; Tue, 07 Mar 2023 23:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678261243; cv=none; d=google.com; s=arc-20160816; b=vdSprCpMiX0NznEiaYf+0dgtopT1IbLKxV3B3JAe4QvQWZpNBJpclE8AlcthG6ATqI QpIU4ZWHszCnzh/dcQxAzdNQXb6HBJfruDmKSsGg1Rno1R0/KZYBQADEKG+nktZHosCq C3kbt6zLthpICkoJPTLiVfHa07aGPHbNBQDJ312s1cfGYpexML1LTmI4PcbEIXPbs4qv awNT9+t9gn3aud+5lHVtxafsjiPr7q/8TsNfksmIAnFWOr0ZdxHPfuZGDWJDFHefPUgu kThUwlBHqj4zpZfgu3vngbOkrGvAy7+am0vbbOLZoGC7yh5er5YWSozoz//YZDEq4Rc3 +fRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UlkyO8OW+WgRQk2FFiUYUZ/IqArcuXEwbJRily5asgc=; b=pSbV65i8IGUlC2W+Ewo5zdG4jnEFj944jvuER85OQZExtsmiyAiUGelGzlmo+NDuCN IhFbQxuPryOkEuPyEW3erupM5Ok37mYp5eQu8gzQhXMK4UmFpvAEUAZCKsfHlxMJy1gK GZ35VHlUNOgGWeOxEFcDzxsHy/YEmlThemExHbT4bgVnbGArSPU9sy0u57L0uEGjDoK2 1M10y5zsNkCnpL+xGYxdpyV2/zMjhbx0NXD3FkxMH21euT+tV3q+gNLpcORhcS0aGGwt J5zXO5ewqpWm5NixAb6T6HjJk1WFWMelJZRYdAKZRofTJ/DGyUcegi32zz5ES78f/gkA ugUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gfFE6M8D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh6-20020a170903064600b0019cd93a8200si13176402plb.331.2023.03.07.23.40.30; Tue, 07 Mar 2023 23:40:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gfFE6M8D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbjCHHfu (ORCPT + 99 others); Wed, 8 Mar 2023 02:35:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbjCHHff (ORCPT ); Wed, 8 Mar 2023 02:35:35 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2FE63596; Tue, 7 Mar 2023 23:35:26 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id i34so62022523eda.7; Tue, 07 Mar 2023 23:35:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UlkyO8OW+WgRQk2FFiUYUZ/IqArcuXEwbJRily5asgc=; b=gfFE6M8DHtIav5RU6MsJ3sTZtpxapVJLnD8kVuiiozcjPo1XQt7IOzULrdEeV6Ahgs iUWujv1S+BM7sNUt1+eH9PhUb48XhuuB2bfK+8kmt10oXE804Y0eJw4HShFnmVMJS+q0 MZaeF+1WVM2fBRbuxRN7i9bC99UNr+pqarOQX6snESecTdHoQaZGuEMSR2YC8xViyjmZ z4mgfTI9lSSJv4a7kRoo+owwHnE5E+R0wnLHLm/2+RLks9ascL54EsewO0uHEOCegjF9 AONbZtwPe9uWywrlVKLkJQqTCR0MwysL3in3OytvhQWFFAzP9Nl6LFWaIBnSY16qus/a f68g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UlkyO8OW+WgRQk2FFiUYUZ/IqArcuXEwbJRily5asgc=; b=HLz+vIj6JG9qkyCUwtxnRT8jzsO0b6dredg8X1qZVfGZDklCKowCvTY6AXmMtmQIX2 Ls1cMDa3idSIBpzovrUfpJef+ID+Q+9w+Nk3vqhf0bDMDobz0OKM7BPjkY9zv2Lh/z1N T4EChRdccaRZaEDBryyBaTNbs5SHCfjiAdvqg5HaDdnMf7TbNzO0giU/vU77OmOvlBr3 BLFWxuHRPGtGSwn0AH4HuXXd9iJoJ1LLLWWhoSXEzm+Y2SjuD9M3U0wd/8OIFEUjnnnf hxoOqSHfR622gabR4KDweyVQA3xNFBMQBr6NcQeMoETYgjJhvYWsA72BLQUrYIWvbSQA /b7Q== X-Gm-Message-State: AO0yUKWDjjgcDXGIVUmhjp+TffG9PkV1e8Em3J6yCO8X2qHdQx7ttHmL kW0T38wD0duFjhDHUB2t8j8= X-Received: by 2002:a17:907:2bde:b0:906:2b5c:7390 with SMTP id gv30-20020a1709072bde00b009062b5c7390mr15767615ejc.16.1678260925211; Tue, 07 Mar 2023 23:35:25 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:25 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 2/8] ASoC: tegra: Support coupled mic-hp detection Date: Wed, 8 Mar 2023 09:34:56 +0200 Message-Id: <20230308073502.5421-3-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759784461864459106?= X-GMAIL-MSGID: =?utf-8?q?1759784461864459106?= This quirk is used for cases when there is GPIO which detects any type of 3.5 Jack insertion and actual type of jack is defined by other GPIO. 3.5 Jack GPIO generates interrupt and MIC GPIO indicates type of Jack only if 3.5 Jack GPIO is active. Signed-off-by: Svyatoslav Ryhel --- sound/soc/tegra/tegra_asoc_machine.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c index 78faa8bcae27..7b6d5d90c3a2 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -51,6 +51,17 @@ static struct snd_soc_jack_gpio tegra_machine_headset_jack_gpio = { }; /* Mic Jack */ +static int coupled_mic_hp_check(void *data) +{ + struct tegra_machine *machine = (struct tegra_machine *)data; + + /* Detect mic insertion only if 3.5 jack is in */ + if (gpiod_get_value_cansleep(machine->gpiod_hp_det) && + gpiod_get_value_cansleep(machine->gpiod_mic_det)) + return SND_JACK_MICROPHONE; + + return 0; +} static struct snd_soc_jack tegra_machine_mic_jack; @@ -183,8 +194,15 @@ int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd) return err; } + tegra_machine_mic_jack_gpio.data = machine; tegra_machine_mic_jack_gpio.desc = machine->gpiod_mic_det; + if (of_property_read_bool(card->dev->of_node, + "nvidia,coupled-mic-hp-det")) { + tegra_machine_mic_jack_gpio.desc = machine->gpiod_hp_det; + tegra_machine_mic_jack_gpio.jack_status_check = coupled_mic_hp_check; + }; + err = snd_soc_jack_add_gpios(&tegra_machine_mic_jack, 1, &tegra_machine_mic_jack_gpio); if (err) From patchwork Wed Mar 8 07:34:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp194803wrd; Tue, 7 Mar 2023 23:49:34 -0800 (PST) X-Google-Smtp-Source: AK7set/zustC1ZzyxMluFrOVw17EYP+EVq4qXiBNlYj4GZdsmwdj02eRn5/Fh8y69gIA1Cxy/Pqw X-Received: by 2002:a17:906:ce39:b0:8aa:f2f2:7543 with SMTP id sd25-20020a170906ce3900b008aaf2f27543mr17186289ejb.29.1678261774147; Tue, 07 Mar 2023 23:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678261774; cv=none; d=google.com; s=arc-20160816; b=vsIjwRuFiVDfnEVac8gYlJL3OmpxPCrC7BkgHegViKyQBYYepNWMALQGSrvvbvyPxs /ArXANrrQwAiqsjOOqkLT3PBE7sJn3f1WevENPbXqcGsokbTVyu9342FQcUrwKoh5FS4 sFzjCCvMxTQgoEnUwIhQyL113VxQK9DSHuYeR5z/W1+NCOKyMEAqec9YtkT2lRQVsviQ 7RgmDHk2yVyyd4938KdjwAJCkbOBYc97JaHiZ5BznWBusKxhJ69xJTgeQmLA1VM5BY08 0+VMROwILtWAlKiGSZVU8cYjHtCwBMvQ3T/jYnxtE8yhXLP07rM/ULWtTS3LyJZYhWJv ftZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Sw6Zqne2z7YifJ5cyYa9t+wWI0sG16wXBTs6NvHN/Wk=; b=avCFRP5vyQaXJUwgvbw4RcsRVCJlAtDlfOrTcEJuGIwrCsp4KRA4WbSA2IyaUOqfcv OnuSCUwSo/5l+Ndic4mxoUIuO2HS2XKK5g6DlM/8mNuKeoVOxhUPYbrIN3BpMYVGQ2TN g55H0UcSAHRdMiKW8e1l6p6wyZ9RzwMlyqEJ19+U5fGAlV7kWnfFJyk/oCmp/ARvCqSx XTX1b19AmkcgxIeQ954E9w8o/2FPef0bpCD4gfNuKGoq8+g1Yr9i3bENELAP0+is/XmV an8gj6JrQQEiuz7FGPNjVGkIwBMVhpN6DLX46bdZGCiN2xHYA/EakHNK2PfDddbiNA1X erTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=H5ySkeSB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lj9-20020a170906f9c900b008d77c083937si2052779ejb.907.2023.03.07.23.49.08; Tue, 07 Mar 2023 23:49:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=H5ySkeSB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbjCHHfz (ORCPT + 99 others); Wed, 8 Mar 2023 02:35:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjCHHfg (ORCPT ); Wed, 8 Mar 2023 02:35:36 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CCF72FCF4; Tue, 7 Mar 2023 23:35:28 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id k10so38121569edk.13; Tue, 07 Mar 2023 23:35:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Sw6Zqne2z7YifJ5cyYa9t+wWI0sG16wXBTs6NvHN/Wk=; b=H5ySkeSBojKDLn9ziiQj/VN4R2TuGi3ptHrTGL5+4i5PLSHGhULRP4wKjh2za4ih0y f4ul79eEQClRwZ4ZnKbVfwJUnpet0B35mxxMelxp6jDpC+F4dGVRnRVk5keB25zkY/TJ DUnZM2M/Wa2cCVSY7KugZ4vC8fjO0wgOM6qWfcdkSuwqvw9FI/VP50LK5Bt0nTsDmCxm MqJmGjbOOg9OWnn4l4Vkq4K2ubOnb+Jv2KjkiHhX1UE38IH5XF0QQppUFdvIZI1zAd+I d1+CKSOIrsozHV55AVae1y4wcT7iN0iLucKtsptcPlfd7+Zxc1ULkF/DuceLxJHQR7td 2UwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sw6Zqne2z7YifJ5cyYa9t+wWI0sG16wXBTs6NvHN/Wk=; b=XdgiyQ7vlT/qfTPAVjbw7rGJEhSJuKz6JAwAsgSJLNJUs1vo9gZ0jPHAMpzkAQVYYN GL0/HSv2WcPls0/l83ubblpaecyMN+P7Tb+9qKOcMnyjgsmeRzOw7WFS8p48BMOjaWm5 TicDFTcg6076GKmKr9FVVEPniMkAbOueWz74ECQpDGa2QmmglsOt/JoBjacXEalmFx2A DWrVkPycRtgUNjJr6qeNs256CID4eLa5ys23a5Q8/KaMjUVZxbxZc7yRF8W4OXkCpKNr 0LcjOWi0xg7BglsAco4qLR60epg0C+9ctF+8aJrpZDdHh6U/jA8wr9e7NSywjiBayIgf aabA== X-Gm-Message-State: AO0yUKWQmEL3/7V1QqmfZqV/E6ED+qm1m7upWFznZ0pRcqn9REh2O0e9 DZApzJAA3jMSm2H4FT1l/zo= X-Received: by 2002:a17:906:b007:b0:8aa:c038:974c with SMTP id v7-20020a170906b00700b008aac038974cmr16145441ejy.54.1678260926392; Tue, 07 Mar 2023 23:35:26 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:26 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 3/8] ARM: tegra: transformers: update sound nodes Date: Wed, 8 Mar 2023 09:34:57 +0200 Message-Id: <20230308073502.5421-4-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759785017812488745?= X-GMAIL-MSGID: =?utf-8?q?1759785017812488745?= - fix headset detection in common device tree; - diverge control and detect elements for mic; - use GPIO mic detection on wm8903 devices; Signed-off-by: Svyatoslav Ryhel --- arch/arm/boot/dts/tegra20-asus-tf101.dts | 7 ++++--- arch/arm/boot/dts/tegra30-asus-tf300t.dts | 5 ++--- arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi | 9 +++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/dts/tegra20-asus-tf101.dts b/arch/arm/boot/dts/tegra20-asus-tf101.dts index c39ddb462ad0..4ed50b8300b1 100644 --- a/arch/arm/boot/dts/tegra20-asus-tf101.dts +++ b/arch/arm/boot/dts/tegra20-asus-tf101.dts @@ -1179,15 +1179,16 @@ sound { "Int Spk", "RON", "Int Spk", "LOP", "Int Spk", "LON", - "Mic Jack", "MICBIAS", - "IN1L", "Mic Jack"; + "IN1L", "Int Mic", + "IN2L", "Headset Mic"; nvidia,i2s-controller = <&tegra_i2s1>; nvidia,audio-codec = <&wm8903>; nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>; nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>; - nvidia,headset; + nvidia,mic-det-gpios = <&gpio TEGRA_GPIO(X, 1) GPIO_ACTIVE_LOW>; + nvidia,coupled-mic-hp-det; clocks = <&tegra_car TEGRA20_CLK_PLL_A>, <&tegra_car TEGRA20_CLK_PLL_A_OUT0>, diff --git a/arch/arm/boot/dts/tegra30-asus-tf300t.dts b/arch/arm/boot/dts/tegra30-asus-tf300t.dts index f47434871a5c..78f78cca337a 100644 --- a/arch/arm/boot/dts/tegra30-asus-tf300t.dts +++ b/arch/arm/boot/dts/tegra30-asus-tf300t.dts @@ -1011,13 +1011,12 @@ sound { "Int Spk", "RON", "Int Spk", "LOP", "Int Spk", "LON", - "IN1L", "Mic Jack", - "IN2L", "Mic Jack", + "IN1L", "Headset Mic", + "IN2L", "Headset Mic", "DMICDAT", "Int Mic"; nvidia,audio-codec = <&wm8903>; nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>; - nvidia,headset; }; }; diff --git a/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi b/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi index 08ea9cb32d0e..42dae0f4759e 100644 --- a/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi +++ b/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi @@ -550,7 +550,7 @@ spi1_mosi_px4 { nvidia,enable-input = ; }; - spi2_cs1_n_pw2 { + hp_detect { nvidia,pins = "spi2_cs1_n_pw2"; nvidia,function = "spi2"; nvidia,pull = ; @@ -558,10 +558,10 @@ spi2_cs1_n_pw2 { nvidia,enable-input = ; }; - spi2_sck_px2 { + mic_detect { nvidia,pins = "spi2_sck_px2"; nvidia,function = "spi2"; - nvidia,pull = ; + nvidia,pull = ; nvidia,tristate = ; nvidia,enable-input = ; }; @@ -1674,7 +1674,8 @@ sound { nvidia,i2s-controller = <&tegra_i2s1>; nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>; - nvidia,hp-mute-gpios = <&gpio TEGRA_GPIO(X, 2) GPIO_ACTIVE_LOW>; + nvidia,mic-det-gpios = <&gpio TEGRA_GPIO(X, 2) GPIO_ACTIVE_LOW>; + nvidia,coupled-mic-hp-det; clocks = <&tegra_car TEGRA30_CLK_PLL_A>, <&tegra_car TEGRA30_CLK_PLL_A_OUT0>, From patchwork Wed Mar 8 07:34:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66055 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp192352wrd; Tue, 7 Mar 2023 23:41:29 -0800 (PST) X-Google-Smtp-Source: AK7set/QgAHLAu3e+ASiGyLeWQ7c5DXVT9TkhKjxwpELBOO5GXtNBq4rTFK5BMG68bZmnRAqm3kO X-Received: by 2002:a05:6a20:4b26:b0:cd:1e80:587d with SMTP id fp38-20020a056a204b2600b000cd1e80587dmr14365915pzb.23.1678261289249; Tue, 07 Mar 2023 23:41:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678261289; cv=none; d=google.com; s=arc-20160816; b=Xoq1Tll+whDfGNtenHLs59vw4fDlV6iWuSIwMk7AKXmPlyRiWO+pMGDpPIzuA8Qulw mI6Zg+cqf0qkGz3uBNaZVZOIvQ416l/CMtjHOiQb6LiGCmNX8Y3rCVJ3zerR7QS6CXYE 4KEkjxzb6jRzV+/Gp15WaZokyVkrlMXrd9R10wXAcUsft3t3lMr3RXGUZ/+70CH+zn+M TFxgVXsll4G19cqCnk9CvU0K7djaK4yQBIuX/H1Dh6BrWpY5Xz4X8EeEItsyAD41GCdx hEgnULDhUjqT0dETOgO6HmgBh23wkFqg3xaeaVUbYwvtpF9LRgx7ps8TafVQKXNauIiJ 82eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WBcnq48gZafulICVd9tvrELT8WaB8t4pfISzUK/pzOI=; b=Lok654njraBGaJVySH0jwzf6a5ihM6rFwBRfWDqWYUfyzNoeuqnZttnhUVhsbPZHj2 KofmauKwpUo2GN5V94fVxdiVZQSG8AgOW52vXFxGN5U+4mh6fGDrPK57l53nKGVubxFS eGlW2x1p5iKrx1VEZdO4T7nblgQiTR+z+6rm+myu2S81HmrzoMP8heLgboaepqrA/HRw bTihjPpS6rBnvu6pOq4UdsJ4sgy0ev3wIiFedIe6T3q8EVsUeAFMIflL3sTqtSxEDK8M D/Bkf4hbsUYHzQIHWJ/hJncWJ4H33aA2Qni5xrHlR+hAqC8J+Dth3EqlGb4y7oNf4I5d oVOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LtOCJHK4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l64-20020a639143000000b005001709205bsi14536114pge.722.2023.03.07.23.41.16; Tue, 07 Mar 2023 23:41:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LtOCJHK4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbjCHHgA (ORCPT + 99 others); Wed, 8 Mar 2023 02:36:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjCHHfg (ORCPT ); Wed, 8 Mar 2023 02:35:36 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 357EF1EBC2; Tue, 7 Mar 2023 23:35:29 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id s11so62021673edy.8; Tue, 07 Mar 2023 23:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WBcnq48gZafulICVd9tvrELT8WaB8t4pfISzUK/pzOI=; b=LtOCJHK4KvMX8bwTtHJrl8sZHkh+iEgZz6I87FKs713yXXegtKWTWcWFc/1P5V9pzf 3uY+McYYdyOoCIzWMZN/E8S7P226CMZ9IOdn2mjGDHGkVxhkMf3rW5KFJaSLlBL9654V y1PqPvye6lBWlzcGm2qHm/B3ECEH07bWwXAKuc32lJ/CkfDb1kSVmODkVoVVHSnWM1Ua VU592RmHtzHhiVi/XRlwqqmbsN6WI2OA+EimSNlXcN2lb3nwUSI/2pzvGnb42sZ+zTvg usP2J3osvVH8ExlHymqazrZHFPd2jryxCbmCMxDygSxQlrVZr/yP6hgm8W3rx1utFwFR sLJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WBcnq48gZafulICVd9tvrELT8WaB8t4pfISzUK/pzOI=; b=OlIjTofCt+U2ao2LluRkA5CWloWLYcVQtMbET/M9mpGLifjerJ69UDufRzAzIYChih KLKo5KFTDV/rnCLTNgCXuRa1OTz2/iTyBSrPeLKgH9B14bydCLtEzCY9Evkt+/7R32cT Bd1/23tC5awBtMZ+qMC2huJGrv4N1njje0IQj/4aRbsDD90pl/a1W4iyluwkVqwjuo44 MJNMA16hXobmdUesmc/zggv6gkaDNnmCbD3IQDEjlQc8rXFJH/t9oeWFGo8+RUBdQZoU OR+LZWQyvRdfFIHW/GIk77xb02khuDHGhcfyEkhWWeg6ozaEjdIwNyPI0UTUeGPjr1Fk bQdw== X-Gm-Message-State: AO0yUKWP52EUF+CRr3gYF+YL2XZEHGE1F/rx7diz2MV4HiNvo12XeF5E dCe4hY2xRzwI7635rJIt2Xo= X-Received: by 2002:a17:906:2db1:b0:7c9:6e0e:1427 with SMTP id g17-20020a1709062db100b007c96e0e1427mr15342605eji.6.1678260927608; Tue, 07 Mar 2023 23:35:27 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:27 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 4/8] dt-bindings: sound: nvidia,tegra-audio: add RT5631 CODEC Date: Wed, 8 Mar 2023 09:34:58 +0200 Message-Id: <20230308073502.5421-5-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759784509778850415?= X-GMAIL-MSGID: =?utf-8?q?1759784509778850415?= From: David Heidelberg Add dt-binding for RT5631 CODEC. Signed-off-by: David Heidelberg Signed-off-by: Svyatoslav Ryhel --- .../sound/nvidia,tegra-audio-rt5631.yaml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-rt5631.yaml diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-rt5631.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-rt5631.yaml new file mode 100644 index 000000000000..a04487002e88 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-rt5631.yaml @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-rt5631.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra audio complex with RT5631 CODEC + +maintainers: + - Jon Hunter + - Thierry Reding + +allOf: + - $ref: nvidia,tegra-audio-common.yaml# + +properties: + compatible: + items: + - pattern: '^[a-z0-9]+,tegra-audio-rt5631(-[a-z0-9]+)+$' + - const: nvidia,tegra-audio-rt5631 + + nvidia,audio-routing: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: | + A list of the connections between audio components. + Each entry is a pair of strings, the first being the connection's sink, + the second being the connection's source. Valid names for sources and + sinks are the pins (documented in the binding document), + and the jacks on the board. + minItems: 2 + items: + enum: + # Board Connectors + - "Int Spk" + - "Headphone Jack" + - "Mic Jack" + - "Int Mic" + + # CODEC Pins + - MIC1 + - MIC2 + - AXIL + - AXIR + - MONOIN_RXN + - MONOIN_RXP + - DMIC + - MIC Bias1 + - MIC Bias2 + - MONO_IN + - AUXO1 + - AUXO2 + - SPOL + - SPOR + - HPOL + - HPOR + - MONO + +unevaluatedProperties: false + +examples: + - | + #include + #include + sound { + compatible = "asus,tegra-audio-rt5631-tf700t", + "nvidia,tegra-audio-rt5631"; + nvidia,model = "Asus Transformer Infinity TF700T RT5631"; + + nvidia,audio-routing = + "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR", + "Int Spk", "SPOL", + "Int Spk", "SPOR", + "MIC1", "MIC Bias1", + "MIC Bias1", "Mic Jack", + "DMIC", "Int Mic"; + + nvidia,i2s-controller = <&tegra_i2s1>; + nvidia,audio-codec = <&rt5631>; + + clocks = <&tegra_car TEGRA30_CLK_PLL_A>, + <&tegra_car TEGRA30_CLK_PLL_A_OUT0>, + <&tegra_pmc TEGRA_PMC_CLK_OUT_1>; + clock-names = "pll_a", "pll_a_out0", "mclk"; + }; From patchwork Wed Mar 8 07:34:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp191926wrd; Tue, 7 Mar 2023 23:40:18 -0800 (PST) X-Google-Smtp-Source: AK7set+GseYSo/I1GIXBSgtg2dhHpkZ/W3uHlnobap+bqohg/o6AB1KLf9QO17gYivhz2W+M5mds X-Received: by 2002:a17:90b:4b4b:b0:237:2045:5198 with SMTP id mi11-20020a17090b4b4b00b0023720455198mr18368880pjb.36.1678261217873; Tue, 07 Mar 2023 23:40:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678261217; cv=none; d=google.com; s=arc-20160816; b=dseTU6ZROj4qfYm2KmIPcEQcjoc1ZtBJer+ACaor5KyrMwpR386qq36VlVGVocI6jp dzJ9KzmLGLSXOP4tEY3POIxOP36q7YM49wtujZ8PI0047VxgxOX+FCX+D84cekwCNW9l aXdDKOol9DZ1amwZxcMlf8U4y0JWGAf3uomqD/g6ByaTOb/rGdW52zjz7LoofkHB84Sa oTyJddn/FY+dfsalZ60F/ifQAxviZhVHecTjkxoBBxFoAk6kSwe+2ueV4k8lJ6WTU2/x XXKu0MDV6twdxBfgYz0q1S1dguSBjt23485+hxQBctXg6yS3bIEKmU64YKlp4+BkbmbT jeqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kRurDuvuLcJjquBqSnwjPCy2E5AO2aJIW97iErA9sM4=; b=kI35dGXHSeg26g1+YpaseD/qSqSlwRmtOcM1BCAndx+ep2+xswY2202G8Hzry/Z/7S DvDQtLJEcwMoEOw/zehcSHAZ34w6YoBZSIA4J5pcs7jjKwu2bgVyI6Qt+sTxDv0/ipie BKDYfjaENjqKnDNEnxPpKDxuNPJAtUPMgYMYs4LT7KB8hz8LOH4CGt2GaA1ayLRWjvj1 nG/NjXNS44zeGtsA3pdjvJ7ocTD9SVClrgiwq6pKlxeajhd5R7zjUDseAsVqwXBXYj7v 69Bhdz5l537yiqLgqLeqmS640W3G/cbsZ2OG35SvfLjJJVGL31eDeyyqwcg8/Ep5ic65 C2DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DXEy2PFJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 7-20020a17090a000700b00233abbae8a6si14198814pja.147.2023.03.07.23.40.05; Tue, 07 Mar 2023 23:40:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DXEy2PFJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbjCHHgE (ORCPT + 99 others); Wed, 8 Mar 2023 02:36:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbjCHHfh (ORCPT ); Wed, 8 Mar 2023 02:35:37 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D3267830; Tue, 7 Mar 2023 23:35:30 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id k10so38121900edk.13; Tue, 07 Mar 2023 23:35:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kRurDuvuLcJjquBqSnwjPCy2E5AO2aJIW97iErA9sM4=; b=DXEy2PFJOzpqN104cccK6uYxR5c1174ZSer35zVcmfd97DYrcnuPs3IRxB/v6YC/wp oQDwktYZ/tbk79vXnE/ptfBSdhZsGjkcyJSrOm0pmNvXfQ1jyPc+GdTPA4Jtu+zh41Hu yajCjd28Dzvc5phqM0C1jybRX3odJZkM0tOIkefL9FgQoD+xjXvnphD0krYUU0bzw+Yb ADkOmnBfAgjkaa4iteoGxFXY1Fsrdldf3qxJtIckCoOpWsuYobTnVzc/21hN9RdadyJK toink2EWE4nBO2lnA04I4nKOjeYa6wK2oSFnI/QdJUZDbVQ+iZDQ3jyNAirNr3gVO0rW RhrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kRurDuvuLcJjquBqSnwjPCy2E5AO2aJIW97iErA9sM4=; b=T2cP9jE5LyO2dyL9Kzt/nsl9971/lsNoIUcrDOarRbxXhBQM+1qVMZf0CpQtzdgzXS Vw5Ncg6fsBlHnzbhbZoTNNGYBN2BhY+YIBtEuCcADqrWirmr1thxn8sD+JiXl8BDMaOq peSw6ui0ZG2AHxd3fXGMDUo/xQDIPveGMUxoXFWRQ2QuAz1B8Pr9MFG64RUcsWmyK4vN J9y7yb51FQqsHcV6DY/Vjx7GwzFqG3uG/jzfnmQF4vby6ybpNSdKHaLmlKWIZp3/9tcw CMJ6lkIikcOTD1dzJi9dmRfaN9zd/KwWdyEoYeYk1PuROU6tM0EGxL7PMHFd62cyrq+/ tl4Q== X-Gm-Message-State: AO0yUKVGGa26VIKSTIgNDCmOiaEXsKLEN5mFYWte79uuq/J7zUNgsUbC BoSDoiEfhX2Ak64l7smZzPo= X-Received: by 2002:a17:907:7fa7:b0:8d7:6699:3bae with SMTP id qk39-20020a1709077fa700b008d766993baemr20690292ejc.57.1678260928840; Tue, 07 Mar 2023 23:35:28 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:28 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 5/8] ASoC: tegra: Support RT5631 by machine driver Date: Wed, 8 Mar 2023 09:34:59 +0200 Message-Id: <20230308073502.5421-6-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759784435069804066?= X-GMAIL-MSGID: =?utf-8?q?1759784435069804066?= Add Realtek ALC5631/RT5631 codec support to the Tegra ASoC machine driver. The RT5631 codec is found on devices like ASUS Transformer TF201, TF700T and other Tegra-based Android tablets. Signed-off-by: Ion Agorria Signed-off-by: Svyatoslav Ryhel --- sound/soc/tegra/Kconfig | 9 ++++ sound/soc/tegra/tegra_asoc_machine.c | 61 ++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index b6712a3d1fa1..ff905e5dcd86 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig @@ -189,6 +189,15 @@ config SND_SOC_TEGRA_AUDIO_GRAPH_CARD config SND_SOC_TEGRA_MACHINE_DRV tristate +config SND_SOC_TEGRA_RT5631 + tristate "SoC Audio support for Tegra boards using an RT5631 codec" + depends on SND_SOC_TEGRA && I2C && GPIOLIB + select SND_SOC_TEGRA_MACHINE_DRV + select SND_SOC_RT5631 + help + Say Y or M here if you want to add support for SoC audio on Tegra + boards using the RT5631 codec, such as Transformer. + config SND_SOC_TEGRA_RT5640 tristate "SoC Audio support for Tegra boards using an RT5640 codec" depends on I2C && GPIOLIB diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c index 7b6d5d90c3a2..020f03349373 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -256,6 +256,32 @@ static unsigned int tegra_machine_mclk_rate_12mhz(unsigned int srate) return mclk; } +static unsigned int tegra_machine_mclk_rate_6mhz(unsigned int srate) +{ + unsigned int mclk; + + switch (srate) { + case 8000: + case 16000: + case 64000: + mclk = 8192000; + break; + case 11025: + case 22050: + case 88200: + mclk = 11289600; + break; + case 96000: + mclk = 12288000; + break; + default: + mclk = 256 * srate; + break; + } + + return mclk; +} + static int tegra_machine_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { @@ -883,6 +909,40 @@ static const struct tegra_asoc_data tegra_rt5632_data = { .add_headset_jack = true, }; +/* RT5631 machine */ + +SND_SOC_DAILINK_DEFS(rt5631_hifi, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "rt5631-hifi")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +static struct snd_soc_dai_link tegra_rt5631_dai = { + .name = "RT5631", + .stream_name = "RT5631 PCM", + .init = tegra_asoc_machine_init, + .dai_fmt = SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, + SND_SOC_DAILINK_REG(rt5631_hifi), +}; + +static struct snd_soc_card snd_soc_tegra_rt5631 = { + .components = "codec:rt5631", + .dai_link = &tegra_rt5631_dai, + .num_links = 1, + .fully_routed = true, +}; + +static const struct tegra_asoc_data tegra_rt5631_data = { + .mclk_rate = tegra_machine_mclk_rate_6mhz, + .card = &snd_soc_tegra_rt5631, + .add_common_dapm_widgets = true, + .add_common_controls = true, + .add_common_snd_ops = true, + .add_mic_jack = true, + .add_hp_jack = true, +}; + static const struct of_device_id tegra_machine_of_match[] = { { .compatible = "nvidia,tegra-audio-trimslice", .data = &tegra_trimslice_data }, { .compatible = "nvidia,tegra-audio-max98090", .data = &tegra_max98090_data }, @@ -892,6 +952,7 @@ static const struct of_device_id tegra_machine_of_match[] = { { .compatible = "nvidia,tegra-audio-rt5677", .data = &tegra_rt5677_data }, { .compatible = "nvidia,tegra-audio-rt5640", .data = &tegra_rt5640_data }, { .compatible = "nvidia,tegra-audio-alc5632", .data = &tegra_rt5632_data }, + { .compatible = "nvidia,tegra-audio-rt5631", .data = &tegra_rt5631_data }, {}, }; MODULE_DEVICE_TABLE(of, tegra_machine_of_match); From patchwork Wed Mar 8 07:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp195354wrd; Tue, 7 Mar 2023 23:51:22 -0800 (PST) X-Google-Smtp-Source: AK7set/I9LGTEWEsDOJyJ0LgaLHl8Usd9/TLlxzjjFi2Qvsz8+VSVZVOT7BIckRoz9sIfS4ZdhxV X-Received: by 2002:a17:906:1e47:b0:8ae:a761:e361 with SMTP id i7-20020a1709061e4700b008aea761e361mr16425552ejj.41.1678261882571; Tue, 07 Mar 2023 23:51:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678261882; cv=none; d=google.com; s=arc-20160816; b=OQebQJI8vO9+3gxhsnz9ZkvSh4GLaePBKorbpOdqORrW3xudUILBjni6oJs++r0SGU NBgHl19usX24ITQxl21rJCXqCgPbzF+YhDuyQM59q9vu4nfZ8UQRncZkVEbYpFWDbS8/ G2Ipl5O/Fxbm10tkvsrXAWtFWDgf+XA8w7ZinLCcSb1czQKEZZSVF/qmZZNxt7Dkpow8 Fcm3nvd8hqvqO4OW/0eRcr04dpb0Y+Dndzzab7QODxKR3+xKoCXTSb0Mrmadse3TZ6S9 79edewnrMJn94Z5q0XOO7HcPi9eVsU1wAbT7+rTHIinF7ZF4WSl+5jHh80F1kHMgXHO2 UjGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=39MKY2PBggsOqLz16dtI8J1bAyc0BT5d5OTGVqhjQKs=; b=zy/S+X5+aF7EswD6uhTD7Kxb6n3wx7xZdd1GveM73YW/rFRsVXqOjfpHKr7v+614OQ CE7aJsUmtCbAnXexQcvbhK5681yCmCRfr4PrNYWn5s1QboZITLXK6CkdNar+kSgp1VlF TPlQuXOiU8E9B+DVk1bThFH0F4LCscUsxuQXxiOBFrX7q2zNtbIbV6LsSTXwawAT9/IO SyUvUYDkgtsuSnaSBpoGvFpVqGYyEfQ/PEyqjHWjeWHDiw0YFdL0GUF7I8dd1wlEOwZh TtwsXyx+hDMCje/ampgTimDJfwyZ4FWRwo/CkYO2lwTWPaqEjk2nXkahS2tpoxnWxc4G 2OeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QHNf0aLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca10-20020a170906a3ca00b008cec55af403si1111967ejb.832.2023.03.07.23.50.58; Tue, 07 Mar 2023 23:51:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QHNf0aLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230016AbjCHHgR (ORCPT + 99 others); Wed, 8 Mar 2023 02:36:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbjCHHfi (ORCPT ); Wed, 8 Mar 2023 02:35:38 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88D3D84816; Tue, 7 Mar 2023 23:35:31 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id s11so62021969edy.8; Tue, 07 Mar 2023 23:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=39MKY2PBggsOqLz16dtI8J1bAyc0BT5d5OTGVqhjQKs=; b=QHNf0aLV0JBCmKc7lo9CAcdqetX0+L7WO5mOJT6e1MG2iD5mPktKd8CpCvITismNE8 nAZbon1hMTDWH09FXCFpkBeJiqt4LhWe0frq9/LtZIhSMrd8Er0+VvpimR8KbJtjHFZe ShlFEbH/K7Vpz65ubEXRTnjKglid7YAbP9NQGR+tKBzWZX8mv1S7YANnYTRcJ7fh6OhS NyHDOUMasETq8xtiwNndMKQlL24TffXN4qtUUmF1S97ASdNp57vJTJ5a5yUYaWsouYCS Nq94fWqucEqCW9D9ZJLVLFlL6HRf2w01sjBcWaUZtNoVQ+Tkcv5U6QGtKjsyMAFomo6p /ogQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=39MKY2PBggsOqLz16dtI8J1bAyc0BT5d5OTGVqhjQKs=; b=fea7K7hBLItL09xpdVX4qJ/Muun87JXJFYnV/48gpb2AAZ2VuCmo+G2quBkm6Q1+7r vTsQS4YGer9BhUF0NrphDEqjfB4SOsct1d0CDXUaLidsRB/kEwCp/47DNu1gXCs5YkBT VELfnr52GjRXCMYGjPcZyMZu8w6+NztZJhTFuYBOqU507T65GhRPCig9RMtFiNmvBkP4 nzRHA6fBvj69rYkIrsKquJ04vUAeEOJSUDPc4Br5eooy3LTjSKpqP8O7HGP5eMnaoILO +TFSBrYh1vd21NdJyaW9T1TOXrCsypaGlY41TwHfKC5+UB39d2l7EeK2+8sdeBL/CfGU VMag== X-Gm-Message-State: AO0yUKVrBwtu1g4Fln8Zc2r592CRFWhrAmjHBr+b8hklckVogk+XfGFt WUqDM0fzn8Tq9JMGatWCEAU= X-Received: by 2002:a05:6402:1810:b0:4ab:ec2:3cd1 with SMTP id g16-20020a056402181000b004ab0ec23cd1mr15708604edy.25.1678260930042; Tue, 07 Mar 2023 23:35:30 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:29 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 6/8] ARM: tegra: transformers: bind RT5631 sound nodes Date: Wed, 8 Mar 2023 09:35:00 +0200 Message-Id: <20230308073502.5421-7-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759785131951611953?= X-GMAIL-MSGID: =?utf-8?q?1759785131951611953?= TF201, TF300TG and TF700T support RT5631 codec. Signed-off-by: Svyatoslav Ryhel --- arch/arm/boot/dts/tegra30-asus-tf201.dts | 17 +++++++++++++++++ arch/arm/boot/dts/tegra30-asus-tf300tg.dts | 17 +++++++++++++++++ arch/arm/boot/dts/tegra30-asus-tf700t.dts | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/arch/arm/boot/dts/tegra30-asus-tf201.dts b/arch/arm/boot/dts/tegra30-asus-tf201.dts index 315c6dc068c5..47865deeb88a 100644 --- a/arch/arm/boot/dts/tegra30-asus-tf201.dts +++ b/arch/arm/boot/dts/tegra30-asus-tf201.dts @@ -605,6 +605,23 @@ haptic-feedback { enable-gpios = <&gpio TEGRA_GPIO(H, 7) GPIO_ACTIVE_HIGH>; vcc-supply = <&vdd_3v3_sys>; }; + + sound { + compatible = "asus,tegra-audio-rt5631-tf201", + "nvidia,tegra-audio-rt5631"; + nvidia,model = "Asus Transformer Prime TF201 RT5631"; + + nvidia,audio-routing = + "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR", + "Int Spk", "SPOL", + "Int Spk", "SPOR", + "MIC1", "MIC Bias1", + "MIC Bias1", "Headset Mic", + "DMIC", "Int Mic"; + + nvidia,audio-codec = <&rt5631>; + }; }; &emc_icc_dvfs_opp_table { diff --git a/arch/arm/boot/dts/tegra30-asus-tf300tg.dts b/arch/arm/boot/dts/tegra30-asus-tf300tg.dts index 96345f821c3d..82c51e177a70 100644 --- a/arch/arm/boot/dts/tegra30-asus-tf300tg.dts +++ b/arch/arm/boot/dts/tegra30-asus-tf300tg.dts @@ -1072,6 +1072,23 @@ timing-667000000 { display-panel { compatible = "innolux,g101ice-l01"; }; + + sound { + compatible = "asus,tegra-audio-rt5631-tf300tg", + "nvidia,tegra-audio-rt5631"; + nvidia,model = "Asus Transformer Pad TF300TG RT5631"; + + nvidia,audio-routing = + "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR", + "Int Spk", "SPOL", + "Int Spk", "SPOR", + "MIC1", "MIC Bias1", + "MIC Bias1", "Headset Mic", + "DMIC", "Int Mic"; + + nvidia,audio-codec = <&rt5631>; + }; }; &emc_icc_dvfs_opp_table { diff --git a/arch/arm/boot/dts/tegra30-asus-tf700t.dts b/arch/arm/boot/dts/tegra30-asus-tf700t.dts index 1a331dec3cfe..766225ebdeab 100644 --- a/arch/arm/boot/dts/tegra30-asus-tf700t.dts +++ b/arch/arm/boot/dts/tegra30-asus-tf700t.dts @@ -812,6 +812,23 @@ vdd_1v2_mipi: regulator-mipi { enable-active-high; vin-supply = <&vdd_3v3_sys>; }; + + sound { + compatible = "asus,tegra-audio-rt5631-tf700t", + "nvidia,tegra-audio-rt5631"; + nvidia,model = "Asus Transformer Infinity TF700T RT5631"; + + nvidia,audio-routing = + "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR", + "Int Spk", "SPOL", + "Int Spk", "SPOR", + "MIC1", "MIC Bias1", + "MIC Bias1", "Headset Mic", + "DMIC", "Int Mic"; + + nvidia,audio-codec = <&rt5631>; + }; }; &emc_icc_dvfs_opp_table { From patchwork Wed Mar 8 07:35:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp201035wrd; Wed, 8 Mar 2023 00:07:19 -0800 (PST) X-Google-Smtp-Source: AK7set+Oq18k5SHnX0pjQG099CFuOwN+7j5EUdviqPA2CO6A9P3VjUWrQvOq4zCpTqfpg3h6kC79 X-Received: by 2002:aa7:dd06:0:b0:4ac:b31c:83d3 with SMTP id i6-20020aa7dd06000000b004acb31c83d3mr15215219edv.14.1678262839679; Wed, 08 Mar 2023 00:07:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678262839; cv=none; d=google.com; s=arc-20160816; b=GEQHJXi0cuMQyQr1EO/1sD4ju3zlj9Wp2tXcYitRU4CD2KdhkKWsfzPf5vwYp1ox+w L/LwfY4bqgn/4PLqEOtdd1jgr5QKigWPPliXi44QsiPZjpneDEQtOsIWCztAWWQjMScW x6HSM0U86Yy8db7+VD7xZlWCL7zkjldkcnpJAQQ3c+PNXnNnfYFBaH22JsLPCKO9GZVw mgrUJzBsOnfOBgUA2pAo+pDElpv6Y7xdQP0YJddcHpf3jrfY+KIfmVsh4CLkASAe6Lfc sSOJIN7w6pW017CIBSsXgRtUK6s4YvQ6DXqOQ1dLc4YoJBoUcmaJ+IsCLbCUt3Ew4j71 3tXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1fl8uW/bQJEJTin+QIg8DWseVdDDVo44lOoVAOeBzPc=; b=SpP+1EmgdR+oCm7uUlehvKhqF+SCxF25x6tauEnrdL/k1LwWtHz23fcoB32RqrAGaF CBz0Z8B9KBo/iEbZ9dLGWlbSDZhPXVeXqh0TPyusY0hDpaZ9LFjJbHcBTiLyB/CBUbmi cyj3t1VLDS4ExeoEmReCB58rD6mGayifiD06hoZRGf8TjDFeJ44kAhmEdbcbdCElGwYf SqL5Q6Mo23S4Q4X85rRxNimmImybtujbsuIZwDUyDrnPyQEbfCv65CF0XdNu1wpL9lvm +3LcPA387Cc6tb0qw38AaMJUqmVmfrkRDq/8YZHXnKf0/DVWr4ztzxWZs+/hiYUO36q8 ovew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qm6adxrv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020aa7ce08000000b004acc30ee8fbsi4743284edv.429.2023.03.08.00.06.56; Wed, 08 Mar 2023 00:07:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qm6adxrv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230007AbjCHHgI (ORCPT + 99 others); Wed, 8 Mar 2023 02:36:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjCHHfj (ORCPT ); Wed, 8 Mar 2023 02:35:39 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C290614227; Tue, 7 Mar 2023 23:35:32 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id ec29so31189447edb.6; Tue, 07 Mar 2023 23:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1fl8uW/bQJEJTin+QIg8DWseVdDDVo44lOoVAOeBzPc=; b=Qm6adxrvZNiyIQbLUCsj66urFNjR/BgPWPxUMP16ivYCXpi1zIYeSQe3B2yITeMI3u +AuwNDUqk1IB12ZPyulZha3fwvbO0M3KCw9u45yMdbfZHe+PypAHHybYmS7QqV1X2Mz9 gp/AhXVhWCpZb0l9wBU7lQjQgYrYuWGo8Nr/y/ypJcFe3lUgCd0gMSFHQvmSBhryxtmj l7bZ1pn37/vkR2VS0HK8TdOWdFro+H/2GMrXTc95U3EZ72b9x9SGYvp7nANgg5HbSi9x 4lUkHhKPuF50dmL+J1rYVJXtPVxo2DVnahdjWzVpW743ojRgB/LWD6wiynXWGrLCLqkE eDeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1fl8uW/bQJEJTin+QIg8DWseVdDDVo44lOoVAOeBzPc=; b=OL6x6N+ugcAOSYhBKtCJzMjavoDgKjIDFb5h+oJVw6nlRqCrDSWP+BpDPooN14v8su N5or3QfXDDgwsETHfu97n+x93RPLogilh7FdhuZALyIJ9d6ohSQwsD2GqNOTdkaLVK1j //mZlyTIXhxpmDTChxbBufh498jTRZGNp1UIEw/JO/yIOATrwgNGhIHa+qahc6blXXbx ZHCtk82SwSTUtFDEjvivtP0Uf6L9txfg/VOrm+ZwDPAy1QKt44Z81G9KuTFOLoSf8u6R j+6b2ATbYx+ydGoKg8NGp+MPSLL1HMfXqnP7WZM+2s844BAZf+ETssEORNkshdxzUuoW UMMA== X-Gm-Message-State: AO0yUKW3Qs+VqlzagRn6Jcm9MGufM3aVfhghYaH6XFST9khVYOU9vlgw saNNZe/6NmcaNJ1EuCWucWDGM2uQ0b0= X-Received: by 2002:a17:906:fe44:b0:88f:8a5:b4cd with SMTP id wz4-20020a170906fe4400b0088f08a5b4cdmr19309704ejb.1.1678260931239; Tue, 07 Mar 2023 23:35:31 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:31 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 7/8] dt-bindings: sound: nvidia,tegra-audio: add MAX9808x CODEC Date: Wed, 8 Mar 2023 09:35:01 +0200 Message-Id: <20230308073502.5421-8-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759786135423463505?= X-GMAIL-MSGID: =?utf-8?q?1759786135423463505?= Add dt-binding for MAX9808x CODEC. Signed-off-by: Svyatoslav Ryhel --- .../sound/nvidia,tegra-audio-max9808x.yaml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.yaml diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.yaml new file mode 100644 index 000000000000..fc89dbd6bf24 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.yaml @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-max9808x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra audio complex with MAX9808x CODEC + +maintainers: + - Jon Hunter + - Thierry Reding + +allOf: + - $ref: nvidia,tegra-audio-common.yaml# + +properties: + compatible: + oneOf: + - items: + - pattern: '^[a-z0-9]+,tegra-audio-max98088(-[a-z0-9]+)+$' + - const: nvidia,tegra-audio-max98088 + - items: + - pattern: '^[a-z0-9]+,tegra-audio-max98089(-[a-z0-9]+)+$' + - const: nvidia,tegra-audio-max98089 + + nvidia,audio-routing: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: | + A list of the connections between audio components. + Each entry is a pair of strings, the first being the connection's sink, + the second being the connection's source. Valid names for sources and + sinks are the pins (documented in the binding document), + and the jacks on the board. + minItems: 2 + items: + enum: + # Board Connectors + - "Int Spk" + - "Headphone Jack" + - "Earpiece" + - "Headset Mic" + - "Internal Mic 1" + - "Internal Mic 2" + + # CODEC Pins + - HPL + - HPR + - SPKL + - SPKR + - RECL + - RECR + - INA1 + - INA2 + - INB1 + - INB2 + - MIC1 + - MIC2 + - MICBIAS + +unevaluatedProperties: false + +examples: + - | + #include + #include + sound { + compatible = "lge,tegra-audio-max98089-p895", + "nvidia,tegra-audio-max98089"; + nvidia,model = "LG Optimus Vu MAX98089"; + + nvidia,audio-routing = + "Headphone Jack", "HPL", + "Headphone Jack", "HPR", + "Int Spk", "SPKL", + "Int Spk", "SPKR", + "Earpiece", "RECL", + "Earpiece", "RECR", + "INA1", "Headset Mic", + "MIC1", "MICBIAS", + "MICBIAS", "Internal Mic 1", + "MIC2", "Internal Mic 2"; + + nvidia,i2s-controller = <&tegra_i2s0>; + nvidia,audio-codec = <&codec>; + + clocks = <&tegra_car TEGRA30_CLK_PLL_A>, + <&tegra_car TEGRA30_CLK_PLL_A_OUT0>, + <&tegra_pmc TEGRA_PMC_CLK_OUT_1>; + clock-names = "pll_a", "pll_a_out0", "mclk"; + }; From patchwork Wed Mar 8 07:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svyatoslav Ryhel X-Patchwork-Id: 66061 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp194534wrd; Tue, 7 Mar 2023 23:48:46 -0800 (PST) X-Google-Smtp-Source: AK7set9yFDV74zHkua6JNuz6wSAorjIZ+5uNUKNpw3HShHdEDNx5xhxpQQpMDGvjXxWxccsH4Mft X-Received: by 2002:a17:906:eb49:b0:8f7:7876:fd96 with SMTP id mc9-20020a170906eb4900b008f77876fd96mr16096733ejb.58.1678261726400; Tue, 07 Mar 2023 23:48:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678261726; cv=none; d=google.com; s=arc-20160816; b=D8+9KZqa67MJXD9SCl5WB2nTw/2gjKYX2gL++IWhWkUZLIV1HKypS49ZEkPsx3bqOl YC36e0tKUY/AbCE5NwRMIuXuzcxD/0xTYRg+3Ou8JLJ1sVzhVIWN97xMc/sj5hLnbNtI p6l9cyLPzwDWAraOqPKbRvyZDjSbD5Zr3oPgiahPlVBWHh4MH/U26tbA93iHfB///pPO dTvi4uiuBeUaIdsKvaIYZmeO90yTlF/TZZPxlH48slhFA0DtRDdkEcuAJYYOxHQwuwtq 20E5+vxTlQfwn8HgQRvdA7LwmVuIPAeFyDZxHA4e4yu/m1f2nqJ6xmG+ibodba7PIpXg DUMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uwmnzBCq63isuXl3Q6C2EI4fASZ8/CUk+jrNqzYxJ44=; b=SEsQ9PoxI3oQvjzTEPXH2/B/6sqGCySd+xEdopjL75V0HV/0h37MsEzy+WGIFbHVJR XI7wOGHNe9k3NdA8sEfruloAXVZHY7nY/EQyKevcqYDOuh7XgX9Cz5xx9BtV6xi+328m 9qJL427/q0xPlCj0wgXf4/lE/ZwwP+gwuLIbTwwDY5Bf3RPag6ZxhmWC0NdaA5m5SbD6 2Wortq37EClMxK/atsYgFJbiSoAQmExHY46Xkclb4AfZH9P5febDtoRs45S0YpqCH6uk lRKYTb7f60EAbRaw8U3vRuvBTCYIbrTF1e1gB0jGlV1u4flyZNCTGd8TmWxH1cU4jo62 L4wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="VbzEV/Vv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca10-20020a170906a3ca00b008cec55af403si1111967ejb.832.2023.03.07.23.48.22; Tue, 07 Mar 2023 23:48:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="VbzEV/Vv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbjCHHgN (ORCPT + 99 others); Wed, 8 Mar 2023 02:36:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjCHHfj (ORCPT ); Wed, 8 Mar 2023 02:35:39 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F420768F; Tue, 7 Mar 2023 23:35:34 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id i34so62023467eda.7; Tue, 07 Mar 2023 23:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678260932; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uwmnzBCq63isuXl3Q6C2EI4fASZ8/CUk+jrNqzYxJ44=; b=VbzEV/VvOn0aSQHQgw9+0pNrIzr+/yH5ubUhN1HKeSmTXf94BdvU0QAKeTG/UexecP ZICikcpLbHW2e0fYNwJ1vyGRLpXhwmMMlXD9YP4uO+DI5vvTfwVk203z/MAYV7iNWyaM LzAP5cU4wfatBnoKPgcGA8qelmXohuXnpZcu1lSeTbjjW3JnQg7Lwe2dS93Db7T778FE cBvDSoBmgp6dMUeoYjAojgWZRchmdsvquJU223oHpOImJgsuy1k8R4gIJQ1WmoZmx8pJ N8S7zxDTRsGGvpgIvE+YkAOd2Hsg6lQsjUcJTHv2ZjlZBM3GeR1S2dA9jZ8xNEj38m4l TbHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678260932; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uwmnzBCq63isuXl3Q6C2EI4fASZ8/CUk+jrNqzYxJ44=; b=QRoaVuvEejaXxFL2QIvvozunDgJzuBpF7ocfTTsI6MnpkT1KPvjWGZULa9UK8gDiEq Uhz7WnvmXhp5dukvcWWMNNI8cJrHLwSM2XJLu6zPSDQtbOtQJV21C3u34HGCQPdzz5BQ sjXLBNhWZTdwpwe45/RcNCkw0ibJ2fZrkWwQxs4d6ItgC76j1tHkipLhzKBVGZ08Xi3d TW43zwxj+ZCQraDrPPtRrbaOrxLsgqYUlKvuSV3SsDD5NfJmrT4amUOjjQR+776P11W3 +P3mH8YaaMHkmagD5iqPx9mxc3p/u6dmy+J1c1GlBDXfRcJys6v5LD9JfBOvtLxDNMyv wghA== X-Gm-Message-State: AO0yUKW7lnkhdWkFF+bhVImY7MbB6uzEWL0lIB9d+CP3NP5xDv52hSr6 FN3EdzqZcfYJZZyC7Nn0txop5dkczr0= X-Received: by 2002:a17:907:6f18:b0:8f8:5779:f1af with SMTP id sy24-20020a1709076f1800b008f85779f1afmr18421549ejc.15.1678260932432; Tue, 07 Mar 2023 23:35:32 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id h15-20020a1709062dcf00b008dffda52d71sm7051880eji.124.2023.03.07.23.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 23:35:32 -0800 (PST) From: Svyatoslav Ryhel To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Svyatoslav Ryhel , Maxim Schwalm , Dmitry Osipenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 8/8] ASoC: tegra: Support MAX9808x by machine driver Date: Wed, 8 Mar 2023 09:35:02 +0200 Message-Id: <20230308073502.5421-9-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308073502.5421-1-clamor95@gmail.com> References: <20230308073502.5421-1-clamor95@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759784967931072400?= X-GMAIL-MSGID: =?utf-8?q?1759784967931072400?= Add Maxim MAX9808x codec support to the Tegra ASoC machine driver. This codec is found on LG T30 devices like Optimus 4X HD and Optimus Vu. Signed-off-by: Svyatoslav Ryhel --- sound/soc/tegra/Kconfig | 9 ++++++ sound/soc/tegra/tegra_asoc_machine.c | 46 +++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index ff905e5dcd86..950f490b8d54 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig @@ -263,6 +263,15 @@ config SND_SOC_TEGRA_MAX98090 Say Y or M here if you want to add support for SoC audio on Tegra boards using the MAX98090 codec, such as Venice2. +config SND_SOC_TEGRA_MAX98088 + tristate "SoC Audio support for Tegra boards using a MAX9808x codec" + depends on I2C && GPIOLIB + select SND_SOC_TEGRA_MACHINE_DRV + select SND_SOC_MAX98088 + help + Say Y or M here if you want to add support for SoC audio on Tegra + boards using the MAX98088 codec, such as LG X3. + config SND_SOC_TEGRA_RT5677 tristate "SoC Audio support for Tegra boards using a RT5677 codec" depends on I2C && GPIOLIB diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c index 020f03349373..cc08325d523b 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -86,11 +86,11 @@ static int tegra_machine_event(struct snd_soc_dapm_widget *w, gpiod_set_value_cansleep(machine->gpiod_spkr_en, SND_SOC_DAPM_EVENT_ON(event)); - if (!strcmp(w->name, "Mic Jack")) + if (!strcmp(w->name, "Mic Jack") || !strcmp(w->name, "Headset Mic")) gpiod_set_value_cansleep(machine->gpiod_ext_mic_en, SND_SOC_DAPM_EVENT_ON(event)); - if (!strcmp(w->name, "Int Mic")) + if (!strcmp(w->name, "Int Mic") || !strcmp(w->name, "Internal Mic 2")) gpiod_set_value_cansleep(machine->gpiod_int_mic_en, SND_SOC_DAPM_EVENT_ON(event)); @@ -108,11 +108,12 @@ static const struct snd_soc_dapm_widget tegra_machine_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphones", NULL), SND_SOC_DAPM_SPK("Speakers", tegra_machine_event), SND_SOC_DAPM_SPK("Int Spk", tegra_machine_event), + SND_SOC_DAPM_SPK("Earpiece", NULL), SND_SOC_DAPM_MIC("Int Mic", tegra_machine_event), SND_SOC_DAPM_MIC("Mic Jack", tegra_machine_event), SND_SOC_DAPM_MIC("Internal Mic 1", NULL), - SND_SOC_DAPM_MIC("Internal Mic 2", NULL), - SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MIC("Internal Mic 2", tegra_machine_event), + SND_SOC_DAPM_MIC("Headset Mic", tegra_machine_event), SND_SOC_DAPM_MIC("Digital Mic", NULL), SND_SOC_DAPM_MIC("Mic", NULL), SND_SOC_DAPM_LINE("Line In Jack", NULL), @@ -123,6 +124,7 @@ static const struct snd_soc_dapm_widget tegra_machine_dapm_widgets[] = { static const struct snd_kcontrol_new tegra_machine_controls[] = { SOC_DAPM_PIN_SWITCH("Speakers"), SOC_DAPM_PIN_SWITCH("Int Spk"), + SOC_DAPM_PIN_SWITCH("Earpiece"), SOC_DAPM_PIN_SWITCH("Int Mic"), SOC_DAPM_PIN_SWITCH("Headset Mic"), SOC_DAPM_PIN_SWITCH("Internal Mic 1"), @@ -718,6 +720,40 @@ static const struct tegra_asoc_data tegra_max98090_data = { .add_hp_jack = true, }; +/* MAX98088 machine */ + +SND_SOC_DAILINK_DEFS(max98088_hifi, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "HiFi")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +static struct snd_soc_dai_link tegra_max98088_dai = { + .name = "MAX98088", + .stream_name = "MAX98088 PCM", + .init = tegra_asoc_machine_init, + .dai_fmt = SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, + SND_SOC_DAILINK_REG(max98088_hifi), +}; + +static struct snd_soc_card snd_soc_tegra_max98088 = { + .components = "codec:max98088", + .dai_link = &tegra_max98088_dai, + .num_links = 1, + .fully_routed = true, +}; + +static const struct tegra_asoc_data tegra_max98088_data = { + .mclk_rate = tegra_machine_mclk_rate_12mhz, + .card = &snd_soc_tegra_max98088, + .add_common_dapm_widgets = true, + .add_common_controls = true, + .add_common_snd_ops = true, + .add_mic_jack = true, + .add_hp_jack = true, +}; + /* SGTL5000 machine */ SND_SOC_DAILINK_DEFS(sgtl5000_hifi, @@ -946,6 +982,8 @@ static const struct tegra_asoc_data tegra_rt5631_data = { static const struct of_device_id tegra_machine_of_match[] = { { .compatible = "nvidia,tegra-audio-trimslice", .data = &tegra_trimslice_data }, { .compatible = "nvidia,tegra-audio-max98090", .data = &tegra_max98090_data }, + { .compatible = "nvidia,tegra-audio-max98088", .data = &tegra_max98088_data }, + { .compatible = "nvidia,tegra-audio-max98089", .data = &tegra_max98088_data }, { .compatible = "nvidia,tegra-audio-sgtl5000", .data = &tegra_sgtl5000_data }, { .compatible = "nvidia,tegra-audio-wm9712", .data = &tegra_wm9712_data }, { .compatible = "nvidia,tegra-audio-wm8753", .data = &tegra_wm8753_data },