Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
adp8860_bl.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/fb.h>
#include <linux/backlight.h>
#include <linux/leds.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/i2c/adp8860.h>

Go to the source code of this file.

Data Structures

struct  adp8860_led
 
struct  adp8860_bl
 

Macros

#define ADP8860_EXT_FEATURES
 
#define ADP8860_USE_LEDS
 
#define ADP8860_MFDVID   0x00 /* Manufacturer and device ID */
 
#define ADP8860_MDCR   0x01 /* Device mode and status */
 
#define ADP8860_MDCR2   0x02 /* Device mode and Status Register 2 */
 
#define ADP8860_INTR_EN   0x03 /* Interrupts enable */
 
#define ADP8860_CFGR   0x04 /* Configuration register */
 
#define ADP8860_BLSEN   0x05 /* Sink enable backlight or independent */
 
#define ADP8860_BLOFF   0x06 /* Backlight off timeout */
 
#define ADP8860_BLDIM   0x07 /* Backlight dim timeout */
 
#define ADP8860_BLFR   0x08 /* Backlight fade in and out rates */
 
#define ADP8860_BLMX1   0x09 /* Backlight (Brightness Level 1-daylight) maximum current */
 
#define ADP8860_BLDM1   0x0A /* Backlight (Brightness Level 1-daylight) dim current */
 
#define ADP8860_BLMX2   0x0B /* Backlight (Brightness Level 2-office) maximum current */
 
#define ADP8860_BLDM2   0x0C /* Backlight (Brightness Level 2-office) dim current */
 
#define ADP8860_BLMX3   0x0D /* Backlight (Brightness Level 3-dark) maximum current */
 
#define ADP8860_BLDM3   0x0E /* Backlight (Brightness Level 3-dark) dim current */
 
#define ADP8860_ISCFR   0x0F /* Independent sink current fade control register */
 
#define ADP8860_ISCC   0x10 /* Independent sink current control register */
 
#define ADP8860_ISCT1   0x11 /* Independent Sink Current Timer Register LED[7:5] */
 
#define ADP8860_ISCT2   0x12 /* Independent Sink Current Timer Register LED[4:1] */
 
#define ADP8860_ISCF   0x13 /* Independent sink current fade register */
 
#define ADP8860_ISC7   0x14 /* Independent Sink Current LED7 */
 
#define ADP8860_ISC6   0x15 /* Independent Sink Current LED6 */
 
#define ADP8860_ISC5   0x16 /* Independent Sink Current LED5 */
 
#define ADP8860_ISC4   0x17 /* Independent Sink Current LED4 */
 
#define ADP8860_ISC3   0x18 /* Independent Sink Current LED3 */
 
#define ADP8860_ISC2   0x19 /* Independent Sink Current LED2 */
 
#define ADP8860_ISC1   0x1A /* Independent Sink Current LED1 */
 
#define ADP8860_CCFG   0x1B /* Comparator configuration */
 
#define ADP8860_CCFG2   0x1C /* Second comparator configuration */
 
#define ADP8860_L2_TRP   0x1D /* L2 comparator reference */
 
#define ADP8860_L2_HYS   0x1E /* L2 hysteresis */
 
#define ADP8860_L3_TRP   0x1F /* L3 comparator reference */
 
#define ADP8860_L3_HYS   0x20 /* L3 hysteresis */
 
#define ADP8860_PH1LEVL   0x21 /* First phototransistor ambient light level-low byte register */
 
#define ADP8860_PH1LEVH   0x22 /* First phototransistor ambient light level-high byte register */
 
#define ADP8860_PH2LEVL   0x23 /* Second phototransistor ambient light level-low byte register */
 
#define ADP8860_PH2LEVH   0x24 /* Second phototransistor ambient light level-high byte register */
 
#define ADP8860_MANUFID   0x0 /* Analog Devices ADP8860 Manufacturer ID */
 
#define ADP8861_MANUFID   0x4 /* Analog Devices ADP8861 Manufacturer ID */
 
#define ADP8863_MANUFID   0x2 /* Analog Devices ADP8863 Manufacturer ID */
 
#define ADP8860_DEVID(x)   ((x) & 0xF)
 
#define ADP8860_MANID(x)   ((x) >> 4)
 
#define INT_CFG   (1 << 6)
 
#define NSTBY   (1 << 5)
 
#define DIM_EN   (1 << 4)
 
#define GDWN_DIS   (1 << 3)
 
#define SIS_EN   (1 << 2)
 
#define CMP_AUTOEN   (1 << 1)
 
#define BLEN   (1 << 0)
 
#define L3_EN   (1 << 1)
 
#define L2_EN   (1 << 0)
 
#define CFGR_BLV_SHIFT   3
 
#define CFGR_BLV_MASK   0x3
 
