Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
ab8500_charger.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/completion.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/workqueue.h>
#include <linux/kobject.h>
#include <linux/mfd/abx500/ab8500.h>
#include <linux/mfd/abx500.h>
#include <linux/mfd/abx500/ab8500-bm.h>
#include <linux/mfd/abx500/ab8500-gpadc.h>
#include <linux/mfd/abx500/ux500_chargalg.h>
#include <linux/usb/otg.h>

Go to the source code of this file.

Data Structures

struct  ab8500_charger_interrupts
 
struct  ab8500_charger_info
 
struct  ab8500_charger_event_flags
 
struct  ab8500_charger_usb_state
 
struct  ab8500_charger
 

Macros

#define NO_PW_CONN   0
 
#define AC_PW_CONN   1
 
#define USB_PW_CONN   2
 
#define MAIN_WDOG_ENA   0x01
 
#define MAIN_WDOG_KICK   0x02
 
#define MAIN_WDOG_DIS   0x00
 
#define CHARG_WD_KICK   0x01
 
#define MAIN_CH_ENA   0x01
 
#define MAIN_CH_NO_OVERSHOOT_ENA_N   0x02
 
#define USB_CH_ENA   0x01
 
#define USB_CHG_NO_OVERSHOOT_ENA_N   0x02
 
#define MAIN_CH_DET   0x01
 
#define MAIN_CH_CV_ON   0x04
 
#define USB_CH_CV_ON   0x08
 
#define VBUS_DET_DBNC100   0x02
 
#define VBUS_DET_DBNC1   0x01
 
#define OTP_ENABLE_WD   0x01
 
#define MAIN_CH_INPUT_CURR_SHIFT   4
 
#define VBUS_IN_CURR_LIM_SHIFT   4
 
#define LED_INDICATOR_PWM_ENA   0x01
 
#define LED_INDICATOR_PWM_DIS   0x00
 
#define LED_IND_CUR_5MA   0x04
 
#define LED_INDICATOR_PWM_DUTY_252_256   0xBF
 
#define MAIN_CH_TH_PROT   0x02
 
#define VBUS_CH_NOK   0x08
 
#define USB_CH_TH_PROT   0x02
 
#define VBUS_OVV_TH   0x01
 
#define MAIN_CH_NOK   0x01
 
#define VBUS_DET   0x80
 
#define AB8500_USB_LINK_STATUS   0x78
 
#define AB8500_STD_HOST_SUSP   0x18
 
#define WD_TIMER   0x30 /* 4min */
 
#define WD_KICK_INTERVAL   (60 * HZ)
 
#define LOW_VOLT_REG   0x4E
 
#define USB_CH_IP_CUR_LVL_0P05   50
 
#define USB_CH_IP_CUR_LVL_0P09   98
 
#define USB_CH_IP_CUR_LVL_0P19   193
 
#define USB_CH_IP_CUR_LVL_0P29   290
 
#define USB_CH_IP_CUR_LVL_0P38   380
 
#define USB_CH_IP_CUR_LVL_0P45   450
 
#define USB_CH_IP_CUR_LVL_0P5   500
 
#define USB_CH_IP_CUR_LVL_0P6   600
 
#define USB_CH_IP_CUR_LVL_0P7   700
 
#define USB_CH_IP_CUR_LVL_0P8   800
 
#define USB_CH_IP_CUR_LVL_0P9   900
 
#define USB_CH_IP_CUR_LVL_1P0   1000
 
#define USB_CH_IP_CUR_LVL_1P1   1100
 
#define USB_CH_IP_CUR_LVL_1P3   1300
 
#define USB_CH_IP_CUR_LVL_1P4   1400
 
#define USB_CH_IP_CUR_LVL_1P5   1500
 
#define VBAT_TRESH_IP_CUR_RED   3800
 
#define to_ab8500_charger_usb_device_info(x)
 
#define to_ab8500_charger_ac_device_info(x)
 

Enumerations

