From: Jarkko Nikula <jhnikula@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: [PATCH 1/3] ASoC: Add sound card directory under debugfs/asoc/
Date: Fri, 5 Nov 2010 20:35:19 +0200 [thread overview]
Message-ID: <1288982121-22201-2-git-send-email-jhnikula@gmail.com> (raw)
In-Reply-To: <1288982121-22201-1-git-send-email-jhnikula@gmail.com>
There will be need to have sound card specific debugfs entries. This patch
introduces a new debugfs/asoc/{card->name}/ directory but does not add yet
any entries there.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
include/sound/soc.h | 4 ++++
sound/soc/soc-core.c | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index b048e08..95ce0dd 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -589,6 +589,10 @@ struct snd_soc_card {
struct list_head codec_dev_list;
struct list_head platform_dev_list;
struct list_head dai_dev_list;
+
+#ifdef CONFIG_DEBUG_FS
+ struct dentry *debugfs_card_root;
+#endif
};
/* SoC machine DAI configuration, glues a codec and cpu DAI together */
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index abbeadf..3819659 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -374,6 +374,20 @@ static const struct file_operations platform_list_fops = {
.llseek = default_llseek,/* read accesses f_pos */
};
+static void soc_init_card_debugfs(struct snd_soc_card *card)
+{
+ card->debugfs_card_root = debugfs_create_dir(card->name,
+ debugfs_root);
+ if (!card->debugfs_card_root)
+ dev_warn(card->dev,
+ "ASoC: Failed to create codec debugfs directory\n");
+}
+
+static void soc_cleanup_card_debugfs(struct snd_soc_card *card)
+{
+ debugfs_remove_recursive(card->debugfs_card_root);
+}
+
#else
static inline void soc_init_codec_debugfs(struct snd_soc_codec *codec)
@@ -1667,6 +1681,8 @@ static int soc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&card->codec_dev_list);
INIT_LIST_HEAD(&card->platform_dev_list);
+ soc_init_card_debugfs(card);
+
ret = snd_soc_register_card(card);
if (ret != 0) {
dev_err(&pdev->dev, "Failed to register card\n");
@@ -1694,6 +1710,8 @@ static int soc_remove(struct platform_device *pdev)
for (i = 0; i < card->num_rtd; i++)
soc_remove_dai_link(card, i);
+ soc_cleanup_card_debugfs(card);
+
/* remove the card */
if (card->remove)
card->remove(pdev);
--
1.7.2.3
next prev parent reply other threads:[~2010-11-05 18:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-05 18:35 [PATCH 0/3] sound card dir under debugfs Jarkko Nikula
2010-11-05 18:35 ` Jarkko Nikula [this message]
2010-11-05 18:35 ` [PATCH 2/3] ASoC: Move codec debugfs directories under parent card directory Jarkko Nikula
2010-11-05 18:35 ` [PATCH 3/3] ASoC: Move pop time from DAPM context to sound card Jarkko Nikula
2010-11-05 18:36 ` [PATCH 0/3] sound card dir under debugfs Mark Brown
2010-11-05 18:39 ` Jarkko Nikula
2010-11-05 18:39 ` Mark Brown
2010-11-05 18:41 ` Jarkko Nikula
2010-11-05 18:46 ` Mark Brown
2010-11-05 18:48 ` Jarkko Nikula
2010-11-05 18:50 ` Mark Brown
2010-11-06 10:52 ` Liam Girdwood
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=1288982121-22201-2-git-send-email-jhnikula@gmail.com \
--to=jhnikula@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@slimlogic.co.uk \
/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;
as well as URLs for NNTP newsgroup(s).