Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
isl29018.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/regmap.h>
#include <linux/slab.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

Go to the source code of this file.

Data Structures

struct  isl29018_chip
 

Macros

#define CONVERSION_TIME_MS   100
 
#define ISL29018_REG_ADD_COMMAND1   0x00
 
#define COMMMAND1_OPMODE_SHIFT   5
 
#define COMMMAND1_OPMODE_MASK   (7 << COMMMAND1_OPMODE_SHIFT)
 
#define COMMMAND1_OPMODE_POWER_DOWN   0
 
#define COMMMAND1_OPMODE_ALS_ONCE   1
 
#define COMMMAND1_OPMODE_IR_ONCE   2
 
#define COMMMAND1_OPMODE_PROX_ONCE   3
 
#define ISL29018_REG_ADD_COMMANDII   0x01
 
#define COMMANDII_RESOLUTION_SHIFT   2
 
#define COMMANDII_RESOLUTION_MASK   (0x3 << COMMANDII_RESOLUTION_SHIFT)
 
#define COMMANDII_RANGE_SHIFT   0
 
#define COMMANDII_RANGE_MASK   (0x3 << COMMANDII_RANGE_SHIFT)
 
#define COMMANDII_SCHEME_SHIFT   7
 
#define COMMANDII_SCHEME_MASK   (0x1 << COMMANDII_SCHEME_SHIFT)
 
#define ISL29018_REG_ADD_DATA_LSB   0x02
 
#define ISL29018_REG_ADD_DATA_MSB   0x03
 
#define ISL29018_REG_TEST   0x08
 
#define ISL29018_TEST_SHIFT   0
 
#define ISL29018_TEST_MASK   (0xFF << ISL29018_TEST_SHIFT)
 
#define ISL29018_DEV_ATTR(name)   (&iio_dev_attr_##name.dev_attr.attr)
 
#define ISL29018_CONST_ATTR(name)   (&iio_const_attr_##name.dev_attr.attr)
 

Functions

 MODULE_DEVICE_TABLE (i2c, isl29018_id)
 
 MODULE_DEVICE_TABLE (of, isl29018_of_match)
 
 module_i2c_driver (isl29018_driver)
 
 MODULE_DESCRIPTION ("ISL29018 Ambient Light Sensor driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define COMMANDII_RANGE_MASK   (0x3 << COMMANDII_RANGE_SHIFT)

Definition at line 49 of file isl29018.c.

#define COMMANDII_RANGE_SHIFT   0

Definition at line 48 of file isl29018.c.

#define COMMANDII_RESOLUTION_MASK   (0x3 << COMMANDII_RESOLUTION_SHIFT)

Definition at line 46 of file isl29018.c.

#define COMMANDII_RESOLUTION_SHIFT   2

Definition at line 45 of file isl29018.c.

#define COMMANDII_SCHEME_MASK   (0x1 << COMMANDII_SCHEME_SHIFT)

Definition at line 52 of file isl29018.c.

#define COMMANDII_SCHEME_SHIFT   7

Definition at line 51 of file isl29018.c.

#define COMMMAND1_OPMODE_ALS_ONCE   1

Definition at line 40 of file isl29018.c.

#define COMMMAND1_OPMODE_IR_ONCE   2

Definition at line 41 of file isl29018.c.

#define COMMMAND1_OPMODE_MASK   (7 << COMMMAND1_OPMODE_SHIFT)

Definition at line 38 of file isl29018.c.

#define COMMMAND1_OPMODE_POWER_DOWN   0

Definition at line 39 of file isl29018.c.

#define COMMMAND1_OPMODE_PROX_ONCE   3

Definition at line 42 of file isl29018.c.

#define COMMMAND1_OPMODE_SHIFT   5

Definition at line 37 of file isl29018.c.

#define CONVERSION_TIME_MS   100

Definition at line 34 of file isl29018.c.

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

Definition at line 435 of file isl29018.c.

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

Definition at line 434 of file isl29018.c.

#define ISL29018_REG_ADD_COMMAND1   0x00

Definition at line 36 of file isl29018.c.

#define ISL29018_REG_ADD_COMMANDII   0x01

Definition at line 44 of file isl29018.c.

#define ISL29018_REG_ADD_DATA_LSB   0x02

Definition at line 54 of file isl29018.c.

#define ISL29018_REG_ADD_DATA_MSB   0x03

Definition at line 55 of file isl29018.c.

#define ISL29018_REG_TEST   0x08

Definition at line 57 of file isl29018.c.

#define ISL29018_TEST_MASK   (0xFF << ISL29018_TEST_SHIFT)

Definition at line 59 of file isl29018.c.

#define ISL29018_TEST_SHIFT   0

Definition at line 58 of file isl29018.c.

Function Documentation

MODULE_DESCRIPTION ( "ISL29018 Ambient Light Sensor driver )
MODULE_DEVICE_TABLE ( i2c  ,
isl29018_id   
)
MODULE_DEVICE_TABLE ( of  ,
isl29018_of_match   
)
module_i2c_driver ( isl29018_driver  )
MODULE_LICENSE ( "GPL"  )