Skip to contentSkip to conversation

Added driver for ISL29003 ambient light sensor

PATCH In review Daniel Mack 2 participants 2 messages Mar 10, 2009 – Mar 15, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Added driver for ISL29003 ambient light sensor

This patch adds a driver for Intersil's ISL29003 ambient light sensor device plus some documentation. Inspired by tsl2550.c, a driver for a similar device.

It is put to drivers/misc for now until the industrial I/O framework gets merged.

---
(The discussion about where to put the files for this has some
history on linux-i2c list and the verdict there was to re-post the driver to the LKML for further review as both drivers/hwmon and drivers/i2c/chips are unsuitable places for it)

 Documentation/misc-devices/isl29003 |   62 +++++
 drivers/misc/Kconfig                |   10 +
 drivers/misc/Makefile               |    1 +
 drivers/misc/isl29003.c             |  486 +++++++++++++++++++++++++++++++++++
 4 files changed, 559 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/misc-devices/isl29003
 create mode 100644 drivers/misc/isl29003.c
Documentation/misc-devices/isl29003 new file +62 -0
new file mode 100644
index 0000000..c4ff5f3
@@ -0,0 +1,62 @@
+Kernel driver isl29003
+=====================
+
+Supported chips:
+* Intersil ISL29003
+Prefix: 'isl29003'
+Addresses scanned: none
+Datasheet:
+http://www.intersil.com/data/fn/fn7464.pdf
+
+Author: Daniel Mack <[email protected]>
+
+
+Description
+-----------
+The ISL29003 is an integrated light sensor with a 16-bit integrating type
+ADC, I2C user programmable lux range select for optimized counts/lux, and
+I2C multi-function control and monitoring capabilities. The internal ADC
+provides 16-bit resolution while rejecting 50Hz and 60Hz flicker caused by
+artificial light sources.
+
+The driver allows to set the lux range, the bit resolution, the operational
+mode (see below) and the power state of device and can read the current lux
+value, of course.
+
+
+Detection
+---------
+
+The ISL29003 does not have an ID register which could be used to identify
+it, so the detection routine will just try to read from the configured I2C
+addess and consider the device to be present as soon as it ACKs the
+transfer.
+
+
+Sysfs entries
+-------------
+
+range:
+	0: 0 lux to 1000 lux (default)
+	1: 0 lux to 4000 lux
+	2: 0 lux to 16,000 lux
+	3: 0 lux to 64,000 lux
+
+resolution:
+	0: 2^16 cycles (default)
+	1: 2^12 cycles
+	2: 2^8 cycles
+	3: 2^4 cycles
+
+mode:
+	0: diode1's current (unsigned 16bit) (default)
+	1: diode1's current (unsigned 16bit)
+	2: difference between diodes (l1 - l2, signed 15bit)
+
+power_state:
+	0: device is disabled (default)
+	1: device is enabled
+
+lux (read only):
+	returns the value from the last sensor reading
+
drivers/misc/Kconfig +10 -0
index c64e679..b883b19 100644
@@ -223,6 +223,16 @@ config DELL_LAPTOP
 	This driver adds support for rfkill and backlight control to Dell
 	laptops.
 
+config ISL29003
+	tristate "Intersil ISL29003 ambient light sensor"
+	depends on I2C
+	help
+	  If you say yes here you get support for the Intersil ISL29003
+	  ambient light sensor.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called isl29003.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 
drivers/misc/Makefile +1 -0
index bc11998..7871f05 100644
@@ -18,5 +18,6 @@ obj-$(CONFIG_KGDB_TESTS)	+= kgdbts.o
 obj-$(CONFIG_SGI_XP)		+= sgi-xp/
 obj-$(CONFIG_SGI_GRU)		+= sgi-gru/
 obj-$(CONFIG_HP_ILO)		+= hpilo.o
+obj-$(CONFIG_ISL29003)		+= isl29003.o
 obj-$(CONFIG_C2PORT)		+= c2port/
 obj-y				+= eeprom/
drivers/misc/isl29003.c new file +486 -0

486 lines not on this page · raw message

Signature · 1 line
1.6.2
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

Trivial comment on the docs:

Daniel> +mode:
Daniel> + 0: diode1's current (unsigned 16bit) (default)
Daniel> + 1: diode1's current (unsigned 16bit)
Daniel> + 2: difference between diodes (l1 - l2, signed 15bit)

That has diode1 twice. Should it, instead, be:

+mode:
+ 0: diode1's current (unsigned 16bit) (default)
+ 1: diode2's current (unsigned 16bit)
+ 2: difference between diodes (l1 - l2, signed 15bit)

?

-JimC

Signature · 1 line
James Cloos <[email protected]>         OpenPGP: 1024D/ED7DAEA6