// SPDX-License-Identifier: GPL-2.0 /* * Driver for the ChromeOS human presence sensor (HPS), attached via I2C. * * The driver exposes HPS as a character device, although currently no read or * write operations are supported. Instead, the driver only controls the power * state of the sensor, keeping it on only while userspace holds an open file * descriptor to the HPS device. * * Copyright 2022 Google LLC.
*/
/* * HPS is powered on from firmware before entering the kernel, so we * acquire the line with GPIOD_OUT_HIGH here to preserve the existing * state. The peripheral is powered off after successful probe below.
*/
hps->enable_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_HIGH); if (IS_ERR(hps->enable_gpio)) {
ret = PTR_ERR(hps->enable_gpio);
dev_err(&client->dev, "failed to get enable gpio: %d\n", ret); return ret;
}
ret = misc_register(&hps->misc_device); if (ret) {
dev_err(&client->dev, "failed to initialize misc device: %d\n", ret); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.