Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
lm3533-als.c File Reference
#include <linux/atomic.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/mfd/core.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/mfd/lm3533.h>

Go to the source code of this file.

Data Structures

struct  lm3533_als
 
struct  lm3533_als_attribute
 

Macros

#define LM3533_ALS_RESISTOR_MIN   1
 
#define LM3533_ALS_RESISTOR_MAX   127
 
#define LM3533_ALS_CHANNEL_CURRENT_MAX   2
 
#define LM3533_ALS_THRESH_MAX   3
 
#define LM3533_ALS_ZONE_MAX   4
 
#define LM3533_REG_ALS_RESISTOR_SELECT   0x30
 
#define LM3533_REG_ALS_CONF   0x31
 
#define LM3533_REG_ALS_ZONE_INFO   0x34
 
#define LM3533_REG_ALS_READ_ADC_RAW   0x37
 
#define LM3533_REG_ALS_READ_ADC_AVERAGE   0x38
 
#define LM3533_REG_ALS_BOUNDARY_BASE   0x50
 
#define LM3533_REG_ALS_TARGET_BASE   0x60
 
#define LM3533_ALS_ENABLE_MASK   0x01
 
#define LM3533_ALS_INPUT_MODE_MASK   0x02
 
#define LM3533_ALS_INT_ENABLE_MASK   0x01
 
#define LM3533_ALS_ZONE_SHIFT   2
 
#define LM3533_ALS_ZONE_MASK   0x1c
 
#define LM3533_ALS_FLAG_INT_ENABLED   1
 
#define CHANNEL_CURRENT(_channel)
 
#define ALS_ATTR(_name, _mode, _show, _store, _type, _val1, _val2)
 
#define LM3533_ALS_ATTR(_name, _mode, _show, _store, _type, _val1, _val2)
 
#define ALS_TARGET_ATTR_RW(_channel, _zone)
 
#define ALS_THRESH_FALLING_ATTR_RW(_nr)
 
#define ALS_THRESH_RAISING_ATTR_RW(_nr)
 
#define ALS_HYSTERESIS_ATTR_RO(_nr)
 
#define ILLUMINANCE_ATTR_RO(_name)   DEVICE_ATTR(in_illuminance0_##_name, S_IRUGO, show_##_name, NULL)
 
#define ILLUMINANCE_ATTR_RW(_name)
 

Enumerations

enum  lm3533_als_attribute_type { LM3533_ATTR_TYPE_HYSTERESIS, LM3533_ATTR_TYPE_TARGET, LM3533_ATTR_TYPE_THRESH_FALLING, LM3533_ATTR_TYPE_THRESH_RAISING }
 

Functions

 module_platform_driver (lm3533_als_driver)
 
 MODULE_AUTHOR ("Johan Hovold <[email protected]>")
 
 MODULE_DESCRIPTION ("LM3533 Ambient Light Sensor driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:lm3533-als")
 

Macro Definition Documentation

#define ALS_ATTR (   _name,
  _mode,
  _show,
  _store,
  _type,
  _val1,
  _val2 
)
Value:
{ .dev_attr = __ATTR(_name, _mode, _show, _store), \
.type = _type, \
.val1 = _val1, \
.val2 = _val2 }

Definition at line 575 of file lm3533-als.c.

#define ALS_HYSTERESIS_ATTR_RO (   _nr)
Value:
LM3533_ALS_ATTR(in_illuminance0_thresh##_nr##_hysteresis, \
S_IRUGO, show_als_attr, NULL, \

Definition at line 640 of file lm3533-als.c.

#define ALS_TARGET_ATTR_RW (   _channel,
  _zone 
)
Value:
LM3533_ALS_ATTR(out_current##_channel##_current##_zone##_raw, \
show_als_attr, store_als_attr, \
LM3533_ATTR_TYPE_TARGET, _channel, _zone)

Definition at line 585 of file lm3533-als.c.

