Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4678696rdb; Tue, 12 Dec 2023 06:33:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyb9Mjk6WRl+zMOULvQ7r2ubBon8wQsHbp0pz7ktK2ld189OLOK0r4qD2KqylP90dVZrgR X-Received: by 2002:a17:903:22cd:b0:1d0:7165:3faf with SMTP id y13-20020a17090322cd00b001d071653fafmr3640063plg.63.1702391609989; Tue, 12 Dec 2023 06:33:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702391609; cv=none; d=google.com; s=arc-20160816; b=OPjycfBFiHr7z5Q56Ch1si5RLym3bmrJ2VcgbhSWvVGL2sWDAtP58R+CCV4b5ohMUy 8Bz4pwrV+sB+pqThiBARwIZfPvodA3j4OajdQN1AI35weJgDdV8lT5ZCNc5UUuC3lC42 JMfhx0YuHt+QMDbP/qcXP6FFusKns/wSBqKZFoGx2AbLK/WlrZeDdRRvSJ9ApXTanfwa 8ZwTHRI8jH2glunFppU6Lwyg0jWEyYnuCSqYTXuMzrJyttaXFJHz4UTzFs+6peu59Gyi kKuzgHJQog7ml1qSnxsDnvRZHyAR1zrkBHJtUEqvgbr+a2/f6B5a4uxEKmbWmL86aiD4 n3OA== 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=FgtrwCld4CcJzZn2fDspIh0QCBOkWG+UpKY4fFhtYqs=; fh=CdgkjZFNH+qyUcwgwTIypecU8g6R1qltqkm7y304EQ0=; b=i5jgW++x9kygM7xcJz45k0XgMJG4JxFIYhLekjMjBGcktMgu1X1zuY4zDdEmdJPtVL OndxxBDh5XDBtnaLrPsMdeErio8HyLweHIkZ1a1KexCHuAikDazc7MxxqflCb3lr0Irm UU254aR85bd1hqHrLGID/EyJM1QM1+p7woUAX6/Qxqi21szn+UAfcfaztSqsOREYGWkR yIJBYC7OkyT0HOD+kBDZ2h8ux8z1ijva5aS92YP3sBP5i7mY1SBP++QsWJBTGJhCmDLK J8umB9ERtBKo/TGkW6H6embHQ5Jqmx474S9ueZssr6WGVrDptS8xuyiS8yUPTg7azkQ4 ovIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gcdP3N1K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d18-20020a170903231200b001d07619e8cdsi8147629plh.449.2023.12.12.06.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:33:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gcdP3N1K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 9025B80219E1; Tue, 12 Dec 2023 06:33:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376824AbjLLOdA (ORCPT + 99 others); Tue, 12 Dec 2023 09:33:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376810AbjLLOc7 (ORCPT ); Tue, 12 Dec 2023 09:32:59 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3219E9; Tue, 12 Dec 2023 06:33:05 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1d076ebf79cso32844625ad.1; Tue, 12 Dec 2023 06:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702391585; x=1702996385; 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=FgtrwCld4CcJzZn2fDspIh0QCBOkWG+UpKY4fFhtYqs=; b=gcdP3N1KA2cWjtkugsIpxjNAxWqO1m2dUA1lOxkZKvC7p+69DfmMUfD9OfwcMlDyvu odrYpYOKPg9fKSg7JApk9j2kbQVDj7jJQpc5ui7UE1OoWeh+V4j0eeDrfwtpf904yCp4 nYIkXbXyh9LokEEfJ3Ob/XMTu6tQ0JMQs6sq3gP+9/iE0qfVaWHiVSO8c2cOS7Z15J6R 8qSBtRNaGQaZ5PL4DzyZpnbabEHD8wvzrOYJZJkMZFTkJGJJKjNC9fmcTn4UEAiaj0CK gFQabyFqmm1jwp1gRjv5sIle+hvDs4YRz1IS5e6qwZfKlmdknFom+4Hf7q3oeGRf0h3J VtjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702391585; x=1702996385; 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=FgtrwCld4CcJzZn2fDspIh0QCBOkWG+UpKY4fFhtYqs=; b=pXNjkCLdahd9klLOec+J2uG45IBPjDGI+yu2IDOzd9y9D1TbT9uhmtTkmIzR0m6aTu jRPtgQ9ZTx8GENZavTQpQr+BDn5TyMSZN51ZDiE80UsDoXFTtIBFzvZALGkg/K/T2I/a WO7hh/z3EI9kXvO2uohZMYh+mIs1ae4E2rJ+YxM11ooh9/9+DNdZzeWiuQEaAfXP3yoU mVwu2JZJDegSBhbkGUO2Zck6gNAIFNKywU1Amk2aLSEQwqNHeS7m+ej5/E8sTSRTvpDZ q8COoZQMxmrBy+L/Q00LvWxuTjwQpdlInemK18KhGbZV9Rw6vYHM60rrzCR0YUNVhUU3 zb7g== X-Gm-Message-State: AOJu0Yx5HX2RZyB/LvW0NXQ84nLa4R91EBZin/q9dw2Wc5z+6VZ3LIim sAxJRxlaoUwBNXeQNxYv8aGN+R/astyC+w== X-Received: by 2002:a17:902:bc4c:b0:1d0:6ffd:cec3 with SMTP id t12-20020a170902bc4c00b001d06ffdcec3mr3345275plz.124.1702391584856; Tue, 12 Dec 2023 06:33:04 -0800 (PST) Received: from Gentoo ([2409:8a6a:5426:70b1:a6fc:77ff:fe50:e63d]) by smtp.gmail.com with ESMTPSA id w23-20020a170902a71700b001d0c418174fsm2902272plq.117.2023.12.12.06.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:33:04 -0800 (PST) Date: Tue, 12 Dec 2023 22:32:56 +0800 From: Jianhua Lu To: Srinivas Kandagatla Cc: Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC, PATCH v2 1/2] ASoC: qcom: sdw: Add TDM support Message-ID: References: <20231212095850.26482-1-lujianhua000@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 06:33:27 -0800 (PST) On Tue, Dec 12, 2023 at 11:47:36AM +0000, Srinivas Kandagatla wrote: > > +int qcom_snd_tdm_hw_params(struct snd_pcm_substream *substream, > > + struct snd_pcm_hw_params *params) > > +{ > > TBH, this should not be part of sdw.c file, its intended for more of > soundwire specific helpers, pl consider moving this to common.c for now. > Because, Not all old qcom platforms have soundwire controllers. Acked. > > > + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, 0x3, 8, slot_width); > > slot mask is always set to 2 channels in this case, should you not check > the number of channels to determine the correct one? > > > These magic number 0, 0x3, 8 seems to make the code unreadable, can you > do something like this: > snd_soc_dai_set_tdm_slot(cpu_dai, tx_mask, rx_mask, > ARRAY_SIZE(tdm_slot_offset), slot_width); Acked. > > > + } > > + } > Finally ./sound/soc/qcom/sdm845.c does have exactly same code, can you > consider removing this and make use of this new helper in that file too. Acked. Thanks for your reveiw very much, I will do it in patch v3.