~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/sh/rcar/debugfs.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 //
  3 // // Renesas R-Car debugfs support
  4 //
  5 // Copyright (c) 2021 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  6 //
  7 //      > mount -t debugfs none /sys/kernel/debug
  8 //      > cd /sys/kernel/debug/asoc/rcar-sound/ec500000.sound/rdai{N}/
  9 //      > cat playback/xxx
 10 //      > cat capture/xxx
 11 //
 12 #ifdef CONFIG_DEBUG_FS
 13 
 14 #include <linux/debugfs.h>
 15 #include "rsnd.h"
 16 
 17 static int rsnd_debugfs_show(struct seq_file *m, void *v)
 18 {
 19         struct rsnd_dai_stream *io = m->private;
 20         struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io);
 21         struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
 22         int i;
 23 
 24         /* adg is out of mods */
 25         rsnd_adg_clk_dbg_info(priv, m);
 26 
 27         for_each_rsnd_mod(i, mod, io) {
 28                 u32 *status = mod->ops->get_status(mod, io, mod->type);
 29 
 30                 seq_printf(m, "name: %s\n", rsnd_mod_name(mod));
 31                 seq_printf(m, "status: %08x\n", *status);
 32 
 33                 if (mod->ops->debug_info)
 34                         mod->ops->debug_info(m, io, mod);
 35         }
 36 
 37         return 0;
 38 }
 39 DEFINE_SHOW_ATTRIBUTE(rsnd_debugfs);
 40 
 41 void rsnd_debugfs_reg_show(struct seq_file *m, phys_addr_t _addr,
 42                            void __iomem *base, int offset, int size)
 43 {
 44         int i, j;
 45 
 46         for (i = 0; i < size; i += 0x10) {
 47                 phys_addr_t addr = _addr + offset + i;
 48 
 49                 seq_printf(m, "%pa:", &addr);
 50                 for (j = 0; j < 0x10; j += 0x4)
 51                         seq_printf(m, " %08x", __raw_readl(base + offset + i + j));
 52                 seq_puts(m, "\n");
 53         }
 54 }
 55 
 56 void rsnd_debugfs_mod_reg_show(struct seq_file *m, struct rsnd_mod *mod,
 57                                int reg_id, int offset, int size)
 58 {
 59         struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
 60 
 61         rsnd_debugfs_reg_show(m,
 62                               rsnd_gen_get_phy_addr(priv, reg_id),
 63                               rsnd_gen_get_base_addr(priv, reg_id),
 64                               offset, size);
 65 }
 66 
 67 int rsnd_debugfs_probe(struct snd_soc_component *component)
 68 {
 69         struct rsnd_priv *priv = dev_get_drvdata(component->dev);
 70         struct rsnd_dai *rdai;
 71         struct dentry *dir;
 72         char name[64];
 73         int i;
 74 
 75         /* Gen1 is not supported */
 76         if (rsnd_is_gen1(priv))
 77                 return 0;
 78 
 79         for_each_rsnd_dai(rdai, priv, i) {
 80                 /*
 81                  * created debugfs will be automatically
 82                  * removed, nothing to do for _remove.
 83                  * see
 84                  *      soc_cleanup_component_debugfs()
 85                  */
 86                 snprintf(name, sizeof(name), "rdai%d", i);
 87                 dir = debugfs_create_dir(name, component->debugfs_root);
 88 
 89                 debugfs_create_file("playback", 0444, dir, &rdai->playback, &rsnd_debugfs_fops);
 90                 debugfs_create_file("capture",  0444, dir, &rdai->capture,  &rsnd_debugfs_fops);
 91         }
 92 
 93         return 0;
 94 }
 95 
 96 #endif /* CONFIG_DEBUG_FS */
 97 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php