Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
leds-lm3530.c File Reference
#include <linux/i2c.h>
#include <linux/leds.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/led-lm3530.h>
#include <linux/types.h>
#include <linux/regulator/consumer.h>
#include <linux/module.h>

Go to the source code of this file.

Data Structures

struct  lm3530_mode_map
 
struct  lm3530_data
 
struct  lm3530_als_data
 

Macros

#define LM3530_LED_DEV   "lcd-backlight"
 
#define LM3530_NAME   "lm3530-led"
 
#define LM3530_GEN_CONFIG   0x10
 
#define LM3530_ALS_CONFIG   0x20
 
#define LM3530_BRT_RAMP_RATE   0x30
 
#define LM3530_ALS_IMP_SELECT   0x41
 
#define LM3530_BRT_CTRL_REG   0xA0
 
#define LM3530_ALS_ZB0_REG   0x60
 
#define LM3530_ALS_ZB1_REG   0x61
 
#define LM3530_ALS_ZB2_REG   0x62
 
#define LM3530_ALS_ZB3_REG   0x63
 
#define LM3530_ALS_Z0T_REG   0x70
 
#define LM3530_ALS_Z1T_REG   0x71
 
#define LM3530_ALS_Z2T_REG   0x72
 
#define LM3530_ALS_Z3T_REG   0x73
 
#define LM3530_ALS_Z4T_REG   0x74
 
#define LM3530_REG_MAX   14
 
#define LM3530_EN_I2C_SHIFT   (0)
 
#define LM3530_RAMP_LAW_SHIFT   (1)
 
#define LM3530_MAX_CURR_SHIFT   (2)
 
#define LM3530_EN_PWM_SHIFT   (5)
 
#define LM3530_PWM_POL_SHIFT   (6)
 
#define LM3530_EN_PWM_SIMPLE_SHIFT   (7)
 
#define LM3530_ENABLE_I2C   (1 << LM3530_EN_I2C_SHIFT)
 
#define LM3530_ENABLE_PWM   (1 << LM3530_EN_PWM_SHIFT)
 
#define LM3530_POL_LOW   (1 << LM3530_PWM_POL_SHIFT)
 
#define LM3530_ENABLE_PWM_SIMPLE   (1 << LM3530_EN_PWM_SIMPLE_SHIFT)
 
#define LM3530_ALS_AVG_TIME_SHIFT   (0)
 
#define LM3530_EN_ALS_SHIFT   (3)
 
#define LM3530_ALS_SEL_SHIFT   (5)
 
#define LM3530_ENABLE_ALS   (3 << LM3530_EN_ALS_SHIFT)
 
#define LM3530_BRT_RAMP_FALL_SHIFT   (0)
 
#define LM3530_BRT_RAMP_RISE_SHIFT   (3)
 
#define LM3530_ALS1_IMP_SHIFT   (0)
 
#define LM3530_ALS2_IMP_SHIFT   (4)
 
#define LM3530_ALS_ZB_MAX   (4)
 
#define LM3530_ALS_WINDOW_mV   (1000)
 
#define LM3530_ALS_OFFSET_mV   (4)
 
#define LM3530_DEF_ZT_0   (0x7F)
 
#define LM3530_DEF_ZT_1   (0x66)
 
#define LM3530_DEF_ZT_2   (0x4C)
 
#define LM3530_DEF_ZT_3   (0x33)
 
#define LM3530_DEF_ZT_4   (0x19)
 
#define MAX_BRIGHTNESS   (127)
 

Functions

 MODULE_DEVICE_TABLE (i2c, lm3530_id)
 
 module_i2c_driver (lm3530_i2c_driver)
 
 MODULE_DESCRIPTION ("Back Light driver for LM3530")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_AUTHOR ("Shreshtha Kumar SAHU <[email protected]>")
 

Macro Definition Documentation

#define LM3530_ALS1_IMP_SHIFT   (0)

Definition at line 67 of file leds-lm3530.c.

#define LM3530_ALS2_IMP_SHIFT   (4)

Definition at line 68 of file leds-lm3530.c.

#define LM3530_ALS_AVG_TIME_SHIFT   (0)

Definition at line 56 of file leds-lm3530.c.

#define LM3530_ALS_CONFIG   0x20

Definition at line 27 of file leds-lm3530.c.

#define LM3530_ALS_IMP_SELECT   0x41

Definition at line 29 of file leds-lm3530.c.

#define LM3530_ALS_OFFSET_mV   (4)

Definition at line 73 of file leds-lm3530.c.

#define LM3530_ALS_SEL_SHIFT   (5)

Definition at line 58 of file leds-lm3530.c.

#define LM3530_ALS_WINDOW_mV   (1000)