#define ADP8860_FLAG_LED_MASK   0xFF
 
#define FADE_VAL(in, out)   ((0xF & (in)) | ((0xF & (out)) << 4))
 
#define BL_CFGR_VAL(law, blv)   ((((blv) & CFGR_BLV_MASK) << CFGR_BLV_SHIFT) | ((0x3 & (law)) << 1))
 
#define ALS_CCFG_VAL(filt)   ((0x7 & filt) << 5)
 
#define adp8860_i2c_suspend   NULL
 
#define adp8860_i2c_resume   NULL
 

Enumerations

enum  { adp8860, adp8861, adp8863 }
 

Functions

 MODULE_DEVICE_TABLE (i2c, adp8860_id)
 
 module_i2c_driver (adp8860_driver)
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_AUTHOR ("Michael Hennerich <[email protected]>")
 
 MODULE_DESCRIPTION ("ADP8860 Backlight driver")
 
 MODULE_ALIAS ("i2c:adp8860-backlight")
 

Macro Definition Documentation

#define ADP8860_BLDIM   0x07 /* Backlight dim timeout */

Definition at line 32 of file adp8860_bl.c.

#define ADP8860_BLDM1   0x0A /* Backlight (Brightness Level 1-daylight) dim current */

Definition at line 35 of file adp8860_bl.c.

#define ADP8860_BLDM2   0x0C /* Backlight (Brightness Level 2-office) dim current */

Definition at line 37 of file adp8860_bl.c.

#define ADP8860_BLDM3   0x0E /* Backlight (Brightness Level 3-dark) dim current */

Definition at line 39 of file adp8860_bl.c.

#define ADP8860_BLFR   0x08 /* Backlight fade in and out rates */

Definition at line 33 of file adp8860_bl.c.

#define ADP8860_BLMX1   0x09 /* Backlight (Brightness Level 1-daylight) maximum current */

Definition at line 34 of file adp8860_bl.c.

#define ADP8860_BLMX2   0x0B /* Backlight (Brightness Level 2-office) maximum current */

Definition at line 36 of file adp8860_bl.c.

#define ADP8860_BLMX3   0x0D /* Backlight (Brightness Level 3-dark) maximum current */

Definition at line 38 of file adp8860_bl.c.

#define ADP8860_BLOFF   0x06 /* Backlight off timeout */

Definition at line 31 of file adp8860_bl.c.

#define ADP8860_BLSEN   0x05 /* Sink enable backlight or independent */

Definition at line 30 of file adp8860_bl.c.

#define ADP8860_CCFG   0x1B /* Comparator configuration */

Definition at line 52 of file adp8860_bl.c.

#define ADP8860_CCFG2   0x1C /* Second comparator configuration */

Definition at line 53 of file adp8860_bl.c.

#define ADP8860_CFGR   0x04 /* Configuration register */

Definition at line 29 of file adp8860_bl.c.

#define ADP8860_DEVID (   x)    ((x) & 0xF)

Definition at line 67 of file adp8860_bl.c.

#define ADP8860_EXT_FEATURES

Definition at line 22 of file adp8860_bl.c.

#define ADP8860_FLAG_LED_MASK   0xFF

Definition at line 85 of file adp8860_bl.c.

#define adp8860_i2c_resume   NULL

Definition at line 792 of file adp8860_bl.c.

#define adp8860_i2c_suspend   NULL

Definition at line 791 of file adp8860_bl.c.

#define ADP8860_INTR_EN   0x03 /* Interrupts enable */

Definition at line 28 of file adp8860_bl.c.

#define ADP8860_ISC1   0x1A /* Independent Sink Current LED1 */

Definition at line 51 of file adp8860_bl.c.

#define ADP8860_ISC2   0x19 /* Independent Sink Current LED2 */

Definition at line 50 of file adp8860_bl.c.

#define ADP8860_ISC3   0x18 /* Independent Sink Current LED3 */

Definition at line 49 of file adp8860_bl.c.

#define ADP8860_ISC4   0x17 /* Independent Sink Current LED4 */

Definition at line 48 of file adp8860_bl.c.

#define ADP8860_ISC5   0x16 /* Independent Sink Current LED5 */

Definition at line 47 of file adp8860_bl.c.

#define ADP8860_ISC6   0x15 /* Independent Sink Current LED6 */

Definition at line 46 of file adp8860_bl.c.

#define ADP8860_ISC7   0x14 /* Independent Sink Current LED7 */

Definition at line 45 of file adp8860_bl.c.

#define ADP8860_ISCC   0x10 /* Independent sink current control register */

Definition at line 41 of file adp8860_bl.c.

#define ADP8860_ISCF   0x13 /* Independent sink current fade register */

Definition at line 44 of file adp8860_bl.c.

#define ADP8860_ISCFR   0x0F /* Independent sink current fade control register */

