Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3237831pxj; Mon, 24 May 2021 01:51:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNOFWDmak84P3XCxWW3sg3E6+eaZJDNv0n73PsGQRE2JXNSfyphNfQY1CAjaJU6LjC7bUi X-Received: by 2002:a50:fc91:: with SMTP id f17mr23787010edq.201.1621846309083; Mon, 24 May 2021 01:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621846309; cv=none; d=google.com; s=arc-20160816; b=MDySbqbGpfSMKm55nXWUWMsFjvwgtbioNPse4hdKnco1ICjKNk5nLZbzKBYrOeJFAQ Fp/N0GgU37sSScLt8wFkq9URua657wV5G7Mwor0MtfwsiCNwBiJSb51PRnkRh2WuQswD 1Vm4hs4WA4HtUXea+pMyCQhDlX7Dh/iqeCwOz7BQy29TywEIAVddvwtBs5U4BCbOVpfN BFcMf6AJ4PyoQ2VyhoREw4mB91gXH6+M9Pfqu1yKrDYm1TzjpG6yheHtvgqZ+uy9nc59 hndCQr/tApIIehwZVow4Pu17rahvuM26aOuH2aEi2hpWCwiLClPLmmPija1n8NZkRK7W j2OQ== 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=qctUSYHr5HUHKNeM+US54ACn680xy5JVgv6pYiAbRJA=; b=zXNQn8VGND6tAMSmCdp6DNq9vC4vVkY1BKxf7pSzCqMXXe882Glu6lTjvtK5mRH6VI Txe3LG3k/Ha+9vFpshaDitE+6Ix+GHP3U261R2sE8DeMcOWuhrUalBCyBRzCNz9rxU23 gx5EYr8gfituSAKfYCTlvZEmRbWz9Au1SKaaO6pkmSrQZlJTGOingsyEWz+LMwHIAApP tTUHLEK1+S+vUa+u8C0SLHJAJKbAh7cr+Futvni7GnVF23k2BE+npbNsJorG4A/dFBoh 0xo7Vi9ewEhLWEulf/HPnWCljgYKaoYv7XOgVBcFgryMGevNGmyEK2R2cSi7SqeeV0mO TmQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rff3oXBQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 x2si12628637ejs.198.2021.05.24.01.51.26; Mon, 24 May 2021 01:51:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=rff3oXBQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S232476AbhEXIup (ORCPT + 99 others); Mon, 24 May 2021 04:50:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232634AbhEXIu0 (ORCPT ); Mon, 24 May 2021 04:50:26 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48D2EC06138F for ; Mon, 24 May 2021 01:48:53 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id q5so27648847wrs.4 for ; Mon, 24 May 2021 01:48:53 -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=qctUSYHr5HUHKNeM+US54ACn680xy5JVgv6pYiAbRJA=; b=rff3oXBQN1KWOufY2wiB5c6bIHYakPPlTw5ELevddWVaHSHZToKwBLoyZjda6vIV/V zSz4okq1a5U1vmzByBndO4L5mtS8xTI0+aPSOc6+nzFpq/Ir8tSSAwJnk22QKW7oZrvn p6eaJVsFRT+d2fE9cY69UwP788q9M0QfKgJqtN+ruXPsj5lEEFsPK5d5LLDpgMhbshBC dGQz+nKmPR5ai02yt2YhO4my5vxuVfym7GeLCD0sWN9sQzHjyWLTXcWDTHPcIQojoWV3 geXmO8rU+LXKstvtqzn7XlwITOq4B2pMsTpMtLpnolgNlP91gTOHEzOMSDtd3rB9jkgP PjNA== 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=qctUSYHr5HUHKNeM+US54ACn680xy5JVgv6pYiAbRJA=; b=tVFmISDnFqaW0WITm1a/XIZCYtvF1MCY70IqKRevq/jsaks8QQEFPGXCoddR8BPX96 aMdLtvndx8xBfgFPWWU1XO3a2xxhdw5tC8ey7qVxAtLkpd6HCfEehWQCW5Ty6sGo5824 fLsDNXA8esZNojuKKEuru3qJPiWFNW+cLP7Fm1EZX7eubPbG73FQVo/70FLmPUc9Zl9S Y/T9tWRhhNPLhLEUVqiIYYAygiHYCvrlNlGxJFEfoY9wDta0pI5EsNxhxKv6iVgYZiVt r5um3lo5qBHX3UkMiIKi6murOaMH2M3k/+WkGj9BroFsnkbxFyOGg5ou5IQ++lALqakH S4lg== X-Gm-Message-State: AOAM5304IvTNXoG1YtyyA5QLNu8GJeH8BekSlIT2wNY17JmYOwJbnGSp RtW0fNrbCFGT2x2E+n0Bijfqyg== X-Received: by 2002:a5d:4744:: with SMTP id o4mr20229008wrs.86.1621846131907; Mon, 24 May 2021 01:48:51 -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 x206sm4034548wmx.47.2021.05.24.01.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 01:48:51 -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 v7 9/9] ASoC: codecs: wcd938x: add audio routing Date: Mon, 24 May 2021 09:48:28 +0100 Message-Id: <20210524084828.12787-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210524084828.12787-1-srinivas.kandagatla@linaro.org> References: <20210524084828.12787-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index dfd14b223bff..c16ec8c1620d 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -3133,6 +3133,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) @@ -3300,6 +3392,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) -- 2.21.0