Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3326050ybt; Mon, 29 Jun 2020 23:09:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtdZQcSObSYec+0/41DCkRKOuBeL0hVnJNNQJG6uze7Wgj2hUqP3dsGckoNH4llsKqDqBZ X-Received: by 2002:a50:8465:: with SMTP id 92mr20662790edp.388.1593497372245; Mon, 29 Jun 2020 23:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593497372; cv=none; d=google.com; s=arc-20160816; b=WZSL6lJwa4J+jFMUv7dGxg8YG8eWT0jDq2CraRhW5wAX7SXv03kQP/QehaqOnyP/z8 HHu5rRPycKgToAPZS/gFtYbdm2VQtuypHA8JG073tHng5ljZGMDcHj8oN6V4qliknIyg E4ehtU22jrvIzxLOMrwbjqpszGtU2qdo7xEN4LOzo1qKCeXt8MYr3Jq/02a+6eigiK9X h1awz3Rb1TNZOcFsaWskmDETv/deSAXqLeB3ehj7AWkM5ra3cZrXaLzLzdNfS79eaSGP zjELX+7OHunLkeMykohOMOncd/Vq63TnPd1tZ/OEAQqmzpgMydXrYE1ru7oEA4KM+C0w tgOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=8NVqvBk33P5/kUt9p19lYxXbwgDviwUiMB3jRRO4a/o=; b=oVwUAFM5hGZ+yLJvg1v0pUeYZoOhCgp02qOuX6jEQbu03bmR0rOkyoHO3AMClJz7vx XThzzM2d6Rba4fzBvGqC4Mzk3f/sfIvAOhaHA5LkmSiXnfb2bPR2gm4gAn2j8qw0T45P PRG4KWjhdRmTChtvLUrk5VW49avV/3Ofj65SQSIz3XmGZs2sRFFNOxpaTFv9D7KjDZZU E5xmdEmWamHD7AFaeTUBbTKwEb9Plr3UUN+2Dx53X9QyKhGZ2NiMlj58tFOixTzrweg0 ROGIgDKigFNZR7eWl7wb7BP2sR4Yu4DHkulmYkLYZmauRHZAnG9ECbS+uTnApU4L5FCp ZONQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u29si1103214edi.469.2020.06.29.23.09.08; Mon, 29 Jun 2020 23:09:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729444AbgF3GH5 (ORCPT + 99 others); Tue, 30 Jun 2020 02:07:57 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:59888 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728928AbgF3GH5 (ORCPT ); Tue, 30 Jun 2020 02:07:57 -0400 Date: 30 Jun 2020 15:07:55 +0900 X-IronPort-AV: E=Sophos;i="5.75,296,1589209200"; d="scan'208";a="50707825" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 30 Jun 2020 15:07:55 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id A2CDD41C117A; Tue, 30 Jun 2020 15:07:55 +0900 (JST) Message-ID: <87h7utytlx.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Sameer Pujar Cc: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v4 15/23] ASoC: soc-core: Identify 'no_pcm' DAI links for DPCM In-Reply-To: <1593233625-14961-16-git-send-email-spujar@nvidia.com> References: <1593233625-14961-1-git-send-email-spujar@nvidia.com> <1593233625-14961-16-git-send-email-spujar@nvidia.com> User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sameer > PCM devices are created for dai links with 'no-pcm' flag as '0'. > Such DAI links have CPU component which implement pcm_construct() > and pcm_destruct() callbacks. Based on this, current patch exposes > a helper function to identify such components and populate 'no_pcm' > flag for DPCM DAI link. > > This helps to have BE<->BE component links where PCM devices need > not be created for CPU components involved in the links. > > Signed-off-by: Sameer Pujar > --- (snip) > +bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc) > +{ > + struct snd_soc_component *component; > + struct snd_soc_dai *dai; > + > + for_each_component(component) { > + if (!component->driver) > + continue; > + > + for_each_component_dais(component, dai) { > + if (!dai->name || !dlc->dai_name) > + continue; > + > + if (strcmp(dai->name, dlc->dai_name)) > + continue; > + > + if (component->driver->pcm_construct) > + return true; > + } > + } > + > + return false; > +} At least my CPU driver doesn't use component:pcm_construct but is using DAI:pcm_new for some reasons. I'm not sure checking DAI:pcm here is enough, or not... Thank you for your help !! Best regards --- Kuninori Morimoto