Skip to content

Commit

Permalink
iio: light: add support for UVIS25 sensor
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lorenzo Bianconi authored and Jonathan Cameron committed Dec 2, 2017
1 parent f4457f7 commit 3025c86
Show file tree
Hide file tree
Showing 6 changed files with 560 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/iio/light/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,30 @@ config STK3310
Choosing M will build the driver as a module. If so, the module
will be called stk3310.

config ST_UVIS25
tristate "STMicroelectronics UVIS25 sensor driver"
depends on (I2C || SPI)
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select ST_UVIS25_I2C if (I2C)
select ST_UVIS25_SPI if (SPI_MASTER)
help
Say yes here to build support for STMicroelectronics UVIS25
uv sensor

To compile this driver as a module, choose M here: the module
will be called st_uvis25.

config ST_UVIS25_I2C
tristate
depends on ST_UVIS25
select REGMAP_I2C

config ST_UVIS25_SPI
tristate
depends on ST_UVIS25
select REGMAP_SPI

config TCS3414
tristate "TAOS TCS3414 digital color sensor"
depends on I2C
Expand Down
3 changes: 3 additions & 0 deletions drivers/iio/light/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ obj-$(CONFIG_RPR0521) += rpr0521.o
obj-$(CONFIG_SENSORS_TSL2563) += tsl2563.o
obj-$(CONFIG_SI1145) += si1145.o
obj-$(CONFIG_STK3310) += stk3310.o
obj-$(CONFIG_ST_UVIS25) += st_uvis25_core.o
obj-$(CONFIG_ST_UVIS25_I2C) += st_uvis25_i2c.o
obj-$(CONFIG_ST_UVIS25_SPI) += st_uvis25_spi.o
obj-$(CONFIG_TCS3414) += tcs3414.o
obj-$(CONFIG_TCS3472) += tcs3472.o
obj-$(CONFIG_TSL2583) += tsl2583.o
Expand Down
37 changes: 37 additions & 0 deletions drivers/iio/light/st_uvis25.h
Original file line number Diff line number Diff line change
@@ -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 */
Loading

0 comments on commit 3025c86

Please sign in to comment.