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

Go to the source code of this file.

Data Structures

struct  tsl2563_gainlevel_coeff
 
struct  tsl2563_chip
 
struct  tsl2563_lux_coeff
 

Macros

#define ADC_FRAC_BITS   (14)
 
#define FRAC10K(f)   (((f) * (1L << (ADC_FRAC_BITS))) / (10000))
 
#define CALIB_FRAC_BITS   (10)
 
#define CALIB_FRAC_HALF   (1 << (CALIB_FRAC_BITS - 1))
 
#define CALIB_FRAC(n, b)   (((n) << CALIB_FRAC_BITS) / (b))
 
#define CALIB_BASE_SYSFS   (1000)
 
#define TSL2563_CMD   (0x80)
 
#define TSL2563_CLEARINT   (0x40)
 
#define TSL2563_REG_CTRL   (0x00)
 
#define TSL2563_REG_TIMING   (0x01)
 
#define TSL2563_REG_LOWLOW   (0x02) /* data0 low threshold, 2 bytes */
 
#define TSL2563_REG_LOWHIGH   (0x03)
 
#define TSL2563_REG_HIGHLOW   (0x04) /* data0 high threshold, 2 bytes */
 
#define TSL2563_REG_HIGHHIGH   (0x05)
 
#define TSL2563_REG_INT   (0x06)
 
#define TSL2563_REG_ID   (0x0a)
 
#define TSL2563_REG_DATA0LOW   (0x0c) /* broadband sensor value, 2 bytes */
 
#define TSL2563_REG_DATA0HIGH   (0x0d)
 
#define TSL2563_REG_DATA1LOW   (0x0e) /* infrared sensor value, 2 bytes */
 
#define TSL2563_REG_DATA1HIGH   (0x0f)
 
#define TSL2563_CMD_POWER_ON   (0x03)
 
#define TSL2563_CMD_POWER_OFF   (0x00)
 
#define TSL2563_CTRL_POWER_MASK   (0x03)
 
#define TSL2563_TIMING_13MS   (0x00)
 
#define TSL2563_TIMING_100MS   (0x01)
 
#define TSL2563_TIMING_400MS   (0x02)
 
#define TSL2563_TIMING_MASK   (0x03)
 
#define TSL2563_TIMING_GAIN16   (0x10)
 
#define TSL2563_TIMING_GAIN1   (0x00)
 
#define TSL2563_INT_DISBLED   (0x00)
 
#define TSL2563_INT_LEVEL   (0x10)
 
#define TSL2563_INT_PERSIST(n)   ((n) & 0x0F)
 
#define TSL2563_PM_OPS   NULL
 

Functions

 MODULE_DEVICE_TABLE (i2c, tsl2563_id)
 
 module_i2c_driver (tsl2563_i2c_driver)
 
 MODULE_AUTHOR ("Nokia Corporation")
 
 MODULE_DESCRIPTION ("tsl2563 light sensor driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ADC_FRAC_BITS   (14)

Definition at line 44 of file tsl2563.c.

#define CALIB_BASE_SYSFS   (1000)

Definition at line 56 of file tsl2563.c.

#define CALIB_FRAC (   n,
  b 
)    (((n) << CALIB_FRAC_BITS) / (b))

Definition at line 54 of file tsl2563.c.

#define CALIB_FRAC_BITS   (10)

Definition at line 50 of file tsl2563.c.

#define CALIB_FRAC_HALF   (1 << (CALIB_FRAC_BITS - 1))

Definition at line 52 of file tsl2563.c.

#define FRAC10K (   f)    (((f) * (1L << (ADC_FRAC_BITS))) / (10000))

Definition at line 47 of file tsl2563.c.

#define TSL2563_CLEARINT   (0x40)

Definition at line 59 of file tsl2563.c.

#define TSL2563_CMD   (0x80)

Definition at line 58 of file tsl2563.c.

#define TSL2563_CMD_POWER_OFF   (0x00)

Definition at line 75 of file tsl2563.c.

#define TSL2563_CMD_POWER_ON   (0x03)

Definition at line 74 of file tsl2563.c.

#define TSL2563_CTRL_POWER_MASK   (0x03)

Definition at line 76 of file tsl2563.c.

#define TSL2563_INT_DISBLED   (0x00)

Definition at line 85 of file tsl2563.c.

#define TSL2563_INT_LEVEL   (0x10)

Definition at line 86 of file tsl2563.c.

#define TSL2563_INT_PERSIST (   n)    ((n) & 0x0F)

Definition at line 87 of file tsl2563.c.

#define TSL2563_PM_OPS   NULL

Definition at line 874 of file tsl2563.c.

#define TSL2563_REG_CTRL   (0x00)

Definition at line 61 of file tsl2563.c.

#define TSL2563_REG_DATA0HIGH   (0x0d)

Definition at line 70 of file tsl2563.c.

#define TSL2563_REG_DATA0LOW   (0x0c) /* broadband sensor value, 2 bytes */

Definition at line 69 of file tsl2563.c.

#define TSL2563_REG_DATA1HIGH   (0x0f)

Definition at line 72 of file tsl2563.c.

#define TSL2563_REG_DATA1LOW   (0x0e) /* infrared sensor value, 2 bytes */

Definition at line 71 of file tsl2563.c.

#define TSL2563_REG_HIGHHIGH   (0x05)

Definition at line 66 of file tsl2563.c.

#define TSL2563_REG_HIGHLOW   (0x04) /* data0 high threshold, 2 bytes */

Definition at line 65 of file tsl2563.c.

#define TSL2563_REG_ID   (0x0a)

Definition at line 68 of file tsl2563.c.

#define TSL2563_REG_INT   (0x06)

Definition at line 67 of file tsl2563.c.

#define TSL2563_REG_LOWHIGH   (0x03)

Definition at line 64 of file tsl2563.c.

#define TSL2563_REG_LOWLOW   (0x02) /* data0 low threshold, 2 bytes */

Definition at line 63 of file tsl2563.c.

#define TSL2563_REG_TIMING   (0x01)

Definition at line 62 of file tsl2563.c.

#define TSL2563_TIMING_100MS   (0x01)

Definition at line 79 of file tsl2563.c.

#define TSL2563_TIMING_13MS   (0x00)

Definition at line 78 of file tsl2563.c.

#define TSL2563_TIMING_400MS   (0x02)

Definition at line 80 of file tsl2563.c.

#define TSL2563_TIMING_GAIN1   (0x00)

Definition at line 83 of file tsl2563.c.

#define TSL2563_TIMING_GAIN16   (0x10)

Definition at line 82 of file tsl2563.c.

#define TSL2563_TIMING_MASK   (0x03)

Definition at line 81 of file tsl2563.c.

Function Documentation

MODULE_AUTHOR ( "Nokia Corporation"  )
MODULE_DESCRIPTION ( "tsl2563 light sensor driver )
MODULE_DEVICE_TABLE ( i2c  ,
tsl2563_id   
)
module_i2c_driver ( tsl2563_i2c_driver  )
MODULE_LICENSE ( "GPL"  )