platform/chrome: mfd/cros_ec_dev: Add sysfs entry to set keyboard wake lid angle
authorGwendal Grignou <gwendal@chromium.org>
Fri, 23 Mar 2018 17:42:47 +0000 (18:42 +0100)
committerBenson Leung <bleung@chromium.org>
Wed, 11 Apr 2018 05:25:07 +0000 (22:25 -0700)
commitc1d1e91aff3d1183d6b16a282c2575e3e006cee4
treec28563a8b73ebda8598b47f059ab328df9cc65e9
parentb082b2e1454c3e0217d7cf70f2211966c3d54301
platform/chrome: mfd/cros_ec_dev: Add sysfs entry to set keyboard wake lid angle

This adds a sysfs attribute (/sys/class/chromeos/cros_ec/kb_wake_angle)
used to set and get the keyboard wake lid angle. This attribute is
present only if 2 accelerometers are controlled by the EC.

This patch also moves the cros_ec features check before the device is
added so the features map obtained from the EC is ready on time.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Benson Leung <bleung@chromium.org>
drivers/mfd/cros_ec_dev.c
drivers/platform/chrome/cros_ec_sysfs.c
include/linux/mfd/cros_ec.h