Skip to content

Commit

Permalink
ChromeOS: module to allow hid sensors use within ChromeOS
Browse files Browse the repository at this point in the history
ChromeOS sensors management framework is not natively compatible with hid sensors reported values. This module makes hid accelerometer and ambient light sensors work under ChromeOS.
  • Loading branch information
sebanc committed Jan 28, 2020
1 parent e466341 commit d9c46c8
Show file tree
Hide file tree
Showing 3 changed files with 1,065 additions and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/drivers/hid/hid-sensor-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,7 @@ static int sensor_hub_probe(struct hid_device *hdev,
if (last_hsdev)
last_hsdev->end_collection_index = i;
last_hsdev = hsdev;
name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
"HID-SENSOR-%x",
collection->usage);
name = devm_kasprintf(&hdev->dev, GFP_KERNEL, "cros-ec-compat");
if (name == NULL) {
hid_err(hdev, "Failed MFD device name\n");
ret = -ENOMEM;
Expand Down
2 changes: 2 additions & 0 deletions kernel/drivers/iio/common/hid-sensors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
obj-$(CONFIG_HID_SENSOR_IIO_COMMON) += hid-sensor-iio-common.o
obj-$(CONFIG_HID_SENSOR_IIO_TRIGGER) += hid-sensor-trigger.o
hid-sensor-iio-common-y := hid-sensor-attributes.o

obj-$(CONFIG_HID_SENSOR_IIO_COMMON) += hid-sensor-cros-compat.o

0 comments on commit d9c46c8

Please sign in to comment.