From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Mark Brown <broonie@kernel.org>
Cc: kernel@collabora.com, "Jaroslav Kysela" <perex@perex.cz>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
"Akihiko Odaki" <akihiko.odaki@gmail.com>,
"Jiaxin Yu" <jiaxin.yu@mediatek.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Miaoqian Lin" <linmq006@gmail.com>,
"Takashi Iwai" <tiwai@suse.com>,
"Tzung-Bi Shih" <tzungbi@google.com>,
alsa-devel@alsa-project.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [PATCH] ASoC: mediatek: mt8192-mt6359: Set the driver name for the card
Date: Thu, 29 Sep 2022 16:54:53 -0400 [thread overview]
Message-ID: <20220929205453.1144142-1-nfraprado@collabora.com> (raw)
The ASoC core automatically populates the driver name field in the card
from the card name if left unset. However, since the driver name can be
at most 16 characters long, wrapping will happen if the card name is
longer, which is the case for the mt8192-mt6359 driver.
Explicitly set the driver name for the card in order to avoid said
wrapping and have a readable driver name exposed to userspace.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
Issue noticed while upstreaming the UCM file for this driver [1].
[1] https://github.com/alsa-project/alsa-ucm-conf/pull/217
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
index ff40ccd36f7e..b93c3237ef2d 100644
--- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
+++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
@@ -24,6 +24,8 @@
#include "mt8192-afe-clk.h"
#include "mt8192-afe-gpio.h"
+#define DRIVER_NAME "mt8192_mt6359"
+
#define RT1015_CODEC_DAI "rt1015-aif"
#define RT1015_DEV0_NAME "rt1015.1-0028"
#define RT1015_DEV1_NAME "rt1015.1-0029"
@@ -1070,6 +1072,7 @@ static struct snd_soc_codec_conf rt1015_amp_conf[] = {
static struct snd_soc_card mt8192_mt6359_rt1015_rt5682_card = {
.name = RT1015_RT5682_CARD_NAME,
+ .driver_name = DRIVER_NAME,
.owner = THIS_MODULE,
.dai_link = mt8192_mt6359_dai_links,
.num_links = ARRAY_SIZE(mt8192_mt6359_dai_links),
@@ -1105,6 +1108,7 @@ static const struct snd_kcontrol_new mt8192_mt6359_rt1015p_rt5682x_controls[] =
};
static struct snd_soc_card mt8192_mt6359_rt1015p_rt5682x_card = {
+ .driver_name = DRIVER_NAME,
.owner = THIS_MODULE,
.dai_link = mt8192_mt6359_dai_links,
.num_links = ARRAY_SIZE(mt8192_mt6359_dai_links),
@@ -1266,7 +1270,7 @@ static const struct dev_pm_ops mt8192_mt6359_pm_ops = {
static struct platform_driver mt8192_mt6359_driver = {
.driver = {
- .name = "mt8192_mt6359",
+ .name = DRIVER_NAME,
#ifdef CONFIG_OF
.of_match_table = mt8192_mt6359_dt_match,
#endif
--
2.37.3
next reply other threads:[~2022-09-29 20:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 20:54 Nícolas F. R. A. Prado [this message]
2022-09-30 8:31 ` [PATCH] ASoC: mediatek: mt8192-mt6359: Set the driver name for the card AngeloGioacchino Del Regno
2022-09-30 10:33 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220929205453.1144142-1-nfraprado@collabora.com \
--to=nfraprado@collabora.com \
--cc=akihiko.odaki@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=jiaxin.yu@mediatek.com \
--cc=kernel@collabora.com \
--cc=lgirdwood@gmail.com \
--cc=linmq006@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=tzungbi@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox