From ae45583684f543739e17aa78e08fb424f73ec444 Mon Sep 17 00:00:00 2001 From: yxj Date: Wed, 10 Apr 2013 14:11:04 +0800 Subject: [PATCH] edp anx:create debug node under dir debug/edp/ --- .../video/display/transmitter/dp_anx6345.c | 23 +++++++++++++++---- include/linux/anx6345.h | 3 ++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/video/display/transmitter/dp_anx6345.c b/drivers/video/display/transmitter/dp_anx6345.c index d0def8ffbeef..45192733db20 100755 --- a/drivers/video/display/transmitter/dp_anx6345.c +++ b/drivers/video/display/transmitter/dp_anx6345.c @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include #include @@ -9,7 +7,13 @@ #include #include #include + +#if defined(CONFIG_DEBUG_FS) +#include #include +#include +#endif + //#define BIST_MODE 0 @@ -63,6 +67,7 @@ static int anx6345_i2c_write_p1_reg(struct i2c_client *client, char reg, char *v return ret; } +#if defined(CONFIG_DEBUG_FS) static int edp_reg_show(struct seq_file *s, void *v) { int i = 0; @@ -104,7 +109,7 @@ static const struct file_operations edp_reg_fops = { .llseek = seq_lseek, .release = single_release, }; - +#endif //get chip ID. Make sure I2C is OK static int get_dp_chip_id(struct i2c_client *client) @@ -778,8 +783,16 @@ static int anx6345_i2c_probe(struct i2c_client *client,const struct i2c_device_i if(anx6345->pdata->power_ctl) anx6345->pdata->power_ctl(); - debugfs_create_file("edp-reg", S_IRUSR,NULL,anx6345,&edp_reg_fops); - +#if defined(CONFIG_DEBUG_FS) + anx6345->debugfs_dir = debugfs_create_dir("edp", NULL); + if (IS_ERR(anx6345->debugfs_dir)) + { + printk(KERN_ERR "failed to create debugfs dir for edp!\n"); + } + else + debugfs_create_file("edp-reg", S_IRUSR,anx6345->debugfs_dir,anx6345,&edp_reg_fops); +#endif + #ifdef CONFIG_HAS_EARLYSUSPEND anx6345->early_suspend.suspend = anx6345_early_suspend; anx6345->early_suspend.resume = anx6345_late_resume; diff --git a/include/linux/anx6345.h b/include/linux/anx6345.h index 728f19ea525f..da904a3b5b42 100755 --- a/include/linux/anx6345.h +++ b/include/linux/anx6345.h @@ -693,11 +693,12 @@ struct anx6345_platform_data { struct edp_anx6345 { struct i2c_client *client; struct anx6345_platform_data *pdata; - int (*edp_anx_init)(struct i2c_client *client); rk_screen screen; + struct dentry *debugfs_dir; #ifdef CONFIG_HAS_EARLYSUSPEND struct early_suspend early_suspend; #endif + int (*edp_anx_init)(struct i2c_client *client); }; #endif -- 2.34.1