aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorSebastien Guiriec <s-guiriec@ti.com>2012-02-15 10:25:31 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-15 11:05:18 -0500
commit731f1ab290ca1e59430ab222290d379222eb38a5 (patch)
treeaacd52320691daeb0e41e12336b35a8257931462 /sound
parent48a8c3943d1010c81d8144cc773f81c30bf59246 (diff)
ASoC: core: add platform DAPM debugfs support
Allow platform widgets to be visible in debugfs like codec widgets. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 50b8b80acdf4..6bad7cd4131e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -300,6 +300,27 @@ static void soc_cleanup_codec_debugfs(struct snd_soc_codec *codec)
300 debugfs_remove_recursive(codec->debugfs_codec_root); 300 debugfs_remove_recursive(codec->debugfs_codec_root);
301} 301}
302 302
303static void soc_init_platform_debugfs(struct snd_soc_platform *platform)
304{
305 struct dentry *debugfs_card_root = platform->card->debugfs_card_root;
306
307 platform->debugfs_platform_root = debugfs_create_dir(platform->name,
308 debugfs_card_root);
309 if (!platform->debugfs_platform_root) {
310 dev_warn(platform->dev,
311 "Failed to create platform debugfs directory\n");
312 return;
313 }
314
315 snd_soc_dapm_debugfs_init(&platform->dapm,
316 platform->debugfs_platform_root);
317}
318
319static void soc_cleanup_platform_debugfs(struct snd_soc_platform *platform)
320{
321 debugfs_remove_recursive(platform->debugfs_platform_root);
322}
323
303static ssize_t codec_list_read_file(struct file *file, char __user *user_buf, 324static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
304 size_t count, loff_t *ppos) 325 size_t count, loff_t *ppos)
305{ 326{
@@ -433,6 +454,14 @@ static inline void soc_cleanup_codec_debugfs(struct snd_soc_codec *codec)
433{ 454{
434} 455}
435 456
457static inline void soc_init_platform_debugfs(struct snd_soc_platform *platform)
458{
459}
460
461static inline void soc_cleanup_platform_debugfs(struct snd_soc_platform *platform)
462{
463}
464
436static inline void soc_init_card_debugfs(struct snd_soc_card *card) 465static inline void soc_init_card_debugfs(struct snd_soc_card *card)
437{ 466{
438} 467}
@@ -920,6 +949,7 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order)
920 /* Make sure all DAPM widgets are freed */ 949 /* Make sure all DAPM widgets are freed */
921 snd_soc_dapm_free(&platform->dapm); 950 snd_soc_dapm_free(&platform->dapm);
922 951
952 soc_cleanup_platform_debugfs(platform);
923 platform->probed = 0; 953 platform->probed = 0;
924 list_del(&platform->card_list); 954 list_del(&platform->card_list);
925 module_put(platform->dev->driver->owner); 955 module_put(platform->dev->driver->owner);
@@ -1037,6 +1067,8 @@ static int soc_probe_platform(struct snd_soc_card *card,
1037 if (!try_module_get(platform->dev->driver->owner)) 1067 if (!try_module_get(platform->dev->driver->owner))
1038 return -ENODEV; 1068 return -ENODEV;
1039 1069
1070 soc_init_platform_debugfs(platform);
1071
1040 if (driver->dapm_widgets) 1072 if (driver->dapm_widgets)
1041 snd_soc_dapm_new_controls(&platform->dapm, 1073 snd_soc_dapm_new_controls(&platform->dapm,
1042 driver->dapm_widgets, driver->num_dapm_widgets); 1074 driver->dapm_widgets, driver->num_dapm_widgets);