Linux 6.2 Adding Driver For Google's ChromeOS Human Presence Sensor
For use-cases like adaptive backlight handling depending upon whether people are detected or deferring the screensaver, the Linux 6.2 kernel is mainlining the cros_hps_i2c driver for supporting this Human Presence Sensor found on new Chromebooks.
Google Chromebooks continue to enjoy many upstream, open-source Linux kernel driver improvements.
The cros_hps_i2c kernel driver itself doesn't report to you if there is a human detected but that's left up to user-space interfacing with this sensor via an exposed character device. The patch-set from Google explains this new driver:
This patch introduces a driver for the ChromeOS human presence sensor (aka. HPS). The driver supports a sensor connected to the I2C bus and identified as "GOOG0020" in the ACPI tables.
When loaded, the driver exports the sensor to userspace through a character device. This device only supports power management, i.e., communication with the sensor must be done through regular I2C transmissions from userspace.
Power management is implemented by enabling the respective power GPIO while at least one userspace process holds an open fd on the character device. By default, the device is powered down if there are no active clients.
For those having privacy concerns around this Human Presence Sensor with Google's ever popular Chromebooks, as a pleasant attribute at least the hardware's firmware is open-source. The HPS device firmware, I2C protocol, and other technical documentation can be found on GoogleSource.com.
This Google Human Presence Sensor driver was sent in as part of the Chrome platform updates for the newly-opened Linux 6.2 merge window. Also notable with this pull request is more of the ChromeOS drivers now setting PROBE_PREFER_ASYNCHRONOUS to help in speeding up boot times for Chromebooks.