Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6079040rdb; Thu, 14 Dec 2023 07:52:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCSUDTpZkezTi3Wa4+Mc3MaVX7T84/x0FYvZgTK6f/r5ltJSsAxS58ZeyBsTgEC7Z/jr4A X-Received: by 2002:a17:902:6506:b0:1d3:5229:cf2b with SMTP id b6-20020a170902650600b001d35229cf2bmr1560691plk.117.1702569139644; Thu, 14 Dec 2023 07:52:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702569139; cv=none; d=google.com; s=arc-20160816; b=SeDUpZ4WmXMOBVI6HW5Rs7+eXid5hleCEVw8y8Wf5TZB5vxOQfjp8jlPtKOMC+gwUQ nqKLITv5hjqBROo9QB+Uk1MLLU0bevoacgZWneG11YMub0X+lFDkqkiQiu6dYTz+LnEN /VGCeeKvN6RFCypZyfZI5Ob67JjShbHveumKRs/4iy4D4gxggu43odep3YiMHrjrbTEF 6IfcqrYdO+yZvlURYCH9AYkxWSVZ180/JV8rO0rKXG5ffPfMUZIZF/mktS9vwluMRj75 q+sjZvu10FfcurAX7+2K9V+h/Lg31HbDBUdGEQaCOg4pKu/ejo1R1Lv8ELniLfS6sADq S3Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LJYbFg0YusLQd7kau+7yl+2+5aq7Aytpc7bFv1yVVFU=; fh=e4U9aepcGEf6O6zjLftAYhmaL+GPTAZcCv4H08JRyWA=; b=l+iU0MrTQ/x4P8OHZx8h+Fe4nhy/4VgAFvsW+WSX9mNiwcoh4tcc+wS0j0AQKruM00 zmZcpZRER+SWh5lJ7Fjs9lJogroyLjB29JsXCkjYSbA4tru0oPk8xNDy85rxd4J9jAtP DXs4uK/D6/cV5FRL9GZK20vxUFk25myNV2KPJbJJgz+1Gh9ioBf7sYaL40dW/3F24We4 cueGlFM1DCzE9AttDimFDr5B1FIcPo29fFbJ7PiLRn1WuXhexbo4o3FRgleR2qfmvaYl vASsG19W5NieyoKM6H1OBIgUwNUQA52eSEB0fg5MsZxUFmT2F/gvrgCMR/AZ3/kndTJE ckLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dKQI+pKl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q16-20020a17090311d000b001b8922e82e3si11525774plh.297.2023.12.14.07.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 07:52:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dKQI+pKl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 42AA18561655; Thu, 14 Dec 2023 07:52:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573916AbjLNPwB (ORCPT + 99 others); Thu, 14 Dec 2023 10:52:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573914AbjLNPv7 (ORCPT ); Thu, 14 Dec 2023 10:51:59 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E47C312E; Thu, 14 Dec 2023 07:52:05 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d359f04514so9577995ad.2; Thu, 14 Dec 2023 07:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702569125; x=1703173925; darn=vger.kernel.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=dKQI+pKlbRNW/yvwOTkrGo0E62ygUEuf6NQy8Wxuk5Zph5lLp/mqUZ99xKZ7d/dyzM 8mZiLmdSPD7UK/wjYIkq98u2nlfDecBmaWSqsZw/KSJXxJkljb0BF+LKFScaiVFF3pV6 JguGHTw335/7/5PMmlOJF6HvxCkYoWO5UIDFlwT/xRJtWshFqwY0iFJzDcYV+tC4iakA lwvR6yill6ujcKxsRQ5mdtDy5dMc+JEinV/+e52imBetNxXbBdDfdAtuDKv9dC58BXoC ZPJKdNHyaHQXSejM2u00vvaosLg0lTSQVBnthtNUkp+b9EYveNsNyWZnEY1t45WcI1UH 9JPA== 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=v48HDSU960MG337EZg/cbYR4IPf8RzGNxZjjjck0OATwSy/KyokI+QTWdVD4gMK3FK qMPYLK5o49vrkwAUMx7vn0nhPDmE/STp/JeAx8WxKUyul6+02T2ge7IccF4z1GmYY4sh 9zQHYKi02nX8KNv80hd6C9bTtHTmBUuFl8XWbG2Pd6E+4c6JTu67F+k2HF7M8STLjp3Y 17hHDwRssvdvNXI7JP9/J+MqAuvpckt/9jkkkUccD/G6ET4/w9oZ1wW0KxcewhvASsVP C7Sy9G4d1t00bgYl7L+upGU+m9oA7CplvpnlXeYY/kvUmbsIzEDNBBQTpokiUqMiD7BS Cb1g== X-Gm-Message-State: AOJu0YzNzXfigpgcwVaEpIIxjpwyxYXREdzwL3mdQa2MwrYd0WCwW9if 1mRO5AMrkr1qzE97tze8xEkbMxLi3z9/fw== 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-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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 07:52:16 -0800 (PST) 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.