From patchwork Tue Mar 16 10:58:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 401691 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4200741jai; Tue, 16 Mar 2021 03:59:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjMU/H+gIJvJ1U0x+OqRGC9yKq1KgSbyQGK7ieI5445NY8J5QnVSpPVpkF5o7XZ9hqCvH2 X-Received: by 2002:aa7:cf02:: with SMTP id a2mr34892301edy.59.1615892392491; Tue, 16 Mar 2021 03:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615892392; cv=none; d=google.com; s=arc-20160816; b=Prx9nWLzPADPiYc7ubZSmsZVuPYJrrGM4qYz6tTEqsZ9fBrxkT+3glszwkTX/VEhna kr4hzx55tM1yHVrS0orj4O8fxLmJMvTNxu5WVCSN4rCokAGpwipKIR/SrXlLyd6Zy5J4 FgNuO/L8vFdVJ6TlCVMeyx/10H4L8ekJOFUeX4/ex7zV672VrvWxgrM6uXwx8usytGPB fheeKpwYGbbLVpWA72HwdAWHvk7TKOpHkWBooswdOqu6QXc+E4NQcaU9nIHCX2S4fLez W9MZA9csnvUYv/KZF5T91oaiPEgIZzR+cqoVWFYRzF4HAXSdjANdQc601g74e7hlMM3M whAg== 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=/vUWvhAchaqpjbMn74HpIxb8CiMc71rLCGrcTJNmxv0=; b=ev96+ymeGRghKIdGJggjhDfYSw7LLnXUTli7aRcNc7+Wyst6MARCuHRFSOf3iKnHMZ wNZPi4GYdODlquusH1fOcPxyrTNNFInZ7xJycD4XSyGL/tT/0R0X308tLm/SSqyoAspG nbRtr/DInnas5FZUQQB9nR4kKNUyqv4hXgqW6KBaSS2cP00vCvNtF+FHkWhAU8cInmct /HzMMYaYj9vpTgvZV/C+08AESDQQ9j+R1wUqj4jmVzD1XkXh7iBPBw8vDwUDon2TbYui ABEUKxCuvkOc8D1iJ6YIAzSMsAp7Ll8+cExEP9qwTEMGxN2hprBiGQJQoKkeEVLs4+WU krmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K3MKD6XX; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hy25si12984429ejc.333.2021.03.16.03.59.52; Tue, 16 Mar 2021 03:59:52 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K3MKD6XX; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236957AbhCPK7X (ORCPT + 6 others); Tue, 16 Mar 2021 06:59:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233142AbhCPK6q (ORCPT ); Tue, 16 Mar 2021 06:58:46 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A436C0613DA for ; Tue, 16 Mar 2021 03:58:45 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id g20so9853126wmk.3 for ; Tue, 16 Mar 2021 03:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/vUWvhAchaqpjbMn74HpIxb8CiMc71rLCGrcTJNmxv0=; b=K3MKD6XXGXJ0yT+1v/UqRy2TXWDGhBzNxHRnOrIAVvwvDDoU6GAQxmwOE7mvD1tUE3 AKFSQiD4ypdPsEzPOAyt41Mxs/fig+i4h5xsf0syMKWMpZiC3GlTs6KcKMiP69gv7wkB HlvjofddxDGpNOP4hdkKKwSjHWuGbWb3ycYlcNMHkXPQloKT8NREPY7z2rlP1ZpPqabc kZkVxYf+CZdvHsYkeQwFedVize36XaJMu2u1tMkO7HkD9+TkUDX1FlQh0LnebNzLbXYN 5UvZjwPrdUsxq13WKrFcIQrRMkBXcoGkVfal8XsNL4lItMeu0DwKgEtFZCs/w26aQet7 ofEw== 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=/vUWvhAchaqpjbMn74HpIxb8CiMc71rLCGrcTJNmxv0=; b=R4pjvS4NHjvlqWu3gzw7UAKGB6e5qD/NLD3UG35lNCfuMT1ecRmeLCA9yPKoAnb99y d3Z3xEAvkylt+LPzgQH/3EA44uMT4GmOC4npBmVNPFx72Um+0iTkTLM/Vpto9ve1Ymc7 M1UMBr09Gc8bWZzlotP/Bv5XQv4/VVAUzBURf9mtJJkrbLkBvk/Pje1Q8LbCUlM7PxK6 mr5mv3CC9JIn/5on6vxw8DTRTGsLp82vbGEhF+VMrALR5k3A9fZUJ7f95aOn8KhB3uIl kNwcZGqbskohBAhWhfD/E4aMrep6oSWuxocRTdFRvCGrz5DvK8wQ61STRzUSVwpWqzaM LN4g== X-Gm-Message-State: AOAM5313XNR1gvZKjfz1L+o1A1LPRmArrvcg2Aub3dgoZxpcBllVCZAG Med9zQkFKKwrVM7AM5qbfkhofg== X-Received: by 2002:a1c:6a05:: with SMTP id f5mr4078106wmc.75.1615892324353; Tue, 16 Mar 2021 03:58:44 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id t8sm21465956wrr.10.2021.03.16.03.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 03:58:43 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: robh@kernel.org, devicetree@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH v2 7/7] ASoC: codecs: wcd938x: add audio routing Date: Tue, 16 Mar 2021 10:58:28 +0000 Message-Id: <20210316105828.16436-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210316105828.16436-1-srinivas.kandagatla@linaro.org> References: <20210316105828.16436-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds audio routing for both playback and capture. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/wcd938x.c | 97 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) -- 2.21.0 diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index 31e3cf729568..0f801920ebac 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -3153,6 +3153,99 @@ static const struct snd_soc_dapm_widget wcd938x_rx_dapm_widgets[] = { }; +static const struct snd_soc_dapm_route wcd938x_rx_audio_map[] = { + {"IN1_HPHL", NULL, "VDD_BUCK"}, + {"IN1_HPHL", NULL, "CLS_H_PORT"}, + + {"RX1", NULL, "IN1_HPHL"}, + {"RX1", NULL, "RXCLK"}, + {"RDAC1", NULL, "RX1"}, + {"HPHL_RDAC", "Switch", "RDAC1"}, + {"HPHL PGA", NULL, "HPHL_RDAC"}, + {"HPHL", NULL, "HPHL PGA"}, + + {"IN2_HPHR", NULL, "VDD_BUCK"}, + {"IN2_HPHR", NULL, "CLS_H_PORT"}, + {"RX2", NULL, "IN2_HPHR"}, + {"RDAC2", NULL, "RX2"}, + {"RX2", NULL, "RXCLK"}, + {"HPHR_RDAC", "Switch", "RDAC2"}, + {"HPHR PGA", NULL, "HPHR_RDAC"}, + {"HPHR", NULL, "HPHR PGA"}, + + {"IN3_AUX", NULL, "VDD_BUCK"}, + {"IN3_AUX", NULL, "CLS_H_PORT"}, + {"RX3", NULL, "IN3_AUX"}, + {"RDAC4", NULL, "RX3"}, + {"RX3", NULL, "RXCLK"}, + {"AUX_RDAC", "Switch", "RDAC4"}, + {"AUX PGA", NULL, "AUX_RDAC"}, + {"AUX", NULL, "AUX PGA"}, + + {"RDAC3_MUX", "RX3", "RX3"}, + {"RDAC3_MUX", "RX1", "RX1"}, + {"RDAC3", NULL, "RDAC3_MUX"}, + {"EAR_RDAC", "Switch", "RDAC3"}, + {"EAR PGA", NULL, "EAR_RDAC"}, + {"EAR", NULL, "EAR PGA"}, +}; + +static const struct snd_soc_dapm_route wcd938x_audio_map[] = { + {"ADC1_OUTPUT", NULL, "ADC1_MIXER"}, + {"ADC1_MIXER", "Switch", "ADC1 REQ"}, + {"ADC1 REQ", NULL, "ADC1"}, + {"ADC1", NULL, "AMIC1"}, + + {"ADC2_OUTPUT", NULL, "ADC2_MIXER"}, + {"ADC2_MIXER", "Switch", "ADC2 REQ"}, + {"ADC2 REQ", NULL, "ADC2"}, + {"ADC2", NULL, "HDR12 MUX"}, + {"HDR12 MUX", "NO_HDR12", "ADC2 MUX"}, + {"HDR12 MUX", "HDR12", "AMIC1"}, + {"ADC2 MUX", "INP3", "AMIC3"}, + {"ADC2 MUX", "INP2", "AMIC2"}, + + {"ADC3_OUTPUT", NULL, "ADC3_MIXER"}, + {"ADC3_MIXER", "Switch", "ADC3 REQ"}, + {"ADC3 REQ", NULL, "ADC3"}, + {"ADC3", NULL, "HDR34 MUX"}, + {"HDR34 MUX", "NO_HDR34", "ADC3 MUX"}, + {"HDR34 MUX", "HDR34", "AMIC5"}, + {"ADC3 MUX", "INP4", "AMIC4"}, + {"ADC3 MUX", "INP6", "AMIC6"}, + + {"ADC4_OUTPUT", NULL, "ADC4_MIXER"}, + {"ADC4_MIXER", "Switch", "ADC4 REQ"}, + {"ADC4 REQ", NULL, "ADC4"}, + {"ADC4", NULL, "ADC4 MUX"}, + {"ADC4 MUX", "INP5", "AMIC5"}, + {"ADC4 MUX", "INP7", "AMIC7"}, + + {"DMIC1_OUTPUT", NULL, "DMIC1_MIXER"}, + {"DMIC1_MIXER", "Switch", "DMIC1"}, + + {"DMIC2_OUTPUT", NULL, "DMIC2_MIXER"}, + {"DMIC2_MIXER", "Switch", "DMIC2"}, + + {"DMIC3_OUTPUT", NULL, "DMIC3_MIXER"}, + {"DMIC3_MIXER", "Switch", "DMIC3"}, + + {"DMIC4_OUTPUT", NULL, "DMIC4_MIXER"}, + {"DMIC4_MIXER", "Switch", "DMIC4"}, + + {"DMIC5_OUTPUT", NULL, "DMIC5_MIXER"}, + {"DMIC5_MIXER", "Switch", "DMIC5"}, + + {"DMIC6_OUTPUT", NULL, "DMIC6_MIXER"}, + {"DMIC6_MIXER", "Switch", "DMIC6"}, + + {"DMIC7_OUTPUT", NULL, "DMIC7_MIXER"}, + {"DMIC7_MIXER", "Switch", "DMIC7"}, + + {"DMIC8_OUTPUT", NULL, "DMIC8_MIXER"}, + {"DMIC8_MIXER", "Switch", "DMIC8"}, +}; + static int wcd938x_get_micb_vout_ctl_val(u32 micb_mv) { /* min micbias voltage is 1V and maximum is 2.85V */ @@ -3332,6 +3425,8 @@ static const struct snd_soc_component_driver soc_codec_dev_wcd938x_sdw_rx = { .num_controls = ARRAY_SIZE(wcd938x_rx_snd_controls), .dapm_widgets = wcd938x_rx_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wcd938x_rx_dapm_widgets), + .dapm_routes = wcd938x_rx_audio_map, + .num_dapm_routes = ARRAY_SIZE(wcd938x_rx_audio_map), }; static const struct snd_soc_component_driver soc_codec_dev_wcd938x_sdw_tx = { @@ -3341,6 +3436,8 @@ static const struct snd_soc_component_driver soc_codec_dev_wcd938x_sdw_tx = { .num_controls = ARRAY_SIZE(wcd938x_snd_controls), .dapm_widgets = wcd938x_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wcd938x_dapm_widgets), + .dapm_routes = wcd938x_audio_map, + .num_dapm_routes = ARRAY_SIZE(wcd938x_audio_map), }; static void wcd938x_dt_parse_micbias_info(struct device *dev, struct wcd938x_priv *wcd)