[PATCH 4/5] OMAPDSS: HDMI: Add support to dump registers through

2011-09-20 Thread mythripk
From: Mythri P K mythr...@ti.com

Add support to dump the HDMI core, PLL and PHY registers through debugfs

Signed-off-by: Mythri P K mythr...@ti.com
---
 drivers/video/omap2/dss/core.c|4 +
 drivers/video/omap2/dss/dss.h |1 +
 drivers/video/omap2/dss/dss_features.c|5 +
 drivers/video/omap2/dss/hdmi.c|   16 +++
 drivers/video/omap2/dss/ti_hdmi.h |   14 +++
 drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c |  168 +
 6 files changed, 208 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 76821fe..86ec12e 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -145,6 +145,10 @@ static int dss_initialize_debugfs(void)
debugfs_create_file(venc, S_IRUGO, dss_debugfs_dir,
venc_dump_regs, dss_debug_fops);
 #endif
+#ifdef CONFIG_OMAP4_DSS_HDMI
+   debugfs_create_file(hdmi, S_IRUGO, dss_debugfs_dir,
+   hdmi_dump_regs, dss_debug_fops);
+#endif
return 0;
 }
 
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 47eebd8..8652007 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -472,6 +472,7 @@ int hdmi_init_platform_driver(void);
 void hdmi_uninit_platform_driver(void);
 int hdmi_init_display(struct omap_dss_device *dssdev);
 unsigned long hdmi_get_pixel_clock(void);
+void hdmi_dump_regs(struct seq_file *s);
 #else
 static inline int hdmi_init_display(struct omap_dss_device *dssdev)
 {
diff --git a/drivers/video/omap2/dss/dss_features.c 
b/drivers/video/omap2/dss/dss_features.c
index 47e66d8..a2fc8e0 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -447,6 +447,11 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
.pll_enable =   ti_hdmi_4xxx_pll_enable,
.pll_disable=   ti_hdmi_4xxx_pll_disable,
.video_enable   =   ti_hdmi_4xxx_wp_video_start,
+   .dump_wrapper   =   ti_hdmi_4xxx_wp_dump,
+   .dump_core  =   ti_hdmi_4xxx_core_dump,
+   .dump_pll   =   ti_hdmi_4xxx_pll_dump,
+   .dump_phy   =   ti_hdmi_4xxx_phy_dump,
+
 };
 
 void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data)
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 2f554ae..3262f0f 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -438,6 +438,22 @@ void omapdss_hdmi_display_set_timing(struct 
omap_dss_device *dssdev)
}
 }
 
+void hdmi_dump_regs(struct seq_file *s)
+{
+   mutex_lock(hdmi.lock);
+
+   if (hdmi_runtime_get())
+   return;
+
+   hdmi.ip_data.ops-dump_wrapper(hdmi.ip_data, s);
+   hdmi.ip_data.ops-dump_pll(hdmi.ip_data, s);
+   hdmi.ip_data.ops-dump_phy(hdmi.ip_data, s);
+   hdmi.ip_data.ops-dump_core(hdmi.ip_data, s);
+
+   hdmi_runtime_put();
+   mutex_unlock(hdmi.lock);
+}
+
 int omapdss_hdmi_read_edid(u8 *buf, int len)
 {
int r;
diff --git a/drivers/video/omap2/dss/ti_hdmi.h 
b/drivers/video/omap2/dss/ti_hdmi.h
index d48603c..2c3443d 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -101,6 +101,15 @@ struct ti_hdmi_ip_ops {
void (*pll_disable)(struct hdmi_ip_data *ip_data);
 
void (*video_enable)(struct hdmi_ip_data *ip_data, bool start);
+
+   void (*dump_wrapper)(struct hdmi_ip_data *ip_data, struct seq_file *s);
+
+   void (*dump_core)(struct hdmi_ip_data *ip_data, struct seq_file *s);
+
+   void (*dump_pll)(struct hdmi_ip_data *ip_data, struct seq_file *s);
+
+   void (*dump_phy)(struct hdmi_ip_data *ip_data, struct seq_file *s);
+
 };
 
 struct hdmi_ip_data {
@@ -121,4 +130,9 @@ void ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data 
*ip_data, bool start);
 int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data);
 void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data);
 void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data);
+void ti_hdmi_4xxx_wp_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
+void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
+void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
+void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
+
 #endif
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c 
b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index 5f22d2e..8355c4f 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -27,6 +27,7 @@
 #include linux/mutex.h
 #include linux/delay.h
 #include linux/string.h
+#include linux/seq_file.h
 
 #include ti_hdmi_4xxx_ip.h
 #include dss.h
@@ -805,6 +806,173 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data 
*ip_data)

Re: [PATCH 4/5] OMAPDSS: HDMI: Add support to dump registers through

2011-09-20 Thread Tomi Valkeinen
On Tue, 2011-09-20 at 18:19 +0530, mythr...@ti.com wrote:
 From: Mythri P K mythr...@ti.com
 
 Add support to dump the HDMI core, PLL and PHY registers through debugfs

The subject seems to be broken.

This prints PLL registers twice, second time is when it should be
printing PHY registers.

It also prints lines like:

HDMI_CORE_AV_SPD_DBYTE(i)   
HDMI_CORE_AV_SPD_DBYTE(i)   
HDMI_CORE_AV_SPD_DBYTE(i)   
HDMI_CORE_AV_SPD_DBYTE(i)   

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html