From patchwork Mon Jul 22 09:51:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 13738605 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 4E4AB16CD0F; Mon, 22 Jul 2024 09:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641940; cv=none; b=oCKRMT1kkn4/nJ+/BAZMfqo2H2xPpPLGMKbyvIoXQrt+E50fuhRLdy+uaATcj386UcaCxi0/e45vHw7wwmsfz4hvzQN/xV96xtpHmPb33N9WshmK4mxB+OIqGrzGIK6uDJ5egEbmnJDyrYYexITnkx48mNVZJNsKz5oT821zvsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641940; c=relaxed/simple; bh=ElxwyvAYRep8iP0erjBmNwM65GYITd2Altmm3t3OTiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JGkUPa3/yce08OS2l3ouVLkO1oFbBYN15Furt9w7A1UHLwNxEhlT3BLrfgDfXvLGORxKP1jiX6i1tSpYuFgKJD2pNHTHDv/NiqnxZe6de5P+eXJaDzygpQ5GtbhYN9ZEnZ7WPKUz006R5kl6bwS2RTxAR2pUNAQK7flnq89O/gM= 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=Rswypx2g; arc=none smtp.client-ip=209.85.167.44 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="Rswypx2g" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52efd8807aaso1824654e87.3; Mon, 22 Jul 2024 02:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721641936; x=1722246736; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c4l/632voSz6mCh2TqLV6xqS8GDhLDgECY3Nfdz+lQQ=; b=Rswypx2g/C14AnGP6lxAU/wRNgpuLzuL0nLH4BKuUPn7SMkxAT3zC1wvkw/X9VChmV kmNv6aY9v8NBq40/fUC3OIZX+RIBqdcI5Z0jSLtiPdhuH/oGBhuH4d0qcPZk0d7byqQ8 K4FAwNaKFMxPOZNfutf00VA/RBp1IB/dL8T33XYau+WXdr8Pk8N7KgkjfTJ6EXvS3LJ1 2fV0cTwAti7P6dXl9fhLnlc9RSSAt2PN/4JQO2hK9T6C8Mmz+QQTZFDY4m1EQGRn8GrM 5FeFgS7sPpmA7SB1IMRNp9a/ObGuNOB/TNhlZxN8A3KJd5NqCTwCPzJbI0MleNnAAoC4 mTiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721641936; x=1722246736; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c4l/632voSz6mCh2TqLV6xqS8GDhLDgECY3Nfdz+lQQ=; b=AeCzMXLYc/ifK1ynvNiqDEGTwyiH8shzTKPEGg1i3rSbT8DTP/tleo0o+ZHrIJM4ug xmWIbJvtqfL6lucdo2Vr9REo8bnO08cbRD19Vj42gdKkpPYU4uE2QXDxYlMCMVV5Gjr2 3tBaUL04JLDYYoXE1cBTyUo/3u2u5tKEYIqb0mHy+uBfUjTLkyCH3gdMCx1Z5RLbzgP8 PmcB/DxFr96u9FOeK1MLJuSNq9goUbbcPPJqMu2p1W81gN44KWVC5AAhndmihYHU2yTO a59DkCzMOV6knvQLwDzhVaMLdrTr8wcJkY1dJmjRmzuXGg3D74gTwsAGLty3OH6lj3f1 M1eQ== X-Forwarded-Encrypted: i=1; AJvYcCU9AfVXfmTvcUJAJhXrmWDa1TPlTqikmXRHlLajdJKKeyHZr6sFCx9JmRyCb34SukzGEu74WmWdn7sEaIVtBhgaMP5zgKpzldAo9lnVkE0wn4k56wiYb4pEKhLfaHphhVUDxnDR8iAUUOY6zbioQ8YAzfdgvJl1I+9qs3YYvR+3jTRAkIKJx3IaSEIdJf0YQg5qFbRcsFsUvaJ+E16+F/mCL63ZZQ== X-Gm-Message-State: AOJu0YyHSA7sksV1T3kYAwcJuvD1w6som1FmuYxc90reYVuy6yNXYlm7 VTjeGW1tLk2TWWKCuqFtUvyFQ/pSYLVb/aehQCQ7NynHY6+uv0EZEYiPJdnY X-Google-Smtp-Source: AGHT+IEkUCQN4xvNexHQBngyKo1Jr+lRR08xYuntYXjmUoolBteeZ3Gzo1t7dPmmD02D9Nfl7fIeHw== X-Received: by 2002:a05:6512:1289:b0:52c:80f6:d384 with SMTP id 2adb3069b0e04-52ef8d85836mr4304130e87.3.1721641935595; Mon, 22 Jul 2024 02:52:15 -0700 (PDT) Received: from localhost.localdomain (byy214.neoplus.adsl.tpnet.pl. [83.30.44.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52fc226cdccsm91552e87.164.2024.07.22.02.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 02:52:15 -0700 (PDT) From: Adam Skladowski To: Cc: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Adam Skladowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Lypak Subject: [PATCH 1/4] ASoC: qcom: apq8016_sbc.c: Add Quinary support Date: Mon, 22 Jul 2024 11:51:05 +0200 Message-ID: <20240722095147.3372-2-a39.skl@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722095147.3372-1-a39.skl@gmail.com> References: <20240722095147.3372-1-a39.skl@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.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 --- sound/soc/qcom/apq8016_sbc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 3023cf180a75..8971f4f5d339 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; } @@ -320,6 +330,10 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev) if (IS_ERR(data->spkr_iomux)) return PTR_ERR(data->spkr_iomux); + data->quin_iomux = devm_platform_ioremap_resource_byname(pdev, "quin-iomux"); + if (IS_ERR(data->quin_iomux)) + return PTR_ERR(data->quin_iomux); + snd_soc_card_set_drvdata(card, data); add_ops(card); From patchwork Mon Jul 22 09:51:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 13738606 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 8A2E816D308; Mon, 22 Jul 2024 09:52:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641942; cv=none; b=tRch1SQEtvyVnUEX0yDGVz/SNkINTOqc6Q2B5G5pQ1dGBlbfBzUVjwKllM8a4jR2OHTG4tICVG1dUq127aJttPGjXqzE6HWOiCShcUfk90aJR/9JHBhPeSjyufQ5TNtvVW+jf2cTUbIh+pLADCQJkh3W3SPbcmKlNGXT6JgLTko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641942; c=relaxed/simple; bh=EFy7tExuqG9na7Q+Y80CJaISj3tjIZbe4+zf3f1TTaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lkbx+735G8/2uNeDvtzbnXk7iz+KISRIo/INRkXHYqrVtedXRFntGjOjgvOOaIZjf8OIxC3vFTzcHJzVCVcWfL5mHJcNDxO0GrC4lRe6lnor5u9f+GDfpwRmdfSPwggVEormkiJMuq9UtYqdefT7pcNX2pMqVMKPrY77/O9As4A= 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=bqu93y7d; arc=none smtp.client-ip=209.85.167.44 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="bqu93y7d" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52f01afa11cso1589688e87.0; Mon, 22 Jul 2024 02:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721641938; x=1722246738; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GF6xFxPj/ytlezNbhhUqMrRGdstZMHpzQeT2XWw6wjY=; b=bqu93y7dBe6371DIGkBkVawt8R8SV7BB3RC7L4LYBSBLmfKrOTCqQV6k2q/2z6q6x/ XylenjnDZD/3LmZgi/ADqy5tfs5paV6O0tkE7mU7BB1nESWe/ms0p0NNNyDMVZXYWfwp 8MwykmvuFlKsuz13LdvYRWL+sNqKxv7rOzbrmv2k1CsKfu7oVxiZhdud/9ScapKStylD Ox7pcWEgHbUN92QrM5/XW6N+f8A9CjCvTINadOGJMafEI8yC+qBAWFM+XPGdlrdj98KW xOnWDolTsOiHC9wUK71G5l763HhYHCmQTosd99HyMBumlyyfsjT07gGJz7HiPPm5gCEL SdGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721641938; x=1722246738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GF6xFxPj/ytlezNbhhUqMrRGdstZMHpzQeT2XWw6wjY=; b=j1hoLQbnZlK1ncCdwfkt0L5q9f3JRFGa6dFWm1xynjdoaLdF6PK+etgF9LPHB6W6tl LbS64Tp51a5+IASFPK3tu/UDAY3xUnm0v8/rK3xQP2G3urZU7u8WiSEn3kxkvE63Uy2k aZVqmMYMZ2JdtNgI9x6NZSFlXVfbymZ6dZgNmKR6fC/HXYIZ1fo2JIYUZCiE4JI7jVWL obbdSJ198qxPkxnKDhZygxtIvDCLdjswohVIInd1aTXSOsYb2VXcgairQ73pUC+QhwwD f0hErAjHpNchqBRV8nk7n8G9QkAwBH+pXsw1p4msLzDH70vB0NoDLTJWNMHydX+HCsNA C2uw== X-Forwarded-Encrypted: i=1; AJvYcCVLc0ZF/UtDT6LswWGN8/c1LEBwedZllYQuakvReNxhXOBfYMX0/HFZPkJ/pPPLLimrEEiV7s8FRq+os6Q6WCYjr4Ih4Hdwtd39E4SGQCiHLyB1Nz4wfp21GfgqGwh3w06UH9yN+A0JY2l96n+B+flwG97PdZweCIa8gEXYhtofTsOyXgkc+BgEAtoH/5E7FbaRp0rGIp5tJ9Dgr0kaaq2NA6x6qA== X-Gm-Message-State: AOJu0YzWR+xjAseRGkDI2I95XcdEXGwNowlkkBU7wrIESieadeYTjhnG BEaZ17fQgK7ILu/xlAowDo31zPKSzjbFU5TbSgvKYLY3SMZYGe1aZCh2DpOs X-Google-Smtp-Source: AGHT+IGMjXFxraEsXHIkxYNkndbJxB9/sBbeVo4mr3BgdM9QyhZYaPDjmM+IUr8WAtpuoBhZAJ6eTg== X-Received: by 2002:a05:6512:1327:b0:52b:bf8e:ffea with SMTP id 2adb3069b0e04-52efb7bf318mr4451648e87.40.1721641938089; Mon, 22 Jul 2024 02:52:18 -0700 (PDT) Received: from localhost.localdomain (byy214.neoplus.adsl.tpnet.pl. [83.30.44.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52fc226cdccsm91552e87.164.2024.07.22.02.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 02:52:17 -0700 (PDT) From: Adam Skladowski To: Cc: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Adam Skladowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Lypak Subject: [PATCH 2/4] ASoC: msm8916-wcd-analog: add cajon and cajon v2 support Date: Mon, 22 Jul 2024 11:51:06 +0200 Message-ID: <20240722095147.3372-3-a39.skl@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722095147.3372-1-a39.skl@gmail.com> References: <20240722095147.3372-1-a39.skl@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Lypak Add regs overrides for Cajon(PM8952) and Cajon v2(PM8953) codecs. Signed-off-by: Vladimir Lypak [Adam: Add Cajon support,add msg] Co-developed-by: Adam Skladowski Signed-off-by: Adam Skladowski --- sound/soc/codecs/msm8916-wcd-analog.c | 63 +++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index 9ca381812975..daf65f5d4e99 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -250,6 +250,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,12 +265,15 @@ #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) #define CDC_A_PERPH_RESET_CTL3 (0xf1DA) #define CDC_A_PERPH_RESET_CTL4 (0xf1DB) +#define CDC_A_RX_EAR_STATUS (0xf1A1) + #define MSM8916_WCD_ANALOG_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000) #define MSM8916_WCD_ANALOG_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ @@ -715,6 +719,50 @@ static const struct reg_default wcd_reg_defaults_2_0[] = { {CDC_A_MASTER_BIAS_CTL, 0x30}, }; +static const struct reg_default wcd_reg_defaults_cajon[] = { + {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 reg_default wcd_reg_defaults_cajon_2_0[] = { + {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 int pm8916_wcd_analog_probe(struct snd_soc_component *component) { struct pm8916_wcd_analog_priv *priv = dev_get_drvdata(component->dev); @@ -738,9 +786,18 @@ 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); + if (priv->codec_version == 4) + for (reg = 0; reg < ARRAY_SIZE(wcd_reg_defaults_cajon_2_0); reg++) + snd_soc_component_write(component, wcd_reg_defaults_cajon_2_0[reg].reg, + wcd_reg_defaults_cajon_2_0[reg].def); + else if (priv->codec_version == 3) + for (reg = 0; reg < ARRAY_SIZE(wcd_reg_defaults_cajon); reg++) + snd_soc_component_write(component, wcd_reg_defaults_cajon[reg].reg, + wcd_reg_defaults_cajon[reg].def); + else + 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); priv->component = component; From patchwork Mon Jul 22 09:51:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 13738607 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.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 D542F16DEB9; Mon, 22 Jul 2024 09:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641945; cv=none; b=AH4bjIyXShH4BZsH7HdKe5AX/r2WtFMlrDv907dv2fwTAn5DO3jV3wu7XngtGuVpkF6Nc/ZJl0xvn1KJ49vLj2AI62YfrytbjES1oXjDjj27xh2OJSqjUZHior7ijDvfN2lo6L4ZWMqxkHSXVxLzwZydQvqWcczPq2KShajXKzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641945; c=relaxed/simple; bh=KRsPJdZcwmK3gbwOR0QFyaoTgSYfTVGDmjEFVejhQg0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DyYpqwMvaRNfLCo3Xy4whqWKlIJNFPnY3C2VCQR7784qZMNMRrW8QXb9utAO6Q5ophj0fMIJbQoGDCWY3DWTy/FdEPZNXy1x0ezc1ovwioQt7yh7bQw/7BNTsJp9KYs2zy9efE4siBK5ExPMgZ4xAqQG+18aa1TXvt/0756oGYg= 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=fJ1b+XUv; arc=none smtp.client-ip=209.85.167.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="fJ1b+XUv" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-52f04c29588so802017e87.3; Mon, 22 Jul 2024 02:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721641942; x=1722246742; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LueQvPp7jIsOu7JwwYrAGJM7gILiYRCDnqZjPBjPXPA=; b=fJ1b+XUvJBooM7Uy5lEHypLNpiUoeDirm7wOP1D4Z2aJU/OSygHtU7xrI2UsGrVZI0 WYyUslqHA6bVdzaYSOxcP8n6GlvlSi/ZY13tKb309emGp9ydC3n/akjevfOC3sEqPr/m VGImAAzYuZ2y3oSGSqH9tYDuLnkiB/t3NVQZuB1MyL3BPmRUtMXHipiGr3w7C7pok0uQ xoSs7LO0IbNtMwPDBPD8jqD/LG2Sh9aX71tjFCYKfttRbRgRiJY7gLVV7aLYkf9XSHpr JUMhZBf21eSjR5aTRFbqr2GG8T9qyMokKAMZamdROq+54pU7uSeEly19FizSVZHlYJJD VxyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721641942; x=1722246742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LueQvPp7jIsOu7JwwYrAGJM7gILiYRCDnqZjPBjPXPA=; b=IChc1jrX2vO3XpfAAbE+JGo7lLC8O9EmMzESz3c3DZqH9ZnCbasXxNkcbpw+zHMqMu Cat8O0o+GSRPtFMh1rvda09n4ReAT8pZQqXL8V9fOqhg8wuAcdwDPgEt8qW214EI70eh XPKBHGxj7cyaXQJuFUg9c594mTRXh7mgOU8fqc5uwO5ByMEh2af2mF0kqtYwYXK12tK1 D3mw2yNkrJt/0ZkFWZ2lzNCwaE6JSwWjzk67J4vRRK6HRzOUSE4KLNtlES8MckQm/GTk BUDCHFL+BAe7bNmcH/2ZDFzjtx0ggtge1/bvH1w9lkcOHsTi1TiowF2DG/OSuK92S/p0 20Mg== X-Forwarded-Encrypted: i=1; AJvYcCWSFBqfq0ebUXRzcK/Q2WmTW2ZVMn9XdwyKPTwX0Q/YS3ViMineA+tv2gEwjExBdegu5OgUdsrCr1eMYy67cY+1vfawx5lCG1dBJ6LEzVo+aVkiI0RtlSpXNQZaGK6vTZsGrgV7D4yGsWJpKrCzhW2758bf6SszkavgYb9u7jXrWSHI7v2It5ASXBbjIi4s+1rkYIN+2uMoYlKzLYEL7WNuEEoCDg== X-Gm-Message-State: AOJu0YwoyejkjW4kJPLtaXYdrqRIUns7yCt9UCRz6qzM8BXPAP2dYpDT LLH+49NqZTTJB4p4UrDROANFgS1Hvjh5GmROPlJngiyqcVdSfxQBn+wINDlt X-Google-Smtp-Source: AGHT+IFEAj1t++gm3u7tMYWGE3y1vx+XHwQtuisG9uc4Yr+MK+jmP04CRcVD6fbhOpk4+urwoo37lA== X-Received: by 2002:a05:6512:2826:b0:52e:764b:b20d with SMTP id 2adb3069b0e04-52efb7e1281mr4257344e87.28.1721641941605; Mon, 22 Jul 2024 02:52:21 -0700 (PDT) Received: from localhost.localdomain (byy214.neoplus.adsl.tpnet.pl. [83.30.44.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52fc226cdccsm91552e87.164.2024.07.22.02.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 02:52:21 -0700 (PDT) From: Adam Skladowski To: Cc: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Adam Skladowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] ASoC: dt-bindings: qcom,sm8250: Add msm8953/msm8976-qdsp6-sndcard Date: Mon, 22 Jul 2024 11:51:07 +0200 Message-ID: <20240722095147.3372-4-a39.skl@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722095147.3372-1-a39.skl@gmail.com> References: <20240722095147.3372-1-a39.skl@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Document MSM8953/MSM8976 QDSP6 cards. Signed-off-by: Adam Skladowski --- .../bindings/sound/qcom,sm8250.yaml | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml index b2e15ebbd1bc..3b5f8adba725 100644 --- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml @@ -29,6 +29,8 @@ properties: - enum: - qcom,apq8016-sbc-sndcard - qcom,msm8916-qdsp6-sndcard + - qcom,msm8953-qdsp6-sndcard + - qcom,msm8976-qdsp6-sndcard - qcom,qcm6490-idp-sndcard - qcom,qcs6490-rb3gen2-sndcard - qcom,qrb5165-rb5-sndcard @@ -144,10 +146,30 @@ allOf: - model - reg - reg-names - else: + - if: + properties: + compatible: + contains: + enum: + - qcom,msm8953-qdsp6-sndcard + - qcom,msm8976-qdsp6-sndcard + then: properties: - reg: false - reg-names: false + reg: + 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: + items: + - const: mic-iomux + - const: spkr-iomux + - const: quin-iomux + required: + - compatible + - model + - reg + - reg-names additionalProperties: false From patchwork Mon Jul 22 09:51:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Skladowski X-Patchwork-Id: 13738608 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 2C20116E884; Mon, 22 Jul 2024 09:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641949; cv=none; b=B5jccEd3PwL/cQ+XWQwZBSWfu9LlCFYwGClwuRbEA59W5Ac6T4q8WIQTrEjMjr0uee11yGhBXcw/KGZtmE+GgqicPh83bbkd/mu1iOKmhEgbJiwiOQM6qSlMVwo55VMuLJSt2gFA3v7tVprcCs0bt60BTe+wLuUFp+zHJdv7UfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721641949; c=relaxed/simple; bh=L/ApIpFJ9BfLOmjZ356/A8+sGcAzB4WiLcEPhi10XKI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=plbUG3AAdQgv/FeALM1JqFxA7fgYMNRSxxNmuZiGPtHJRrmU6FwOhc1Lx7E5t1UwmDWPU0Bgj38UrXcYp3Cq8ARbtHs1YZROlsqZGOVH8dIFy9m7FnsTuM6xUayEYfjHMCXfECJ3ea/SuxovExJRkdmA3pC2ubOwTnx59eEe2rw= 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=jUEYtoQp; arc=none smtp.client-ip=209.85.167.44 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="jUEYtoQp" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52efdf02d13so1790152e87.2; Mon, 22 Jul 2024 02:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721641945; x=1722246745; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dl6ci1X9H1bocspAYVTPwqDYk40+i0zlUVaPzwxman8=; b=jUEYtoQpoRGKzaJvIq5X2V3U5vsgXwvFpb0f1ZZSaNXbJb6iDjyszVFelV5WUWdzDN gwAe7Kb92iheLmgtMIKNaIZcRH1815StUQlRJL8DqC0C9rYMpk5uMtAqztiVCgI9b9Jl 55/RUSBAxwZ7kklglLMdbTcOmXa9NnTCrdjXXuenwuMlnua5vc3dbYI1Gqs2kylITix+ QCPWSlwgE8sHdQPmqJALa3T61EdVmDIn81Q94+n3XTaXAc7Pzu+EH46GnIdKtC41VhrU KD7D/9Poy/LrztzXCOE1TYlVfIXKNdnfhd7Vjjjyq/95ldNFfnwG+9fjuRqgYEBP1pzK Hl+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721641945; x=1722246745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dl6ci1X9H1bocspAYVTPwqDYk40+i0zlUVaPzwxman8=; b=jFZCu6GtouPd2196EQtMC818X/GPOLU2HL4f9xmniL1kwVGr6BDMXP9vRCMBEADsDE GjPH8xZj0zeF6NEticj68Tcpu04JHBrVJTOAtnWr/pTTFhuWpcwixSn8O8agulU2RlPh zRoSgnduKv+F1XGO7beh1Zncr1gU5g2OFr2i0HVcBYdAMTVNzFq2OdMKu194bSY1DTTH H6UWvKN4DRCqHHacWwoEgirODYPW6MgdM64NrSrqnhlWG32kTzTU4bJ/aMDVb8Ys+dTR yclig57kYkO/WEBlzK+GAFwlS3W+4jtNq56j0Bu88qqArFN0Cb/vRgAQrXUlUMrFC3xS mcdA== X-Forwarded-Encrypted: i=1; AJvYcCW0Ouf7UcS7Kl/Z2+w5bmnOAs/RJgyOp2LZ6iNjB0gxlWJSXMTkXhQtx/OSvz427YKAXPGML/2/QqnNDmFBUlFlnCtDllM6FQyxEn0749GUVBq+fp3fPpehe1wdyPw+eT410CcYfbk7VKovq5OuVgSKj+tfNB3WO2ei6WT1MfiutkZqTRcwYxgOZhv4IIynRNzAPYe2zY4pL84t0vLGqO75Osv9Yg== X-Gm-Message-State: AOJu0YzRXAQRFq/CLE30un1DNDmCWGMPPHoKPHbAW6LukLxGQdSHsnrY V5DxqNztis1UJqVlK0AMd3zFE+KYztqJvOPrQ86WfAO/+uJIDQuZONM/zUya X-Google-Smtp-Source: AGHT+IHiwNvnwn1Ldydw+/A3gbnMJ79+Ia18db3RGXJpSUtCeRrxw/7o90BQd8QswtyBBxDk+Uh7pg== X-Received: by 2002:a05:6512:1250:b0:52c:db76:2a7a with SMTP id 2adb3069b0e04-52efb74c166mr4664718e87.34.1721641944859; Mon, 22 Jul 2024 02:52:24 -0700 (PDT) Received: from localhost.localdomain (byy214.neoplus.adsl.tpnet.pl. [83.30.44.214]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52fc226cdccsm91552e87.164.2024.07.22.02.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 02:52:24 -0700 (PDT) From: Adam Skladowski To: Cc: phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Adam Skladowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Lypak Subject: [PATCH 4/4] ASoC: qcom: apq8016_sbc: Add support for msm8953/msm8976 SoC Date: Mon, 22 Jul 2024 11:51:08 +0200 Message-ID: <20240722095147.3372-5-a39.skl@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722095147.3372-1-a39.skl@gmail.com> References: <20240722095147.3372-1-a39.skl@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Lypak Introduce support for audio card on MSM8953/MSM8976 platform. Main difference between those two is Q6AFE CLK API supported by firmware which influence way we enable digital codec clock. Either inside machine driver or outside via q6afe-clocks driver. Signed-off-by: Vladimir Lypak [Adam: Add MSM8976, rename functions, add mclk setting,add msg] Co-developed-by: Adam Skladowski Signed-off-by: Adam Skladowski --- sound/soc/qcom/apq8016_sbc.c | 66 ++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 8971f4f5d339..51efefefe0a1 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,8 @@ struct apq8016_sbc_data { void __iomem *quin_iomux; 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]; }; @@ -192,6 +199,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); @@ -214,8 +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 == true) + 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, 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,9 +273,15 @@ 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); + + if (data->q6afe_clk_ver == Q6AFE_CLK_V1 && data->dig_cdc_mclk_en == true) + 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 = { @@ -279,6 +322,23 @@ 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); + + pdata->q6afe_clk_ver = Q6AFE_CLK_V2; + msm8916_qdsp6_add_ops(card); +} + +static void msm8976_qdsp6_add_ops(struct snd_soc_card *card) +{ + struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card); + + pdata->q6afe_clk_ver = Q6AFE_CLK_V1; + pdata->dig_cdc_mclk_en = true; + msm8916_qdsp6_add_ops(card); +} + static const struct snd_kcontrol_new apq8016_sbc_snd_controls[] = { SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Mic Jack"), @@ -343,6 +403,8 @@ 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 }, + { .compatible = "qcom,msm8976-qdsp6-sndcard", .data = msm8976_qdsp6_add_ops }, {}, }; MODULE_DEVICE_TABLE(of, apq8016_sbc_device_id);