Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4744878pxj; Tue, 25 May 2021 15:36:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUSyAUgJxrgTFa4lg6oSUOPkU8IS23hZGiNjhNECzEcMYhdO/NKEhTdxyJj+9N+n5cLbKZ X-Received: by 2002:a17:906:ac1:: with SMTP id z1mr18328104ejf.463.1621982203947; Tue, 25 May 2021 15:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621982203; cv=none; d=google.com; s=arc-20160816; b=Yjx7bpogfbQpzaye8E14LHJF8N3/Kug113RZqxohDUHXIxRccgBA3MdxqX5wU9MSG0 iHNwxR9TaosJLvRMm5QyyAPmuf91LLhCatGRzx0S3yFwIiAjV2IN7vRQxk1itqrgGXkK UzYzmvjMH5mmfXfcVkIYmjvozgJIWOK8JsabHX/cY9WKR3c8XGBr9KoTD5ZgPRH7zhJB eIKaoeKG4X5iA1EokHjc9g12dSIalRVokBvvf4Z9mAP1SKSNTXI3vXNhzb86CRYS+5oS LcLddHWE/oG3XY29+cNk8uNdmbHo8+N6T45RHVn7KfYG4tZT3wX29LluWhCdU6f4d7p5 rNkg== 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; bh=ZD+vlbnCmCd0+YdhT3Kf05pgMEL8yn/TGh5XC3e9yC4=; b=R7jAqYNksVgldLqxcnMZ3Ufb7Z60nP281544kzMYIU8zXRuRMZzEGuxld30kgBenWH iiFIEYR3/Oc4mmSlEt4QuCyRLJGPHNb9cWN6cjmQ8woZNiCtB8AdnlaY4wPvz3pKTM0g 4jOhOr6olnDy/4cruA8CIoKaCcFmZPrAiOFl8XNkuqzDT6GAnm/k7LDvUELu/NQCNyeH SqhoLiruLfhul9Bb0cHLmTnkesDgwjLOlGj0hxPJnDFVs7xvUw994fOoNJuCJqJAyaXy geXJNe5IbGv2Y7Qh/R2K+A7Yb2QHXUHfNFXHJ8fdrrj1sJDuBnEh6jTwQkw/MpW4S146 PT2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EDoW110K; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si15842606edw.535.2021.05.25.15.36.21; Tue, 25 May 2021 15:36:43 -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=@gmail.com header.s=20161025 header.b=EDoW110K; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231321AbhEYVKl (ORCPT + 99 others); Tue, 25 May 2021 17:10:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbhEYVKk (ORCPT ); Tue, 25 May 2021 17:10:40 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71B20C061574; Tue, 25 May 2021 14:09:10 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id w15so40003871ljo.10; Tue, 25 May 2021 14:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZD+vlbnCmCd0+YdhT3Kf05pgMEL8yn/TGh5XC3e9yC4=; b=EDoW110KV9wcfQ30kqQ1ZybqTTE/mSj56bdcleLHZ9K1K65hsPrg9IrsZJ6lqu84SD RuaswPbLyuqVCWQ0oyQgm36Uwfqs9e5USUOw4l22hAuVIBSi0CxekIhx1On8J1Hu+9gv ZF/G3WukVhsQGoQEbSwWKl3XJU0aQWLmoFLDB9+NMilvdBo/Qey7m+ScBsh60Vs9X/G7 tfb5FLBY2sQ88qOQom7PT3Kg3cN7B+TXWhT2uw9rcBT1brIlb6UFMfndAakABXqJf3k7 tLK3gwnMhy1IclNyskN3N65WqXKwIJcrHn7YXSf4BCWEbttcrpt+SDK+SbYFSu7o0Doj XGvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZD+vlbnCmCd0+YdhT3Kf05pgMEL8yn/TGh5XC3e9yC4=; b=toDXCmVLCfYk9AdEmsKlXDqeeZb5kfh4DqNEwEmPQkHGD1yAWkzlC582QE9AbRv16X zEHWQ/Rrc6D72XLy6hZNr1reoVtW7G/1oFBhjFKMfhOfZUuVfBxHnd6TrbOXMdclaj0a PuXiBh/fvVFzYpHE/59mOVKImETvOX26P8wIKq82k47C9RHjYG5N7aL+F5TTlAhMV8HE mZvwhlebqqYu/nGLH0XHi35ogTPjagBwurPOLovHHkEg3HBwaFeg19DMPqd3ot+7UjNd 5MSx7KJfMxgBpwhQUn8ahr1vKmNtAEs0DHYj/YRuPAD0rrSjAV7KRCpT1nf8+c6VPuts znxg== X-Gm-Message-State: AOAM532IrwAN4KHl+oL+M3cDuWP0lSBxNXp+lfG33u0MK7hsyNuBy4ME TCYWJWVzUSPKHjNSPeFAfQ2kA/SCmlU= X-Received: by 2002:a2e:5045:: with SMTP id v5mr22264105ljd.270.1621976948326; Tue, 25 May 2021 14:09:08 -0700 (PDT) Received: from [192.168.2.145] (46-138-180-236.dynamic.spd-mgts.ru. [46.138.180.236]) by smtp.googlemail.com with ESMTPSA id w3sm2207406lji.25.2021.05.25.14.09.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 May 2021 14:09:07 -0700 (PDT) Subject: Re: [PATCH v3 4/4] ASoC: tegra: Specify components string for Nexus 7 To: Jaroslav Kysela , 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: Dmitry Osipenko Message-ID: Date: Wed, 26 May 2021 00:09:07 +0300 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: 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 25.05.2021 19:24, Jaroslav Kysela пишет: > 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. Everything that goes into device-tree needs a firm specification. We can't add it into device-tree since there is no specification for the components string other than something that Intel driver made up for its own needs. So either we could add the components string to the kernel driver right now or not add it. I think the best option would be to drop this patch for now.