Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
lp8788-charger.c File Reference
#include <linux/err.h>
#include <linux/iio/consumer.h>
#include <linux/interrupt.h>
#include <linux/irqdomain.h>
#include <linux/mfd/lp8788.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  lp8788_chg_irq
 
struct  lp8788_charger
 

Macros

#define LP8788_CHG_STATUS   0x07
 
#define LP8788_CHG_IDCIN   0x13
 
#define LP8788_CHG_IBATT   0x14
 
#define LP8788_CHG_VTERM   0x15
 
#define LP8788_CHG_EOC   0x16
 
#define LP8788_CHG_INPUT_STATE_M   0x03 /* Addr 07h */
 
#define LP8788_CHG_STATE_M   0x3C
 
#define LP8788_CHG_STATE_S   2
 
#define LP8788_NO_BATT_M   BIT(6)
 
#define LP8788_BAD_BATT_M   BIT(7)
 
#define LP8788_CHG_IBATT_M   0x1F /* Addr 14h */
 
#define LP8788_CHG_VTERM_M   0x0F /* Addr 15h */
 
#define LP8788_CHG_EOC_LEVEL_M   0x30 /* Addr 16h */
 
#define LP8788_CHG_EOC_LEVEL_S   4
 
#define LP8788_CHG_EOC_TIME_M   0x0E
 
#define LP8788_CHG_EOC_TIME_S   1
 
#define LP8788_CHG_EOC_MODE_M   BIT(0)
 
#define LP8788_CHARGER_NAME   "charger"
 
#define LP8788_BATTERY_NAME   "main_batt"
 
#define LP8788_CHG_START   0x11
 
#define LP8788_CHG_END   0x1C
 
#define LP8788_BUF_SIZE   40
 
#define LP8788_ISEL_MAX   23
 
#define LP8788_ISEL_STEP   50
 
#define LP8788_VTERM_MIN   4100
 
#define LP8788_VTERM_STEP   25
 
#define LP8788_MAX_BATT_CAPACITY   100
 
#define LP8788_MAX_CHG_IRQS   11
 

Enumerations

enum  lp8788_charging_state {
  LP8788_OFF, LP8788_WARM_UP, LP8788_LOW_INPUT = 0x3, LP8788_PRECHARGE,
  LP8788_CC, LP8788_CV, LP8788_MAINTENANCE, LP8788_BATTERY_FAULT,
  LP8788_SYSTEM_SUPPORT = 0xC, LP8788_HIGH_CURRENT = 0xF, LP8788_MAX_CHG_STATE
}
 
enum  lp8788_charger_adc_sel { LP8788_VBATT, LP8788_BATT_TEMP, LP8788_NUM_CHG_ADC }
 
enum  lp8788_charger_input_state { LP8788_SYSTEM_SUPPLY = 1, LP8788_FULL_FUNCTION }
 

Functions

 module_platform_driver (lp8788_charger_driver)
 
 MODULE_DESCRIPTION ("TI LP8788 Charger Driver")
 
 MODULE_AUTHOR ("Milo Kim")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:lp8788-charger")
 

Macro Definition Documentation

#define LP8788_BAD_BATT_M   BIT(7)

Definition at line 37 of file lp8788-charger.c.

#define LP8788_BATTERY_NAME   "main_batt"

Definition at line 47 of file lp8788-charger.c.

#define LP8788_BUF_SIZE   40

Definition at line 52 of file lp8788-charger.c.

#define LP8788_CHARGER_NAME   "charger"

Definition at line 46 of file lp8788-charger.c.

#define LP8788_CHG_END   0x1C

Definition at line 50 of file lp8788-charger.c.

#define LP8788_CHG_EOC   0x16

Definition at line 30 of file lp8788-charger.c.

#define LP8788_CHG_EOC_LEVEL_M   0x30 /* Addr 16h */

Definition at line 40 of file lp8788-charger.c.

#define LP8788_CHG_EOC_LEVEL_S   4

Definition at line 41 of file lp8788-charger.c.

#define LP8788_CHG_EOC_MODE_M   BIT(0)

Definition at line 44 of file lp8788-charger.c.

#define LP8788_CHG_EOC_TIME_M   0x0E

Definition at line 42 of file lp8788-charger.c.

#define LP8788_CHG_EOC_TIME_S   1

Definition at line 43 of file lp8788-charger.c.

#define LP8788_CHG_IBATT   0x14

Definition at line 28 of file lp8788-charger.c.

#define LP8788_CHG_IBATT_M   0x1F /* Addr 14h */

Definition at line 38 of file lp8788-charger.c.

#define LP8788_CHG_IDCIN   0x13

Definition at line 27 of file lp8788-charger.c.

#define LP8788_CHG_INPUT_STATE_M   0x03 /* Addr 07h */

Definition at line 33 of file lp8788-charger.c.

#define LP8788_CHG_START   0x11

Definition at line 49 of file lp8788-charger.c.

#define LP8788_CHG_STATE_M   0x3C

Definition at line 34 of file lp8788-charger.c.

#define LP8788_CHG_STATE_S   2

Definition at line 35 of file lp8788-charger.c.

#define LP8788_CHG_STATUS   0x07

Definition at line 26 of file lp8788-charger.c.

#define LP8788_CHG_VTERM   0x15

Definition at line 29 of file lp8788-charger.c.

#define LP8788_CHG_VTERM_M   0x0F /* Addr 15h */

Definition at line 39 of file lp8788-charger.c.

#define LP8788_ISEL_MAX   23

Definition at line 53 of file lp8788-charger.c.

#define LP8788_ISEL_STEP   50

Definition at line 54 of file lp8788-charger.c.

#define LP8788_MAX_BATT_CAPACITY   100

Definition at line 57 of file lp8788-charger.c.

#define LP8788_MAX_CHG_IRQS   11

Definition at line 58 of file lp8788-charger.c.

#define LP8788_NO_BATT_M   BIT(6)

Definition at line 36 of file lp8788-charger.c.

#define LP8788_VTERM_MIN   4100

Definition at line 55 of file lp8788-charger.c.

#define LP8788_VTERM_STEP   25

Definition at line 56 of file lp8788-charger.c.

Enumeration Type Documentation

Enumerator:
LP8788_VBATT 
LP8788_BATT_TEMP 
LP8788_NUM_CHG_ADC 

Definition at line 74 of file lp8788-charger.c.

Enumerator:
LP8788_SYSTEM_SUPPLY 
LP8788_FULL_FUNCTION 

Definition at line 80 of file lp8788-charger.c.

Enumerator:
LP8788_OFF 
LP8788_WARM_UP 
LP8788_LOW_INPUT 
LP8788_PRECHARGE 
LP8788_CC 
LP8788_CV 
LP8788_MAINTENANCE 
LP8788_BATTERY_FAULT 
LP8788_SYSTEM_SUPPORT 
LP8788_HIGH_CURRENT 
LP8788_MAX_CHG_STATE 

Definition at line 60 of file lp8788-charger.c.

Function Documentation

MODULE_ALIAS ( "platform:lp8788-charger"  )
MODULE_AUTHOR ( "Milo Kim"  )
MODULE_DESCRIPTION ( "TI LP8788 Charger Driver"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( lp8788_charger_driver  )