Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
adjd_s311.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/bitmap.h>
#include <linux/err.h>
#include <linux/irq.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/buffer.h>
#include <linux/iio/triggered_buffer.h>

Go to the source code of this file.

Data Structures

struct  adjd_s311_data
 

Macros

#define ADJD_S311_DRV_NAME   "adjd_s311"
 
#define ADJD_S311_CTRL   0x00
 
#define ADJD_S311_CONFIG   0x01
 
#define ADJD_S311_CAP_RED   0x06
 
#define ADJD_S311_CAP_GREEN   0x07
 
#define ADJD_S311_CAP_BLUE   0x08
 
#define ADJD_S311_CAP_CLEAR   0x09
 
#define ADJD_S311_INT_RED_LO   0x0a
 
#define ADJD_S311_INT_RED_HI   0x0b
 
#define ADJD_S311_INT_GREEN_LO   0x0c
 
#define ADJD_S311_INT_GREEN_HI   0x0d
 
#define ADJD_S311_INT_BLUE_LO   0x0e
 
#define ADJD_S311_INT_BLUE_HI   0x0f
 
#define ADJD_S311_INT_CLEAR_LO   0x10
 
#define ADJD_S311_INT_CLEAR_HI   0x11
 
#define ADJD_S311_DATA_RED_LO   0x40
 
#define ADJD_S311_DATA_RED_HI   0x41
 
#define ADJD_S311_DATA_GREEN_LO   0x42
 
#define ADJD_S311_DATA_GREEN_HI   0x43
 
#define ADJD_S311_DATA_BLUE_LO   0x44
 
#define ADJD_S311_DATA_BLUE_HI   0x45
 
#define ADJD_S311_DATA_CLEAR_LO   0x46
 
#define ADJD_S311_DATA_CLEAR_HI   0x47
 
#define ADJD_S311_OFFSET_RED   0x48
 
#define ADJD_S311_OFFSET_GREEN   0x49
 
#define ADJD_S311_OFFSET_BLUE   0x4a
 
#define ADJD_S311_OFFSET_CLEAR   0x4b
 
#define ADJD_S311_CTRL_GOFS   0x02
 
#define ADJD_S311_CTRL_GSSR   0x01
 
#define ADJD_S311_CAP_MASK   0x0f
 
#define ADJD_S311_INT_MASK   0x0fff
 
#define ADJD_S311_DATA_MASK   0x03ff
 
#define ADJD_S311_DATA_REG(chan)   (ADJD_S311_DATA_RED_LO + (chan) * 2)
 
#define ADJD_S311_INT_REG(chan)   (ADJD_S311_INT_RED_LO + (chan) * 2)
 
#define ADJD_S311_CAP_REG(chan)   (ADJD_S311_CAP_RED + (chan))
 
#define ADJD_S311_CHANNEL(_color, _scan_idx)
 

Enumerations

enum  adjd_s311_channel_idx { IDX_RED, IDX_GREEN, IDX_BLUE, IDX_CLEAR }
 

Functions

 MODULE_DEVICE_TABLE (i2c, adjd_s311_id)
 
 module_i2c_driver (adjd_s311_driver)
 
 MODULE_AUTHOR ("Peter Meerwald <[email protected]>")
 
 MODULE_DESCRIPTION ("ADJD-S311 color sensor")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ADJD_S311_CAP_BLUE   0x08

Definition at line 38 of file adjd_s311.c.

#define ADJD_S311_CAP_CLEAR   0x09

Definition at line 39 of file adjd_s311.c.

#define ADJD_S311_CAP_GREEN   0x07

Definition at line 37 of file adjd_s311.c.

#define ADJD_S311_CAP_MASK   0x0f

Definition at line 63 of file adjd_s311.c.

#define ADJD_S311_CAP_RED   0x06

Definition at line 36 of file adjd_s311.c.

#define ADJD_S311_CAP_REG (   chan)    (ADJD_S311_CAP_RED + (chan))

Definition at line 78 of file adjd_s311.c.

