input: sensor: set the ABS_MISC bit to absbit
If set EV_ABS bit to evbit, and also set ABS_MISC
bit absbit, kernel will treat it as vitual input
device, it has the file node like "/sys/devices/
virtual/input/inputx/", besides "/sys/class/input/
inputx/". The uevent scripts will set the group of
all "enable" files in "/sys/devices/virtual/input/
inputx*" as "input" group, so that the sensor HAL
which group is "input", can write the "enable" file
to control the sensor
Change-Id: I4ceda923d7f236b8ceebaaa36cfd72abf4fa7e10
Signed-off-by: Richard Liu <richardl@codeaurora.org>
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
index bec4874..519b7e4 100644
--- a/drivers/input/misc/mpu3050.c
+++ b/drivers/input/misc/mpu3050.c
@@ -333,7 +333,7 @@
__ATTR(pollrate_ms, 0664,
mpu3050_attr_get_polling_rate,
mpu3050_attr_set_polling_rate),
- __ATTR(enable, 0664,
+ __ATTR(enable, 0644,
mpu3050_attr_get_enable,
mpu3050_attr_set_enable),
};
@@ -721,7 +721,7 @@
idev->open = mpu3050_input_open;
idev->close = mpu3050_input_close;
- __set_bit(EV_ABS, idev->evbit);
+ input_set_capability(idev, EV_ABS, ABS_MISC);
input_set_abs_params(idev, ABS_X,
MPU3050_MIN_VALUE, MPU3050_MAX_VALUE, 0, 0);
input_set_abs_params(idev, ABS_Y,