enum  ab8500_charger_link_status {
  USB_STAT_NOT_CONFIGURED, USB_STAT_STD_HOST_NC, USB_STAT_STD_HOST_C_NS, USB_STAT_STD_HOST_C_S,
  USB_STAT_HOST_CHG_NM, USB_STAT_HOST_CHG_HS, USB_STAT_HOST_CHG_HS_CHIRP, USB_STAT_DEDICATED_CHG,
  USB_STAT_ACA_RID_A, USB_STAT_ACA_RID_B, USB_STAT_ACA_RID_C_NM, USB_STAT_ACA_RID_C_HS,
  USB_STAT_ACA_RID_C_HS_CHIRP, USB_STAT_HM_IDGND, USB_STAT_RESERVED, USB_STAT_NOT_VALID_LINK
}
 
enum  ab8500_usb_state {
  AB8500_BM_USB_STATE_RESET_HS, AB8500_BM_USB_STATE_RESET_FS, AB8500_BM_USB_STATE_CONFIGURED, AB8500_BM_USB_STATE_SUSPEND,
  AB8500_BM_USB_STATE_RESUME, AB8500_BM_USB_STATE_MAX
}
 

: name of the interrupt

struct ab8500_charger_interrupts - ab8500 interupts

function pointer to the isr

#define ab8500_charger_suspend   NULL
 
#define ab8500_charger_resume   NULL
 
 subsys_initcall_sync (ab8500_charger_init)
 
 module_exit (ab8500_charger_exit)
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_AUTHOR ("Johan Palsson, Karl Komierowski, Arun R Murthy")
 
 MODULE_ALIAS ("platform:ab8500-charger")
 
 MODULE_DESCRIPTION ("AB8500 charger management driver")
 

Macro Definition Documentation

#define ab8500_charger_resume   NULL

Definition at line 2490 of file ab8500_charger.c.

#define ab8500_charger_suspend   NULL

Definition at line 2489 of file ab8500_charger.c.

#define AB8500_STD_HOST_SUSP   0x18

Definition at line 71 of file ab8500_charger.c.

#define AB8500_USB_LINK_STATUS   0x78

Definition at line 70 of file ab8500_charger.c.

#define AC_PW_CONN   1

Definition at line 35 of file ab8500_charger.c.

#define CHARG_WD_KICK   0x01

Definition at line 41 of file ab8500_charger.c.

#define LED_IND_CUR_5MA   0x04

Definition at line 58 of file ab8500_charger.c.

#define LED_INDICATOR_PWM_DIS   0x00

Definition at line 57 of file ab8500_charger.c.

#define LED_INDICATOR_PWM_DUTY_252_256   0xBF

Definition at line 59 of file ab8500_charger.c.

#define LED_INDICATOR_PWM_ENA   0x01

Definition at line 56 of file ab8500_charger.c.

#define LOW_VOLT_REG   0x4E

Definition at line 78 of file ab8500_charger.c.

#define MAIN_CH_CV_ON   0x04

Definition at line 47 of file ab8500_charger.c.

#define MAIN_CH_DET   0x01

Definition at line 46 of file ab8500_charger.c.

#define MAIN_CH_ENA   0x01

Definition at line 42 of file ab8500_charger.c.

#define MAIN_CH_INPUT_CURR_SHIFT   4

Definition at line 53 of file ab8500_charger.c.

#define MAIN_CH_NO_OVERSHOOT_ENA_N   0x02

Definition at line 43 of file ab8500_charger.c.

#define MAIN_CH_NOK   0x01

Definition at line 66 of file ab8500_charger.c.

#define MAIN_CH_TH_PROT   0x02

Definition at line 62 of file ab8500_charger.c.

#define MAIN_WDOG_DIS   0x00

Definition at line 40 of file ab8500_charger.c.

#define MAIN_WDOG_ENA   0x01

Definition at line 38 of file ab8500_charger.c.

#define MAIN_WDOG_KICK   0x02

Definition at line 39 of file ab8500_charger.c.

#define NO_PW_CONN   0

Definition at line 34 of file ab8500_charger.c.

#define OTP_ENABLE_WD   0x01

Definition at line 51 of file ab8500_charger.c.

#define to_ab8500_charger_ac_device_info (   x)
Value:
struct ab8500_charger, ac_chg)

