From patchwork Wed Apr 14 15:48:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 421116 Delivered-To: patch@linaro.org Received: by 2002:a02:c4d2:0:0:0:0:0 with SMTP id h18csp3668839jaj; Wed, 14 Apr 2021 08:52:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUT5yNrukOUIOs7SHn0eBJRtLAZ4iNtll2NBjcSxqumWoIwt9fT05Xq4TmMdlqfOpIg69Z X-Received: by 2002:a17:906:c1c4:: with SMTP id bw4mr22125299ejb.70.1618415527967; Wed, 14 Apr 2021 08:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618415527; cv=none; d=google.com; s=arc-20160816; b=r/TD5qVSzxk8wGIFoW5pi/iq4eF1kMh1YkCUsCPek4dV50Y1vHxYpNfmehivL8x4SI N9OuVES9DATI3j9VZ5/fXGDHsfYRvFGoyFh++qEZ6X9NuKfIg4QDF7F0SEjW5nr8S5k+ XSeFAbTNYRiFeQ6RdJ2Zb8cJakihNLBdQS1DXqiNDF7lYIdN2fS8F+GSe8aeEt+kXyj4 UUUKz2/2771My/kz/MSHk/+dU8Osh42MdHZE1kmtTRbTINuAsq0uHfl7ui/SFDIfPLFj MD4aDMzXrjep0VIjf/ui9fwO9726UYziMC/QpzMn+K+hW9gNDc/YsoWPLhoq9pT5C/eD ItEA== 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=uGqXKNepWMiRK4L6umZmSd60JxhJtOROnMTMOBVaS0w=; b=etGp8gU5qmr+ZTgUjOiQd7UcpZ/2Km2UNVnjnbUFgT6Fqrl8D59NkqjTJ8Zg1uo89d OdXfGc7GSY1O2IKxijeNmv/+L7GgXFgDu/yptYGwMCj3xgiplbu1F1Toy3KUnr+gwgu4 3nQts/KF1tmWoCAkQw6Lh3hld9hcwMFM/GvBKtiYFXDlhO2m1S8UgBmcwOELckMR5ku3 vJsw3H+HynpeoiGYOKg9+URN+KXpOAIke8o4oTDCnxFIDjdzsy+djzq1bLaU3b9aQO+y vbUfh/pGLBsXl7K05+Nlhjuz+kUAfrD79Q/getSDu2OUtfdMzXITaJaivDzb+cJluYxs 0t9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aVBbEZIe; 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 c5si2227342eds.46.2021.04.14.08.52.04; Wed, 14 Apr 2021 08:52:07 -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=aVBbEZIe; 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 S1352285AbhDNPuR (ORCPT + 6 others); Wed, 14 Apr 2021 11:50:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352470AbhDNPuJ (ORCPT ); Wed, 14 Apr 2021 11:50:09 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F312CC06134D for ; Wed, 14 Apr 2021 08:49:35 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id n2so32115343ejy.7 for ; Wed, 14 Apr 2021 08:49:35 -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=uGqXKNepWMiRK4L6umZmSd60JxhJtOROnMTMOBVaS0w=; b=aVBbEZIeMYk9oUnjuxb6YOo9fxYJM1S/cNjUGQDK9xQ6/+30zuoBKKIfcZQM1quDxT n4pY5r4Te6jfZnw2yIh9ztfc8G/5GnDP/67FXwI40UG8k90YBobXvPO3EN8Hm/Nng0Fv Dtwf6nxRHGvTUFuOYexJLHQ5qgCOpuK4lkOKMhVugxAMYY5JqzB8dOWZXLnVRBgDq4e1 28PJZ49ojUZxWE18qti/t75A+GSDYol+GvHYrnKd9KoZIsb0QfgYCoOoFUwHvbQwDd9j RZwEfIYKc/dKz/bTzvWEyIDQYDy2bWrmfTFcqsRQOT+osrXqy9vVSRuvS1teDfn+9bdT Wy3g== 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=uGqXKNepWMiRK4L6umZmSd60JxhJtOROnMTMOBVaS0w=; b=eN6BvZiE4Q9NZAE6v4lUpJeQQLK49+kkvqgmbO0QdXDRzoZVsUmf/cF8V2NRxpTpi6 agLxE++rVot+OoVK0bl3hqDk4e1tq9oiW64dXDrTOVdoAGQn7VZ8RGY9rgpR7t2htGVC 5HSpwOq7L82xOAVB4YsorXFAGWVMgdVt/PINf4UeLYSWfmUMrlNsaVvbyfRIeaGxLyqI jaCbJKRrXJtHml0/rW+4c5rurtosEbsq4dB/4mhiEaz9y4xgr6FUPBEkCRIGiIV0dG51 fv+8ADqr4Ff10mZEA9x4+7TKRjJOvv3SF8mZ/Se+71XFWDOu33G8fbHeSso2IBvb8sMz M9eg== X-Gm-Message-State: AOAM532irKF1WulZ4o27mYJCt2cTPH+6KRRkmICtf/Ymczt00Nsu7aAB NoLLkx+63BDiI5pykNXlvrPM3Q== X-Received: by 2002:a17:906:4e93:: with SMTP id v19mr14016866eju.215.1618415374750; Wed, 14 Apr 2021 08:49:34 -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 q12sm10495540ejy.91.2021.04.14.08.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Apr 2021 08:49:34 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: robh@kernel.org, devicetree@vger.kernel.org, perex@perex.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, Srinivas Kandagatla Subject: [PATCH v4 9/9] ASoC: codecs: wcd938x: add audio routing Date: Wed, 14 Apr 2021 16:48:45 +0100 Message-Id: <20210414154845.21964-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210414154845.21964-1-srinivas.kandagatla@linaro.org> References: <20210414154845.21964-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 | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) -- 2.21.0 diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index 05e1b0fc4f5f..e0be916bad65 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -3132,6 +3132,98 @@ static const struct snd_soc_dapm_widget wcd938x_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("AUX"), SND_SOC_DAPM_OUTPUT("HPHL"), SND_SOC_DAPM_OUTPUT("HPHR"), + +}; + +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"}, + + {"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 int wcd938x_get_micb_vout_ctl_val(u32 micb_mv) @@ -3299,6 +3391,8 @@ static const struct snd_soc_component_driver soc_codec_dev_wcd938x = { .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)