summaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome/cros_ec_dev.c
diff options
context:
space:
mode:
authorEric Caruso2017-05-16 17:46:48 +0200
committerBenson Leung2017-06-16 22:57:45 +0200
commite86264595225d2764a903965356ef59aeb7d1c47 (patch)
treef4999d2bf8c25004afaa1e351a7776e5378698a4 /drivers/platform/chrome/cros_ec_dev.c
parentmfd: cros_ec: Add EC console read structures definitions (diff)
downloadkernel-qcow2-linux-e86264595225d2764a903965356ef59aeb7d1c47.tar.gz
kernel-qcow2-linux-e86264595225d2764a903965356ef59aeb7d1c47.tar.xz
kernel-qcow2-linux-e86264595225d2764a903965356ef59aeb7d1c47.zip
mfd: cros_ec: add debugfs, console log file
If the EC supports the new CONSOLE_READ command type, then we place a console_log file in debugfs for that EC device which allows us to grab EC logs. The kernel will poll every 10 seconds for the log and keep its own buffer, but userspace should grab this and write it out to some logs which actually get rotated. Signed-off-by: Eric Caruso <ejcaruso@chromium.org> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Acked-by: Lee Jones <lee.jones@linaro.org> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> [bleung: restored original version of this commit, with pointer size issue to be fixed in next commit] Signed-off-by: Benson Leung <bleung@chromium.org>
Diffstat (limited to 'drivers/platform/chrome/cros_ec_dev.c')
-rw-r--r--drivers/platform/chrome/cros_ec_dev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
index 6aa120cd0574..20ce1c23fb5c 100644
--- a/drivers/platform/chrome/cros_ec_dev.c
+++ b/drivers/platform/chrome/cros_ec_dev.c
@@ -24,6 +24,7 @@
#include <linux/slab.h>
#include <linux/uaccess.h>
+#include "cros_ec_debugfs.h"
#include "cros_ec_dev.h"
/* Device variables */
@@ -427,6 +428,9 @@ static int ec_device_probe(struct platform_device *pdev)
goto failed;
}
+ if (cros_ec_debugfs_init(ec))
+ dev_warn(dev, "failed to create debugfs directory\n");
+
/* check whether this EC is a sensor hub. */
if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE))
cros_ec_sensors_register(ec);
@@ -441,6 +445,9 @@ failed:
static int ec_device_remove(struct platform_device *pdev)
{
struct cros_ec_dev *ec = dev_get_drvdata(&pdev->dev);
+
+ cros_ec_debugfs_remove(ec);
+
cdev_del(&ec->cdev);
device_unregister(&ec->class_dev);
return 0;