Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
max17042_battery.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/mod_devicetable.h>
#include <linux/power_supply.h>
#include <linux/power/max17042_battery.h>
#include <linux/of.h>

Go to the source code of this file.

Data Structures

struct  max17042_chip
 

Macros

#define STATUS_POR_BIT   (1 << 1)
 
#define STATUS_BST_BIT   (1 << 3)
 
#define STATUS_VMN_BIT   (1 << 8)
 
#define STATUS_TMN_BIT   (1 << 9)
 
#define STATUS_SMN_BIT   (1 << 10)
 
#define STATUS_BI_BIT   (1 << 11)
 
#define STATUS_VMX_BIT   (1 << 12)
 
#define STATUS_TMX_BIT   (1 << 13)
 
#define STATUS_SMX_BIT   (1 << 14)
 
#define STATUS_BR_BIT   (1 << 15)
 
#define CONFIG_ALRT_BIT_ENBL   (1 << 2)
 
#define STATUS_INTR_SOCMIN_BIT   (1 << 10)
 
#define STATUS_INTR_SOCMAX_BIT   (1 << 14)
 
#define VFSOC0_LOCK   0x0000
 
#define VFSOC0_UNLOCK   0x0080
 
#define MODEL_UNLOCK1   0X0059
 
#define MODEL_UNLOCK2   0X00C4
 
#define MODEL_LOCK1   0X0000
 
#define MODEL_LOCK2   0X0000
 
#define dQ_ACC_DIV   0x4
 
#define dP_ACC_100   0x1900
 
#define dP_ACC_200   0x3200
 
#define MAX17042_IC_VERSION   0x0092
 
#define MAX17047_IC_VERSION   0x00AC /* same for max17050 */
 
#define MAX17042_PM_OPS   NULL
 

Functions

 MODULE_DEVICE_TABLE (i2c, max17042_id)
 
 module_i2c_driver (max17042_i2c_driver)
 
 MODULE_AUTHOR ("MyungJoo Ham <[email protected]>")
 
 MODULE_DESCRIPTION ("MAX17042 Fuel Gauge")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define CONFIG_ALRT_BIT_ENBL   (1 << 2)

Definition at line 50 of file max17042_battery.c.

#define dP_ACC_100   0x1900

Definition at line 62 of file max17042_battery.c.

#define dP_ACC_200   0x3200

Definition at line 63 of file max17042_battery.c.

#define dQ_ACC_DIV   0x4

Definition at line 61 of file max17042_battery.c.

#define MAX17042_IC_VERSION   0x0092

Definition at line 65 of file max17042_battery.c.

#define MAX17042_PM_OPS   NULL

Definition at line 826 of file max17042_battery.c.

#define MAX17047_IC_VERSION   0x00AC /* same for max17050 */

Definition at line 66 of file max17042_battery.c.

#define MODEL_LOCK1   0X0000

Definition at line 58 of file max17042_battery.c.

#define MODEL_LOCK2   0X0000

Definition at line 59 of file max17042_battery.c.

#define MODEL_UNLOCK1   0X0059

Definition at line 56 of file max17042_battery.c.

#define MODEL_UNLOCK2   0X00C4

Definition at line 57 of file max17042_battery.c.

#define STATUS_BI_BIT   (1 << 11)

Definition at line 43 of file max17042_battery.c.

#define STATUS_BR_BIT   (1 << 15)

Definition at line 47 of file max17042_battery.c.

#define STATUS_BST_BIT   (1 << 3)

Definition at line 39 of file max17042_battery.c.

#define STATUS_INTR_SOCMAX_BIT   (1 << 14)

Definition at line 52 of file max17042_battery.c.

#define STATUS_INTR_SOCMIN_BIT   (1 << 10)

Definition at line 51 of file max17042_battery.c.

#define STATUS_POR_BIT   (1 << 1)

Definition at line 38 of file max17042_battery.c.

#define STATUS_SMN_BIT   (1 << 10)

Definition at line 42 of file max17042_battery.c.

#define STATUS_SMX_BIT   (1 << 14)

Definition at line 46 of file max17042_battery.c.

#define STATUS_TMN_BIT   (1 << 9)

Definition at line 41 of file max17042_battery.c.

#define STATUS_TMX_BIT   (1 << 13)

Definition at line 45 of file max17042_battery.c.

#define STATUS_VMN_BIT   (1 << 8)

Definition at line 40 of file max17042_battery.c.

#define STATUS_VMX_BIT   (1 << 12)

Definition at line 44 of file max17042_battery.c.

#define VFSOC0_LOCK   0x0000

Definition at line 54 of file max17042_battery.c.

#define VFSOC0_UNLOCK   0x0080

Definition at line 55 of file max17042_battery.c.

Function Documentation

MODULE_AUTHOR ( "MyungJoo Ham <[email protected]>"  )
MODULE_DESCRIPTION ( "MAX17042 Fuel Gauge"  )
MODULE_DEVICE_TABLE ( i2c  ,
max17042_id   
)
module_i2c_driver ( max17042_i2c_driver  )
MODULE_LICENSE ( "GPL"  )