media: video: tegra: add avp port transport info to debug dump
authorDima Zavin <dima@android.com>
Tue, 9 Nov 2010 00:59:22 +0000 (16:59 -0800)
committerDima Zavin <dima@android.com>
Wed, 10 Nov 2010 02:48:17 +0000 (18:48 -0800)
Change-Id: I7ade4469609ecf87663e6a6733842889b27f7ce5
Signed-off-by: Dima Zavin <dima@android.com>
drivers/media/video/tegra/avp/avp.c

index 2fc0fab573096a664c7f0afc38c6cffcd36b0320..7d4ecc05b2e4d9c76e021a04caeb14899a97a2ad 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/mutex.h>
 #include <linux/platform_device.h>
 #include <linux/rbtree.h>
+#include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/tegra_rpc.h>
 #include <linux/types.h>
@@ -148,11 +149,13 @@ static struct avp_info *tegra_avp;
 
 static int avp_trpc_send(struct trpc_endpoint *ep, void *buf, size_t len);
 static void avp_trpc_close(struct trpc_endpoint *ep);
+static void avp_trpc_show(struct seq_file *s, struct trpc_endpoint *ep);
 static void libs_cleanup(struct avp_info *avp);
 
 static struct trpc_ep_ops remote_ep_ops = {
        .send   = avp_trpc_send,
        .close  = avp_trpc_close,
+       .show   = avp_trpc_show,
 };
 
 static struct remote_info *rinfo_alloc(struct avp_info *avp)
@@ -251,6 +254,24 @@ static struct remote_info *validate_trpc_ep(struct avp_info *avp,
        return NULL;
 }
 
+static void avp_trpc_show(struct seq_file *s, struct trpc_endpoint *ep)
+{
+       struct avp_info *avp = tegra_avp;
+       struct remote_info *rinfo;
+       unsigned long flags;
+
+       spin_lock_irqsave(&avp->state_lock, flags);
+       rinfo = validate_trpc_ep(avp, ep);
+       if (!rinfo) {
+               seq_printf(s, "    <unknown>\n");
+               goto out;
+       }
+       seq_printf(s, "    loc_id:0x%x\n    rem_id:0x%x\n",
+                  rinfo->loc_id, rinfo->rem_id);
+out:
+       spin_unlock_irqrestore(&avp->state_lock, flags);
+}
+
 static inline void mbox_writel(u32 val, void __iomem *mbox)
 {
        writel(val, mbox);