Skip to contentSkip to conversation

Add ALS drivers for the apds9802als

PATCH New Alan Cox 1 participant 1 message Oct 15, 2010 Char and misc drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/2 Add ALS drivers for the apds9802als

From: anantha <[email protected]>

This adds support for the ADPS9802ALS sensor.

Cleanup by Alan Cox
- move mutexes to cover more things
- report I/O errors back to user space
- report range and values in LUX

[The 4K and 64K in the hw spec actually means 4095 (12bit) and 65535 (16bit).]
[Updated to match the ALS light API interface convention from Samu]

---

 drivers/misc/Kconfig       |   10 +
 drivers/misc/Makefile      |    1 
 drivers/misc/apds9802als.c |  308 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 319 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/apds9802als.c
drivers/misc/Kconfig +10 -0
index 9d0a84d..45801d6 100644
@@ -293,6 +293,16 @@ config SGI_GRU_DEBUG
 	This option enables addition debugging code for the SGI GRU driver. If
 	you are unsure, say N.
 
+config APDS9802ALS
+	tristate "Medfield Avago APDS9802 ALS Sensor module"
+	depends on I2C
+	help
+	  If you say yes here you get support for the ALS APDS9802 ambient
+	  light sensor.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called apds9802als.
+
 config ISL29003
 	tristate "Intersil ISL29003 ambient light sensor"
 	depends on I2C && SYSFS
drivers/misc/Makefile +1 -0
index d71d5a7..c1d59f3 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_SGI_XP)		+= sgi-xp/
 obj-$(CONFIG_SGI_GRU)		+= sgi-gru/
 obj-$(CONFIG_CS5535_MFGPT)	+= cs5535-mfgpt.o
 obj-$(CONFIG_HP_ILO)		+= hpilo.o
+obj-$(CONFIG_APDS9802ALS)	+= apds9802als.o
 obj-$(CONFIG_ISL29003)		+= isl29003.o
 obj-$(CONFIG_SENSORS_TSL2550)	+= tsl2550.o
 obj-$(CONFIG_EP93XX_PWM)	+= ep93xx_pwm.o
drivers/misc/apds9802als.c new file +308 -0

308 lines not on this page · raw message