xref: /openbmc/linux/drivers/iio/light/st_uvis25.h (revision 867e6d38)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * STMicroelectronics uvis25 sensor driver
4  *
5  * Copyright 2017 STMicroelectronics Inc.
6  *
7  * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
8  */
9 
10 #ifndef ST_UVIS25_H
11 #define ST_UVIS25_H
12 
13 #define ST_UVIS25_DEV_NAME		"uvis25"
14 
15 #include <linux/iio/iio.h>
16 
17 /**
18  * struct st_uvis25_hw - ST UVIS25 sensor instance
19  * @regmap: Register map of the device.
20  * @trig: The trigger in use by the driver.
21  * @enabled: Status of the sensor (false->off, true->on).
22  * @irq: Device interrupt line (I2C or SPI).
23  */
24 struct st_uvis25_hw {
25 	struct regmap *regmap;
26 
27 	struct iio_trigger *trig;
28 	bool enabled;
29 	int irq;
30 	/* Ensure timestamp is naturally aligned */
31 	struct {
32 		u8 chan;
33 		s64 ts __aligned(8);
34 	} scan;
35 };
36 
37 extern const struct dev_pm_ops st_uvis25_pm_ops;
38 
39 int st_uvis25_probe(struct device *dev, int irq, struct regmap *regmap);
40 
41 #endif /* ST_UVIS25_H */
42