aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorJarkko Nikula <jhnikula@gmail.com>2010-11-05 20:35:19 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-06 11:28:35 -0400
commita6052154944c822993d04ca8f8d8926e8b73b749 (patch)
treeb39ca2870b3865f87a6d29fa7349c9fc288f06f3 /sound/soc/soc-core.c
parentce6120cca2589ede530200c7cfe11ac9f144333c (diff)
downloadkernel_samsung_espresso10-a6052154944c822993d04ca8f8d8926e8b73b749.zip
kernel_samsung_espresso10-a6052154944c822993d04ca8f8d8926e8b73b749.tar.gz
kernel_samsung_espresso10-a6052154944c822993d04ca8f8d8926e8b73b749.tar.bz2
ASoC: Add sound card directory under debugfs/asoc/
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> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3c7c884..b0f635c 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);