Lines Matching full:hps

3  * Driver for the ChromeOS human presence sensor (HPS), attached via I2C.
5 * The driver exposes HPS as a character device, although currently no read or
8 * descriptor to the HPS device.
29 static void hps_set_power(struct hps_drvdata *hps, bool state) in hps_set_power() argument
31 gpiod_set_value_cansleep(hps->enable_gpio, state); in hps_set_power()
36 struct hps_drvdata *hps = container_of(file->private_data, in hps_open() local
38 struct device *dev = &hps->client->dev; in hps_open()
45 struct hps_drvdata *hps = container_of(file->private_data, in hps_release() local
47 struct device *dev = &hps->client->dev; in hps_release()
60 struct hps_drvdata *hps; in hps_i2c_probe() local
63 hps = devm_kzalloc(&client->dev, sizeof(*hps), GFP_KERNEL); in hps_i2c_probe()
64 if (!hps) in hps_i2c_probe()
67 hps->misc_device.parent = &client->dev; in hps_i2c_probe()
68 hps->misc_device.minor = MISC_DYNAMIC_MINOR; in hps_i2c_probe()
69 hps->misc_device.name = "cros-hps"; in hps_i2c_probe()
70 hps->misc_device.fops = &hps_fops; in hps_i2c_probe()
72 i2c_set_clientdata(client, hps); in hps_i2c_probe()
73 hps->client = client; in hps_i2c_probe()
76 * HPS is powered on from firmware before entering the kernel, so we in hps_i2c_probe()
80 hps->enable_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_HIGH); in hps_i2c_probe()
81 if (IS_ERR(hps->enable_gpio)) { in hps_i2c_probe()
82 ret = PTR_ERR(hps->enable_gpio); in hps_i2c_probe()
87 ret = misc_register(&hps->misc_device); in hps_i2c_probe()
93 hps_set_power(hps, false); in hps_i2c_probe()
100 struct hps_drvdata *hps = i2c_get_clientdata(client); in hps_i2c_remove() local
103 misc_deregister(&hps->misc_device); in hps_i2c_remove()
106 * Re-enable HPS, in order to return it to its default state in hps_i2c_remove()
109 hps_set_power(hps, true); in hps_i2c_remove()
115 struct hps_drvdata *hps = i2c_get_clientdata(client); in hps_suspend() local
117 hps_set_power(hps, false); in hps_suspend()
124 struct hps_drvdata *hps = i2c_get_clientdata(client); in hps_resume() local
126 hps_set_power(hps, true); in hps_resume()
132 { "cros-hps", 0 },
150 .name = "cros-hps",
159 MODULE_DESCRIPTION("Driver for ChromeOS HPS");