Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
isl29028.c File Reference
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/regmap.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  isl29028_chip
 

Macros

#define CONVERSION_TIME_MS   100
 
#define ISL29028_REG_CONFIGURE   0x01
 
#define CONFIGURE_ALS_IR_MODE_ALS   0
 
#define CONFIGURE_ALS_IR_MODE_IR   BIT(0)
 
#define CONFIGURE_ALS_IR_MODE_MASK   BIT(0)
 
#define CONFIGURE_ALS_RANGE_LOW_LUX   0
 
#define CONFIGURE_ALS_RANGE_HIGH_LUX   BIT(1)
 
#define CONFIGURE_ALS_RANGE_MASK   BIT(1)
 
#define CONFIGURE_ALS_DIS   0
 
#define CONFIGURE_ALS_EN   BIT(2)
 
#define CONFIGURE_ALS_EN_MASK   BIT(2)
 
#define CONFIGURE_PROX_DRIVE   BIT(3)
 
#define CONFIGURE_PROX_SLP_SH   4
 
#define CONFIGURE_PROX_SLP_MASK   (7 << CONFIGURE_PROX_SLP_SH)
 
#define CONFIGURE_PROX_EN   BIT(7)
 
#define CONFIGURE_PROX_EN_MASK   BIT(7)
 
#define ISL29028_REG_INTERRUPT   0x02
 
#define ISL29028_REG_PROX_DATA   0x08
 
#define ISL29028_REG_ALSIR_L   0x09
 
#define ISL29028_REG_ALSIR_U   0x0A
 
#define ISL29028_REG_TEST1_MODE   0x0E
 
#define ISL29028_REG_TEST2_MODE   0x0F
 
#define ISL29028_NUM_REGS   (ISL29028_REG_TEST2_MODE + 1)
 
#define ISL29028_DEV_ATTR(name)   (&iio_dev_attr_##name.dev_attr.attr)
 
#define ISL29028_CONST_ATTR(name)   (&iio_const_attr_##name.dev_attr.attr)
 

Enumerations

enum  als_ir_mode { MODE_NONE = 0, MODE_ALS, MODE_IR }
 

Functions

 MODULE_DEVICE_TABLE (i2c, isl29028_id)
 
 MODULE_DEVICE_TABLE (of, isl29028_of_match)
 
 module_i2c_driver (isl29028_driver)
 
 MODULE_DESCRIPTION ("ISL29028 Ambient Light and Proximity Sensor driver")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_AUTHOR ("Laxman Dewangan <[email protected]>")
 

Macro Definition Documentation

#define CONFIGURE_ALS_DIS   0

Definition at line 42 of file isl29028.c.

#define CONFIGURE_ALS_EN   BIT(2)

Definition at line 43 of file isl29028.c.

#define CONFIGURE_ALS_EN_MASK   BIT(2)

Definition at line 44 of file isl29028.c.

#define CONFIGURE_ALS_IR_MODE_ALS   0

Definition at line 34 of file isl29028.c.

#define CONFIGURE_ALS_IR_MODE_IR   BIT(0)

Definition at line 35 of file isl29028.c.

#define CONFIGURE_ALS_IR_MODE_MASK   BIT(0)

Definition at line 36 of file isl29028.c.

#define CONFIGURE_ALS_RANGE_HIGH_LUX   BIT(1)

Definition at line 39 of file isl29028.c.

#define CONFIGURE_ALS_RANGE_LOW_LUX   0

Definition at line 38 of file isl29028.c.

#define CONFIGURE_ALS_RANGE_MASK   BIT(1)

Definition at line 40 of file isl29028.c.

#define CONFIGURE_PROX_DRIVE   BIT(3)

Definition at line 46 of file isl29028.c.

#define CONFIGURE_PROX_EN   BIT(7)

Definition at line 51 of file isl29028.c.

#define CONFIGURE_PROX_EN_MASK   BIT(7)

Definition at line 52 of file isl29028.c.

#define CONFIGURE_PROX_SLP_MASK   (7 << CONFIGURE_PROX_SLP_SH)

Definition at line 49 of file isl29028.c.

#define CONFIGURE_PROX_SLP_SH   4

Definition at line 48 of file isl29028.c.

#define CONVERSION_TIME_MS   100

Definition at line 30 of file isl29028.c.

#define ISL29028_CONST_ATTR (   name)    (&iio_const_attr_##name.dev_attr.attr)

Definition at line 380 of file isl29028.c.

#define ISL29028_DEV_ATTR (   name)    (&iio_dev_attr_##name.dev_attr.attr)

Definition at line 379 of file isl29028.c.

#define ISL29028_NUM_REGS   (ISL29028_REG_TEST2_MODE + 1)

Definition at line 63 of file isl29028.c.

#define ISL29028_REG_ALSIR_L   0x09

Definition at line 57 of file isl29028.c.

#define ISL29028_REG_ALSIR_U   0x0A

Definition at line 58 of file isl29028.c.

#define ISL29028_REG_CONFIGURE   0x01

Definition at line 32 of file isl29028.c.

#define ISL29028_REG_INTERRUPT   0x02

Definition at line 54 of file isl29028.c.

#define ISL29028_REG_PROX_DATA   0x08

Definition at line 56 of file isl29028.c.

#define ISL29028_REG_TEST1_MODE   0x0E

Definition at line 60 of file isl29028.c.

#define ISL29028_REG_TEST2_MODE   0x0F

Definition at line 61 of file isl29028.c.

Enumeration Type Documentation

Enumerator:
MODE_NONE 
MODE_ALS 
MODE_IR 

Definition at line 65 of file isl29028.c.

Function Documentation

MODULE_AUTHOR ( "Laxman Dewangan <[email protected]>"  )
MODULE_DESCRIPTION ( "ISL29028 Ambient Light and Proximity Sensor driver )
MODULE_DEVICE_TABLE ( i2c  ,
isl29028_id   
)
MODULE_DEVICE_TABLE ( of  ,
isl29028_of_match   
)
module_i2c_driver ( isl29028_driver  )
MODULE_LICENSE ( "GPL v2 )