summaryrefslogtreecommitdiffstats
path: root/drivers/iio/light/st_uvis25.h
diff options
context:
space:
mode:
authorLorenzo Bianconi2017-11-23 23:59:05 +0100
committerJonathan Cameron2017-12-02 11:41:25 +0100
commit3025c8688c1e9768fe272a021a039f5840012175 (patch)
tree8a9cb4d37064ff818950ae18f90f4f626533b59a /drivers/iio/light/st_uvis25.h
parentMAINTAINERS: Add missing IIO ABI entries (diff)
downloadkernel-qcow2-linux-3025c8688c1e9768fe272a021a039f5840012175.tar.gz
kernel-qcow2-linux-3025c8688c1e9768fe272a021a039f5840012175.tar.xz
kernel-qcow2-linux-3025c8688c1e9768fe272a021a039f5840012175.zip
iio: light: add support for UVIS25 sensor
add support for STMicroelectronics UVIS25 uv sensor http://www.st.com/resource/en/datasheet/uvis25.pdf - continuos mode support - i2c support - spi support - trigger mode support - system PM support Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light/st_uvis25.h')
-rw-r--r--drivers/iio/light/st_uvis25.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/iio/light/st_uvis25.h b/drivers/iio/light/st_uvis25.h
new file mode 100644
index 000000000000..5e970ab480cd
--- /dev/null
+++ b/drivers/iio/light/st_uvis25.h
@@ -0,0 +1,37 @@
+/*
+ * STMicroelectronics uvis25 sensor driver
+ *
+ * Copyright 2017 STMicroelectronics Inc.
+ *
+ * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
+ *
+ * Licensed under the GPL-2.
+ */
+
+#ifndef ST_UVIS25_H
+#define ST_UVIS25_H
+
+#define ST_UVIS25_DEV_NAME "uvis25"
+
+#include <linux/iio/iio.h>
+
+/**
+ * struct st_uvis25_hw - ST UVIS25 sensor instance
+ * @regmap: Register map of the device.
+ * @trig: The trigger in use by the driver.
+ * @enabled: Status of the sensor (false->off, true->on).
+ * @irq: Device interrupt line (I2C or SPI).
+ */
+struct st_uvis25_hw {
+ struct regmap *regmap;
+
+ struct iio_trigger *trig;
+ bool enabled;
+ int irq;
+};
+
+extern const struct dev_pm_ops st_uvis25_pm_ops;
+
+int st_uvis25_probe(struct device *dev, int irq, struct regmap *regmap);
+
+#endif /* ST_UVIS25_H */