Definition at line 131 of file ab8500_charger.c.

#define to_ab8500_charger_usb_device_info (   x)
Value:
struct ab8500_charger, usb_chg)

Definition at line 129 of file ab8500_charger.c.

#define USB_CH_CV_ON   0x08

Definition at line 48 of file ab8500_charger.c.

#define USB_CH_ENA   0x01

Definition at line 44 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P05   50

Definition at line 110 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P09   98

Definition at line 111 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P19   193

Definition at line 112 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P29   290

Definition at line 113 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P38   380

Definition at line 114 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P45   450

Definition at line 115 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P5   500

Definition at line 116 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P6   600

Definition at line 117 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P7   700

Definition at line 118 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P8   800

Definition at line 119 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_0P9   900

Definition at line 120 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_1P0   1000

Definition at line 121 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_1P1   1100

Definition at line 122 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_1P3   1300

Definition at line 123 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_1P4   1400

Definition at line 124 of file ab8500_charger.c.

#define USB_CH_IP_CUR_LVL_1P5   1500

Definition at line 125 of file ab8500_charger.c.

#define USB_CH_TH_PROT   0x02

Definition at line 64 of file ab8500_charger.c.

#define USB_CHG_NO_OVERSHOOT_ENA_N   0x02

Definition at line 45 of file ab8500_charger.c.

#define USB_PW_CONN   2

Definition at line 36 of file ab8500_charger.c.

#define VBAT_TRESH_IP_CUR_RED   3800

Definition at line 127 of file ab8500_charger.c.

#define VBUS_CH_NOK   0x08

Definition at line 63 of file ab8500_charger.c.

#define VBUS_DET   0x80

Definition at line 67 of file ab8500_charger.c.

#define VBUS_DET_DBNC1   0x01

Definition at line 50 of file ab8500_charger.c.

#define VBUS_DET_DBNC100   0x02

Definition at line 49 of file ab8500_charger.c.

#define VBUS_IN_CURR_LIM_SHIFT   4

Definition at line 54 of file ab8500_charger.c.

#define VBUS_OVV_TH   0x01

Definition at line 65 of file ab8500_charger.c.

#define WD_KICK_INTERVAL   (60 * HZ)

Definition at line 75 of file ab8500_charger.c.

#define WD_TIMER   0x30 /* 4min */

Definition at line 74 of file ab8500_charger.c.

Enumeration Type Documentation

Enumerator:
USB_STAT_NOT_CONFIGURED 
USB_STAT_STD_HOST_NC 
USB_STAT_STD_HOST_C_NS 
USB_STAT_STD_HOST_C_S 
USB_STAT_HOST_CHG_NM 
USB_STAT_HOST_CHG_HS 
USB_STAT_HOST_CHG_HS_CHIRP 
USB_STAT_DEDICATED_CHG 
USB_STAT_ACA_RID_A 
USB_STAT_ACA_RID_B 
USB_STAT_ACA_RID_C_NM 
USB_STAT_ACA_RID_C_HS 
USB_STAT_ACA_RID_C_HS_CHIRP 
USB_STAT_HM_IDGND 
USB_STAT_RESERVED 
USB_STAT_NOT_VALID_LINK 

Definition at line 81 of file ab8500_charger.c.

Enumerator:
AB8500_BM_USB_STATE_RESET_HS 
AB8500_BM_USB_STATE_RESET_FS 
AB8500_BM_USB_STATE_CONFIGURED 
AB8500_BM_USB_STATE_SUSPEND 
AB8500_BM_USB_STATE_RESUME 
AB8500_BM_USB_STATE_MAX 

Definition at line 100 of file ab8500_charger.c.

Function Documentation

MODULE_ALIAS ( "platform:ab8500-charger"  )
MODULE_AUTHOR ( "Johan  Palsson,
Karl  Komierowski,
Arun R Murthy"   
)
MODULE_DESCRIPTION ( "AB8500 charger management driver )
module_exit ( ab8500_charger_exit  )
MODULE_LICENSE ( "GPL v2 )
subsys_initcall_sync ( ab8500_charger_init  )