Definition at line 40 of file adp8860_bl.c.

#define ADP8860_ISCT1   0x11 /* Independent Sink Current Timer Register LED[7:5] */

Definition at line 42 of file adp8860_bl.c.

#define ADP8860_ISCT2   0x12 /* Independent Sink Current Timer Register LED[4:1] */

Definition at line 43 of file adp8860_bl.c.

#define ADP8860_L2_HYS   0x1E /* L2 hysteresis */

Definition at line 55 of file adp8860_bl.c.

#define ADP8860_L2_TRP   0x1D /* L2 comparator reference */

Definition at line 54 of file adp8860_bl.c.

#define ADP8860_L3_HYS   0x20 /* L3 hysteresis */

Definition at line 57 of file adp8860_bl.c.

#define ADP8860_L3_TRP   0x1F /* L3 comparator reference */

Definition at line 56 of file adp8860_bl.c.

#define ADP8860_MANID (   x)    ((x) >> 4)

Definition at line 68 of file adp8860_bl.c.

#define ADP8860_MANUFID   0x0 /* Analog Devices ADP8860 Manufacturer ID */

Definition at line 63 of file adp8860_bl.c.

#define ADP8860_MDCR   0x01 /* Device mode and status */

Definition at line 26 of file adp8860_bl.c.

#define ADP8860_MDCR2   0x02 /* Device mode and Status Register 2 */

Definition at line 27 of file adp8860_bl.c.

#define ADP8860_MFDVID   0x00 /* Manufacturer and device ID */

Definition at line 25 of file adp8860_bl.c.

#define ADP8860_PH1LEVH   0x22 /* First phototransistor ambient light level-high byte register */

Definition at line 59 of file adp8860_bl.c.

#define ADP8860_PH1LEVL   0x21 /* First phototransistor ambient light level-low byte register */

Definition at line 58 of file adp8860_bl.c.

#define ADP8860_PH2LEVH   0x24 /* Second phototransistor ambient light level-high byte register */

Definition at line 61 of file adp8860_bl.c.

#define ADP8860_PH2LEVL   0x23 /* Second phototransistor ambient light level-low byte register */

Definition at line 60 of file adp8860_bl.c.

#define ADP8860_USE_LEDS

Definition at line 23 of file adp8860_bl.c.

#define ADP8861_MANUFID   0x4 /* Analog Devices ADP8861 Manufacturer ID */

Definition at line 64 of file adp8860_bl.c.

#define ADP8863_MANUFID   0x2 /* Analog Devices ADP8863 Manufacturer ID */

Definition at line 65 of file adp8860_bl.c.

#define ALS_CCFG_VAL (   filt)    ((0x7 & filt) << 5)

Definition at line 89 of file adp8860_bl.c.

#define BL_CFGR_VAL (   law,
  blv 
)    ((((blv) & CFGR_BLV_MASK) << CFGR_BLV_SHIFT) | ((0x3 & (law)) << 1))

Definition at line 88 of file adp8860_bl.c.

#define BLEN   (1 << 0)

Definition at line 77 of file adp8860_bl.c.

#define CFGR_BLV_MASK   0x3

Definition at line 84 of file adp8860_bl.c.

#define CFGR_BLV_SHIFT   3

Definition at line 83 of file adp8860_bl.c.

#define CMP_AUTOEN   (1 << 1)

Definition at line 76 of file adp8860_bl.c.

#define DIM_EN   (1 << 4)

Definition at line 73 of file adp8860_bl.c.

#define FADE_VAL (   in,
  out 
)    ((0xF & (in)) | ((0xF & (out)) << 4))

Definition at line 87 of file adp8860_bl.c.

#define GDWN_DIS   (1 << 3)

Definition at line 74 of file adp8860_bl.c.

#define INT_CFG   (1 << 6)

Definition at line 71 of file adp8860_bl.c.

#define L2_EN   (1 << 0)

Definition at line 81 of file adp8860_bl.c.

#define L3_EN   (1 << 1)

Definition at line 80 of file adp8860_bl.c.

#define NSTBY   (1 << 5)

Definition at line 72 of file adp8860_bl.c.

#define SIS_EN   (1 << 2)

Definition at line 75 of file adp8860_bl.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
adp8860 
adp8861 
adp8863 

Definition at line 91 of file adp8860_bl.c.

Function Documentation

MODULE_ALIAS ( "i2c:adp8860-backlight"  )
MODULE_AUTHOR ( "Michael Hennerich <[email protected]>"  )
MODULE_DESCRIPTION ( "ADP8860 Backlight driver )
MODULE_DEVICE_TABLE ( i2c  ,
adp8860_id   
)
module_i2c_driver ( adp8860_driver  )
MODULE_LICENSE ( "GPL v2 )