#define ADJD_S311_CHANNEL (   _color,
  _scan_idx 
)
Value:
{ \
.type = IIO_INTENSITY, \
.modified = 1, \
.address = (IDX_##_color), \
.channel2 = (IIO_MOD_LIGHT_##_color), \
.scan_index = (_scan_idx), \
.scan_type = IIO_ST('u', 10, 16, 0), \
.ext_info = adjd_s311_ext_info, \
}

Definition at line 207 of file adjd_s311.c.

#define ADJD_S311_CONFIG   0x01

Definition at line 35 of file adjd_s311.c.

#define ADJD_S311_CTRL   0x00

Definition at line 34 of file adjd_s311.c.

#define ADJD_S311_CTRL_GOFS   0x02

Definition at line 61 of file adjd_s311.c.

#define ADJD_S311_CTRL_GSSR   0x01

Definition at line 62 of file adjd_s311.c.

#define ADJD_S311_DATA_BLUE_HI   0x45

Definition at line 53 of file adjd_s311.c.

#define ADJD_S311_DATA_BLUE_LO   0x44

Definition at line 52 of file adjd_s311.c.

#define ADJD_S311_DATA_CLEAR_HI   0x47

Definition at line 55 of file adjd_s311.c.

#define ADJD_S311_DATA_CLEAR_LO   0x46

Definition at line 54 of file adjd_s311.c.

#define ADJD_S311_DATA_GREEN_HI   0x43

Definition at line 51 of file adjd_s311.c.

#define ADJD_S311_DATA_GREEN_LO   0x42

Definition at line 50 of file adjd_s311.c.

#define ADJD_S311_DATA_MASK   0x03ff

Definition at line 65 of file adjd_s311.c.

#define ADJD_S311_DATA_RED_HI   0x41

Definition at line 49 of file adjd_s311.c.

#define ADJD_S311_DATA_RED_LO   0x40

Definition at line 48 of file adjd_s311.c.

#define ADJD_S311_DATA_REG (   chan)    (ADJD_S311_DATA_RED_LO + (chan) * 2)

Definition at line 76 of file adjd_s311.c.

#define ADJD_S311_DRV_NAME   "adjd_s311"

Definition at line 32 of file adjd_s311.c.

#define ADJD_S311_INT_BLUE_HI   0x0f

Definition at line 45 of file adjd_s311.c.

#define ADJD_S311_INT_BLUE_LO   0x0e

Definition at line 44 of file adjd_s311.c.

#define ADJD_S311_INT_CLEAR_HI   0x11

Definition at line 47 of file adjd_s311.c.

#define ADJD_S311_INT_CLEAR_LO   0x10

Definition at line 46 of file adjd_s311.c.

#define ADJD_S311_INT_GREEN_HI   0x0d

Definition at line 43 of file adjd_s311.c.

#define ADJD_S311_INT_GREEN_LO   0x0c

Definition at line 42 of file adjd_s311.c.

#define ADJD_S311_INT_MASK   0x0fff

Definition at line 64 of file adjd_s311.c.

#define ADJD_S311_INT_RED_HI   0x0b

Definition at line 41 of file adjd_s311.c.

#define ADJD_S311_INT_RED_LO   0x0a

Definition at line 40 of file adjd_s311.c.

#define ADJD_S311_INT_REG (   chan)    (ADJD_S311_INT_RED_LO + (chan) * 2)

Definition at line 77 of file adjd_s311.c.

#define ADJD_S311_OFFSET_BLUE   0x4a

Definition at line 58 of file adjd_s311.c.

#define ADJD_S311_OFFSET_CLEAR   0x4b

Definition at line 59 of file adjd_s311.c.

#define ADJD_S311_OFFSET_GREEN   0x49

Definition at line 57 of file adjd_s311.c.

#define ADJD_S311_OFFSET_RED   0x48

Definition at line 56 of file adjd_s311.c.

Enumeration Type Documentation

Enumerator:
IDX_RED 
IDX_GREEN 
IDX_BLUE 
IDX_CLEAR 

Definition at line 72 of file adjd_s311.c.

Function Documentation

MODULE_AUTHOR ( "Peter Meerwald <[email protected]>"  )
MODULE_DESCRIPTION ( "ADJD-S311 color sensor"  )
MODULE_DEVICE_TABLE ( i2c  ,
adjd_s311_id   
)
module_i2c_driver ( adjd_s311_driver  )
MODULE_LICENSE ( "GPL"  )