Skip to contentSkip to conversation

iio: chemical: add driver for dsm501/ppd42ns particle sensors

PATCH Superseded Tomasz Duszynski 1 participant 1 message Feb 6, 2017 IIO

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/4 iio: chemical: add driver for dsm501/ppd42ns particle sensors

This patch adds support for dsm501 and ppd42ns particle sensors.

Both sensors work on the same principle. Heater (resistor) heats up air in sensor chamber which induces upward flow. Particles convect up through a light beam provided by internal infra-red LED. Light scattered by particles is picked by photodiode and internal electronics outputs PWM signal.

Measuring low time occupancy of the signal during 30s measurement period particles number in cubic meter can be computed.

---
Changes in v2:
o whitespace fix
o drop excessive comments about conversion to pcs/0.01cf
o fix 'concentartion' typo in dsm501_number_concentartion handler name

 drivers/iio/chemical/Kconfig  |  10 ++
 drivers/iio/chemical/Makefile |   1 +
 drivers/iio/chemical/dsm501.c | 225 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 236 insertions(+)
 create mode 100644 drivers/iio/chemical/dsm501.c
drivers/iio/chemical/Kconfig +10 -0
index cea7f9857a1f..986d612aa77f 100644
@@ -21,6 +21,16 @@ config ATLAS_PH_SENSOR
 	 To compile this driver as module, choose M here: the
 	 module will be called atlas-ph-sensor.
 
+config DSM501
+	tristate "Samyoung DSM501 particle sensor"
+	depends on GPIOLIB
+	help
+	 Say yes here to build support for the Samyoung DSM501
+	 particle sensor.
+
+	 To compile this driver as a module, choose M here: the module
+	 will be called dsm501.
+
 config IAQCORE
 	tristate "AMS iAQ-Core VOC sensors"
 	depends on I2C
drivers/iio/chemical/Makefile +1 -0
index b02202b41289..76f50ff8ba7d 100644
@@ -4,5 +4,6 @@
 
 # When adding new entries keep the list in alphabetical order
 obj-$(CONFIG_ATLAS_PH_SENSOR)	+= atlas-ph-sensor.o
+obj-$(CONFIG_DSM501)		+= dsm501.o
 obj-$(CONFIG_IAQCORE)		+= ams-iaq-core.o
 obj-$(CONFIG_VZ89X)		+= vz89x.o
drivers/iio/chemical/dsm501.c new file +225 -0

225 lines not on this page · raw message

--
2.11.1