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: 13748907 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BD7E1AED3B; Wed, 31 Jul 2024 15:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439567; cv=none; b=rwsFTrOHf4vIGDixvbZLcq/b5wGs1A7M7mmFUIQWciEzlR4U4FIuMKnzIQs0TeUvGFui2kAzkBpCx0NWwtFlZIivLK5Cgk9MkSAVx4Zr5/wxJgAB39XDaEB3DDMJcY67rMwBaN7N5YqZet+Wv2Kc4M0Acz3RCLCQbyeJpgBmqiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439567; c=relaxed/simple; bh=lyyOSz5mnVlYsXDZyPPBuvrk6tGYt4/xz9ZU1RO5S4A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Cai2m8vlyJTHNPdiFAI/fNHn5tIW7Oxul2RXgSEfAvZ0oOn63XbkT97uOmfMM+pxhFkEZlgVfn3XMIHefk4UtgQ46TEoo7w971wd1vS7xisF6S7REZMfRgNr45EbAjeTDIyll1roH04v7+sCYavdxlg54WEjP86LtxGJEWTb8cQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mRfGq9og; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mRfGq9og" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4281d812d3eso37148815e9.3; Wed, 31 Jul 2024 08:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439564; x=1723044364; darn=vger.kernel.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=mRfGq9og9ioSmRoHSN8vjdo6q7Nzs2GydUh9MEdD7JJcm69xIjzFCrVV3z6VWrp5BQ K6jL5LtXDlwjJAQSKE3vV3JNH91OFx9KA0Q4uUK4zouXFEQ2Z3KB3IIXEXC09dM2YNOv 4Gv4lbHWgl1xO9Kr4TNxIhVFgBU0gBSxsGEN9DfksI0DcMuMfugyBqMnmvLxINi3tjju gOhgxylCbYQxMHoZXN1reqjA6PU+sB7f3tnn55vw1ZwF6TDPQjgeFcxvWqeVtzzzwFLf yuyYdRtwQwT+wyRTKHvvfwbdRWRuL+Ea8gPPCdRH1cSRAnV/UxiZwPROHPZrRG5sBS04 T6pg== 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=NvEPbib/hUM0Mx2G7wjkqQq1HdR5+XRXYERu9C7fGCHKj7dT2UdTncsV7keaCZU7oK jvqIInkf09DlchnOHc3KQFZy7CZdAG30K0uXA3h5TwMD8dGa5EYwmdmGdxA+AbwHdWy3 fhAIo2sTotAlSxu1LA541LWvCSOvKAZ8yZYsz8XIyPQfPHCM3R1ly/j7ZVjIjknSsR4r Sp/kTZQ1wRwKnOIs1SyVVZbX3nA0LMp88Kjbb68FSCJ4qCz0FCt5YNR4+rq04Ykg4dLr P8gjNtcCpaiBBPwl3YMl5yCxJMXGIcNhw7UKm6HfJ4PPIao2NaCt3M00MxXfMGgYhw/G Y/Aw== X-Forwarded-Encrypted: i=1; AJvYcCVj2Fx2O1BHhhWBXZW5mX1t4sQeki8Ig4WOc5FF7JaKI3e7MUwxRvF+ForQ7DB0JInH8iCc+bgB3czOq981w7MJUmh4drSQDEMXNQwCeHDJxp3t45MEFdjIbufYI6gzWgySN4rhdaiuk5zinFCXvOjhn79xVfQ1Rd8+INvqZ/6Vnhje9YKy/sduq14CwM+R05RqUVaKJlhOEr2N6ynVUvVvANOXtA== X-Gm-Message-State: AOJu0YxPFhOeG/S9IVYnPuzLA9nDhIAEBC8F5X8a3Y3zfFmeYYrAkD04 bsxRevixlMQushqbocVOA3F0dbQbRM3xCAyW/y3k9xpiRX3tLxDCnl2pPQ== 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 Reviewed-by: Dmitry Baryshkov 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: 13748908 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C11861BC065; Wed, 31 Jul 2024 15:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439569; cv=none; b=YawJGUNFt3ZQZcK8WkIXCAc5ZRwRwhFxNMv+ANdhbyeHarvyDMivFTcdzLeE0fApLQBrEVttYHDcsd/Knccma0N8pIy+q6qxAhmZrCuLt2IQUsnm+6a51npsSQhmwUj1Wk6myLSw1EAs1msRJN7jyVr4MrWZ9iV6AlsvSmI4JiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439569; c=relaxed/simple; bh=EVyv4o1kWKU9C0RpwE8ZBKEBCpkeLQtTeetB5bkp+NI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U4iPdVJGf9a++qJxAJPaaW+AM0/iwcz3NuQUU610pS6uGnjbV4H42bpNPSzX0x6zpcF56aGpY2VkkoUWLHbbnJcVWJHlsNe+ZUx3kqCiZox97F5v1tCBswdynLOdshRn94x0IpeknG6Pu0g7dNZhWSkFn2GmRWu/NwGVgWVlyl0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fBRTP5Df; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fBRTP5Df" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-428178fc07eso35450665e9.3; Wed, 31 Jul 2024 08:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439566; x=1723044366; darn=vger.kernel.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=fBRTP5Df36oUd3k/V6ANAQISkBPqbRPTF93XaDD2Kzm3N7l3T0bRXAovlgA1DzIGRb 7p5AE1B9DmLw+9ZGAP5SkXN1ZVMHnV37MUd+eei9OLsuxz2d7KA9a2k/INPTWCVKkvmZ XtgEISflJL0X29xymO1hb9NptIwULS7CVh0S0WA5CqwKmHLaBeQEb6TMX9F9x81b2STF i47kslhrFq5+6H8HhWlIlTNcv9ZWGCIKbrFa3Ey2gI9/EPLNy/PchEwSfUYUGGiHneu2 pXqYfhridPADriso/ZwJo/P0WZ74I9IRPUuWkx5Ka713qqabwnKSupk2wFmgnt7/94NR 18XQ== 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=frqsnoKHYbNeHNB5LuwCMXB3vyppbKZ9iZF12SWeVS17RkX6ZHdt7V5jET9bbiNp81 tuY/LWhHeNd3IsHSsG5Ij3ZqTvmqwlA4P0iQZySggiBVyPPnPfQToIYAcR9VbAtFApjF tyn3OfzW90uvB8J3VrFTcyg9Aq0G7p6w33+yq8fiZNLvNUpXTfRuXmmL6peoMULYrfuc r9tQrlpot41cH0uojOOlhdXRcQXpur2qessQI7awVRO2WuE4Af/i/N7wsmSeuxMv8Nj3 loz1qEPwY6XeIEERJ6DWR372pCbGAHjbfEk1jAOD6cBCHwI3ONVOJpsUOMDbiBa3zx4V 4IQg== X-Forwarded-Encrypted: i=1; AJvYcCV/qyoUp8stpoLZAslIrpLAvZtIBTiZasrQbkpvvs3rA8hG6P0dAoeOlcNhf5eLkaeVoo+wEA8Bjyi6iEsaGCS6cW2SKauoB7hg3xMUZIDhhY/XcKtIvH7DGaEpqWsE1/sp8QLgbZXKagh9abEJPYqBVF3bZ/+epZvkW7l9sb/MgcuqxsjeT7JkLaPM6jyhzET4cSjtAda+lCfO8C4jP1YR9zDiAw== X-Gm-Message-State: AOJu0Yy+kPjX+UeGB4xYibO27YYDXOEZVOiLrvpy7sQgBzPMHDbBZ+s1 /drTGkCv0UK7xGCLDPgyYRrp+twaGg+o0AAyeXxQOJVJmXv+3esu 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13748909 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A071C1BD013; Wed, 31 Jul 2024 15:26:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439572; cv=none; b=H6eLnknHVB4YDj1Mkur7SG+d4mzYnkdNYItID4Q6+11YBTtILsfcc023Gg8ryZCYn3sG2o7EuKEkUSzYLJ3e93lqDww8tYTQe4sDMKoez8SiQQlip2LRCqL1fz15/apnVfWrLbwgxXo8zNJf/ROF9/43crYqBFGPEI7PP3ApqMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439572; c=relaxed/simple; bh=b/S9uy+bIF3wHOM/WZrlrCVkMM4isQGv528aMZ3QO/A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CUHRXXPfmu//E0RyJ1TYrp40yKr5ckJoTFTer5LdCF8IM5EtTUH9pxeJDndRD9zKDN0UivbWU3KCP2C47faZkBKYfGYgVDoUHrSVTq1/YkNyR2QHqUtWP9R1C1NuQKySBIcQh190c3WoENKNvIVJc2fN+Mg4e/ORtOxKlXYTV+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lY5jT9tV; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lY5jT9tV" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4281faefea9so26444215e9.2; 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=vger.kernel.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=lY5jT9tV0FSOZ4D0uiWCfx2y9ZWq1MtTP0CBcxoti2LkuGqXrJ2tY6at8etqbYuLX+ B1DfMuvtoa7aFvF2wBLnJZoHc/7pPx4hzUKGRi7rcaB9pCWT5EgNsUs+BtBvJQhL5AqC /IGEPhqo6HsDSOYwt4k8/Qwp7JjE93TSa92PP18502Ce3/Q/WW5IJi5qmp6ThknqQcUT XyYYpw+/xoKj6XltCN1EVnsr5flHQZzOx1j19eMmZ/RdePKHem5cDUr4OSrZPAO9URol LaHl+wramsLRTdjg39oEzzOWyJ60wtiHWN7oAA3ydthUa+s77mJW2KjICuwgHKyHPicQ R3Gg== 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=f/3b4O5M0xt0htbBHeBz7bERPiZFwaeRddxZiF3Cz8FsX5kRZHvsTcPRt3vHaYsTpG CHbHebxOKZVpqTb0OzacPcTH38gxU79xqAQxEVR4g0SPEjL2pfRpuFD7B6d4Y+u7rGsN adq4Yazdn1DZoshzFIxxeSXkGcZtVdb7LhWiUGhpHZti98ChRbsOX0BzJ8VuOIoP8mAK mNYMHyEZGBXSsDs05LLnd5pF1uY7O2qAh23EPNNrBouAiUsXilfKRPi2zbfZ2zLHhCUE NEqbupHdU7S+9SPt6p4GkoLvqhZLHAjkCwqPdV9adiIWNRwmq3KLd5zBj4JLW/Geat6k f9Pw== X-Forwarded-Encrypted: i=1; AJvYcCXpzlBeCHS5MsG7oJWbvmJ9NJuDiiM+9ZZmvy6FOnWKIirQXyvnohDwQ7viaRtHXlE8YhUjFg0QMM+mVdSS62Frhxxxc8imXBc+BSPTMXnZsL1qc9ubImA36ulgro+NIFdE43fWiPkYT1jLg+h8AqVqFDmIQYTC/H29sGMr0kFtI8CyfcvcPCy05j51Sh+0P2KfJWa7xj/WPXBhrKfdnwMW13I/7w== X-Gm-Message-State: AOJu0Yye7ZhyzuP60ZtSO6OOe1THvJu89ZqpbhryB2cAFuObU6dW57uQ A2AJ8UDUM5J5ZJTzh9ReMUDS7uflYlDU0cmtNvwZ38D+BvoBmh71 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13748910 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51B5A1BD020; Wed, 31 Jul 2024 15:26:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439574; cv=none; b=hj0Z3nz+OQ+WJAMCxsHfH0zLYn/7YTBn7BvOA4tEps+948G8G8cIfD0F5AAuRAlfXgmJk64HMrxlSOTvFn4f9uwFEfYAJqplUGEWOVVuLDFBRGou1lWxhxGMB4jmEv/vvYVhElsQLiFYPOpyhUzYnqNNC5r89ay15peg8heHROY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439574; c=relaxed/simple; bh=cAiwEYPyhie5YN0PaVJrgMAafcZxhlOZNQ26oDH/bMM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EXxE88P1/s6Y1QIxnMjZ5wRCPG/Yqzm2SXvNOOUk/3Daa14ljTQ/GYzvyf2m66+JkfWiEaAYqPH2ihyu9NINjFpTswQRsisE45ypEeT4PnE7/p+2tRw5a38gXMv1Pm8lCHp+KDC7Mhz5BCYNJ1WJPiNP4EJRUvHoz0BDJWWbUnI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E0FRJmVV; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E0FRJmVV" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2eeb1ba0468so91042341fa.0; Wed, 31 Jul 2024 08:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439570; x=1723044370; darn=vger.kernel.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=E0FRJmVVR6JC8aZb0ySFLtTSP7SplVbzrbgIMRC/hNlL39bcMZ689/hHC2aK1mqZl/ 35NyHFv/5Nyp9UUFYSua4ZaYScbGGPAFKSIM59Wp+kHIAjcrf+OAHV8xKCpVhUK/ppVe R3KMZQ0PAfUi74AEwDvpARerkIu0Ox4DOH3xA96LSHZhV/eak8C5lPwE/SxgHgNCWKWF Rqnsfg+HV72tpKVtyqcABlb0zAQNgK0LLCGoFQEraV9Tg/pw4hh7vHdvGgW7sGjaVibD 4B+bZYMlU4C+iZpvHMn0PS1UeZPWLE6oMVkQq7gwZ7Ma6rjgJEzC0XQyueVPXs6Bopc+ Uvig== 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=Nh9jTiGWYggeyZPrixlevfQ/UtpkhUQfLw6Vo1NyN02Zw2wUncvm2fPvN/rrWpbGrz s8cX/ESqQOKWy36k9V92rL97D8gfgZD71VSAJ6NJDQKZJh37+pEtv+xkbszar9a7PCvb rXXqYc05g/KRUq5sJlDWwfvKU4J7a8jq0q7lbkcpo/IDt+MubsK05DjV/FE5Xyg2o4Eo JKhPM2+6ZlTw2nqSd1pwwI+98wObuBQVEdb31R8OA/SGOiILRIhzWJJD0w+ySsqfpcUL kUmJUmLhEUa2YuFQvsC455wLOB8ZaapjdjJe+ekTh3SsYUXPkgzkN3rYARNg79+lP4ja y9/A== X-Forwarded-Encrypted: i=1; AJvYcCVGX8Vrf4SmGWRydtH9M0dC9HThknwQeA/5rYjYD9mq8mRL9DmKVQTUBus6rKC6sf24mJnvM1PyPymqQkKjHykgERPG4UFlzQMDE0fxmNndedMeD33P/Z0x3B3FpsBXcQIlwF7dCNvH6rc0jRb4C3QPhE+vMxI29wFLsVEEMKZeJ1rIcflVHaGwVm8qMAXP3euc09mZQ77WMLOAFDEBYk0u+LsVFg== X-Gm-Message-State: AOJu0YyQ4UTl8/9xpcajCocKKeMGhP/n2KTfKeivF9RQstvSgrABLTk+ JlvG8nDWPY7L3UTIp5fLDFB0E/e7NkFvucI38J3MzHMNeyjD75K1 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 From: Vladimir Lypak Add regs overrides for PM8953 codec. Signed-off-by: Vladimir Lypak [Adam: rename codec] Signed-off-by: Adam Skladowski Reviewed-by: Dmitry Baryshkov --- 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: 13748911 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D249B1BD034; Wed, 31 Jul 2024 15:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439575; cv=none; b=K9HvJtASY88LjzhP7finGy/1v/VkZt+TJ9rI0GyY7bDt0huhM8dCpOMw+DXxfG0XRvlleOZ+4zdzzbGtBPWtQdOWyOfAHr6wWp1A1F93rc9e+0TJaiccHytHbt7Io0vHYULCcBaB1MMPvNQFrIxrifIrwSnveNW2FK0Yg4n64Tg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439575; c=relaxed/simple; bh=ub3FOT3N4vnIxLUsFS2HSpg9K4GlOZ+9OZbF4CeT7Fo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uh5bjDt1Vgkq82bG8HtpCPoeCJp7PpgMmSFZDYQxdteruSF9Wv97Wy09E7P28NRx+56TglY2r3pJp3hwTw58kGhOu3ggi0fFLii/zIh7QEj7vrm8Ecfi+srXLMfPGvjItfVtB97QPFKuzYR9aiUEXYOvMf2tcHfFl9I/vTU32Do= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jfYV8nqR; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jfYV8nqR" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4281e3b2f72so28813775e9.1; 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=vger.kernel.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=jfYV8nqR6U92Sde3OCgCuqRcRI7zowIv8ByB2apWqo7/FdyAuZrIX37gjjNSlDOK5l cfSwtiu17JwUxpv7625AWpvlnCxJnVm2Ur7s/jpu/SeH3ZLR68MaflhjPdFr8kSjWPjO iy6bDJRsVjyO1zv6Mbt5hr2n9ZwGcQtaPcly0R3b0WmKwVDjbVdF9xLOyX5r2yPz5nuv ZPnTEwCCA/0A43bSifdKLBNg3si252C14AFIn4cKWmXnjFxOZ5o9ohEuJodjM6pE01js SR2kvTJLSwnledjQhXUA9irtKSSokW7hYY49jJAg2+8Ir0mji+yeCQeum19USl6vLncD zYrg== 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=dPE6Wxf889N6PqFQG6FpwF54iGHGzfT/1Qgo1ouEJCUxxtH7AZeXMqUJIshTeBihfW g43tIONPwm5dB3qAbaU/p+7TeYKDtRor0rsYpF3NBEZRVIYVJIivo5KVAp3rbAOXl89D 5gC19gQkw0w8QNUEqUz+ezYbT6asE87liBpbPwNjCI33IECBabpUiYP6wegb2bg+/FrL UATxZ58x2w5zxFNFN5zd1xTfGRL+ZfzQRyMG/TO8ubCpn4zTJ55yIApsOVOSj+pZcCnn 0b5iZaKRC03JbV7mBegFEoXFf9yhwJtgWfAihWso/7ExsbP9AC5Y0hNbty1QLcGkKoMw xkeA== X-Forwarded-Encrypted: i=1; AJvYcCVCOy2Dfr8XjD+bqB4wLCQsfnrxc2Likr7uyQxt+GZeiSRlr/TbrZNpxT6O9L5zH3H3jSzKHpaNCNonqPNpudlXL4cRKnY5sUqplvJV+gp43BsVMcIV23zEoJatw4RG3cAwXUYS3GPr/MO0DmH+84S3EN3zOuQBMOzK2hA0XZhJosCPaNtISBO54815uthiIywLSSEVO8skS8nq9PrJmSh9FgfqDQ== X-Gm-Message-State: AOJu0YzXCjP5yHeTHoXigq1ddp5eXSEMJAAOSURn7grNhczaH3Hsrf/X TrEFJVTIMI+4qoY+H5gQc+/klInePCKyLB0gjtIw8u+YxfOBBujBvs1UuQ== 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13748912 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0E281BD4FC; Wed, 31 Jul 2024 15:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439577; cv=none; b=cxpVXF9Fdm6j03718Xsb9M9qnCp1e8P6jT+o598Ku/yN/xjXOM1o7CuLn/KwWd8MKmeK3fCF0pEdZSidkWpFTuECvy0gofOQNRzXZYZRVLxjq59TgPdrVnUmvK2R3tvUpsVkdtkUtEyzHyHs/q9m/SDTfBye5eGX2eYpu0YO7pI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439577; c=relaxed/simple; bh=ue+vpUOG4ZnyGYEi2iXto0ytfCqxL7uNzt6OO5tHUHM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GDbmme9WFXCmGRQp1K0mpkNSeuN8he+AX2H5fRmo6WnCYq/j6DhNNtfl08Kub8J2cgBNMCo1merBiCaKsoprdcqMoOSI0tIwBaJIzrY3UgE+o4XJHwNIn76lNgUMM1VQYoiSD26Y/Q803lW8Z2EBmq+JHf84NtOKJgqgCSe7+G0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ETACI/z2; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ETACI/z2" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4281d812d3eso37151285e9.3; Wed, 31 Jul 2024 08:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439574; x=1723044374; darn=vger.kernel.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=ETACI/z2q6Z6Odnw8lj44SIW6rOnKmVk7VWznm7UrpzX3pq0RMBs+lG0R7G4M508x/ J6Z1vu12aBXg2A2Z/eE9JgQWkfiaL8OxLd/YlKPeLbeKOoRJ4m585Vu6NSWdq/1zzcHF v7FYl1CT81cYh+YmqPNQSra+KWFGTjX9pjUyojs1UAIFuK8yD2E2kvErmxphYI05ssG5 zKtix6PlunUTBAbZFA2HlOJ3aujb7Wc/UUP+2VCVL0aBaxJOKipoibmdSlHgAhwBC5zc 3S2Ec3Xs7mivY0LRhXRhAj8vA25+anUveUBxwMfc3FAoL7q/+nUHlm1uUzdgMDszxJsw CGqA== 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=tznPFLETTP7HtbyEc7VCwtJ3+mt519wW5nQPIyaHb1It2daxdlY90Ov5ry9dIX6zeX ORFisCZ9qCWmuIhJf0KO6rsHVVhTicDy++UWgHfQzPxCkhW1MdDtpreHR8KZJotOjCpj HASZs+Y1ANxUEHsUlEGmFyNPhjV6hKWusRU+ZXvuvfOv0udIU+zzNfAGIusqpJIVHxCn UgmWoobVWSm57bsH3bECTY903GOyB1meExI0PBDwUkqvdB1/ufxgHoI3M11HqdXSc8jd r7NkJPDLf4wLSuA8HHZUdd/wdd3Z398FJN1RuAcsNzhXZwErRIiN3ZtuUFjvn4l8OwZz oU2g== X-Forwarded-Encrypted: i=1; AJvYcCWZRyUAEqEbn+yNmCo50Es6yPPT21pQJ65WuHPg90mXYgqLsVCWvzW0PImZAklSvfA0PqB8kH/5RaA87FCsD7DqnIj/OpA4hLXpgi0qBTfCvhkAQkO0FnUYS00hV4gK1allvRwkXchKlBdr1FDRBTNdgq2GSNunl/Ntx99hbH331lJljBmpo5LC4jPIZLYhUgH5hz4wdcxH8YmGvE19wgPjYmWnsg== X-Gm-Message-State: AOJu0YyZzpF3QNavQUQRxQE7A6iR/s/O4Yed9j6Mt41/lbIiySLoSUGK 7QhV/gbsHe5K7HRDpjAvTS5S3AbyB1nm6HoQIjIKR7CVHaDmBM4J 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13748913 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80D531BE245; Wed, 31 Jul 2024 15:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439580; cv=none; b=AlWIa7YkfOqbHKlbcHKt2sWu2zmQ2NvAcBqQEct1AHNoA3p7hMQBa1x/G6R7xsIMFSU18IeWiw7RcabsQkUIG//eK2BUWNgbehjOQNDoN6+bdcdnuxaw1REAvys5fm0W5BaHSOgh3nfhjAQov9VorvZR9XU+xBmnF+b3DIPPa3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439580; c=relaxed/simple; bh=7ih/twfj7Vu9/nowcpH2q0+GyQypwWFRSVqFIt9jL5M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VZxiP/jMW7SGHhqB6DA3wK76X7tMMcMDHwi2NNO4lU/LdFaaWfGAAAF3jqe9lZjlfJ3qgsaE/Pdfmiejfwckgpl43JSo97wLWDN4I2ZgRk9CQ+MDtYfBF/iz6hlLjo7hP6Cy/9QnEzJg4dUrWy/hVJxLzN6X5ZdRKyPqVTbHxxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=naUzGYF6; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="naUzGYF6" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2ef23d04541so71019181fa.2; Wed, 31 Jul 2024 08:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439577; x=1723044377; darn=vger.kernel.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=naUzGYF6rIo9kAgKJebJ9oT0iyk6ka+rxFIRUMXobPf3brJ7xyWapQTfD68VHwdfLa 4PsOW0hBMz1emgJm5lhAOL9t+aC2xJx2azY+S/GdNgbngydXhLMxw9sJCwfKZqntNMs8 eqGNPPgNgebb318v69dzKkQ9mm1iOdQea2gTr4s2h3FwA99XEACuhG/k5QmRSc6E+teq CthJgYZBwUEdQQgp+eCUMP8p6EinQdZSXs1p82WIUX0Wp+fi6+hN08f4WTYP/SszYsZp 2AoHe7DFsv/56T7k73bc3r6BIzOxMLefdULfxObk+X1ee4f9BKUuD7ZNeIRAADYciNif aDFQ== 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=l36eX8Is1pJEUWC8/t16EhKHXFSsKnVnlKM1bK+wwsenbqpXHg6jw2NaHjiiHt1js8 xgcv4Q9avg61/V+cHHB+b2nLRF7TQmNte5/CUan6ouHRkV3p2vDRWMeuDC7JeJCpsi5E 6HOnpvicxttMpWG/nbreQTG8Y9fduebUzzNLmRSgpVC02+0FXWi5MVC8873n+a30xQfY lCNeAmwpkUcQjSuOgyE4HQ3tZuCuX0hPqmZy0n4cduBTRAdnYQUGW5iFej4/vjvMrUEJ m0x1qSpursVPJWX/TtYfXFsnE0rHtjdrTCWj7F44Z1x9HkZc7yR9jPRRy57otn8FLNSu OnnA== X-Forwarded-Encrypted: i=1; AJvYcCXt9VLTnFl+Ryu9YpgwFsfOu961oVd++B1K1XVW5mYoeVgi/5T/cAuJknMPgxMyF64UutVdbcjWrAs7UESqdUB/GBMB/1EdURSWogZ3F5zH7cV4nAyRsLagNecEV+wRPA+3Df9kiUmF0g40hJEBMV/eAJp5PdfYROmw8j0AEAbAFsIOfT3BPkF0qF5s8BOXdyU0z3zd1T0nVs1Gnq0x9UA4lCQ4Eg== X-Gm-Message-State: AOJu0YzKwI2UFicgrKH7NYpQzpd2iTxT6Zv29IekP574w2NEV7VPMc07 yVLF4pp9FwQThYVfR1p8Y7D8ZALowW9rza2SNitADVRicBZDJ38g 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13748914 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 690D21BE255; Wed, 31 Jul 2024 15:26:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439582; cv=none; b=BQsknGsx37MPCw43ZeJp1P3KF7LiSwuoKVkEIpV09TDa78Eg4XsjKZpqU0WityEZ2nW8k2feKvci60AozGQVaJmiFkYrh3LVxX045hm1pYddZlxznMZi5b3KZnQcxHoNtr3pCuffk4YxxGWNcU7AdZUx1yV7hM8FHy+rzj27pWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722439582; c=relaxed/simple; bh=rmwwYOUTvCDddLDjHz/8Ej1d+CDtpGbxfwCt2PfUiuw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iRBslJ4lnZgLdUIgLBkhIXXMuowrY+8zMmdn2WrmI9ZtWYyEV4z4abxF9SmiBjrWwgYskw45i0614veunnohi+lMZmrQRIlmXjeu2CdHsg1X14PR6w4qTkvuNCBkQAICywQyWsYJ0NLc9o2ckH3VcII6tuRU6vZL5eAnwSYdy58= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ijaeW3FS; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ijaeW3FS" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4280bca3960so38653205e9.3; Wed, 31 Jul 2024 08:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722439579; x=1723044379; darn=vger.kernel.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=ijaeW3FSBEIz0MVESetpW6q/RykcTWKfE+7nSUB8ZCHwIMHnPiyuW5c+/3dgROy1VD 6xBvHgTcY7YXJa7QTCeR1A36lTPw5duIxZ0j82d+H3gap6BxArrIc4oIdFqL+6lxJRxj jrIez/u2NKgee/rkmkqthEoSUVLX35Go+wer9oqOxAglY/MCydrIw6qR79cSXJjGTUTi r9KCRdCVdiqfow/8kGj2GYqJIigIp5WuzKgScncAEKrJwJVyIRbsZ+itvWXFnAvKvWs+ g3CYGOqqFutMzUup+2p7vbK5lvbTesJJR2b87YmC2+pg7LUKnkMA8uWRrs8gXW708pzd K14A== 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=lAw5jZxAN4V/u05CjKEugMkdobXVInSIT+EPl0j2uvzB1CPp3wR9LO4TanQA+xQeAA PlXMBWO/ESVwZ1b4p+pj7BcHcGCJzVRMLo/KteIANXvCIl54kscy+1u6OtUPZFsmv8xL aD8gD1Ho/N+BdMns+SlHGy6tIP2BEvnTL1El13Ys1H7o3PIEGZmRGR+wNc8KaV388upY 29EMsagA153KbHtfbfMBPa9oM4kUQLODHeY6ASvutxseL0bSgKNfdOKB4fbsKrk1qVkV JXakjCoQStk9eCTJZp6/C2Jqb0qWFvjlxlpMRvX7Ff92nytWB0LRE0KiBFtGuQR/9VM9 eizQ== X-Forwarded-Encrypted: i=1; AJvYcCVpX4lxKfS3bG34CzeHMsofGpZ4V0wXAkA8Eppdmb20K9X9MvnbjjdNev4yWesK3zc5QyOuUOilawvC+76WVlCVDDtj3kdrlLkR0MpdA6bYJtT26g2mF+VB8cYzNZVhn4UtVErhj7+XZlrzaf80D6NzvdqWSLM//xQrfbo8CvIAl4mF8LrXDuaRjpcsWXetSaZ22MjNQf/zCW7Yeupakvbtfh59hQ== X-Gm-Message-State: AOJu0YxGqF4yNK7KHemiBRtVVf1FdoakPFTw7xjsJBFZn4gssfZj6nSv ByNRhJp5W/B5qAOM2Lf7mzeQPzcGXTHF0xZa5AqBiorqvvGGHkj2 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 Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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,