Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

isl29003.c File Reference


Detailed Description

ISL29003 light sensor Driver.

Definition in file isl29003.c.

#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/regulator/consumer.h>
#include <mach/hardware.h>

Go to the source code of this file.

Classes

struct  isl29003_data
struct  isl29003_param

Defines

#define ADCPD   6
#define ENABLE   7
#define GAIN   2
#define INT_FLAG   5
#define INT_PERSIST   0
#define ISL29003_GAIN_DEFAULT   ISL29003_GAIN_16000
#define ISL29003_MODE_DEFAULT   ISL29003_MODE_DIODE1
#define ISL29003_WIDTH_DEFAULT   ISL29003_WIDTH_16
#define MODE   2
#define TIMEING_MODE   5
#define WIDTH   0

Enumerations

enum  isl29003_gain { ISL29003_GAIN_1000 = 0, ISL29003_GAIN_4000, ISL29003_GAIN_16000, ISL29003_GAIN_64000 }
enum  isl29003_mode { ISL29003_MODE_DIODE1 = 0, ISL29003_MODE_DIODE2, ISL29003_MODE_DIODE1_2 }
enum  isl29003_reg {
  ISL29003_CMD = 0, ISL29003_CTRL, ISL29003_THRS_HI, ISL29003_THRS_LO,
  ISL29003_LSB_S, ISL29003_MSB_S, ISL29003_LSB_T, ISL29003_MSB_T,
  ISL29003_SYNC_IIC = 0x80, ISL29003_CLAR_INT = 0x40
}
enum  isl29003_width { ISL29003_WIDTH_16 = 0, ISL29003_WIDTH_12, ISL29003_WIDTH_8, ISL29003_WIDTH_4 }

Functions

static void __exit isl29003_cleanup (void)
static int isl29003_i2c_probe (struct i2c_client *client, const struct i2c_device_id *did)
static int isl29003_i2c_remove (struct i2c_client *client)
static int __init isl29003_init (void)
static int isl29003_off (void)
static int isl29003_on (void)
int isl29003_read (struct i2c_client *client, u8 reg)
static int isl29003_read_lux (void)
static int isl29003_resume (struct i2c_client *client)
static int isl29003_suspend (struct i2c_client *client, pm_message_t message)
int isl29003_write (struct i2c_client *client, u8 reg, char value)
static ssize_t ls_enable (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 MODULE_AUTHOR ("Freescale Semiconductor, Inc.")
 MODULE_DESCRIPTION ("ISL29003 light sensor driver")
 MODULE_DEVICE_TABLE (i2c, isl29003_id)
 module_exit (isl29003_cleanup)
 module_init (isl29003_init)
 MODULE_LICENSE ("GPL")
static SENSOR_DEVICE_ATTR (lux, S_IRUGO, show_lux, NULL, 0)
static SENSOR_DEVICE_ATTR (enable, S_IWUGO, NULL, ls_enable, 0)
static ssize_t show_lux (struct device *dev, struct device_attribute *attr, char *buf)

Variables

static struct i2c_client * isl29003_client
static struct i2c_driver isl29003_driver
static struct i2c_device_id isl29003_id []
int range [4] = { 973, 3892, 15568, 62272 }
int width [4] = { 16, 1, 256, 16 }


Generated by  Doxygen 1.6.0   Back to index