Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2104882rdb; Mon, 20 Nov 2023 01:58:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEudYbhv6qRrhBmDbRTiw5FO6rPF2xkjcdj0vONngqYjzoiifOZL80TlsLtt0FxOQsamFc X-Received: by 2002:a05:6a20:6a03:b0:186:7c17:62ce with SMTP id p3-20020a056a206a0300b001867c1762cemr5298285pzk.61.1700474323734; Mon, 20 Nov 2023 01:58:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700474323; cv=none; d=google.com; s=arc-20160816; b=Sp/VIJNUTbkTf/8sQRf/uqLGHVmvxiZDkhBK/liemWvErwAk+lkU1jV7yNUwW0uCat JrU28j/pcgq2a4UNG36eL+dXGBHGpl94uEZFLX6suTxV+kUAh48Kw+GQeUTU63MfduBO qDKkZ74p9sQ4Xe4a8UgEYjccrdcEUSAOVTu3aaROM/r+CZIZJZD1uI7MOo4ng2+qGrMQ KFtU/GF26sisQ7TQTf60cmj6SM+odIcTgAGrtbVPHgyGvPz1IxHQ1wF4f6fH9b3VxTYD CpOf7nFTuPFwaM1t9WqmnE7Uf5anLVHAQspgSWMr99EcPwxA5VXBsmM9JoNA0sGFgIIh WMqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kx8KGcst8hZnUB0atywBnApo9bOB5kKeKwi0TRtSy2w=; fh=OKaVNpwt0dFF2Omj4Xfz+TU4savpypQEE9t3FBBHQGA=; b=zsyoolaORbe2btG3kHby2HfR3UQXwpGEm/v064Bb80MXcV7p9bNNTM61R2UsjUwX0R RwHEGebRmBikOcmjILVF/tD7ivuzhdFjbRSeDNI7wOnjLIzU+YfF0bJ9hV99HZzRF62P MjdRnd6iJt69PTOJFNtfrsTbr+tT5REcodcbMR58ldsGcIG2d1T+suvEByVzYwU/Savo iNYBVz6IKdO0T2ROlrQQs7J2uWYuK4jjecdgjqrOySYB4CQf+Y6+9+YlC56FD9uizVUd jWggwDMrue1iBS2fJjQHo65QkIuOlhaeF1U8LoEgx28v/6iOYKaiDORYGeqbhaHwAm/d Is8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="QBFaV1y/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n15-20020a170903110f00b001c71e907ee6si8048439plh.124.2023.11.20.01.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 01:58:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="QBFaV1y/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 474538047D4C; Mon, 20 Nov 2023 01:58:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232338AbjKTJ6Q (ORCPT + 99 others); Mon, 20 Nov 2023 04:58:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232305AbjKTJ6P (ORCPT ); Mon, 20 Nov 2023 04:58:15 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCEA59E for ; Mon, 20 Nov 2023 01:58:10 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5431614d90eso5952766a12.1 for ; Mon, 20 Nov 2023 01:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700474289; x=1701079089; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kx8KGcst8hZnUB0atywBnApo9bOB5kKeKwi0TRtSy2w=; b=QBFaV1y/9ql5ORVwAxxWAYO49p68Zap9yEVbFeq1Ei190T44P1qs+LlwldNQhHIQsu cN85E+7tumyMzcJlneuiydcq8pqJE5dcdIwpsTiuofBfLuExRAwo3KyJmTS5uRmHf022 O+mknHHfCQjWBQE5AKVcV/r2zVaBXEE/P82t4kjFLz6xNCfQpxqTe3kaF9sSnkgmLWzv U7LT8/1VDByWkRQd2uOxaWpT2boBaIcx9ySfMmOd1oLuzgWTCdCBfvLV0j2wY/u7HAca nHEohCrYTk7ziVxTDmI3aBnJW7HlyVnK/S8JR2l4TuZ79L0yViCMYzMudjYKOJj/QJYs QvzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700474289; x=1701079089; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kx8KGcst8hZnUB0atywBnApo9bOB5kKeKwi0TRtSy2w=; b=i3EjKK86UhsN+c4Dr2YMtwYPGYktZwcRwN7xGJt3MaUS+JJTC7/thcFjb1R1KN0ygc Zu5pr8Rrwmpe488cfr6qWSBTD+LxLeMWW226TGEUE6mgfcNDTVeB4RxmTGtrU3dqpK7T +v9FpDvL4hh8rH4XfLQL4tfSgM81zZnDG9lmGTY2aYGUq7VaTV5g/f9M4qcJMxvEi8/z uL22qqnm4K25kD/CRi9fTiFwKV9xsTGqy0XwutEzOTQIZKwRqF7IiXB6s9T4Bqy+rgdu g8Kt+MK6QHcHxILX3t4m2qHxJbJA9bRTrW2BtTs+6vylmR2MTXv9Oqk9MtJFFcwVc3dy NjXg== X-Gm-Message-State: AOJu0Yxy31Vs527fUkeeyZfBs8PZ9PS1t5yLcf49qFn//WvgnmpCDf2Y h5JWjcLewKVCR8KAqQ1Shphtu3TllOI6ZNkau8NssUSx7tfClA== X-Received: by 2002:a50:fb0c:0:b0:53d:eca9:742e with SMTP id d12-20020a50fb0c000000b0053deca9742emr4790550edq.9.1700474289055; Mon, 20 Nov 2023 01:58:09 -0800 (PST) MIME-Version: 1.0 References: <20231117163900.766996-1-daniel.baluta@oss.nxp.com> <874jhh2g8s.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <874jhh2g8s.wl-kuninori.morimoto.gx@renesas.com> From: Daniel Baluta Date: Mon, 20 Nov 2023 11:57:56 +0200 Message-ID: Subject: Re: [RFC PATCH] ASoC: simple-card: Use dai_id from node description To: Kuninori Morimoto Cc: Daniel Baluta , broonie@kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, iuliana.prodan@nxp.com, shengjiu.wang@nxp.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 01:58:41 -0800 (PST) Hello Morimoto-san, On Mon, Nov 20, 2023 at 6:36=E2=80=AFAM Kuninori Morimoto wrote: > > > Hi Daniel, Mark > > > We can specify DAI id using reg property. When dts > > node has only 1 DAI simple-card always assumes that DAI id is 0. > > > > But this is not correct in the case of SOF for example which adds DAIs > > staticaly (See definition of snd_soc_dai_driver in sound/soc/sof/imx/im= x8m.c) > (snip) > > - args.args_count =3D (of_graph_get_endpoint_count(node) > 1); > > + args.args_count =3D (of_graph_get_endpoint_count(node) >=3D 1); > > If my understanding was correct, for example you want to use 2nd DAI > but your DT has only 1 port (thus, it is using reg property) ? Yes. > > Current simple utils is assuming (1) DT has all DAI settings, (2) having > reg property is option. > > But current DT requests reg property. > So maybe it is good time to remove non-reg-property support ? I have no problem removing non-reg-property support. This will work for me. Will later send a patch. I want to understand how current non-reg-property support works. I'm looking at commit 73b17f1a65c881fc ("SoC: simple-card-utils: support snd_soc_get_dai_id()"). So, the reg property was introduced for cases where we can have ports of different types? E.g In the case of HDMI we can have Audio ports and Video ports? And we need reg property in order to get the correct DAI id? I don't understand how DAI id is currently computed if we don't have the reg property and also we have Non HDMI sound case: Here is the code: =C2=BB /* =C2=BB * Non HDMI sound case, counting port/endpoint on its DT =C2=BB * is enough. Let's count it. =C2=BB */ =C2=BB i =3D 0; =C2=BB id =3D -1; =C2=BB for_each_endpoint_of_node(node, endpoint) { =C2=BB =C2=BB if (endpoint =3D=3D ep) =C2=BB =C2=BB =C2=BB id =3D i; =C2=BB =C2=BB i++; =C2=BB } =C2=BB of_node_put(node); So, this code assumes that the DAI id is exactly the number of the port, ri= ght? But this is wrong if we have a component (port) with multiple DAIs attached= . Daniel.