From patchwork Thu Mar 11 17:34:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 397585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47038C433E0 for ; Thu, 11 Mar 2021 17:38:34 +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 54AB364F98 for ; Thu, 11 Mar 2021 17:38:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54AB364F98 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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 A447F1750; Thu, 11 Mar 2021 18:37:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A447F1750 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1615484311; bh=VYIpdhYpYajrmVCil7e2+8CLe6GdwLY7S6aNkx5Xv4Q=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GhqaO+P02xlj3hjstgsigRDdHEMQcFPHIa7zY9VyRfJnKlcTL/vGGIG6M3JdJ9cN5 vQwGtaCPd5NF0dUN3a7lRKMawYIJpQqCb68vNjWX4DE94ePqmCxj33qTraH7B93f9P VkX2OQ0+TLKktdHuxnRtO0pF0ejj2q/JR6Cqr62w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 58FDFF804B1; Thu, 11 Mar 2021 18:35:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E21CEF804AE; Thu, 11 Mar 2021 18:35:24 +0100 (CET) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 5815EF8032C for ; Thu, 11 Mar 2021 18:35:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5815EF8032C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UdIUHFtc" Received: by mail-wr1-x436.google.com with SMTP id w11so2952459wrr.10 for ; Thu, 11 Mar 2021 09:35:08 -0800 (PST) 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=dmwld0IDC1/VOWzieR6BKsgTEmEgxYcesuBOqNZddyg=; b=UdIUHFtcpCc8g1KL7Z7LVur9YLn073u5jgtMXXB6zpFFL9aOv5EM+jVshrgGu2xT+C tdfFNj1p2uTY59JKdulxGQaWLpNEhicKK0G+3WiiYSu9dh1jE0oCWLLOw8m7VI7i/4Qc TT64GyNQKLA33VpNTtK2fjxmf3RVfeEKGzEZexjEk4r6abiEDdrEtJBx0P78a7XquLwj 066C8hBpU66wjLGS+WN6+1BFmEbBDcAaMcI9JTBZgCUxQpotT7PuCAHFOts3pOTT/eMB VJaq7h75Peo2XTXO/wWMaTuKf9ZfqJEDCTFdeuwUGM9VKmFPxXiCrwgVCLWFkl4N0+SY fq6g== 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=dmwld0IDC1/VOWzieR6BKsgTEmEgxYcesuBOqNZddyg=; b=Yyzf1c5alm/F2Oyv7qm+f5Vh3Yl6DtD0dsoYHPvfJ+mSDcBg7dqJoAayZ3lf/3waGC xlq8Kiz0a302s16xEINdCZpKt19SxZBvQ+vkdA9v05e/A9kM5VFpTmOeYEHgcIvLjuzA ku7v8F74/SM+fj+Nh9b6E/6n56en50IZUMGi8Ru1BI6bWx/FN1q6I0n1XIE32zZux2Ya lsIHdLpq7b/H12250Y98LuOLfe7++sqM3o4W4FsM33SFVhioUsVAUAkzQX012tucY9mg WHH2b4iYK5GcUZmNW8P7T2Dhka+J8ym5cwWGitaAkt37+/4k8NkmyLHQ88c0dy9bxxcT 95vg== X-Gm-Message-State: AOAM5300BIHTYIeYn0PpB9bJ8bb9GhrgWnFYn7M8VaaTa43dIAJknfhG OCvj9HHuf2XeyMfv3xu5cDD1yA== X-Google-Smtp-Source: ABdhPJxi1uHaxJEyBsCkfwTg5oVkY2ifXAmE0uv9xyqTI5zaTrMd+17FOR1P59M+tHYgxjf7ZYycbw== X-Received: by 2002:adf:9bca:: with SMTP id e10mr9951025wrc.364.1615484108639; Thu, 11 Mar 2021 09:35:08 -0800 (PST) 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 36sm5221152wrh.94.2021.03.11.09.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 09:35:07 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Subject: [PATCH 7/7] ASoC: codecs: wcd938x: add audio routing Date: Thu, 11 Mar 2021 17:34:16 +0000 Message-Id: <20210311173416.25219-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210311173416.25219-1-srinivas.kandagatla@linaro.org> References: <20210311173416.25219-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Cc: lgirdwood@gmail.com, alsa-devel@alsa-project.org, Srinivas Kandagatla , 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" 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(+) diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index d8aad187458f..f189d98e2f04 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -3217,6 +3217,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 */ @@ -3393,6 +3486,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 = { @@ -3402,6 +3497,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)