Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5282390rdb; Wed, 13 Dec 2023 04:37:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIHHBqKedCsK45rbTzxG6BnETI611Gm/MyRrH78F7JvnQp9eGuxgquLJtdPJQpuQU+u9Cs X-Received: by 2002:a05:6a00:1798:b0:6cb:a93c:dfd1 with SMTP id s24-20020a056a00179800b006cba93cdfd1mr9469567pfg.14.1702471025684; Wed, 13 Dec 2023 04:37:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702471025; cv=none; d=google.com; s=arc-20160816; b=vWwZIgAEDFHuV5qFsE7j1pLrLOtmDnMIEHjzrnOyDMDzyfOZkOsh+QaYgb+RHEpTaq yIjYSnaAY41/+/UAa/OdGKxeUuqPo7+xa297sNBgR7/WlM8nlo/PlA1ZpW+nxTRhvHRa wkHpi2GDqLQJctY6r6wVtWmNWa6/Gahe7uqnvfpCbfSrzLgiydJ5yUHBAetOZ87HdfOr 9ScqvocSmggLVTAGVyOLgKC+XSHd3/LjEUjLET9kCBprZ/xvMw3tHKJXXHDhmOHXhoDp SJuCyrnzbiAwQuLyHx5RL+MEkqwh2swHwLR8vcZ5oFPUOhTvewweetu31HJHXLBuRccq 9ArA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QZihwxl0v63j7g6/9Ub3zyT34OyL1Z04NfBICmYEzJk=; fh=AjXMO6p+MtnAhJgZ2dXRvhWyXDMGQ+GS3ooIwv5cGEg=; b=PZVlRwHc9UnsFsLl0Cba1l+keQDrMbiWkqckT0uAZddWcClIX8X9dzXUPhpCDO5Kky KPL1Khma+fppWD2o2hd1mKv7zlF9QuN3GA2yzq6M75BGMDzmMoVH3244uQxtPevcMYTn xSCIexG3wE89S26ZsgHjGz4lIR9B4ryojcUKezJfGdIIyTbIKIIwGCwUZdY8Hk/0EjUm cF0XTtSbXVf5Jji5Jq1+nCTO0rQcfcmJHpwVAM2+lGCHicldkGaHXCrvgOcfJG8JpZEO keRGNb1wrz8mgytI0nlLEl2QlxuElUOpvdnlrrIbuW7nI5zvlTquKGV51QT9R0vobTip HISQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Yjqi5CFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m7-20020a635807000000b005bdf5961826si9294194pgb.136.2023.12.13.04.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:37:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Yjqi5CFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 230CC80BE2D7; Wed, 13 Dec 2023 04:37:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233444AbjLMMgq (ORCPT + 99 others); Wed, 13 Dec 2023 07:36:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233437AbjLMMgp (ORCPT ); Wed, 13 Dec 2023 07:36:45 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2D79113; Wed, 13 Dec 2023 04:36:50 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5c66e7eafabso5634605a12.0; Wed, 13 Dec 2023 04:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702471010; x=1703075810; 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=QZihwxl0v63j7g6/9Ub3zyT34OyL1Z04NfBICmYEzJk=; b=Yjqi5CFL/PE1vUIRj+mjZ9GU2RM3WNzdRqOYkNos9IR7UrSyzqIweP4xDOci2mtN8m x7fzCQFwFNv3Sju6HGgVcCj1bDF5qnaP6bbwSu5+852srDk9c15JL/1XNZAzNR1NZtMR p+PuaFRpdGs/9KhuWZr2mUIY0746h4uiru7ofstA2gh9vaRJxVDD1Mq6OQ5GCyIIop89 uZwNL0vCIQZuY5Alc19fBOvgTasUwg8YGA/YiKyJAXAnsCS0v4St66GXAZ/YhgAMhR+e FJIeL0P3zGcZ0/3UML9K19A1gQ27m9FTU9edyFFxtIIoCObb4a2LWkN3W3sRkUZFOfHa g8MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702471010; x=1703075810; 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=QZihwxl0v63j7g6/9Ub3zyT34OyL1Z04NfBICmYEzJk=; b=b7PFkwGb9XpAPzkzlhGFnrnGPdSgSK0C1B7iaFw+fuk8RexGjpWcGCNee0HlID849F E75tNjnGIy2zScpKLcQvQJmxJxUPrRqU5yF1fUJBBkjud127DavOw/00g6lVH6xu+Mg2 UK1UkEdCzl9eCTUzeq83+m795YmN5IhOGk28iiIf4JhQITRZV1KFDKArjWECP7Ciq95P 5d5FTvilFOKPDK+W18/MnzfJYNzYOPQqe3fn2RSRlZTIgiOGmwp9Aj28bgeDfTrq8lU8 lWHwmQRH+JjmSgCQ0TJqHUkdJKaBVoqNpN2bFei9ADHuMkJOItjeexYDGnE+jmaxqWJ3 U8Xw== X-Gm-Message-State: AOJu0YzpDhxJog+QEzY+1QwuO9SzOYOi2oJXRJUcvzH0yhHm307qCKr2 vTpSLbN6MUTLV9iKjOAdTM4= X-Received: by 2002:a05:6a20:9481:b0:18b:4a28:6e15 with SMTP id hs1-20020a056a20948100b0018b4a286e15mr8029288pzb.34.1702471009861; Wed, 13 Dec 2023 04:36:49 -0800 (PST) Received: from localhost.localdomain ([117.189.237.103]) by smtp.gmail.com with ESMTPSA id x3-20020a056a00188300b0068fe5a5a566sm10193584pfh.142.2023.12.13.04.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:36:49 -0800 (PST) From: Jianhua Lu To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Jianhua Lu Subject: [PATCH v3 4/4] ASoC: qcom: sm8250: Add TERTIARY_TDM_RX_0 support Date: Wed, 13 Dec 2023 20:35:56 +0800 Message-ID: <20231213123556.20469-4-lujianhua000@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231213123556.20469-1-lujianhua000@gmail.com> References: <20231213123556.20469-1-lujianhua000@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:37:03 -0800 (PST) Add TERTIARY_TDM_RX_0 case to make speaker amplifiers working on Xiaomi Pad 5 Pro tablet. Signed-off-by: Jianhua Lu --- No changes in v3. No changes in v2. sound/soc/qcom/sm8250.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/qcom/sm8250.c b/sound/soc/qcom/sm8250.c index f298167c2a23..00c89c073e72 100644 --- a/sound/soc/qcom/sm8250.c +++ b/sound/soc/qcom/sm8250.c @@ -16,6 +16,7 @@ #define DRIVER_NAME "sm8250" #define MI2S_BCLK_RATE 1536000 +#define TDM_BCLK_RATE 12288000 struct sm8250_snd_data { bool stream_prepared[AFE_PORT_MAX]; @@ -53,6 +54,7 @@ static int sm8250_snd_startup(struct snd_pcm_substream *substream) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); + int ret, j; switch (cpu_dai->id) { case TERTIARY_MI2S_RX: @@ -63,6 +65,23 @@ static int sm8250_snd_startup(struct snd_pcm_substream *substream) snd_soc_dai_set_fmt(cpu_dai, fmt); snd_soc_dai_set_fmt(codec_dai, codec_dai_fmt); break; + case TERTIARY_TDM_RX_0: + codec_dai_fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_DSP_A; + snd_soc_dai_set_sysclk(cpu_dai, + Q6AFE_LPASS_CLK_ID_TER_TDM_IBIT, + TDM_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK); + + for_each_rtd_codec_dais(rtd, j, codec_dai) { + ret = snd_soc_dai_set_fmt(codec_dai, codec_dai_fmt); + snd_soc_dai_set_sysclk(codec_dai, + 0, + TDM_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK); + if (ret < 0) { + dev_err(rtd->dev, "TDM fmt err:%d\n", ret); + return ret; + } + } + break; default: break; } -- 2.41.0