From patchwork Wed Jun 9 09:09:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 456804 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp5039474jae; Wed, 9 Jun 2021 02:10:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqJCS77jGG6EojVEVmwpC+/75yrIvZg1fvc+yBfOXSWt1U/5/D87LN0DeRh/uQ8MD0U0uk X-Received: by 2002:a50:ce0b:: with SMTP id y11mr5220573edi.356.1623229844833; Wed, 09 Jun 2021 02:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623229844; cv=none; d=google.com; s=arc-20160816; b=OyeYL7wuy9n26ZAOwhxM4lE61d4xCuUHwdWWyaeUH9fbcy7tFkaPipxh9LySEU+fL5 SXLkoenWvnP3RoW045KJg/go3Yr/H6sCoQjNpuB4UTzDdACnb38DThTOAwbX92ZOf+nY KMgcifT72IAZkmRlboeTIgQ296paHFyt058G5/9/dGAO3ZAW8O8SctKdaPH/10VuuTKZ aIGLeDWlGR1E8zAeG2DF1qzP4iqHi8RPgBrIdv0v836OJL07yhlocJ9LPqy1xpOObdzQ rQAeBn0s149FjQ/eRs9jSEQoRz2O9apfOGNAJPUaJqfbEq9otpF9cG84RTcCjqi8drmT kLcQ== 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=y93hdNcnw0E4Yi2H2c7HfE/xyf7sdHZA6dsM2AZsEKw=; b=JZ10/6odDFMdXdiVw4M4QyqCsI36xEesWmugGEId2URAIXP8gqGarHrSkV73SyE3wv DDeoqCJMDDPUAA0GOga9CrRKxGH8d7WpqZFDiOxQQ4eX52LwQajCf4Ybviwp2fNj2HEK n/1UJX8W2GowSv8CWKiLAg58JhKtBsnPi2SSDffDZqHPX+eVygM91Odj3+06t2hfHrlb bX7IGm0WtHhCO51Ygg8Jqk40hciK6yln8cCOBgT6A4YE4qhwtEOSlAxRcO83rV6cO6yV LXuMMuK1VIeu+j4Dcgp2lTCqSWqxc1HOO3A/WFtsM11EgLlBIcZJDy1EaLZIOHqFOhf6 tIeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dMdC2CZm; 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 j11si2036670ejj.121.2021.06.09.02.10.44; Wed, 09 Jun 2021 02:10:44 -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=dMdC2CZm; 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 S237860AbhFIJMG (ORCPT + 7 others); Wed, 9 Jun 2021 05:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237835AbhFIJMF (ORCPT ); Wed, 9 Jun 2021 05:12:05 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1060C06178B for ; Wed, 9 Jun 2021 02:10:10 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id a20so24679433wrc.0 for ; Wed, 09 Jun 2021 02:10:10 -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=y93hdNcnw0E4Yi2H2c7HfE/xyf7sdHZA6dsM2AZsEKw=; b=dMdC2CZm7BdZL0ecS3dbEBgCCHN9pkSmAE7z6yIMgVvBrYhgNYTspj2mBT4lgdaRtI ffMOS3idvBzrNdaqbEdAO9QCJd8KGn519S4mpP1eK54HmiCs03IZ3jvnULbSNNZwzTUL bJsVRUc4eIxDOggPiC6WOPT/pjj0loSNfg/laBGq0ZwdpVa/LR4HJf2V0aSpWy/lhV9G WUSXm+VDGdCXOnnsSM3m1Y4PZ/Ss3Nc8Bk7Dwh2zngnHJcSBLPX2VlaKh3/O5GpUdtF1 hKuFo36qXKRxAVlfspJh+ejvtrhmFZuY5Lt/O+CAp3uOolYkA0PNr94BJfq9d6WHkW3f hlxg== 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=y93hdNcnw0E4Yi2H2c7HfE/xyf7sdHZA6dsM2AZsEKw=; b=tzkRQC/B2yrPpdq1sUAbOLFXAo3LtHs6RDw5c38jSpOzmJzEqBwBN4fnXDFtiun0EO FRUkbg6D8tFyolK+fZVImyhOSfUo+ooDOHnChXebPRaBZf0K0RcQigYOBu0d9AFEVZl7 64PrIrVwi6REoQR0jgwJlQJPgV6Ia1MEGVhsT76f7XXjUpiOxAjeiRDUOiEruK/UZbOT oQOreyPCYdZ3jZd5l0RijPhUj17x/0K2Z8ksK6b9y3x8NynFDDdD5JFlpCGc1O2zbdPp k2YRqYAAGDtG20pNiLoxa1EBhn6x5f2uhljuwoCXKf57uWAmZ/qdxQAGmgDBb4bEOfO1 NucQ== X-Gm-Message-State: AOAM533DTclKxJXoTFgpY8hAz4ftt9O0q4jWBuZLU3O2SuO9mlF9/J5M zQiawJbL/Qn20Fx99aNqWHYwOA== X-Received: by 2002:a5d:47c3:: with SMTP id o3mr18844933wrc.122.1623229809440; Wed, 09 Jun 2021 02:10:09 -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 v18sm25165385wrb.10.2021.06.09.02.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 02:10:09 -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 v9 9/9] ASoC: codecs: wcd938x: add audio routing and Kconfig Date: Wed, 9 Jun 2021 10:09:43 +0100 Message-Id: <20210609090943.7896-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210609090943.7896-1-srinivas.kandagatla@linaro.org> References: <20210609090943.7896-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 and Makefile and Kconfigs changes for wcd938x Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/Kconfig | 14 ++++++ sound/soc/codecs/Makefile | 4 ++ sound/soc/codecs/wcd938x.c | 94 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) -- 2.21.0 diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index bd8583f5ebae..2d80836ef220 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -234,6 +234,8 @@ config SND_SOC_ALL_CODECS imply SND_SOC_UDA1380 imply SND_SOC_WCD9335 imply SND_SOC_WCD934X + imply SND_SOC_WCD937X + imply SND_SOC_WCD938X imply SND_SOC_LPASS_RX_MACRO imply SND_SOC_LPASS_TX_MACRO imply SND_SOC_WL1273 @@ -1554,6 +1556,18 @@ config SND_SOC_WCD934X The WCD9340/9341 is a audio codec IC Integrated in Qualcomm SoCs like SDM845. +config SND_SOC_WCD938X + tristate + +config SND_SOC_WCD938X_SDW + tristate "WCD9380/WCD9385 Codec - SDW" + select SND_SOC_WCD938X + depends on SOUNDWIRE + select REGMAP_SOUNDWIRE + help + The WCD9380/9385 is a audio codec IC Integrated in + Qualcomm SoCs like SM8250. + config SND_SOC_WL1273 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 9d17a374a825..de8b83dd2c76 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -255,6 +255,8 @@ snd-soc-uda1380-objs := uda1380.o snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o snd-soc-wcd9335-objs := wcd-clsh-v2.o wcd9335.o snd-soc-wcd934x-objs := wcd-clsh-v2.o wcd934x.o +snd-soc-wcd938x-objs := wcd938x.o wcd-clsh-v2.o +snd-soc-wcd938x-sdw-objs := wcd938x-sdw.o snd-soc-wl1273-objs := wl1273.o snd-soc-wm-adsp-objs := wm_adsp.o snd-soc-wm0010-objs := wm0010.o @@ -580,6 +582,8 @@ obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o obj-$(CONFIG_SND_SOC_WCD_MBHC) += snd-soc-wcd-mbhc.o obj-$(CONFIG_SND_SOC_WCD9335) += snd-soc-wcd9335.o obj-$(CONFIG_SND_SOC_WCD934X) += snd-soc-wcd934x.o +obj-$(CONFIG_SND_SOC_WCD938X) += snd-soc-wcd938x.o +obj-$(CONFIG_SND_SOC_WCD938X_SDW) += snd-soc-wcd938x-sdw.o obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o obj-$(CONFIG_SND_SOC_WM0010) += snd-soc-wm0010.o obj-$(CONFIG_SND_SOC_WM1250_EV1) += snd-soc-wm1250-ev1.o diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index 2cf6145b7219..a2c76dc8fd89 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)