From patchwork Wed Mar 9 20:21:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 12775557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5B5AAC433F5 for ; Wed, 9 Mar 2022 20:24:08 +0000 (UTC) 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 8AC8616A9; Wed, 9 Mar 2022 21:23:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8AC8616A9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646857446; bh=HrSd8fh84PrFVz9CCbJR4xWn6vhNqj/rfUd2F4NEXFA=; h=Date:Subject:From:To:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cURVQsyJMs2k+i97gGaRXcSFTHjDhHONJuSeF5ja3Fuvh6aOc/NPHl6WtH9Dw2Y8v yPjlR75u2fIfMozfCUcvB8HLwyKC9qEez1yci/tFVfVRfsGwAIGVRVAtxQkn0sNiSi mdqnMqBhBIw6ZRYjs/K9zqVWuZMJVgmnOjYsJ1Kw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1A2FBF80155; Wed, 9 Mar 2022 21:23:16 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C9517F800D2; Wed, 9 Mar 2022 21:23:14 +0100 (CET) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8D46DF800D2 for ; Wed, 9 Mar 2022 21:23:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D46DF800D2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DTW0Cg0X" Received: by mail-ej1-x635.google.com with SMTP id a8so7611909ejc.8 for ; Wed, 09 Mar 2022 12:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=58V2fCGzsfqcmE2/CejONEbjJLKwqBAus/Kg3pGGFn0=; b=DTW0Cg0XQbj7eZyB2vytYdHgXI76DV0YL6Kw7gXv82AfcZibZ+Kd3ekPi3rwu/5gkP D1jhDgNU/KSarFjqcu9BKFzQzltE1BzWAO0hpo7RpBl0eCyN+nG/HdbSinB2a132d4iM 7bKiQjYltwuw8IkqT2Rzfk/xKS7qsn+W9vJHSo22Z+3Nk5fB7rX90TM1iORek7K1VZMq zfjlpwZ0LdGfonW4bf1mdP08XaFfopD8IpAQiclNelX5cDzyQ8RKaaUeZeCQ+qIcKoFL yBrjmFnBpBZ3x1d2ro2woTt4hVjIfe9fTr68m1CCnvyinsGPaWsf2jd4V6d1yzqr+lfO iU/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=58V2fCGzsfqcmE2/CejONEbjJLKwqBAus/Kg3pGGFn0=; b=QCpY38FG1Vtj8uHqLfh7blkcM1jcbbvxMVFD/Qf01UytNKo2Qn284qLCVgEIkIFLnS pEO8bTZOHsqqdwrS3PE2153ohd1O5qoDTZVg1Lnjgpo6XUWEBHE7sMQBOyIRJnzY2gRN rdrtA/HEqapZbLdoAz1SCGJXdobT3OAyxAczUIaRqfr+SOtRuWuZ0sRdTwJDh85c917k ZTtESAFCYbnMPUOEjuwBvRw9QuYWxh+G7gLkhJeBzFl/+leJxHErW6M7JzO0Due/2MXd vuc7pFvyMByLUYaHLKpExTKGjBbTv+9oilUzBWcOgKLKDxQfrvfJfcOMmppPWxd9+8oh eDeQ== X-Gm-Message-State: AOAM530o7FMIXUA9Wt49n3yILaczNgjYrRDFGRN4PhYIW9aWPU/ZOa+A FRtFd0xiSByU7YBX5OjDWEk= X-Google-Smtp-Source: ABdhPJw9W6C1dtgKkVtzTNA2p/OxN3Hn/V9XQcdDnA9AWe1lpB4wWU73n1t2Zni0youpz82qb78esQ== X-Received: by 2002:a17:907:2a53:b0:6ce:e4fe:3f92 with SMTP id fe19-20020a1709072a5300b006cee4fe3f92mr1353881ejc.389.1646857391435; Wed, 09 Mar 2022 12:23:11 -0800 (PST) Received: from ?IPV6:2a01:c22:7793:600:9d6a:7788:3389:da6c? (dynamic-2a01-0c22-7793-0600-9d6a-7788-3389-da6c.c22.pool.telefonica.de. [2a01:c22:7793:600:9d6a:7788:3389:da6c]) by smtp.googlemail.com with ESMTPSA id qb30-20020a1709077e9e00b006d6f8c77695sm1101748ejc.101.2022.03.09.12.23.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Mar 2022 12:23:11 -0800 (PST) Message-ID: Date: Wed, 9 Mar 2022 21:21:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: [PATCH v2 1/2] ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver Content-Language: en-US From: Heiner Kallweit To: Jerome Brunet , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl References: <51953618-79b6-0df7-2d28-d5dce4dc86c7@gmail.com> In-Reply-To: <51953618-79b6-0df7-2d28-d5dce4dc86c7@gmail.com> Cc: "open list:ARM/Amlogic Meson..." , alsa-devel@alsa-project.org, "linux-arm-kernel@lists.infradead.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" Allow the component debugfs_prefix to be set from snd_soc_component_driver. First use case is avoiding a duplicate debugfs entry error in case a device has multiple components which have the same name therefore. Note that we don't set component->debugfs_prefix if it's set already. That's needed because partially component->debugfs_prefix is set before calling snd_soc_component_initialize(). Signed-off-by: Heiner Kallweit --- include/sound/soc-component.h | 4 ++++ sound/soc/soc-core.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index a52080407..766dc6f00 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -179,6 +179,10 @@ struct snd_soc_component_driver { struct snd_pcm_hw_params *params); bool use_dai_pcm_id; /* use DAI link PCM ID as PCM device number */ int be_pcm_base; /* base device ID for all BE PCMs */ + +#ifdef CONFIG_DEBUG_FS + const char *debugfs_prefix; +#endif }; struct snd_soc_component { diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a088bc9f7..11cb15319 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2586,6 +2586,11 @@ int snd_soc_component_initialize(struct snd_soc_component *component, component->dev = dev; component->driver = driver; +#ifdef CONFIG_DEBUG_FS + if (!component->debugfs_prefix) + component->debugfs_prefix = driver->debugfs_prefix; +#endif + return 0; } EXPORT_SYMBOL_GPL(snd_soc_component_initialize); From patchwork Wed Mar 9 20:23:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 12775560 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 77A9AC433F5 for ; Wed, 9 Mar 2022 20:24:42 +0000 (UTC) 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 6379316FB; Wed, 9 Mar 2022 21:23:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6379316FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646857480; bh=07Dd4FoIS7I5Cam0j7GdbiFV61Y/AIx9+RKeEzrx8IQ=; h=Date:Subject:From:To:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LVGxb1WDN0duPIDRze4hG49suhj6Wu5EbwCMkxoaGFpLjBT1s6Z+jxLCV9fUmtc3v Q3WW75waPBt995cfmm6UVdVPcqF3iVnr/qBBYpBM0/2ur/+JKOyDchTLVupG4lLkq4 7PeHUNNhiMVYvUK+QAyXPFoXFPCxe3RqMy0+uzEE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A4288F8025E; Wed, 9 Mar 2022 21:23:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 892A0F804AB; Wed, 9 Mar 2022 21:23:17 +0100 (CET) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 00EE8F800D2 for ; Wed, 9 Mar 2022 21:23:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 00EE8F800D2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pqtjIe+Z" Received: by mail-ej1-x629.google.com with SMTP id kt27so7749991ejb.0 for ; Wed, 09 Mar 2022 12:23:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=NGVLTVFJsUCjubXSfriwHtfIwsDlVociFIc0hJBnwpk=; b=pqtjIe+ZUtDb1ZeuVaqwVq3YPbDh9rBJ4o7jyWzzNMQt0nHlCL4Wuj5VpJemji07sH Vf1B1wzDI+F6bk5VrPCnxIfcTUOa6+A/th9ruhGAPiVAdw6FIlTN87ic5wVM8qhQs2aK r74cazB0augzHOao39P1VzZcnbuUtXilmz7T4A6pQXaIfiY8a/0fOUNVmTml6eUh9WLh kIkLRp6KLWr/gE3g5XRVvuOv7zvaIGQSTN4qzuO4s9VlPfpVVV1n0DcRTFfV/7kbgAe3 gmsXVwzg/hnw9U3yfK1kreuFVymSQyJq8IMjb03WOkkuIaK1iT9NsCzzGEuQOibTJuvI h6zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=NGVLTVFJsUCjubXSfriwHtfIwsDlVociFIc0hJBnwpk=; b=zpFia23eZO1raYIBOGyjBPfGgdEVbogKKnjyXd4MQSa4gPkQ+76/QU+0geSQeCrzlm JQTAmAkGH1BmHBPy2ZIjoIW7Off26lReSf2qIGl/BCAI19YyUBfLiLM/zdSqQbDAlmta wF4iFcFfMqmGJ6V7KkimQXnLgJP8NTRSqUBmhAexLrhBiUvBdoxgVrTGw4HWATRFs65j DvmW4v2co++wN6L+NMNztl73zqyuvYhJAt/TryBVmCgAYUz8ABzUVtm1Cig6/jh7Yusi hu2bSc53H896BYdI8I+tPTcNVN41G4nT2GSjLT3dIwsxVmDELg1nhW8Axar3Guj7QoVs GGIA== X-Gm-Message-State: AOAM531N/o7J3zT0e9QFDjp4AmHZo0ZqOv1M9VWC1ORiq9w0VGkqddwI 9gELuTwfj/wn9OB9Omej6XQ= X-Google-Smtp-Source: ABdhPJwjwNyDz7Zhk+G5PJeQBhyjrdvyfOflLQPcu37GGOkDRuK7VvaTPqYNd6yuk4zpv9a2q9rHSQ== X-Received: by 2002:a17:907:2d25:b0:6d7:c831:5714 with SMTP id gs37-20020a1709072d2500b006d7c8315714mr1411549ejc.137.1646857392603; Wed, 09 Mar 2022 12:23:12 -0800 (PST) Received: from ?IPV6:2a01:c22:7793:600:9d6a:7788:3389:da6c? (dynamic-2a01-0c22-7793-0600-9d6a-7788-3389-da6c.c22.pool.telefonica.de. [2a01:c22:7793:600:9d6a:7788:3389:da6c]) by smtp.googlemail.com with ESMTPSA id d1-20020a17090694c100b006da91d57e93sm1143326ejy.207.2022.03.09.12.23.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Mar 2022 12:23:12 -0800 (PST) Message-ID: <38053baf-c33b-7fdf-7593-99b22153a9c0@gmail.com> Date: Wed, 9 Mar 2022 21:23:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: [PATCH v2 2/2] ASoC: meson: aiu: fix duplicate debugfs directory error Content-Language: en-US From: Heiner Kallweit To: Jerome Brunet , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl References: <51953618-79b6-0df7-2d28-d5dce4dc86c7@gmail.com> In-Reply-To: <51953618-79b6-0df7-2d28-d5dce4dc86c7@gmail.com> Cc: "open list:ARM/Amlogic Meson..." , alsa-devel@alsa-project.org, "linux-arm-kernel@lists.infradead.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 a S905W-based system I get the following error: debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present! Turned out that multiple components having the same name triggers this error in soc_init_component_debugfs(). With the patch the error is gone and that's the debugfs entries. /sys/kernel/debug/asoc/P230-Q200/acodec:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/hdmi:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/cpu:c1105400.audio-controller Signed-off-by: Heiner Kallweit --- sound/soc/meson/aiu-acodec-ctrl.c | 3 +++ sound/soc/meson/aiu-codec-ctrl.c | 3 +++ sound/soc/meson/aiu.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/sound/soc/meson/aiu-acodec-ctrl.c b/sound/soc/meson/aiu-acodec-ctrl.c index 27a6d3259..22e181646 100644 --- a/sound/soc/meson/aiu-acodec-ctrl.c +++ b/sound/soc/meson/aiu-acodec-ctrl.c @@ -193,6 +193,9 @@ static const struct snd_soc_component_driver aiu_acodec_ctrl_component = { .of_xlate_dai_name = aiu_acodec_of_xlate_dai_name, .endianness = 1, .non_legacy_dai_naming = 1, +#ifdef CONFIG_DEBUG_FS + .debugfs_prefix = "acodec", +#endif }; int aiu_acodec_ctrl_register_component(struct device *dev) diff --git a/sound/soc/meson/aiu-codec-ctrl.c b/sound/soc/meson/aiu-codec-ctrl.c index c3ea733fc..59ee66fc2 100644 --- a/sound/soc/meson/aiu-codec-ctrl.c +++ b/sound/soc/meson/aiu-codec-ctrl.c @@ -140,6 +140,9 @@ static const struct snd_soc_component_driver aiu_hdmi_ctrl_component = { .of_xlate_dai_name = aiu_hdmi_of_xlate_dai_name, .endianness = 1, .non_legacy_dai_naming = 1, +#ifdef CONFIG_DEBUG_FS + .debugfs_prefix = "hdmi", +#endif }; int aiu_hdmi_ctrl_register_component(struct device *dev) diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c index d299a70db..88e611e64 100644 --- a/sound/soc/meson/aiu.c +++ b/sound/soc/meson/aiu.c @@ -103,6 +103,9 @@ static const struct snd_soc_component_driver aiu_cpu_component = { .pointer = aiu_fifo_pointer, .probe = aiu_cpu_component_probe, .remove = aiu_cpu_component_remove, +#ifdef CONFIG_DEBUG_FS + .debugfs_prefix = "cpu", +#endif }; static struct snd_soc_dai_driver aiu_cpu_dai_drv[] = {