Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78632b60 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman
Browse files

Staging: IIO: tsl2561 digital light sensor core support



This is a pretty minimalist example of an IIO driver.

Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d1325cf4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,5 +12,6 @@ menuconfig IIO
if IIO

source "drivers/staging/iio/adc/Kconfig"
source "drivers/staging/iio/light/Kconfig"

endif # IIO
+2 −1
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ obj-$(CONFIG_IIO) += industrialio.o
industrialio-y := industrialio-core.o

obj-y += adc/
obj-y += light/
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
#
# Light sensors
#
comment "Light sensors"

config TSL2561
       tristate "TAOS TSL2561 light-to-digital convertor"
       depends on I2C
       help
	Say yes bere to build support for the TAOS light to digital
	convertor.  This chip has two light sensors. One is broadband
	including infrared whilst the other measures only infrared.
	Provides direct access via sysfs.
+5 −0
Original line number Diff line number Diff line
#
# Makefile for industrial I/O Light sensors
#

obj-$(CONFIG_TSL2561)   += tsl2561.o
+12 −0
Original line number Diff line number Diff line
#include "../sysfs.h"

/* Light to digital sensor attributes */

#define IIO_DEV_ATTR_LIGHT_INFRARED(_num, _show, _addr)			\
	IIO_DEVICE_ATTR(light_infrared##_num, S_IRUGO, _show, NULL, _addr)

#define IIO_DEV_ATTR_LIGHT_BROAD(_num, _show, _addr)			\
	IIO_DEVICE_ATTR(light_broadspectrum##_num, S_IRUGO, _show, NULL, _addr)

#define IIO_DEV_ATTR_LIGHT_VISIBLE(_num, _show, _addr)			\
	IIO_DEVICE_ATTR(light_visible##_num, S_IRUGO, _show, NULL, _addr)
Loading