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 X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ED9AC433E0 for ; Fri, 26 Feb 2021 05:59:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9239A64EE1 for ; Fri, 26 Feb 2021 05:59:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9239A64EE1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0AFEC822; Fri, 26 Feb 2021 06:58:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0AFEC822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614319166; bh=/KJvsjcdqImUqMe4Fz7rYiMjw5AxV2uuutYx7Ovmp88=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lXx/ovFfmCX+mXulso/yqRCGCep9d8s3b5i0g9un5kM/k8muFvVSFS4mU3H4+Wuur 78TRIZcdoSNCkIVeZT9HaPhGMa0Ru8PwpxJ+2g9sfWI+NsxdXSONqZjOdi8B4Bjz6S vINthYF4PU/+BgioO2+hczHxbgbr1IHmkFsXE8Q8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5F58AF80161; Fri, 26 Feb 2021 06:58:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DBF86F8016C; Fri, 26 Feb 2021 06:58:32 +0100 (CET) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 57BC6F80159 for ; Fri, 26 Feb 2021 06:58:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 57BC6F80159 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XHhiZlIe" Received: by mail-qt1-x82e.google.com with SMTP id v3so5993521qtw.4 for ; Thu, 25 Feb 2021 21:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kzC7LtlZ0fXzYRkwYY+9DmH23Mg0RAoodBbNopUOmUw=; b=XHhiZlIeVGaiP4Yg/2IfUHI+b/quFjbaVT1OHH8zRpZMsMkkOij6uTY+M2balK4mh4 uHv2OqEXLMnmVFeKfwfYYAbr8syIifaszA9C4DhUMZ3TSQby5CAcFheB/EKPPMTWFMFi vEf3QFQvGsXN1Kl9y2f2vSvqZ0OEtiIDEDXZUM7TEdDA8XbjMGaddCDSzfEkX04URV40 HalelKeRSTscvl589h6X0fcpDlTXugsaO1Q534Rc1KyNluHbnyb3wpT7kOMdQWF92jes H+gLNI4etmQohozv1wltiR9w0D091VoDhiDSZoGASzzIFRXJbxvEC1zJzLbzI5fN/SS4 VcVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kzC7LtlZ0fXzYRkwYY+9DmH23Mg0RAoodBbNopUOmUw=; b=opbj06BjDecseZw+n2nWv5WPfaWZH0l1YJysIIH5NrZoOLUxr8eFpPCcwB02CPlH+2 n0g5Zy/mVNd1XQ4C3flljaovgrteFS1BpK4KUFVojE4gABhohJd8fqt3GCqFZrMAQSxz 0HB/cszx1nynUaFIdTo12Y6t3stqE0LqO+9E76wB0mieEPO3CvYEINfQWq5DU4IsGCE9 IZiZbCTHM8OcvHIj/6+ON1Q8YrDAS7xBYFBjASBEVRLpFAXT22Ex3ijrRgoPRnV0bUcU Zko1a470JNpYdAO8WfwYvvuF0u3ACPbr86wscvFmm0hHEpxVChXCqBwXuCyYHqW0Cdd3 WBIQ== X-Gm-Message-State: AOAM5314ajYDmpiB34o7Jco4x1m9pNC/0d7vUfAG6c7mvhEOXa1SItCD 4JhzEV0VIWDnPy8l4hZq+jkf0qLV+i4j5xsrH2c= X-Google-Smtp-Source: ABdhPJyizV+d1SUe1CimsqygWfbzOJbJDH7iRKCcjlNlV00dtDy4yLr1Gop1IHnePwHjf0/0iBVJc+oKacsZYjABwlg= X-Received: by 2002:ac8:7241:: with SMTP id l1mr1419287qtp.121.1614319103134; Thu, 25 Feb 2021 21:58:23 -0800 (PST) MIME-Version: 1.0 References: <5598a2fc-9b49-ad5e-2265-fbc0593ead1b@flatmax.org> <0d9a9459-9cd7-d384-b1ff-72860895ad13@linux.intel.com> <73148789-58f7-2228-ae42-465cdafcff4c@flatmax.org> <52e1a640-b46f-b494-2047-849c1999eb28@flatmax.org> <7607dd99-0d54-2bab-7407-836a42647f4c@metafoo.de> <20210223135743.GG5116@sirena.org.uk> In-Reply-To: <20210223135743.GG5116@sirena.org.uk> From: Shengjiu Wang Date: Fri, 26 Feb 2021 13:58:12 +0800 Message-ID: Subject: Re: ASoc: soc_core.c stream direction from snd_soc_dai To: Mark Brown Content-Type: text/plain; charset="UTF-8" Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , Pierre-Louis Bossart , Matt Flax X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, Feb 23, 2021 at 9:58 PM Mark Brown wrote: > > On Sat, Feb 20, 2021 at 05:29:03PM +0800, Shengjiu Wang wrote: > > > One of the suggestions is to use two DAIs. but sometimes the > > CPU/CODEC may have the same format for playback and capture, > > then one DAI is enough. it means that we need to define 3 DAIs > > for the CPU/CODEC, one supports playback and capture, another > > two support capture and playback separately, is it some kind of > > duplicate? > > > So I'd like to extend the set_fmt() interface, but this impacts all > > the drivers. > > I'm not sure having two DAIs is an issue if you have them running the > smae format - does it cause any practical problems or is it just that it > doesn't seem elegant to you? There were quite a few devices that pretty > much just had two unidirectional DAIs, in those cases it seems like a > sensible representation for the hardware. If you can set unrelated > formats on transmit and receive then it's not clear that it's actually > the same DAI in anything except logical labelling. When an i2s device, Sometimes it is connected as async mode, there is different clock for tx and rx then there should be two DAIs, Sometimes it is connected as sync mode, then there should be one DAI. So we need to register different DAIs according to the async or sync mode when the driver probes. right? best regards wang shengjiu