From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D73C3C4332F for ; Fri, 15 Dec 2023 07:25:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 285B1DE5; Fri, 15 Dec 2023 08:25:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 285B1DE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1702625122; bh=JggYM8FWdgCSc1DopFNKb3Yiz7a2sGMoFPvdfGQaHV8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=PfyeE6J4XX8k0evqY172GnrGXGEqN+90/EFdyY+afHH01CNrVWDHScparUWO2SoAg 8azvJ9GH4QLYfn/kkjTEPxjfxn2CfNUlWtNjcMX2dPrPene0k6U7B4RvHA4G54MlmD RA6M4gItD0rYf86R992duxJN9E5tnD4HOtdi4okY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1C7E2F80567; Fri, 15 Dec 2023 08:24:50 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 27D26F8057B; Fri, 15 Dec 2023 08:24:50 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 308C5F8016A; Thu, 14 Dec 2023 16:52:15 +0100 (CET) Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EDB94F8001F for ; Thu, 14 Dec 2023 16:52:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EDB94F8001F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=igan6bac Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5ca1b4809b5so2143525a12.3 for ; Thu, 14 Dec 2023 07:52:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702569125; x=1703173925; darn=alsa-project.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=LJYbFg0YusLQd7kau+7yl+2+5aq7Aytpc7bFv1yVVFU=; b=igan6bacQexx7nPThvCIUo/C6VlwiXWpGEuQK5AMn1/ck2QXu0scyT7jXlUhlstOyd pljIoEY8tNdpNLnhMMz29yJe7T9H34Z/sYR052UUb7u6k7yGjOp2V3rQLRrheCvgxJDg N0tnIuWXMmMIiKzDhEr8Px3kbcKMwZSyEExsHYINmAJ4Z/WokEaVHlaoB2hVbSSGirIc z4gxuS4xb6+yVB1rPBK3cLwNwgl9s98W00foCxMzub0swxOhbRUslxFmWEbXUqGSCEKx OH/WBnoGkBwSCwfn7MsEAJ0JKCaR6dxHtaEFeLSGkqezGI2yyLCqyxEavBV/sbOI/n+H Kulg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702569125; x=1703173925; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LJYbFg0YusLQd7kau+7yl+2+5aq7Aytpc7bFv1yVVFU=; b=RRcqJ+bNlyFPy9vLs7a6IuIhpCQqiM1N082DKJNNha0c0AU5uCZD5gIshSbQXA1KMX svVM0DyCwJTr/usutPOM7Ndt3PP8m/2eAjiZsclkWXg/32jwqC/pTkqmlDvb/tJjtqiX yS0QY1Wrxi3tx0u3fwnXkQljM0Vum8j0pn+bKfzWr1GMxdggxcJvJxfy+h4SxHrHQuO6 uX3Zw1YsplapTS2e76xdbcVJjn2hMoGd7MsbbOyO4DCXl17MWMKf4z5Y8pPo2xE+8iD0 sCaE8mrd9D9TzDPUpo7Gd6vPz/Q3hAn6jg9QaZhh1fU7iXj1oGKTYjrutAYyCD8IC2PY r1AA== X-Gm-Message-State: AOJu0YzzKo1FpNEEWEoooEoR+Gon1YBZ8mL80MzP/Pa3ODuazBl8eR9J PMPd/HH66pDrptWgEjIINiA= X-Google-Smtp-Source: AGHT+IGLVtkXrMWtZzPCAej2kU9rW+T3NVD3Oj2+SwbxBlJMUum28HpOEywNDJUC+UADtGETmjTfLQ== X-Received: by 2002:a17:90b:34a:b0:286:bd7a:9f7e with SMTP id fh10-20020a17090b034a00b00286bd7a9f7emr4439129pjb.29.1702569125260; Thu, 14 Dec 2023 07:52:05 -0800 (PST) Received: from Gentoo ([117.189.237.103]) by smtp.gmail.com with ESMTPSA id nd10-20020a17090b4cca00b0028af27eeaf1sm2784079pjb.36.2023.12.14.07.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:52:04 -0800 (PST) Date: Thu, 14 Dec 2023 23:51:50 +0800 From: Jianhua Lu To: Mark Brown Cc: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/4] ASoC: qcom: common: Add qcom_snd_tdm_hw_params function Message-ID: References: <20231213123556.20469-1-lujianhua000@gmail.com> <7b13b8b6-9048-48a3-b1a1-e62de88e8171@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b13b8b6-9048-48a3-b1a1-e62de88e8171@sirena.org.uk> X-MailFrom: lujianhua000@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: XZWP3QJPET27WKOFHDDCQQ5PKKDQK4VN X-Message-ID-Hash: XZWP3QJPET27WKOFHDDCQQ5PKKDQK4VN X-Mailman-Approved-At: Fri, 15 Dec 2023 07:24:44 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, Dec 14, 2023 at 11:11:06AM +0000, Mark Brown wrote: > On Wed, Dec 13, 2023 at 08:35:53PM +0800, Jianhua Lu wrote: > > > Add qcom TDM setup function to support TDM ports for qcom platform. > > > +int qcom_snd_tdm_hw_params(struct snd_pcm_substream *substream, > > + struct snd_pcm_hw_params *params) > > +{ > > ... > > > + ret = snd_soc_dai_set_tdm_slot(cpu_dai, tx_mask, rx_mask, slots, slot_width); > > + if (ret < 0) { > > The expectation is that TDM is set up by the machine driver, not from > hw_params - if the TDM setup can be changed from within hw_params then > it's hard to see how it's going to interact well with other TDM users on > the bus. More usually hw_params() would be influenced by the setup done > in set_tdm_slot(). Currently, qcom TDM setup need to read hw_params, if we want to move it to machine driver, we must hardcode some params, but it will reduce reduce readability.