From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56732C2B9F8 for ; Tue, 25 May 2021 16:24:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2DF156141C for ; Tue, 25 May 2021 16:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232927AbhEYQ0M (ORCPT ); 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-tegra@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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81BDBC2B9F8 for ; Tue, 25 May 2021 16:25:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 093BC6140F for ; Tue, 25 May 2021 16:25:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 093BC6140F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=perex.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 19F2B1772; Tue, 25 May 2021 18:24:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 19F2B1772 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1621959938; bh=wJ6P14BSf28gEteq3TlqF++vo5VP0fXaRoNEIJlz1xI=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ANatuH1mZp4Vfe6nadfvqcRs2nGEfi7OTQXVuY/L99zulfUN5Z7sjPWtZmFt5Y8w1 DGnK+/ECUrtCyq8q56XEu/VOywrSEjWTuxVqlIvmxWXNti1AXhFLIevlJG1qpD+2wG W+YhVrS6xgeBdSyHEikcxJu5Kq1L50n5VwNJpg3c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AADACF800C9; Tue, 25 May 2021 18:24:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 08C9CF800B6; Tue, 25 May 2021 18:24:47 +0200 (CEST) Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1BEB7F800B6 for ; Tue, 25 May 2021 18:24:40 +0200 (CEST) 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 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 Cc: linux-tegra@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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.