summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorXiaoming Zhou <zhoux@codeaurora.org>2013-06-04 18:51:09 -0400
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:20:22 -0700
commit5de3210cdfffc0d26716aa8f577a86c63c75f738 (patch)
tree1beb2ed8fa0f5e4f62c2c50985096070e024a6f1 /drivers/video/fbdev
parent42300e146da1d88d747f14f1017ac10adf5d6501 (diff)
msm: mdss: add debugfs support for MDP3 on 8x10
Enable debugfs support for MDP3 core on 8x10. Change-Id: I3ea94379d58b67533bfbaa9b64977ab3ca08ee67 Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdp3.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdp3.c b/drivers/video/fbdev/msm/mdp3.c
index 644879fb2460..6089c506d2a8 100644
--- a/drivers/video/fbdev/msm/mdp3.c
+++ b/drivers/video/fbdev/msm/mdp3.c
@@ -50,6 +50,7 @@
#include "mdp3_hwio.h"
#include "mdp3_ctrl.h"
#include "mdp3_ppp.h"
+#include "mdss_debug.h"
#define MDP_CORE_HW_VERSION 0x03040310
struct mdp3_hw_resource *mdp3_res;
@@ -1297,10 +1298,50 @@ static int mdp3_panel_register_done(struct mdss_panel_data *pdata)
rc = mdp3_continuous_splash_on(pdata);
}
}
+ return rc;
+}
+
+static void mdp3_debug_enable_clock(int on)
+{
+ if (on)
+ mdp3_clk_enable(1);
+ else
+ mdp3_clk_enable(0);
+}
+
+static int mdp3_debug_init(struct platform_device *pdev)
+{
+ int rc;
+ struct mdss_data_type *mdata;
+
+ mdata = devm_kzalloc(&pdev->dev, sizeof(*mdata), GFP_KERNEL);
+ if (!mdata)
+ return -ENOMEM;
+
+ mdss_res = mdata;
+
+ mdata->debug_inf.debug_dump_stats = NULL;
+ mdata->debug_inf.debug_enable_clock = mdp3_debug_enable_clock;
+
+ rc = mdss_debugfs_init(mdata);
+ if (rc)
+ return rc;
+
+ rc = mdss_debug_register_base(NULL, mdp3_res->mdp_base ,
+ mdp3_res->mdp_reg_size);
return rc;
}
+static void mdp3_debug_deinit(struct platform_device *pdev)
+{
+ if (mdss_res) {
+ mdss_debugfs_remove(mdss_res);
+ devm_kfree(&pdev->dev, mdss_res);
+ mdss_res = NULL;
+ }
+}
+
static int mdp3_probe(struct platform_device *pdev)
{
int rc;
@@ -1349,6 +1390,12 @@ static int mdp3_probe(struct platform_device *pdev)
goto probe_done;
}
+ rc = mdp3_debug_init(pdev);
+ if (rc) {
+ pr_err("unable to initialize mdp debugging\n");
+ goto probe_done;
+ }
+
rc = mdss_fb_register_mdp_instance(&mdp3_interface);
if (rc)
pr_err("unable to register mdp instance\n");
@@ -1362,6 +1409,11 @@ probe_done:
devm_kfree(&pdev->dev, mdp3_res);
mdp3_res = NULL;
+
+ if (mdss_res) {
+ devm_kfree(&pdev->dev, mdss_res);
+ mdss_res = NULL;
+ }
}
return rc;
@@ -1410,6 +1462,7 @@ static int mdp3_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
mdp3_bus_scale_unregister();
mdp3_clk_remove();
+ mdp3_debug_deinit(pdev);
return 0;
}