diff options
author | Dan Callaghan <dcallagh@chromium.org> | 2022-10-18 06:06:23 +0200 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-10-18 06:53:15 +0200 |
commit | 5f9952548d91263eaf70a2ca71f8897c2a638cf1 (patch) | |
tree | 49ddcdbb354d7ae43ca5c4658f069b7440fee78a /drivers/platform/chrome/Kconfig | |
parent | Linux 6.1-rc1 (diff) | |
download | linux-5f9952548d91263eaf70a2ca71f8897c2a638cf1.tar.xz linux-5f9952548d91263eaf70a2ca71f8897c2a638cf1.zip |
platform/chrome: add a driver for HPS
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.
Note that the driver makes no effort to preserve the state of the sensor
between power down and power up events. Userspace is responsible for
reinitializing any needed state once power has been restored.
The device firmware, I2C protocol and other documentation is available
at https://chromium.googlesource.com/chromiumos/platform/hps-firmware.
Co-developed-by: Sami Kyöstilä <skyostil@chromium.org>
Signed-off-by: Sami Kyöstilä <skyostil@chromium.org>
Signed-off-by: Dan Callaghan <dcallagh@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20221018040623.2173441-1-dcallagh@chromium.org
Diffstat (limited to 'drivers/platform/chrome/Kconfig')
-rw-r--r-- | drivers/platform/chrome/Kconfig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig index 6b954c5acadb..c1ca247987d2 100644 --- a/drivers/platform/chrome/Kconfig +++ b/drivers/platform/chrome/Kconfig @@ -228,6 +228,16 @@ config CROS_EC_TYPEC To compile this driver as a module, choose M here: the module will be called cros_ec_typec. +config CROS_HPS_I2C + tristate "ChromeOS HPS device" + depends on HID && I2C && PM + help + Say Y here if you want to enable support for the ChromeOS + human presence sensor (HPS), attached via I2C. The driver supports a + sensor connected to the I2C bus and exposes it as a character device. + To save power, the sensor is automatically powered down when no + clients are accessing it. + config CROS_USBPD_LOGGER tristate "Logging driver for USB PD charger" depends on CHARGER_CROS_USBPD |