Definition at line 72 of file leds-lm3530.c.

#define LM3530_ALS_Z0T_REG   0x70

Definition at line 35 of file leds-lm3530.c.

#define LM3530_ALS_Z1T_REG   0x71

Definition at line 36 of file leds-lm3530.c.

#define LM3530_ALS_Z2T_REG   0x72

Definition at line 37 of file leds-lm3530.c.

#define LM3530_ALS_Z3T_REG   0x73

Definition at line 38 of file leds-lm3530.c.

#define LM3530_ALS_Z4T_REG   0x74

Definition at line 39 of file leds-lm3530.c.

#define LM3530_ALS_ZB0_REG   0x60

Definition at line 31 of file leds-lm3530.c.

#define LM3530_ALS_ZB1_REG   0x61

Definition at line 32 of file leds-lm3530.c.

#define LM3530_ALS_ZB2_REG   0x62

Definition at line 33 of file leds-lm3530.c.

#define LM3530_ALS_ZB3_REG   0x63

Definition at line 34 of file leds-lm3530.c.

#define LM3530_ALS_ZB_MAX   (4)

Definition at line 71 of file leds-lm3530.c.

#define LM3530_BRT_CTRL_REG   0xA0

Definition at line 30 of file leds-lm3530.c.

#define LM3530_BRT_RAMP_FALL_SHIFT   (0)

Definition at line 63 of file leds-lm3530.c.

#define LM3530_BRT_RAMP_RATE   0x30

Definition at line 28 of file leds-lm3530.c.

#define LM3530_BRT_RAMP_RISE_SHIFT   (3)

Definition at line 64 of file leds-lm3530.c.

#define LM3530_DEF_ZT_0   (0x7F)

Definition at line 76 of file leds-lm3530.c.

#define LM3530_DEF_ZT_1   (0x66)

Definition at line 77 of file leds-lm3530.c.

#define LM3530_DEF_ZT_2   (0x4C)

Definition at line 78 of file leds-lm3530.c.

#define LM3530_DEF_ZT_3   (0x33)

Definition at line 79 of file leds-lm3530.c.

#define LM3530_DEF_ZT_4   (0x19)

Definition at line 80 of file leds-lm3530.c.

#define LM3530_EN_ALS_SHIFT   (3)

Definition at line 57 of file leds-lm3530.c.

#define LM3530_EN_I2C_SHIFT   (0)

Definition at line 43 of file leds-lm3530.c.

#define LM3530_EN_PWM_SHIFT   (5)

Definition at line 46 of file leds-lm3530.c.

#define LM3530_EN_PWM_SIMPLE_SHIFT   (7)

Definition at line 48 of file leds-lm3530.c.

#define LM3530_ENABLE_ALS   (3 << LM3530_EN_ALS_SHIFT)

Definition at line 60 of file leds-lm3530.c.

#define LM3530_ENABLE_I2C   (1 << LM3530_EN_I2C_SHIFT)

Definition at line 50 of file leds-lm3530.c.

#define LM3530_ENABLE_PWM   (1 << LM3530_EN_PWM_SHIFT)

Definition at line 51 of file leds-lm3530.c.

#define LM3530_ENABLE_PWM_SIMPLE   (1 << LM3530_EN_PWM_SIMPLE_SHIFT)

Definition at line 53 of file leds-lm3530.c.

#define LM3530_GEN_CONFIG   0x10

Definition at line 26 of file leds-lm3530.c.

#define LM3530_LED_DEV   "lcd-backlight"

Definition at line 23 of file leds-lm3530.c.

#define LM3530_MAX_CURR_SHIFT   (2)

Definition at line 45 of file leds-lm3530.c.

#define LM3530_NAME   "lm3530-led"

Definition at line 24 of file leds-lm3530.c.

#define LM3530_POL_LOW   (1 << LM3530_PWM_POL_SHIFT)

Definition at line 52 of file leds-lm3530.c.

#define LM3530_PWM_POL_SHIFT   (6)

Definition at line 47 of file leds-lm3530.c.

#define LM3530_RAMP_LAW_SHIFT   (1)

Definition at line 44 of file leds-lm3530.c.

#define LM3530_REG_MAX   14

Definition at line 40 of file leds-lm3530.c.

#define MAX_BRIGHTNESS   (127)

Definition at line 83 of file leds-lm3530.c.

Function Documentation

MODULE_AUTHOR ( "Shreshtha Kumar SAHU <[email protected]>"  )
MODULE_DESCRIPTION ( "Back Light driver for LM3530"  )
MODULE_DEVICE_TABLE ( i2c  ,
lm3530_id   
)
module_i2c_driver ( lm3530_i2c_driver  )
MODULE_LICENSE ( "GPL v2 )