#define ALS_THRESH_FALLING_ATTR_RW (   _nr)
Value:
LM3533_ALS_ATTR(in_illuminance0_thresh##_nr##_falling_value, \
show_als_attr, store_als_attr, \

Definition at line 613 of file lm3533-als.c.

#define ALS_THRESH_RAISING_ATTR_RW (   _nr)
Value:
LM3533_ALS_ATTR(in_illuminance0_thresh##_nr##_raising_value, \
show_als_attr, store_als_attr, \

Definition at line 619 of file lm3533-als.c.

#define CHANNEL_CURRENT (   _channel)
Value:
{ \
.type = IIO_CURRENT, \
.channel = _channel, \
.indexed = true, \
.output = true, \
}

Definition at line 228 of file lm3533-als.c.

#define ILLUMINANCE_ATTR_RO (   _name)    DEVICE_ATTR(in_illuminance0_##_name, S_IRUGO, show_##_name, NULL)

Definition at line 657 of file lm3533-als.c.

#define ILLUMINANCE_ATTR_RW (   _name)
Value:
DEVICE_ATTR(in_illuminance0_##_name, S_IRUGO | S_IWUSR , \
show_##_name, store_##_name)

Definition at line 659 of file lm3533-als.c.

#define LM3533_ALS_ATTR (   _name,
  _mode,
  _show,
  _store,
  _type,
  _val1,
  _val2 
)
Value:
struct lm3533_als_attribute lm3533_als_attr_##_name = \
ALS_ATTR(_name, _mode, _show, _store, _type, _val1, _val2)

Definition at line 581 of file lm3533-als.c.

#define LM3533_ALS_CHANNEL_CURRENT_MAX   2

Definition at line 32 of file lm3533-als.c.

#define LM3533_ALS_ENABLE_MASK   0x01

Definition at line 44 of file lm3533-als.c.

#define LM3533_ALS_FLAG_INT_ENABLED   1

Definition at line 51 of file lm3533-als.c.

#define LM3533_ALS_INPUT_MODE_MASK   0x02

Definition at line 45 of file lm3533-als.c.

#define LM3533_ALS_INT_ENABLE_MASK   0x01

Definition at line 46 of file lm3533-als.c.

#define LM3533_ALS_RESISTOR_MAX   127

Definition at line 31 of file lm3533-als.c.

#define LM3533_ALS_RESISTOR_MIN   1

Definition at line 30 of file lm3533-als.c.

#define LM3533_ALS_THRESH_MAX   3

Definition at line 33 of file lm3533-als.c.

#define LM3533_ALS_ZONE_MASK   0x1c

Definition at line 49 of file lm3533-als.c.

#define LM3533_ALS_ZONE_MAX   4

Definition at line 34 of file lm3533-als.c.

#define LM3533_ALS_ZONE_SHIFT   2

Definition at line 48 of file lm3533-als.c.

#define LM3533_REG_ALS_BOUNDARY_BASE   0x50

Definition at line 41 of file lm3533-als.c.

#define LM3533_REG_ALS_CONF   0x31

Definition at line 37 of file lm3533-als.c.

#define LM3533_REG_ALS_READ_ADC_AVERAGE   0x38

Definition at line 40 of file lm3533-als.c.

#define LM3533_REG_ALS_READ_ADC_RAW   0x37

Definition at line 39 of file lm3533-als.c.

#define LM3533_REG_ALS_RESISTOR_SELECT   0x30

Definition at line 36 of file lm3533-als.c.

#define LM3533_REG_ALS_TARGET_BASE   0x60

Definition at line 42 of file lm3533-als.c.

#define LM3533_REG_ALS_ZONE_INFO   0x34

Definition at line 38 of file lm3533-als.c.

Enumeration Type Documentation

Enumerator:
LM3533_ATTR_TYPE_HYSTERESIS 
LM3533_ATTR_TYPE_TARGET 
LM3533_ATTR_TYPE_THRESH_FALLING 
LM3533_ATTR_TYPE_THRESH_RAISING 

Definition at line 484 of file lm3533-als.c.

Function Documentation

MODULE_ALIAS ( "platform:lm3533-als"  )
MODULE_AUTHOR ( "Johan Hovold <[email protected]>"  )
MODULE_DESCRIPTION ( "LM3533 Ambient Light Sensor driver )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( lm3533_als_driver  )