Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3857802rdb; Mon, 11 Dec 2023 01:54:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWQdBBKSvvPtBNLz+AEor06Grb17wJLAD5v+6sfADelcNgCIyij033Sds/EQavfs1G1Zxb X-Received: by 2002:a17:90b:4b4e:b0:286:a956:feef with SMTP id mi14-20020a17090b4b4e00b00286a956feefmr3505666pjb.78.1702288468150; Mon, 11 Dec 2023 01:54:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702288468; cv=none; d=google.com; s=arc-20160816; b=je+2uW4L5KnFo1jL5iZsexBEb/G+bCCpPjto/MZ8Tllafz8DRfVTUzGwgumxsoVEdd 2T91bx+blBUZeEkAYVhILxxk7vNlIumd6otAogKUFvcI2PEx30Xf/6LTrRDpIC9vKU9+ +XTLArg+YA+ht6scS5AKbbWLdfYDVYepsPFH6h0rum2lKYJd83Ju2imncMEwK031Qhy9 UvMi1m7dfYE1LB2LjxTwx2w88kPm8jMQJrx8SRm6uHhTWgFAHt9h8dVBArAITQ/rRgzp oK1yThhBxa1wrMS9B+XSI0W4fpn/qioJA7RHfR5c4oExZHnxmZUfAVb/ZfzRov2FnRxb WTCA== 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=AA04sfNkH62YtYg6Nmq5x2j1Jcg5BYJtxmdnCLXGgCI=; fh=AjXMO6p+MtnAhJgZ2dXRvhWyXDMGQ+GS3ooIwv5cGEg=; b=w07wWJu1dC6NMvRGNsW6VUxUpHz2BFBqBK47mLlUIL1+aXv+lAsP4483zRsJTAfQ/x uPMWuAGyPnF65q9qb9Wj/E0AdTTkEkj0C25iNfg32rYAzyiIXA8rmmj4QtGuwFR6dkmB fsjtyW9A0qYZvymRSGoIviYl70jYZYHGmfdV94aNFzEkLyeMIgmSFUfp64AxCEpU9nBh /P/0/aoV9wK7TX4i/6hEEdwKQvlamwnK9EAVg662IAnuQaSUxvp4eeJdNp7nxtQzju83 gR18+Ay/NZJufIkfYmuC+0E7+O2OxgHFb2CXw0TnWKLjYGoJsW5fQGK8UrujBp9GB5UV 2PQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mrb5bq9b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id sh3-20020a17090b524300b0028a30507ff6si5442090pjb.150.2023.12.11.01.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 01:54:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mrb5bq9b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id A61D1807C85C; Mon, 11 Dec 2023 01:54:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234695AbjLKJyL (ORCPT + 99 others); Mon, 11 Dec 2023 04:54:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbjLKJyI (ORCPT ); Mon, 11 Dec 2023 04:54:08 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0E128E; Mon, 11 Dec 2023 01:54:14 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5bcfc508d14so3580295a12.3; Mon, 11 Dec 2023 01:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702288454; x=1702893254; 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=AA04sfNkH62YtYg6Nmq5x2j1Jcg5BYJtxmdnCLXGgCI=; b=mrb5bq9bp3XzapTLBupayEIyRgwXPGUJz/OAQY89hYHjUHJNnRMdWGDLZ4VMXFzKvf qei+E6U9kwoBVrDxp/UwoPzPoKt4g2bbOK+9EGyQ02/JFjRxQBktXlX4FkRT71z3ZLhY 0kQi+NsJAkGRa0E31W494VMcpucmsNjrxsM6XMU7HWUfCLTVgKl/vSb/fbH0zEIqNgwL hiPfqkH8qW7xVyo8tvs3ftaJ4wfx4gCGM6/W8S4rHjD+8sLwgQPLiySDw76koAyDVgwl HT6tcqGjh3NbvuAQoWkYN1AivIKZEfYWiJBMsCTSjPN1yjYqlp7TAe49cJERggctlZLN zU7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702288454; x=1702893254; 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=AA04sfNkH62YtYg6Nmq5x2j1Jcg5BYJtxmdnCLXGgCI=; b=quNPiv/hutHlwnjI8yO8uc+YJZDtafIYJDaBJhV0cyy7HccnhYBRDyLy4R72RcIVAo ILPkj/XDvFwtyB5dOJ2ptRi8gRzD9S7ow0ZiCQrVHvMdEay9G7p7cPdmYoq9ZrUB5o7A 0ueUU4s0GHp/G5ahmbdGXDAwW54UIVIqtFSF2bik+peI8kLjFj24eg3RsUo8x/Sn04Ht DIvK3ZSpWEWXDLwvrMtPAJ6X8pqK/59PduMw/vOAYKsrJz8/7al6Z7mGdOHXeUKNrUiB vMuKI+5GHIt43cwDYZ5ffubY3vBDW73lw0JyEb/+cPDg4uB0Zht/fkFR7b6eoevKYeXb ZILg== X-Gm-Message-State: AOJu0YzAGmnpE9cVsD8Kua0k13CLOz9D9B+2H8+A4T7zEJQ/Zs+TSNHN nRulFNp9zPxTDdSd6P+L7E4= X-Received: by 2002:a05:6a21:789d:b0:18f:df5f:d9f3 with SMTP id bf29-20020a056a21789d00b0018fdf5fd9f3mr6159341pzc.91.1702288454100; Mon, 11 Dec 2023 01:54:14 -0800 (PST) Received: from localhost.localdomain ([2409:8a6a:5426:70b1:a6fc:77ff:fe50:e63d]) by smtp.gmail.com with ESMTPSA id mt20-20020a17090b231400b002853349e490sm8149734pjb.34.2023.12.11.01.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 01:54:13 -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: [RFC, PATCH 2/2] ASoC: qcom: sm8250: Add TERTIARY_TDM_RX_0 support Date: Mon, 11 Dec 2023 17:53:57 +0800 Message-ID: <20231211095357.4629-2-lujianhua000@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211095357.4629-1-lujianhua000@gmail.com> References: <20231211095357.4629-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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 11 Dec 2023 01:54:25 -0800 (PST) Add TERTIARY_TDM_RX_0 case to make speaker amplifiers working on xiaomi-elish tablet. Signed-off-by: Jianhua Lu --- 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