提交 a6052154 编写于 作者: J Jarkko Nikula 提交者: Mark Brown

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: NJarkko Nikula <jhnikula@gmail.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 ce6120cc
......@@ -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 */
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册