From 57fc92cd719a8f54be58680f19e3110057d9a4f5 Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Thu, 21 May 2015 13:40:15 +0800 Subject: [PATCH] display-sys: debug node support to show debug information. Add a callback function getdebug() to show debug information. Signed-off-by: Zheng Yang --- drivers/video/rockchip/display-sys.c | 7 ++++++- include/linux/display-sys.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/video/rockchip/display-sys.c b/drivers/video/rockchip/display-sys.c index bcf19988006e..8fd6926c67a9 100755 --- a/drivers/video/rockchip/display-sys.c +++ b/drivers/video/rockchip/display-sys.c @@ -364,7 +364,12 @@ static ssize_t display_show_monspecs(struct device *dev, static ssize_t display_show_debug(struct device *dev, struct device_attribute *attr, char *buf) { - return -EINVAL; + struct rk_display_device *dsp = dev_get_drvdata(dev); + + if (dsp->ops && dsp->ops->getdebug) + return dsp->ops->getdebug(dsp, buf); + else + return -EINVAL; } static ssize_t display_store_debug(struct device *dev, diff --git a/include/linux/display-sys.h b/include/linux/display-sys.h index b229b9b2bab1..72a044ba5c1b 100755 --- a/include/linux/display-sys.h +++ b/include/linux/display-sys.h @@ -61,6 +61,7 @@ struct rk_display_ops { int (*getcolor)(struct rk_display_device *, char *); int (*setcolor)(struct rk_display_device *, const char *, int); int (*setdebug)(struct rk_display_device *, int); + int (*getdebug)(struct rk_display_device *, char *); int (*getedidaudioinfo)(struct rk_display_device *, char *audioinfo, int len); int (*getmonspecs)(struct rk_display_device *, -- 2.34.1