From patchwork Wed Jul 31 15:25:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89425C3DA64 for ; Thu, 1 Aug 2024 12:13:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C83D03F83; Thu, 1 Aug 2024 14:12:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C83D03F83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514386; bh=lyyOSz5mnVlYsXDZyPPBuvrk6tGYt4/xz9ZU1RO5S4A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VCqWXs1O3eFi4j4djl5dRvk5VLrU7Aw1bn+lNcI+ujHT8Ygj/jLgtUh4wwX0im7y0 HFuspdBeYoFYDnscKyeJ+0s42YEWUiHfpYoZnczb/C4Aqs+OBoiJkkfKar9M6xuIUM Os/mNgEXREYx+aZr5CvA7YAFxswFUnPXL5sgeZSQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3C563F8062E; Thu, 1 Aug 2024 14:11:37 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9F82AF80622; Thu, 1 Aug 2024 14:11:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C148FF802DB; Wed, 31 Jul 2024 17:31:00 +0200 (CEST) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2DC63F80269 for ; Wed, 31 Jul 2024 17:26:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2DC63F80269 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=fhAa+WYK Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-428243f928fso22700875e9.0 for ; Wed, 31 Jul 2024 08:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439564; x=1723044364; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FC0xYn/ikx2v85GL/8Br0D4pnaNCpqHqIy3/h9Umxsk=; b=fhAa+WYKa0cO1gGarWcWJ+yrLhaSpwk+dm6C6X6ZfFg8F/d8d+xuWyjZzMwbeJpN+a DuFa5LEjTyuCbCaaY+dH9dwPq0XhvKxh3OGP0A2jyRUM0hl1JKgQCR4wjbV+UjDvMaNp C+kt6Rm1LJPxzj2YG35PS+EiO1vax6vb8Ye3sCsA9ZExV84lB3lTdIwVc0Uv5qO0UY0v Bvhwz3jFj0YBZSTlrhw1Y+hEZGutqgIHwPSIffSBYE+BBAUBdaBLA5KIXLnRkqFb6caz sgfUghxkFXYTUe+irYrf4GZax+mdSgGs98Vbc+vH0w9UiN0mzC2mh1sSA6vGatiSGbWY TwYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439564; x=1723044364; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FC0xYn/ikx2v85GL/8Br0D4pnaNCpqHqIy3/h9Umxsk=; b=C0p4qRWItcyqLiyMKMjZemmeJfm3KFHeIuEASo1lHSl44TP49jgpaEA+jLoAXFZ7v+ FWrtjwK/mOLxMCn67PzVZIwW9maWxb9K6FHQ8IWhWsilzmqFPzj+VCrsEOHUH/eLTvuA V1Gf8kIw2n8feMMfmpGtSwfQWmVctBUHiwRW5Crxkau8bqJOlr0i59JUdHDY0gPYUvls imhcWd37ayYCiruWuneiihJhXQgoCximJZXJ9pBjSCbZ0UB6QXR4W2oUQmnRLe5xvDpf F8qq/WswioAsvX4YYir2h58AvNjlvJKcHhYFtlCOQVkWi0/veIvEaIRyy1eB9Pe7dWyk xkNA== X-Gm-Message-State: AOJu0YzwwmcQ52n6lw8KoKw+o/VxJAOpCSrzo0GngDhYSgadBrsbXgj6 0ITLgXa6onzjRjmIEF+t1MPOYR20viLSekmilCOeb/pMoNOkHTm5 X-Google-Smtp-Source: AGHT+IGV5Tyg8OIw9jbYm8EISXLPoSoS24RYZm1S5mUY09Ep05QHPxO5cMSJU7Ibzbu5TFy9NWYQ+w== X-Received: by 2002:a05:600c:3590:b0:426:5c81:2538 with SMTP id 5b1f17b1804b1-42828544a87mr33856585e9.14.1722439563745; Wed, 31 Jul 2024 08:26:03 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:03 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:25 +0200 Subject: [PATCH v3 1/8] ASoC: qcom: apq8016_sbc.c: Add Quinary support MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-1-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski , Vladimir Lypak X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: RFTOMY6JAQ537QLQR4L6BMVGCTLVGKNY X-Message-ID-Hash: RFTOMY6JAQ537QLQR4L6BMVGCTLVGKNY X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:31 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Vladimir Lypak Add support for configuring Quinary Mi2S interface it will be used on MSM8953 and MSM8976 platform. Signed-off-by: Vladimir Lypak [Adam: Split from MSM8953 support patch,add msg] Signed-off-by: Adam Skladowski Acked-by: Konrad Dybcio --- sound/soc/qcom/apq8016_sbc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 3023cf180a75..5a29adbd3f82 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -20,12 +20,13 @@ #include "common.h" #include "qdsp6/q6afe.h" -#define MI2S_COUNT (MI2S_QUATERNARY + 1) +#define MI2S_COUNT (MI2S_QUINARY + 1) struct apq8016_sbc_data { struct snd_soc_card card; void __iomem *mic_iomux; void __iomem *spkr_iomux; + void __iomem *quin_iomux; struct snd_soc_jack jack; bool jack_setup; int mi2s_clk_count[MI2S_COUNT]; @@ -86,6 +87,12 @@ static int apq8016_dai_init(struct snd_soc_pcm_runtime *rtd, int mi2s) SPKR_CTL_TLMM_DATA1_EN | SPKR_CTL_TLMM_WS_OUT_SEL_SEC | SPKR_CTL_TLMM_WS_EN_SEL_SEC, pdata->spkr_iomux); break; + case MI2S_QUINARY: + /* Configure Quinary MI2S */ + if (!pdata->quin_iomux) + return -ENOENT; + writel(readl(pdata->quin_iomux) | 0x01, pdata->quin_iomux); + break; case MI2S_TERTIARY: writel(readl(pdata->mic_iomux) | MIC_CTRL_TER_WS_SLAVE_SEL | MIC_CTRL_TLMM_SCLK_EN, @@ -177,6 +184,9 @@ static int qdsp6_dai_get_lpass_id(struct snd_soc_dai *cpu_dai) case QUATERNARY_MI2S_RX: case QUATERNARY_MI2S_TX: return MI2S_QUATERNARY; + case QUINARY_MI2S_RX: + case QUINARY_MI2S_TX: + return MI2S_QUINARY; default: return -EINVAL; } @@ -290,6 +300,7 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct snd_soc_card *card; struct apq8016_sbc_data *data; + struct resource *res; int ret; add_ops = device_get_match_data(&pdev->dev); @@ -320,6 +331,10 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev) if (IS_ERR(data->spkr_iomux)) return PTR_ERR(data->spkr_iomux); + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "quin-iomux"); + if (res != NULL) + data->quin_iomux = devm_ioremap_resource(&pdev->dev, res); + snd_soc_card_set_drvdata(card, data); add_ops(card); From patchwork Wed Jul 31 15:25:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816288 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57407C3DA4A for ; Thu, 1 Aug 2024 12:12:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8D1F53E8B; Thu, 1 Aug 2024 14:11:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8D1F53E8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514322; bh=EVyv4o1kWKU9C0RpwE8ZBKEBCpkeLQtTeetB5bkp+NI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Px5xgTngO7qsnLx6Q+qHU0N8rSN9Kd3LvmsNkuKfHFLRNPnRecnDNG4v32/su5l6h 4DP2EYCKGPK269Ub44qVJeIzcDzDMhILGwNhfWWkOvUh/ItBwW3td+RhwEw0kXLGiF 2mBGaJQdS9FgGoKUeMydXp5V30sT4kMs89MEpOUo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8A826F805B6; Thu, 1 Aug 2024 14:11:31 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DB772F805B6; Thu, 1 Aug 2024 14:11:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D882F8059F; Wed, 31 Jul 2024 17:26:43 +0200 (CEST) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9D868F8026A for ; Wed, 31 Jul 2024 17:26:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9D868F8026A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CPJmrd3c Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4281abc65daso31402365e9.2 for ; Wed, 31 Jul 2024 08:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439566; x=1723044366; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=X/h0VtcfMml9IUjMbcpLtg90CxFRBSo+axnBjZNg8dc=; b=CPJmrd3cI3jaf8E/M6WiZMAmeYFCnS62pwyItEUKp1ontPQV9S6yPqA3xyHJU38oxX id6Lj3lElcrhY3RRCrvJ9yEdqdP8brTSZkwOnQOH0ZuCipexAJ0fIUpDcJbbg0ElHs+d Z7S73o8DTxMhRbseBc1iIIFI+q1Xm6AHEE+V3QERm9CqgknONs12CNuGgnbfbxIM9ck+ mPyXWZj9Ema1KHSoRm+YUr4Fzb5ywGyKUnAvbb/EAWi/AwRvmhrDndk4JVRvSRWUPKAO 1Avr4JiQJPK3feMUdaAmBP4RmjRwvQW8dLyohFCy+olODWi6hDxTIM5AlDQReFk1/QuB GZfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439566; x=1723044366; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X/h0VtcfMml9IUjMbcpLtg90CxFRBSo+axnBjZNg8dc=; b=odKkgSa+j+1y2GZCGEvr6jFBxTir2a1tw3PUZTGBrXWoY4rAa82/mu6PKCcH6t+a6b l+GulDhtyHb0WjlYdYDoP/R1BkaPOnAFDOS0gpsz2gJ/qJsBlR6Lc+bs3Y4ivz5+K0XJ j/747ucjJSz+chrTHCpS5m7OI23HVLxmuqJqFqkroeERmY29HASNTqR9Fnm/HxDTMPNu X5XHm/Jl/8aRuTUbSOey+sXJXuLtJ7H1OjhtweHTcetcwddZ2Y6CE+lJhpzoAPB7jbLX yT0/+IEZw02zxlWVB9wieKJS0ha3HHa88frDNwNJg84b6Xh1g0IYZInYwSkKM7Kp3X4e MudA== X-Gm-Message-State: AOJu0YxXV86qmaJ8HudiGUlUXDY0WU9F7IDmu47bkWnpqZY9q6BI9z2R v1cNpsRVSh3kA5aJufCOmr2GpeHivQAlezUyv7EEyUgMjhp2uv0f X-Google-Smtp-Source: AGHT+IFaIxFIYcq+H0ksfzt6nQVNfYnsBfjPxrNT5e1tHpK2RZqBXDqp7VIHxXKG3HBqlL+UiNXlFQ== X-Received: by 2002:a05:600c:996:b0:426:59ad:bbb3 with SMTP id 5b1f17b1804b1-42811dfc5f7mr123868005e9.32.1722439565757; Wed, 31 Jul 2024 08:26:05 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:05 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:26 +0200 Subject: [PATCH v3 2/8] ASoC: dt-bindings: pm8916-wcd-analog-codec: Document pm8950/pm8953 MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-2-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: 36L6THG4JGUTAAU5HPKPTSXVYKFAMHHP X-Message-ID-Hash: 36L6THG4JGUTAAU5HPKPTSXVYKFAMHHP X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:29 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Document pm8950 and pm8953 analog audio codecs. Signed-off-by: Adam Skladowski --- .../devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml b/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml index 94e7a1860977..8af8bb747abe 100644 --- a/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,pm8916-wcd-analog-codec.yaml @@ -14,8 +14,10 @@ description: properties: compatible: - const: qcom,pm8916-wcd-analog-codec - + enum: + - qcom,pm8916-wcd-analog-codec + - qcom,pm8950-wcd-analog-codec + - qcom,pm8953-wcd-analog-codec reg: maxItems: 1 From patchwork Wed Jul 31 15:25:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2355C3DA64 for ; Thu, 1 Aug 2024 12:12:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4680C3EDE; Thu, 1 Aug 2024 14:12:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4680C3EDE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514343; bh=b/S9uy+bIF3wHOM/WZrlrCVkMM4isQGv528aMZ3QO/A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lkESEq4pI1wvfCEwLUHTPQ5toafMLLEU3fWqoLCfPVmDQQ0VGnAjER46/PI89XO+W LsqPUvge8h6jJdWYoSvkTIRgASidanKUSfG5HnzSW6kOUqRS2EH+oFmDHDWm5IpPpM T6ixEI5MC/KsxX0DbYciIUPk1eXWtANCBwTPMo8Q= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4A8EDF805E0; Thu, 1 Aug 2024 14:11:32 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 17CF4F805E2; Thu, 1 Aug 2024 14:11:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5AAA8F8058C; Wed, 31 Jul 2024 17:26:58 +0200 (CEST) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A414DF802DB for ; Wed, 31 Jul 2024 17:26:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A414DF802DB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=l8CbVqu3 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4280b3a7efaso38996975e9.0 for ; Wed, 31 Jul 2024 08:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439568; x=1723044368; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sURZDxH5XdiCOHMBbcEMdZ8vmUSUFBsPH3V2odo9HSw=; b=l8CbVqu39V3V93LiqQy9XnA5SXzIzp+EGVTEs5P+cpAxfkbOVC3oRTP9FJC3SgZnZE 5U7xSL1j07d7BhOmRr1lsuuI40RqGpBOU+Wja48Hi9sm9NkU4BHMY9ctjPfzjUQR6/r9 sGLsbwdWKULeknDO0ykhYRTUVl2/iKs+f357HKTgFTosM3K7NQCBwEGUZeEt+byrIDf/ PO4Bh6uRPtBqR8L8fFdrotr+lzQ0bTOKRipuyn/x28vuKWS9g3Dk8DNudJJXHs59pQ2v EjyjdbcML/cnBJlGl+EBD6/zsf+z0zLjXxmKBursofK9j4mC/9m1xMa6WeAHZGlX04f6 0mSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439568; x=1723044368; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sURZDxH5XdiCOHMBbcEMdZ8vmUSUFBsPH3V2odo9HSw=; b=igDEk5fOXOF0P4dTcdWKFO2rWvBw6mPAehVkphTq6e9L6byGbl/2F80uT5OcR7yo98 7o4DpolLbWAi1cEMR+7FIYlhadz/Wcu21m9eOdVvTsf/gy761UA9pLC+TGg198r/gRkw toR8gWyT7JDDwT4Mkd8DRO2IZ1Pr8HaolPHS/Z5n6cSxaBPiTuz/YEiM2LxlxkMJUsey 8tbwoYXNSn0M2JgrtpG5WtdaaNX2yMY+GVtJjx7byhmngCBbdV0adrXjm0GThYnnko65 adeWn2tN+FD2yEql87KeVCZ0VN5juNiY8tcEDMCfDDouSL8bu8RUMCcPEx6V9BPmKxUD cl5g== X-Gm-Message-State: AOJu0YygXEtqf3F0xfnj5HypWBq+/hscv5NyUeg0yD/JKpL1aQqwHmJ1 EBOCyl05rOfuLriitGfwKvSDYDiLXE++gT0AA2QKyr6+hZQWBxrM X-Google-Smtp-Source: AGHT+IG1H5Bp8jT30iBFVbiEisWLixnQb+cAxq4bxDj2j3vvk6Vqxm5kMpTGRf+D6NJonYzOXpNGuw== X-Received: by 2002:a05:600c:190b:b0:428:1846:4f0 with SMTP id 5b1f17b1804b1-428184606e9mr83560415e9.16.1722439567835; Wed, 31 Jul 2024 08:26:07 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:07 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:27 +0200 Subject: [PATCH v3 3/8] ASoC: msm8916-wcd-analog: add pm8950 codec MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-3-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: EBIPLUKZIZ7REJXXJ4HIS3WAZ2UFXGOY X-Message-ID-Hash: EBIPLUKZIZ7REJXXJ4HIS3WAZ2UFXGOY X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:30 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add regs overrides for PM8950 codec and implement matching reg overrides via compatible. Signed-off-by: Adam Skladowski Reviewed-by: Dmitry Baryshkov --- sound/soc/codecs/msm8916-wcd-analog.c | 52 ++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index 9ca381812975..13df60409857 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -232,6 +232,8 @@ #define RX_EAR_CTL_PA_SEL_MASK BIT(7) #define RX_EAR_CTL_PA_SEL BIT(7) +#define CDC_A_RX_EAR_STATUS (0xf1A1) + #define CDC_A_SPKR_DAC_CTL (0xf1B0) #define SPKR_DAC_CTL_DAC_RESET_MASK BIT(4) #define SPKR_DAC_CTL_DAC_RESET_NORMAL 0 @@ -250,6 +252,7 @@ SPKR_DRV_CAL_EN | SPKR_DRV_SETTLE_EN | \ SPKR_DRV_FW_EN | SPKR_DRV_BOOST_SET | \ SPKR_DRV_CMFB_SET | SPKR_DRV_GAIN_SET) +#define CDC_A_SPKR_ANA_BIAS_SET (0xf1B3) #define CDC_A_SPKR_OCP_CTL (0xf1B4) #define CDC_A_SPKR_PWRSTG_CTL (0xf1B5) #define SPKR_PWRSTG_CTL_DAC_EN_MASK BIT(0) @@ -264,6 +267,7 @@ #define CDC_A_SPKR_DRV_DBG (0xf1B7) #define CDC_A_CURRENT_LIMIT (0xf1C0) +#define CDC_A_BYPASS_MODE (0xf1C2) #define CDC_A_BOOST_EN_CTL (0xf1C3) #define CDC_A_SLOPE_COMP_IP_ZERO (0xf1C4) #define CDC_A_SEC_ACCESS (0xf1D0) @@ -286,6 +290,11 @@ static const char * const supply_names[] = { #define MBHC_MAX_BUTTONS (5) +struct wcd_reg_seq { + const struct reg_default *seq; + int seq_size; +}; + struct pm8916_wcd_analog_priv { u16 pmic_rev; u16 codec_version; @@ -715,9 +724,41 @@ static const struct reg_default wcd_reg_defaults_2_0[] = { {CDC_A_MASTER_BIAS_CTL, 0x30}, }; +static const struct wcd_reg_seq pm8916_data = { + .seq = wcd_reg_defaults_2_0, + .seq_size = ARRAY_SIZE(wcd_reg_defaults_2_0), +}; + +static const struct reg_default wcd_reg_defaults_pm8950[] = { + {CDC_A_RX_COM_OCP_CTL, 0xd1}, + {CDC_A_RX_COM_OCP_COUNT, 0xff}, + {CDC_D_SEC_ACCESS, 0xa5}, + {CDC_D_PERPH_RESET_CTL3, 0x0f}, + {CDC_A_TX_1_2_OPAMP_BIAS, 0x4c}, + {CDC_A_NCP_FBCTRL, 0xa8}, + {CDC_A_NCP_VCTRL, 0xa4}, + {CDC_A_SPKR_DRV_CTL, 0x69}, + {CDC_A_SPKR_DRV_DBG, 0x01}, + {CDC_A_SEC_ACCESS, 0xa5}, + {CDC_A_PERPH_RESET_CTL3, 0x0f}, + {CDC_A_CURRENT_LIMIT, 0x82}, + {CDC_A_SPKR_ANA_BIAS_SET, 0x41}, + {CDC_A_SPKR_DAC_CTL, 0x03}, + {CDC_A_SPKR_OCP_CTL, 0xe1}, + {CDC_A_RX_HPH_BIAS_PA, 0xfa}, + {CDC_A_MASTER_BIAS_CTL, 0x30}, + {CDC_A_MICB_1_INT_RBIAS, 0x00}, +}; + +static const struct wcd_reg_seq pm8950_data = { + .seq = wcd_reg_defaults_pm8950, + .seq_size = ARRAY_SIZE(wcd_reg_defaults_pm8950), +}; + static int pm8916_wcd_analog_probe(struct snd_soc_component *component) { struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(component->dev); + const struct wcd_reg_seq *wcd_reg_init_data; int err, reg; err = regulator_bulk_enable(ARRAY_SIZE(priv->supplies), priv->supplies); @@ -738,9 +779,11 @@ static int pm8916_wcd_analog_probe(struct snd_soc_component *component) snd_soc_component_write(component, CDC_D_PERPH_RESET_CTL4, 0x01); snd_soc_component_write(component, CDC_A_PERPH_RESET_CTL4, 0x01); - for (reg = 0; reg < ARRAY_SIZE(wcd_reg_defaults_2_0); reg++) - snd_soc_component_write(component, wcd_reg_defaults_2_0[reg].reg, - wcd_reg_defaults_2_0[reg].def); + wcd_reg_init_data = of_device_get_match_data(component->dev); + + for (reg = 0; reg < wcd_reg_init_data->seq_size; reg++) + snd_soc_component_write(component, wcd_reg_init_data->seq[reg].reg, + wcd_reg_init_data->seq[reg].def); priv->component = component; @@ -1259,7 +1302,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) } static const struct of_device_id pm8916_wcd_analog_spmi_match_table[] = { - { .compatible = "qcom,pm8916-wcd-analog-codec", }, + { .compatible = "qcom,pm8916-wcd-analog-codec", .data = &pm8916_data }, + { .compatible = "qcom,pm8950-wcd-analog-codec", .data = &pm8950_data }, { } }; From patchwork Wed Jul 31 15:25:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B4C5C3DA4A for ; Thu, 1 Aug 2024 12:14:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3C5343FCC; Thu, 1 Aug 2024 14:13:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3C5343FCC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514416; bh=cAiwEYPyhie5YN0PaVJrgMAafcZxhlOZNQ26oDH/bMM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dncQnJz5Ae2YpYUZ2+qwshjvdPfhuts12KVy9OpBXGd94vbb4iZJTb0UVN8I3pmKG mwHIPd64nXfh5DzYX1QRx5dF7yeOVMjx4HIsNnjquxLucr5A/sD7xjJX5I3LNiDZVQ qAHJo9eF513GgSOrXu6aYuHTJXpa0veMK9Mh94ZE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0096CF80579; Thu, 1 Aug 2024 14:11:41 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 17FC8F806A8; Thu, 1 Aug 2024 14:11:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6A6CBF8026A; Wed, 31 Jul 2024 17:31:05 +0200 (CEST) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2DEBEF80448 for ; Wed, 31 Jul 2024 17:26:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2DEBEF80448 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=WALn5UDy Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ef23d04541so71017861fa.2 for ; Wed, 31 Jul 2024 08:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439570; x=1723044370; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HNjd7IUt9Z8kpFWJyPP/P05dyp4sHdu+T/jMNypx4g4=; b=WALn5UDy/TD9OIU7Dnw+5ipElaUnGVirQn3pMqsa+mlqSqwYxRsPq3N7NadE7+BUQS kK8qxsoiIV2xniMmhM8hThHe183Jyun2Zjm66poQP0BPmoggYB95ZBLQEdGah8GWKExC /IM6WML6Qb0srVCPiqNDcnG1t0CqtwxvtS9IXf6tyhlzC3Nbbd0Tx9MSLx159xDMhtaM eUr8r/eVA4KzhEsIt7OKWVDPe6xL/sHjU+V7BucmE93Qqw7SL423o36Kc/Js2Z8XMOya voXEEtdLFvrLG54yIKStkQTmLWpFY98jnbReE8bQl+c7i53MXYcOKGv6KJu6VvH/VbSp LOHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439570; x=1723044370; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HNjd7IUt9Z8kpFWJyPP/P05dyp4sHdu+T/jMNypx4g4=; b=sVl4BkBZaeKkI5v4d3epFF2dy6XNMNX9720uGCd9pjJ4XZw+VBaE770ivrJjlLWnlm tuewONCS8D70NhhGweeE80zjBrTWT9q+v1pfoN5drXamAcnhkrpe27HAsIzb1U1Tu3zl hf0+M63RPnXDBDHeKgSy7LjKiPIc33CrFzTTZTTnjgSjAihtA3XqMFlCJ/ZfwOiMS4BQ w+UYjI+qUzGno/F0UyX5bkdWfL0ZIvfWtlNc4vPPY2STxVj2r4TPR4RiO4ohoPfqgwre rQ1uQz18XJ6AAZUslyNb9rkq51hiYjxb73cW0spBVXUNLcOEC2R8Gs6yRWkZIoRAinRs ZSKA== X-Gm-Message-State: AOJu0YyjuUtEWQ9LoGjc0nPoirzuqWxVhh3xQP04f6QNDmG7MsXseYTq DkGKxTVSb3+q3AN34j19qLx/Wo3ethaCzTk+penumPtVy3/ZOxE7 X-Google-Smtp-Source: AGHT+IFQXiJjYzgQhwbnofWVANeBtgbuGWzLTcGQFaQNCs4mjjL1q369HZTUzjEqcwg8HucG/ozxpQ== X-Received: by 2002:a05:651c:545:b0:2f0:1fd5:2f29 with SMTP id 38308e7fff4ca-2f12edfef11mr114493221fa.19.1722439570019; Wed, 31 Jul 2024 08:26:10 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:09 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:28 +0200 Subject: [PATCH v3 4/8] ASoC: msm8916-wcd-analog: add pm8953 codec MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-4-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski , Vladimir Lypak X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: 4M6CQRO7VKUZNQ5RPYADORQXES5OPYFE X-Message-ID-Hash: 4M6CQRO7VKUZNQ5RPYADORQXES5OPYFE X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:32 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Vladimir Lypak Add regs overrides for PM8953 codec. Signed-off-by: Vladimir Lypak [Adam: rename codec] Signed-off-by: Adam Skladowski --- sound/soc/codecs/msm8916-wcd-analog.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index 13df60409857..b9325290c28d 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -755,6 +755,34 @@ static const struct wcd_reg_seq pm8950_data = { .seq_size = ARRAY_SIZE(wcd_reg_defaults_pm8950), }; +static const struct reg_default wcd_reg_defaults_pm8953[] = { + {CDC_A_RX_COM_OCP_CTL, 0xd1}, + {CDC_A_RX_COM_OCP_COUNT, 0xff}, + {CDC_D_SEC_ACCESS, 0xa5}, + {CDC_D_PERPH_RESET_CTL3, 0x0f}, + {CDC_A_TX_1_2_OPAMP_BIAS, 0x4c}, + {CDC_A_NCP_FBCTRL, 0xa8}, + {CDC_A_NCP_VCTRL, 0xa4}, + {CDC_A_SPKR_DRV_CTL, 0x69}, + {CDC_A_SPKR_DRV_DBG, 0x01}, + {CDC_A_SEC_ACCESS, 0xa5}, + {CDC_A_PERPH_RESET_CTL3, 0x0f}, + {CDC_A_CURRENT_LIMIT, 0xa2}, + {CDC_A_BYPASS_MODE, 0x18}, + {CDC_A_SPKR_ANA_BIAS_SET, 0x41}, + {CDC_A_SPKR_DAC_CTL, 0x03}, + {CDC_A_SPKR_OCP_CTL, 0xe1}, + {CDC_A_RX_HPH_BIAS_PA, 0xfa}, + {CDC_A_RX_EAR_STATUS, 0x10}, + {CDC_A_MASTER_BIAS_CTL, 0x30}, + {CDC_A_MICB_1_INT_RBIAS, 0x00}, +}; + +static const struct wcd_reg_seq pm8953_data = { + .seq = wcd_reg_defaults_pm8953, + .seq_size = ARRAY_SIZE(wcd_reg_defaults_pm8953), +}; + static int pm8916_wcd_analog_probe(struct snd_soc_component *component) { struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(component->dev); @@ -1304,6 +1332,7 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) static const struct of_device_id pm8916_wcd_analog_spmi_match_table[] = { { .compatible = "qcom,pm8916-wcd-analog-codec", .data = &pm8916_data }, { .compatible = "qcom,pm8950-wcd-analog-codec", .data = &pm8950_data }, + { .compatible = "qcom,pm8953-wcd-analog-codec", .data = &pm8953_data }, { } }; From patchwork Wed Jul 31 15:25:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18A9EC3DA64 for ; Thu, 1 Aug 2024 12:13:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 55FA53F9D; Thu, 1 Aug 2024 14:13:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 55FA53F9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514397; bh=ub3FOT3N4vnIxLUsFS2HSpg9K4GlOZ+9OZbF4CeT7Fo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fqoulJLDkbpQpUgvPvujtq+STsyNtTd6mMglEpAAd7ykbi/om/GparOD9jtfjKi3o ST2mvRk5HNtcQN2Z1utuQpvWd8acyn5cMgZC8Dt/9g2vVYbLrfW0h+joDur2bUoYp5 ZdxecWWZCW4/CoZZLv1uBzV/f9NK9rUTJBNheMqo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59875F80680; Thu, 1 Aug 2024 14:11:40 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id BA86FF8067B; Thu, 1 Aug 2024 14:11:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B294FF8026A; Wed, 31 Jul 2024 17:31:04 +0200 (CEST) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A4277F80579 for ; Wed, 31 Jul 2024 17:26:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A4277F80579 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=YcVe95Qq Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-427fc97a88cso39095435e9.0 for ; Wed, 31 Jul 2024 08:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439572; x=1723044372; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+1Cyu5R+oW5fffURVcJfSnNMpwp4wHNtRUsf1XeMFf4=; b=YcVe95Qq82dQu1okPfcIo1sbb/p1pp7PglGFDpJ7pg3oFdlSEpjcvRp3lTa7jnLq6k 11QoLI0SMDcvUbQoIGrUqapR06uAoCBuXwn07a/bnnspu3nnXeDwLbGEEqOvuw7Vpa7Q YutVh9h5oh6bB+JYbWXJ4uAF5MNWP3RTzWOOHj1vHJiDVgtSOJ/kTyfu6A5hvdSfnAEV VDeCHrChJfJO/WNbF8DJhgCoMdniAf6kzL8+Jj94AYk3IQwGbkttyirv4/esvtzp1fLa avmgq04RSCtBK7svxWkomyFFPPnmaWk05P2P6HvaYHj075aZvWdOAnrndEvllFIoHJOR eddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439572; x=1723044372; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+1Cyu5R+oW5fffURVcJfSnNMpwp4wHNtRUsf1XeMFf4=; b=gFVggkC+gid1eKhUa4TmgBT+8kVUcjYo5LuIhMigmfxA5zDrERN28AZ22Amhxx8jpR s9WEJeM7XHHHeJ51tuQy9Gsr1f9ZXFFvpU3VjydyiIw4UZv0jNwdJPVImj3LoStJ9BFS aPibF9kXs73xsNbCdMJq8mIH0/jbFVdv57nLgCXEp3P/PuhpDRKLmlhCTdmtjMwkSyrz x0SMI9DFRL4xUtzI74EzpTiOwrlgCm5hGvtciNcCHkMc9gaxzIo/xSZ/IBxcOQ3+fN5j nZFl4q+AMOcClOva1Gs2SBncyyr0BLhvTcmcj/2rZWvDK5WUugmvXr6dpR1pA167VIKR nI+Q== X-Gm-Message-State: AOJu0YxXnOsHbqu0gPbKl7XNqMazW6AsYGzQ05gu40L9Kd+KEJhX44Nq npBTWNPmjKMwbmtiqFBP9j+QgPDSYdi4y6Xnmzp4HhUnG49aaIba X-Google-Smtp-Source: AGHT+IE4tWC1HMsu8ewKdcCzKf9d3rockdZHaoPstllb0YXHMBWMItwOq1au+xKA5f8sl27YWu529w== X-Received: by 2002:a05:600c:3547:b0:426:5f8f:51a4 with SMTP id 5b1f17b1804b1-42811d89f99mr87663815e9.12.1722439572060; Wed, 31 Jul 2024 08:26:12 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:11 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:29 +0200 Subject: [PATCH v3 5/8] ASoC: dt-bindings: apq8016-sbc: Add msm8953/msm8976-qdsp6-sndcard MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-5-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: 4CIRYO23OIKQE52HX2XWJTGEZV6L4X6P X-Message-ID-Hash: 4CIRYO23OIKQE52HX2XWJTGEZV6L4X6P X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:31 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Document MSM8953/MSM8976 QDSP6 cards. Signed-off-by: Adam Skladowski Reviewed-by: Krzysztof Kozlowski --- .../bindings/sound/qcom,apq8016-sbc-sndcard.yaml | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc-sndcard.yaml b/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc-sndcard.yaml index 6ad451549036..43db5ad65d75 100644 --- a/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc-sndcard.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc-sndcard.yaml @@ -15,16 +15,22 @@ properties: enum: - qcom,apq8016-sbc-sndcard - qcom,msm8916-qdsp6-sndcard + - qcom,msm8953-qdsp6-sndcard + - qcom,msm8976-qdsp6-sndcard reg: + minItems: 2 items: - description: Microphone I/O mux register address - description: Speaker I/O mux register address + - description: Quinary Mi2S I/O mux register address reg-names: + minItems: 2 items: - const: mic-iomux - const: spkr-iomux + - const: quin-iomux audio-routing: $ref: /schemas/types.yaml#/definitions/non-unique-string-array @@ -106,6 +112,27 @@ required: - reg-names - model +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,apq8016-sbc-sndcard + - qcom,msm8916-qdsp6-sndcard + then: + properties: + reg: + maxItems: 2 + reg-names: + maxItems: 2 + else: + properties: + reg: + minItems: 3 + reg-names: + minItems: 3 + additionalProperties: false examples: From patchwork Wed Jul 31 15:25:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C3E7C3DA64 for ; Thu, 1 Aug 2024 12:13:04 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AAF0E3F4F; Thu, 1 Aug 2024 14:12:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AAF0E3F4F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514367; bh=ue+vpUOG4ZnyGYEi2iXto0ytfCqxL7uNzt6OO5tHUHM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ixno1ihu30wZnmEhkJlKzfgffnQlnK3RBoesx3fEXdnWO5qXBzFF5ZXsYxigoK0lN 8+1JXTm4tWQPtbkYvafCvWayc1nyXVwg7mFuMS1BVaj5JN4Wwx1/z1El+kYuyynLIv U5UJetcNnIa4IPM/iLS8iMjsnB6dMqYluY+g9o48= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B70FF80605; Thu, 1 Aug 2024 14:11:35 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8E564F80621; Thu, 1 Aug 2024 14:11:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86DBAF80588; Wed, 31 Jul 2024 17:27:07 +0200 (CEST) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id ECD9BF8057A for ; Wed, 31 Jul 2024 17:26:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ECD9BF8057A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CvVae2qp Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so49299335e9.2 for ; Wed, 31 Jul 2024 08:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439574; x=1723044374; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=y7acxoGv0kNGN7BdTg0LbHlXp+SwEqZuAjJ2EFuphzY=; b=CvVae2qp76CSU1enShOqEpv0O/QXAB7SB/qrbDdVuja9lVGJiK0M7GWD0GdOGWf9qi kG0aaHmAd+j9e6wO/u3prPEQYJ0z2Apn0dHK87fvhWhQsi8mSOYOOpWi21mT9veCebkn JF+vsGYQWwc9wiaayz62UVyfDu4b2muMkC6KNmvklThfLrYATGt2lgaTA0r4oHMp1TyZ qc1TLdyUqNnBV5PiRs8Yz/y8ys/BxxncTZeNDCtqlZItPzPYYj0O9U3KzqlWO2PInpjG 3Tk1t9MR8DjSWYGeufgI8sJzC5h80SqnKrN18Na7+eNfD4EH0LthnDbdmlIVuIK4Aiqb I4lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439574; x=1723044374; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y7acxoGv0kNGN7BdTg0LbHlXp+SwEqZuAjJ2EFuphzY=; b=C5e2gIpFhfaNX5nlRPF8oOEG3w0hXY7lcnN0aOOGWfiPRVu1bisCEQ+0frtCBw8UvN Obl1nHDAwXjqn+ZZznxviRGNJh/1pXynMMS0trn/s/3YUMy9Kgzuiu5Thwh/ewtuWaxA F8dCM1MynJ+xburz99B2ZZm3mFJQtt/ue7/5zOgOQK9Pjns2KKPCBeUO2QksOPHtrBsh eKeoNUKwNxnyFYMxojXPRIloXKoLGXJZJakmHJBJgANtg8u+yvMZNPcCg30gLntSvqct zLPTIbiUEfWqcu7zlreAS6pi3GF0uOuK3dAlOA2XO5jONcL4DP8Lo3/u2XYKQW95a7+F gBkw== X-Gm-Message-State: AOJu0YxEkJfLwS+g5q6ipzIHxPHN2chvvdirfncupuxunnjsJI5tY7/F f3AaZipNI3KT030njxLSTPj1JYa2tYYrGE4Qd4psL1Em7gc3cUUY X-Google-Smtp-Source: AGHT+IEudtEsD9vtF73wmt/UCZjRipmWNhTtdiBDvrtFMRz0YZRF3+kCI0jf70h7wmb2E3E950aO3g== X-Received: by 2002:a05:600c:198b:b0:426:6b14:1839 with SMTP id 5b1f17b1804b1-42811a9886fmr139704645e9.0.1722439574189; Wed, 31 Jul 2024 08:26:14 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:13 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:30 +0200 Subject: [PATCH v3 6/8] ASoC: qcom: apq8016_sbc: Add support for msm8953 SoC MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-6-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski , Vladimir Lypak X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: XGFPHCXPDDX5HA7JI3W3SHX4WKOKJOSV X-Message-ID-Hash: XGFPHCXPDDX5HA7JI3W3SHX4WKOKJOSV X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:31 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Vladimir Lypak Introduce support for audio card on MSM8953 platform. Main difference between MSM8953 and MSM8916 is Q6AFE CLK API supported by firmware which influence way we set codec clocks. SoCs shipping on at least msm-3.18 should use v2 clocks. Signed-off-by: Vladimir Lypak [Adam: rename functions, add msg] Co-developed-by: Adam Skladowski Signed-off-by: Adam Skladowski Reviewed-by: Dmitry Baryshkov --- sound/soc/qcom/apq8016_sbc.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 5a29adbd3f82..3ed35beb671a 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -22,6 +22,11 @@ #define MI2S_COUNT (MI2S_QUINARY + 1) +enum afe_clk_api { + Q6AFE_CLK_V1, + Q6AFE_CLK_V2 +}; + struct apq8016_sbc_data { struct snd_soc_card card; void __iomem *mic_iomux; @@ -29,6 +34,7 @@ struct apq8016_sbc_data { void __iomem *quin_iomux; struct snd_soc_jack jack; bool jack_setup; + enum afe_clk_api q6afe_clk_ver; int mi2s_clk_count[MI2S_COUNT]; }; @@ -192,6 +198,28 @@ static int qdsp6_dai_get_lpass_id(struct snd_soc_dai *cpu_dai) } } +static int qdsp6_get_clk_id(struct apq8016_sbc_data *data, int mi2s_id) +{ + if (data->q6afe_clk_ver == Q6AFE_CLK_V2) { + switch (mi2s_id) { + case MI2S_PRIMARY: + return Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT; + case MI2S_SECONDARY: + return Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT; + case MI2S_TERTIARY: + return Q6AFE_LPASS_CLK_ID_TER_MI2S_IBIT; + case MI2S_QUATERNARY: + return Q6AFE_LPASS_CLK_ID_QUAD_MI2S_IBIT; + case MI2S_QUINARY: + return Q6AFE_LPASS_CLK_ID_QUI_MI2S_IBIT; + default: + break; + } + } + /* If AFE CLK isn't V2 return V1 */ + return LPAIF_BIT_CLK; +} + static int msm8916_qdsp6_dai_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); @@ -215,7 +243,7 @@ static int msm8916_qdsp6_startup(struct snd_pcm_substream *substream) if (++data->mi2s_clk_count[mi2s] > 1) return 0; - ret = snd_soc_dai_set_sysclk(cpu_dai, LPAIF_BIT_CLK, MI2S_BCLK_RATE, 0); + ret = snd_soc_dai_set_sysclk(cpu_dai, qdsp6_get_clk_id(data, mi2s), MI2S_BCLK_RATE, 0); if (ret) dev_err(card->dev, "Failed to enable LPAIF bit clk: %d\n", ret); return ret; @@ -236,7 +264,7 @@ static void msm8916_qdsp6_shutdown(struct snd_pcm_substream *substream) if (--data->mi2s_clk_count[mi2s] > 0) return; - ret = snd_soc_dai_set_sysclk(cpu_dai, LPAIF_BIT_CLK, 0, 0); + ret = snd_soc_dai_set_sysclk(cpu_dai, qdsp6_get_clk_id(data, mi2s), 0, 0); if (ret) dev_err(card->dev, "Failed to disable LPAIF bit clk: %d\n", ret); } @@ -265,10 +293,12 @@ static int msm8916_qdsp6_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, static void msm8916_qdsp6_add_ops(struct snd_soc_card *card) { struct snd_soc_dai_link *link; + struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card); int i; /* Make it obvious to userspace that QDSP6 is used */ card->components = "qdsp6"; + pdata->q6afe_clk_ver = Q6AFE_CLK_V1; for_each_card_prelinks(card, i, link) { if (link->no_pcm) { @@ -279,6 +309,14 @@ static void msm8916_qdsp6_add_ops(struct snd_soc_card *card) } } +static void msm8953_qdsp6_add_ops(struct snd_soc_card *card) +{ + struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card); + + msm8916_qdsp6_add_ops(card); + pdata->q6afe_clk_ver = Q6AFE_CLK_V2; +} + static const struct snd_kcontrol_new apq8016_sbc_snd_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Mic Jack"), @@ -344,6 +382,7 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev) static const struct of_device_id apq8016_sbc_device_id[] __maybe_unused = { { .compatible = "qcom,apq8016-sbc-sndcard", .data = apq8016_sbc_add_ops }, { .compatible = "qcom,msm8916-qdsp6-sndcard", .data = msm8916_qdsp6_add_ops }, + { .compatible = "qcom,msm8953-qdsp6-sndcard", .data = msm8953_qdsp6_add_ops }, {}, }; MODULE_DEVICE_TABLE(of, apq8016_sbc_device_id); From patchwork Wed Jul 31 15:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7EDACC3DA4A for ; Thu, 1 Aug 2024 12:14:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A17914034; Thu, 1 Aug 2024 14:13:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A17914034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514433; bh=7ih/twfj7Vu9/nowcpH2q0+GyQypwWFRSVqFIt9jL5M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=O6NI+IL7JFQvruBinGzTTqBJ4WYeZNg32j8o4fAsWF5QbZOsv5Hl295on7lJ/dKZH IXWslqFa8tlF9tW1OrxyrOsvqTS+0gKknAjcJJ9SkAGSXnXCmIhBHvOA70G9fXMqvJ pCLzoeENyS0jAu+MH0GoIguc3UDIahCBWtXLap2I= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 45227F806AB; Thu, 1 Aug 2024 14:11:44 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 990A0F806C2; Thu, 1 Aug 2024 14:11:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6F3C5F8026A; Wed, 31 Jul 2024 17:31:08 +0200 (CEST) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3D1AAF80580 for ; Wed, 31 Jul 2024 17:26:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D1AAF80580 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=LAZ4TZb5 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ef2d96164aso67289201fa.3 for ; Wed, 31 Jul 2024 08:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439577; x=1723044377; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QiPIHigZUWEy/gTiB3EmC11NKGqz88RzfHr+wLDLdBQ=; b=LAZ4TZb5IPhfjmQwm1yqFEoIf52CZmbYqToInHnnigScnh7157UCOKKSOqAkHKeaEw cR6u7jXWJRi1CatUvEI+oXXpbI0MecSdJya+UYwiz6+ilfAsbk3D5BHJ43YzlupO5dDG BRKGvh+RxigN1oHXgIrb4W8LVWOHW8U3lPJfCd5NgzU2SRdNCx/b6hiGY3a2OppbSaYg PSsBM35t8xuMA2IMnILadZh+RWiQXHCL4nfcbHQ2JkWsMQGyD/BkibvnQNl7iJdHn2e7 wl/Ca8gDuEZI8PPuqs18q3yoOHZ2LkzPrBnshXnApFIjNyomnxL6ubHHVpCSmqfvmNGD ZAPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439577; x=1723044377; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QiPIHigZUWEy/gTiB3EmC11NKGqz88RzfHr+wLDLdBQ=; b=UCNcIH6vk38gjgzP6UFwxRUJfOFtZ4jsQEWXLEuNIX00rZuVBXGOQbEUVsKK3W4f5x ZSUcoi+0QNak7HdRseSTe2kXkY5IoMUjVSUa2GApLCcH8N37b/b28crLOOdu4HwH1CQ5 R7N5C4UMpbfBx9+apGaa7tfQaiUdGz+IncQ1um2a2TCYqQ6d1wazqEG27BzSjd3avmQP 6BuL1o1LsxggeLKZ9W2UPHVssmCogU9842cDOp1LRUb7XtmtY6TVTYP7eo7WY4fGSBZY Sp+WCDpjNF9rdW4ah1JbEm0D6HFegsykb5ZAFUDXy4vX5EqetF55rkiUI0fC+/1EcaCj QBew== X-Gm-Message-State: AOJu0YyO3I+INIzRaYAR+MuA+8J/+/p2p1ZmZhoWRB8dmhgrAIW+/j4C BP8EMkOH1iskhvAatk+hGeiqeTxxYY4AbWCGEa1ZVE+EWAeJvjNL X-Google-Smtp-Source: AGHT+IGfiiY8nEDh5Jy5pRnrx5JgptFO0aaTdFxWxnCuI2DfwVrpN841vJxt9dac7N5AxkUuFMo2zw== X-Received: by 2002:a2e:7d13:0:b0:2ef:2b38:879c with SMTP id 38308e7fff4ca-2f12edf02b2mr97756941fa.3.1722439576327; Wed, 31 Jul 2024 08:26:16 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:15 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:31 +0200 Subject: [PATCH v3 7/8] ASoC: qcom: apq8016_sbc: Add support for msm8976 SoC MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-7-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: TVSN3IGVA4L6WUJ5LGGLZIH7TZ7YGO23 X-Message-ID-Hash: TVSN3IGVA4L6WUJ5LGGLZIH7TZ7YGO23 X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:32 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Introduce support for audio card on MSM8976 platform. While MSM8976 falls into v1 category with MSM8916, digitial codec clock is not available in GCC so we have to set it in machine driver. For that reason for V1 clocks new boolean is added to check if we need to enable codec clock. Signed-off-by: Adam Skladowski Reviewed-by: Dmitry Baryshkov --- sound/soc/qcom/apq8016_sbc.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 3ed35beb671a..8219d4d55625 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -35,6 +35,7 @@ struct apq8016_sbc_data { struct snd_soc_jack jack; bool jack_setup; enum afe_clk_api q6afe_clk_ver; + bool dig_cdc_mclk_en; int mi2s_clk_count[MI2S_COUNT]; }; @@ -242,6 +243,16 @@ static int msm8916_qdsp6_startup(struct snd_pcm_substream *substream) if (++data->mi2s_clk_count[mi2s] > 1) return 0; + /* + * On newer legacy SoC (MSM8976) lpass codec clocks are not available in gcc region + * so we have to request clock from machine driver using V1 API) + */ + if (data->q6afe_clk_ver == Q6AFE_CLK_V1 && + data->dig_cdc_mclk_en) { + ret = snd_soc_dai_set_sysclk(cpu_dai, LPAIF_DIG_CLK, DEFAULT_MCLK_RATE, 0); + if (ret) + dev_err(card->dev, "Failed to enable LPAIF dig clk: %d\n", ret); + } ret = snd_soc_dai_set_sysclk(cpu_dai, qdsp6_get_clk_id(data, mi2s), MI2S_BCLK_RATE, 0); if (ret) @@ -267,6 +278,13 @@ static void msm8916_qdsp6_shutdown(struct snd_pcm_substream *substream) ret = snd_soc_dai_set_sysclk(cpu_dai, qdsp6_get_clk_id(data, mi2s), 0, 0); if (ret) dev_err(card->dev, "Failed to disable LPAIF bit clk: %d\n", ret); + + if (data->q6afe_clk_ver == Q6AFE_CLK_V1 && + data->dig_cdc_mclk_en) { + ret = snd_soc_dai_set_sysclk(cpu_dai, LPAIF_DIG_CLK, 0, 0); + if (ret) + dev_err(card->dev, "Failed to disable LPAIF dig clk: %d\n", ret); + } } static const struct snd_soc_ops msm8916_qdsp6_be_ops = { @@ -317,6 +335,15 @@ static void msm8953_qdsp6_add_ops(struct snd_soc_card *card) pdata->q6afe_clk_ver = Q6AFE_CLK_V2; } +static void msm8976_qdsp6_add_ops(struct snd_soc_card *card) +{ + struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card); + + msm8916_qdsp6_add_ops(card); + pdata->q6afe_clk_ver = Q6AFE_CLK_V1; + pdata->dig_cdc_mclk_en = true; +} + static const struct snd_kcontrol_new apq8016_sbc_snd_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Mic Jack"), @@ -383,6 +410,7 @@ static const struct of_device_id apq8016_sbc_device_id[] __maybe_unused = { { .compatible = "qcom,apq8016-sbc-sndcard", .data = apq8016_sbc_add_ops }, { .compatible = "qcom,msm8916-qdsp6-sndcard", .data = msm8916_qdsp6_add_ops }, { .compatible = "qcom,msm8953-qdsp6-sndcard", .data = msm8953_qdsp6_add_ops }, + { .compatible = "qcom,msm8976-qdsp6-sndcard", .data = msm8976_qdsp6_add_ops }, {}, }; MODULE_DEVICE_TABLE(of, apq8016_sbc_device_id); From patchwork Wed Jul 31 15:25:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 816287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAE28C3DA4A for ; Thu, 1 Aug 2024 12:12:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 199113F21; Thu, 1 Aug 2024 14:12:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 199113F21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722514352; bh=rmwwYOUTvCDddLDjHz/8Ej1d+CDtpGbxfwCt2PfUiuw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qwwpMeaFgBEQxEMWREUZeO8oUU6xl5dXFZG51a+ez1dx0qNboZgX4A0kvPSmQZSob OVDQ9DMTv+Adu6AOnEHACL/NdRFPAK3q1FgezyGJCZGL25nU6mR9gnELfjB6O4HM1h ShSwp2GK1hRpUtkBIxno39Oe4+iTypQ06CrlX/8U= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AEDF0F805F0; Thu, 1 Aug 2024 14:11:34 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3D7A9F80601; Thu, 1 Aug 2024 14:11:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E262BF8057A; Wed, 31 Jul 2024 17:27:12 +0200 (CEST) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id ED653F800C9 for ; Wed, 31 Jul 2024 17:26:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ED653F800C9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=dSxnb6aQ Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42812945633so38785465e9.0 for ; Wed, 31 Jul 2024 08:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439579; x=1723044379; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5WuGgWX4JRf3ODe4Tn035HhTlH91E7fm9nkBF1QertU=; b=dSxnb6aQRcsfUXGqY8CxH4H0MdXGou4OE0KIi2ej+fDkz5Me/h1oS1rIWbY4H6o+b0 KrCb8by5hKyyMskEsKUe6nUNE2cTMkgxUOjoRfdiSqlB6uM8vCPoNR4vAJQTripZXgxu p6UwSdG6QfWvLXJWfSYfzWGGIPiNWxlESFXhih1GaXM9Vn0VYyf5XwX76w3BSK0lSB0u 8pcBVd8IAbOJ6V5IBrAsI4B3TBidIxDLSHIdsCWVLLFPspRab+BkDaKDBeJBZF88lLsm gL7I3UvXX2jAMWx2D3i7dpN/ebjx6gvPwQvLFFeCk5Hr0xLNLKPKCqMXfIbz8St2BDPJ fVhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722439579; x=1723044379; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5WuGgWX4JRf3ODe4Tn035HhTlH91E7fm9nkBF1QertU=; b=wUqS5oLtfP6QndOdRlo0XRGKks+6FXuk2NTkIQaUh1EY8PeQ1GqQhI2l+hU29dn9/7 5c5HdxyOTyZ4F7v/7JVpJSM74/yAcWGXqUApy6XCNOBL3taM6pN9I3k6jofEEtZagtTN O82WN012X0Tm6LuC5zDXvh8S1X2Choa971lc9ONeXgsMh5xMP0FuUhZAUuJ4iCoTN8YF a+ZFFaphp5/55Lm8KGIdUWFfeyx9LAYvxvnmWJ8fypBnXeK24dmbf0Rb6LmKpBQsbMEe /PYmAi2ROZFZW20N0VgBXdgd7T/1CRBoXEfaj3kEHSl/EbQ71f1GSbyDrWDulOXkSjCF LSPg== X-Gm-Message-State: AOJu0Yyc4oaFiEjlAXz2Ef0pjIvt8afq8RXy/Nacd+rUWG+6yhpAKx0f REHwHhF95r6oGkP1qpczef+vqLKTSwPHeAElyNH0iRHLe56DhwNS X-Google-Smtp-Source: AGHT+IGH0/A9VV9XmlFr+VqIo2r5LTMx1mKaXlbbJoBz7UKepQPkmCu2QIQblz8in7UpA4OPhwqRFg== X-Received: by 2002:a05:600c:4fc8:b0:426:593c:935f with SMTP id 5b1f17b1804b1-42811d6c45bmr96433365e9.1.1722439578523; Wed, 31 Jul 2024 08:26:18 -0700 (PDT) Received: from [127.0.1.1] (byv161.neoplus.adsl.tpnet.pl. [83.30.41.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb64755sm25430985e9.36.2024.07.31.08.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 08:26:18 -0700 (PDT) From: Adam Skladowski Date: Wed, 31 Jul 2024 17:25:32 +0200 Subject: [PATCH v3 8/8] ASoC: msm8916-wcd-analog: add lineout output MIME-Version: 1.0 Message-Id: <20240731-msm8953-msm8976-asoc-v3-8-163f23c3a28d@gmail.com> References: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> In-Reply-To: <20240731-msm8953-msm8976-asoc-v3-0-163f23c3a28d@gmail.com> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Stephan Gerhold Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Adam Skladowski , Vladimir Lypak X-Mailer: b4 0.14.0 X-MailFrom: a39.skl@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: G4JXE7FDBJ72CT27FIHT6ACQQBC55MY2 X-Message-ID-Hash: G4JXE7FDBJ72CT27FIHT6ACQQBC55MY2 X-Mailman-Approved-At: Thu, 01 Aug 2024 12:06:31 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Vladimir Lypak Add descriptions and controls to toggle lineout output Signed-off-by: Vladimir Lypak Signed-off-by: Adam Skladowski --- sound/soc/codecs/msm8916-wcd-analog.c | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index b9325290c28d..38949556f7d9 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -233,6 +233,8 @@ #define RX_EAR_CTL_PA_SEL BIT(7) #define CDC_A_RX_EAR_STATUS (0xf1A1) +#define CDC_A_RX_LO_DAC_CTL (0xf1AC) +#define CDC_A_RX_LO_EN_CTL (0xf1AD) #define CDC_A_SPKR_DAC_CTL (0xf1B0) #define SPKR_DAC_CTL_DAC_RESET_MASK BIT(4) @@ -327,6 +329,8 @@ static const struct soc_enum hph_enum = SOC_ENUM_SINGLE_VIRT( static const struct snd_kcontrol_new ear_mux = SOC_DAPM_ENUM("EAR_S", hph_enum); static const struct snd_kcontrol_new hphl_mux = SOC_DAPM_ENUM("HPHL", hph_enum); static const struct snd_kcontrol_new hphr_mux = SOC_DAPM_ENUM("HPHR", hph_enum); +static const struct snd_kcontrol_new lineout_mux = SOC_DAPM_ENUM("LINEOUT", + hph_enum); /* ADC2 MUX */ static const struct soc_enum adc2_enum = SOC_ENUM_SINGLE_VIRT( @@ -630,6 +634,46 @@ static int pm8916_wcd_analog_enable_adc(struct snd_soc_dapm_widget *w, return 0; } +static int pm8916_wcd_analog_enable_lineout_dac(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, + int event) +{ + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + + switch (event) { + case SND_SOC_DAPM_PRE_PMU: + snd_soc_component_update_bits(component, CDC_A_RX_LO_EN_CTL, + 0x20, 0x20); + snd_soc_component_update_bits(component, CDC_A_RX_LO_EN_CTL, + 0x80, 0x80); + snd_soc_component_update_bits(component, CDC_A_RX_LO_DAC_CTL, + 0x08, 0x08); + snd_soc_component_update_bits(component, CDC_A_RX_LO_DAC_CTL, + 0x40, 0x40); + break; + case SND_SOC_DAPM_POST_PMU: + snd_soc_component_update_bits(component, CDC_A_RX_LO_DAC_CTL, + 0x80, 0x80); + snd_soc_component_update_bits(component, CDC_A_RX_LO_DAC_CTL, + 0x08, 0x00); + break; + case SND_SOC_DAPM_POST_PMD: + usleep_range(20000, 20100); + snd_soc_component_update_bits(component, CDC_A_RX_LO_DAC_CTL, + 0x80, 0x00); + snd_soc_component_update_bits(component, CDC_A_RX_LO_DAC_CTL, + 0x40, 0x00); + snd_soc_component_update_bits(component, CDC_A_RX_LO_DAC_CTL, + 0x08, 0x00); + snd_soc_component_update_bits(component, CDC_A_RX_LO_EN_CTL, + 0x80, 0x00); + snd_soc_component_update_bits(component, CDC_A_RX_LO_EN_CTL, + 0x20, 0x00); + break; + } + return 0; +} + static int pm8916_wcd_analog_enable_spk_pa(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) @@ -917,6 +961,13 @@ static const struct snd_soc_dapm_route pm8916_wcd_analog_audio_map[] = { {"SPK PA", NULL, "SPK DAC"}, {"SPK DAC", "Switch", "PDM_RX3"}, + {"LINEOUT_OUT", NULL, "LINEOUT PA"}, + {"LINEOUT PA", NULL, "RX_BIAS"}, + {"LINEOUT PA", NULL, "SPKR_CLK"}, + {"LINEOUT PA", NULL, "LINEOUT"}, + {"LINEOUT", "Switch", "LINEOUT DAC"}, + {"LINEOUT DAC", NULL, "PDM_RX3"}, + {"MIC_BIAS1", NULL, "INT_LDO_H"}, {"MIC_BIAS2", NULL, "INT_LDO_H"}, {"MIC_BIAS1", NULL, "vdd-micbias"}, @@ -978,6 +1029,19 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("DAC_REF", CDC_A_RX_COM_BIAS_DAC, 0, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("RX_BIAS", CDC_A_RX_COM_BIAS_DAC, 7, 0, NULL, 0), + /* Lineout */ + SND_SOC_DAPM_OUTPUT("LINEOUT_OUT"), + + SND_SOC_DAPM_PGA_E("LINEOUT PA", CDC_A_RX_LO_EN_CTL, + 6, 0, NULL, 0, NULL, 0), + + SND_SOC_DAPM_DAC_E("LINEOUT DAC", NULL, SND_SOC_NOPM, 0, 0, + pm8916_wcd_analog_enable_lineout_dac, + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | + SND_SOC_DAPM_POST_PMD), + + SND_SOC_DAPM_MUX("LINEOUT", SND_SOC_NOPM, 0, 0, &lineout_mux), + /* TX */ SND_SOC_DAPM_SUPPLY("MIC_BIAS1", CDC_A_MICB_1_EN, 7, 0, pm8916_wcd_analog_enable_micbias1,