Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp768381pxb; Wed, 27 Jan 2021 22:37:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPMocVk/Y9nf7yuhQFdOJZptWu1L5tSpqmCwux95wkn/QoRoadMPYKDi/KAWTa3BmOo5/L X-Received: by 2002:a05:6402:1c0f:: with SMTP id ck15mr12062435edb.171.1611815869575; Wed, 27 Jan 2021 22:37:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611815869; cv=none; d=google.com; s=arc-20160816; b=sAj5N8Xyfv2HXMVL/4oaGsrPyIdebYKvRs+NA1ovkJZmoIFazwZn/yB3TLNgNc7KNW OFYAdQSjW1OAnBukD9xkAMRPOHsqJiussffw7uyGbRVe9aXAHOWQjVcJUg2z+RxdfGLC wSeF9agPluZ9AP18eG00C5Ymk8LHbB4kR8FN7dG3CCLiY/DDWialkHsvbz/UVsxP8+UN 2hAtAweLMQA91gv5sNqxeXmPIo7A2jb8XCxYNc5SCz21qC4Ku8rh0e3KSSG53qZ8SKvG 6dBvWLdv/YXc/saV7Qj6TTlAosJb5dXnBH3SD933De7zsWJBIb0PWdI5PboIAtWL3HdV smNg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RN3t0jYzcfu6D75LTZ/8ihbZ6pXscDhXrHJvhLYTEbg=; b=XxSm6say7p4i2ZDsB6oOzzW8dtwkHYfKvgCuMhXo73lV4XT1itj0UQRVAKIqaKlOVE MLz/lfnB4L8TLkx0DpgDwXXL1e3Nel1nFtCOqCOyfgNVZJ07JvgmxAoK7svDOAH6JVfy Yc7N5+Mr9mA2eTFmS6cyKa3fpbfO7t0d9lVaKMrXwaCGAWFYMhUxLmbh0jN+LhQJ9NIK L8PnSM7muucRW34cKHyqiWKdV+xs4Ru2xL3nDwDrOm+K/Q7qd2E2pqZuEWATjfUJLPUV 29WO+QZ0dKjgpTevrtt9FKn0okSXMFmGvxYA/AtKv17jW0ZU0oUu5mTToaq8webUrSUS TPrg== 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 q23si671019edv.287.2021.01.27.22.37.25; Wed, 27 Jan 2021 22:37:49 -0800 (PST) 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 S231260AbhA1GgV (ORCPT + 99 others); Thu, 28 Jan 2021 01:36:21 -0500 Received: from muru.com ([72.249.23.125]:53788 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbhA1GgT (ORCPT ); Thu, 28 Jan 2021 01:36:19 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 2C6A680A9; Thu, 28 Jan 2021 06:35:39 +0000 (UTC) Date: Thu, 28 Jan 2021 08:35:30 +0200 From: Tony Lindgren To: =?utf-8?B?UMOpdGVy?= Ujfalusi Cc: Pavel Machek , broonie@kernel.org, aaro.koskinen@iki.fi, spinal.by@gmail.com, jarkko.nikula@bitmer.com, merlijn@wizzup.org, sre@kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, phone-devel@vger.kernel.org, kuninori.morimoto.gx@renesas.com, Carl Philipp Klemm Subject: Re: [PATCH] ASoC: ti: Allocate dais dynamically for TDM and audio graph card Message-ID: References: <20210124092713.GA22195@amd> <2a9e7655-3d32-feb5-080c-8928a96f417e@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2a9e7655-3d32-feb5-080c-8928a96f417e@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Péter Ujfalusi [210126 06:00]: > On 1/24/21 11:27 AM, Pavel Machek wrote: > > From: Tony Lindgren > > + for (i = 0; i < mcbsp->dai_count; i++) { > > + struct snd_soc_dai_driver *dai = &mcbsp->dais[i]; > > + > > + dai->name = devm_kasprintf(mcbsp->dev, GFP_KERNEL, "%s-dai%i", > > + dev_name(mcbsp->dev), i); > > + > > + if (i == 0) { > > + dai->probe = omap_mcbsp_probe; > > + dai->remove = omap_mcbsp_remove; > > + dai->ops = &mcbsp_dai_ops; > > + } > > You are effectively creating extra dummy-dais (no ops), but naming them as > McBSP. > The dummy-dais will only work if the real dai is in use and the dai link > which contains the real dai must be configured (TDM slots, format, channels) > to accomodate the link which contains the dummy-dai. > > The idea did not aged well for me ;) > It still looks and sounds like a hack to model the TDM slots on a single DAI > as multiple DAIs just to satisfy a generic binding which is not aimed to > satisfy the droid4 setup (which is far from anything simple). After thinking about this a bit more, I think the voice call dai should be created by the voice dai. When we have an active voice call, the data transfer is completely out of control of the kernel mcbsp driver. It needs to be only configured on the pmic. So I'm suggesting tha we create the modem voice call dai as a child for sound/soc/codecs/cpcap.c, does that sound OK to you guys? I think from snd-soc-audio-graph-card binding point of view, we'd just move the cpu_dai_mdm endpoint out of the mcbsp in the device tree and drop the $subject patch. Then the dts for the pmic voice codec becomes something like this (untested): cpcap_audio: audio-codec { #sound-dai-cells = <1>; #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; cpcap_audio_codec0: endpoint { }; }; port@1 { reg = <1>; cpcap_audio_codec1: endpoint@0 { }; cpu_dai_mdm: endpoint@1 { reg = <1>; dai-format = "dsp_a"; frame-master = <&cpcap_audio_codec1>; bitclock-master = <&cpcap_audio_codec1>; remote-endpoint = <&mot_mdm6600_audio_codec0>; }; }; }; For things like recording a voice call, I think mcbsp could be configured to also listen on the traffic and dump it out. I guess that could also happen directly with calls from the sound/soc/codecs/cpcap.c driver to the mcbsp driver since we havethe audio graph mapping. Anyways, that's a separate series of patches, still something to consider. Regards, Tony