Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4573436pxj; Tue, 25 May 2021 11:01:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhuzmvO+5jb0hh4IvtRGEnqRzWWDYLxfAy6+bSOKuc9JdEzOgPjvH9SXBSgMaZcmC67dV2 X-Received: by 2002:a6b:b7cf:: with SMTP id h198mr12763324iof.108.1621965677891; Tue, 25 May 2021 11:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621965677; cv=none; d=google.com; s=arc-20160816; b=Pj16zhEtFLmMBcs/3UfNKoAnTsfWoj9HNF7y65VyoU5UAvqSkx0/LDgT9yPb03fDIQ dkaALBfx6xkdYLBdcU7bpvuQ8H7dcgZ2jbbJ5khzjas6Np8FUK1XcE+PnPvpRw5DMH/c KCvsJGfOVjFxzZxxGUq6KrAlVXKaEs5rEfwmFzNoebHBKD52fV9wD26qGqOjSboNMmbP j+sE1VpemTcsxGpX3y48ibrd/oVqUnQZUn3GOpxw+NPoj1/w2caThKqtzIkl5FVCiRlI HWB8sz3SlNMNSf5muaFfrrPzEbZLYf/n1S+TjZhcK/NxyLzq4kQsYXAYfr11QmlLJs3T 4cTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=5vd1CosdGZ1x0kCQ03wCTU9ikNz4E8e+MwaijpSD2AU=; b=t6vEFLaLK8aIX01j5oLMioyfuBMJOmjPE6jvy2OnC22lwgH1bWm0oucfb3sc8C6Q0z AmdhJE9L8R+5DiN3TwZhSLAU5FrtO2b+bfZWMotTddbScxLN2311cQGFr1az5rclVPaK VqEWHnWkNHHwJBD6PD1defwrhn42fycslvGiHxTwMfHWvAT0evLMLsKIj/jksFjIx8SD WVGEjS6K5xWfYJ9sPvBZCqGzSDnLpbBhvmW41dxIXkQW7YZPELxi+H4FQLks2COFRQ0h dBxACmmU0n333mDl/U4EQeqTSl96WR2q4RUlx823PO7LUIDoL3MXWG4Vdo0KQI4eKT7P scxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perex.cz header.s=default header.b=U+4Cziiu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=perex.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l27si16438100jaq.51.2021.05.25.11.01.03; Tue, 25 May 2021 11:01:17 -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; dkim=pass header.i=@perex.cz header.s=default header.b=U+4Cziiu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=perex.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233133AbhEYQ0M (ORCPT + 99 others); Tue, 25 May 2021 12:26:12 -0400 Received: from mail1.perex.cz ([77.48.224.245]:40856 "EHLO mail1.perex.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232200AbhEYQ0L (ORCPT ); Tue, 25 May 2021 12:26:11 -0400 Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id AB630A0042; Tue, 25 May 2021 18:24:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz AB630A0042 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1621959879; bh=5vd1CosdGZ1x0kCQ03wCTU9ikNz4E8e+MwaijpSD2AU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=U+4Cziiuz2bRm/D2OIanNWyLaonXS/fppqUXq/nDrPNOJy+PZh76rC/R5gxCZ6Qam cgc3U5f8cLGD+9p4nkvPlVp0lOHsA6wkNQDNmv7M2AN21eMz/x449mQOO/rRoPf4mJ ySKj4Db3H8iQM1q8nvXWqvB0czYnpIkrUlIBKI5w= Received: from p1gen2.localdomain (unknown [192.168.100.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Tue, 25 May 2021 18:24:28 +0200 (CEST) Subject: Re: [PATCH v3 4/4] ASoC: tegra: Specify components string for Nexus 7 To: Dmitry Osipenko , Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Ion Agorria , Svyatoslav Ryhel , Liam Girdwood Cc: alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210523234437.25077-1-digetx@gmail.com> <20210523234437.25077-5-digetx@gmail.com> <99ef3d77-c626-c632-bbd2-92eb15acad20@gmail.com> From: Jaroslav Kysela Message-ID: Date: Tue, 25 May 2021 18:24:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <99ef3d77-c626-c632-bbd2-92eb15acad20@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24. 05. 21 16:00, Dmitry Osipenko wrote: > 24.05.2021 13:54, Jaroslav Kysela пишет: >> Dne 24. 05. 21 v 1:44 Dmitry Osipenko napsal(a): >>> Specify components string for Nexus 7 using the Intel BayTrail components >>> format. This may allow us to create a more generic UCM for RT5640 codec. >>> >>> Signed-off-by: Dmitry Osipenko >>> --- >>> sound/soc/tegra/tegra_asoc_machine.c | 19 +++++++++++++++++++ >>> 1 file changed, 19 insertions(+) >>> >>> diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c >>> index a81f2ebfc00c..87e0a47040a5 100644 >>> --- a/sound/soc/tegra/tegra_asoc_machine.c >>> +++ b/sound/soc/tegra/tegra_asoc_machine.c >>> @@ -671,6 +671,24 @@ static const struct tegra_asoc_data tegra_rt5640_data = { >>> .add_hp_jack = true, >>> }; >>> >>> +/* >>> + * Speaker: Connected to SPO L/R P/N pins, stereo. >>> + * Internal Microphone: Digital, connected to DMIC1_DAT IN2P/N pins. >>> + * Headphones: Connected to HPOL/R pins. >>> + * Headset Microphone: Unconnected. >>> + * >>> + * IF2_DAC/ADC are unpopulated. >>> + */ >>> +static const struct tegra_asoc_data tegra_rt5640_grouper_data = { >>> + .components = "codec:rt5640 cfg-spk:2 cfg-mic:dmic1 aif:1", >> >> Perhaps, it may be better to handle this string via the DT config (create new >> function like snd_soc_of_parse_card_name()). >> >> The "codec:rt5640" should be set in the driver (it's fixed), but the >> "cfg-spk:2 cfg-mic:dmic1 aif:1" part is suitable for the DT config. > > Not sure that this is possible. The DT is an ABI, while components > string has no specification. Any changes to the components string will > require DT update. > > I think it's much more feasible to have a database of components within > kernel driver, like Intel sound driver does it for ACPI devices. There is no other possibility for ACPI. And while the components string is part of the ALSA ABI, it should not be changed in an incompatible way. Only new information should be added. The DT solution seems more flexible to me. For example the stereo/mono speaker or the AIF number can be set without the driver modification for rt5640. Jaroslav -- Jaroslav Kysela Linux Sound Maintainer; ALSA Project; Red Hat, Inc.