Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
mbc.h File Reference
#include <linux/mfd/pcf50633/core.h>
#include <linux/platform_device.h>

Go to the source code of this file.

Macros

#define PCF50633_REG_MBCC1   0x43
 
#define PCF50633_REG_MBCC2   0x44
 
#define PCF50633_REG_MBCC3   0x45
 
#define PCF50633_REG_MBCC4   0x46
 
#define PCF50633_REG_MBCC5   0x47
 
#define PCF50633_REG_MBCC6   0x48
 
#define PCF50633_REG_MBCC7   0x49
 
#define PCF50633_REG_MBCC8   0x4a
 
#define PCF50633_REG_MBCS1   0x4b
 
#define PCF50633_REG_MBCS2   0x4c
 
#define PCF50633_REG_MBCS3   0x4d
 
#define PCF50633_MBCC1_WDTIME_MASK   0xc0
 
#define PCF50633_MBCC7_USB_MASK   0x03
 
#define PCF50633_MBCS2_MBC_MASK   0x0f
 
#define PCF50633_MBCS2_RESSTAT_AUTO   0x40
 
#define PCF50633_MBCC2_VBATCOND_MASK   0x03
 
#define PCF50633_MBCC2_VMAX_MASK   0x3c
 
#define PCF50633_MBC_USB_ONLINE   0x01
 
#define PCF50633_MBC_USB_ACTIVE   0x02
 
#define PCF50633_MBC_ADAPTER_ONLINE   0x04
 
#define PCF50633_MBC_ADAPTER_ACTIVE   0x08
 

Enumerations

enum  pcf50633_reg_mbcc1 {
  PCF50633_MBCC1_CHGENA = 0x01, PCF50633_MBCC1_AUTOSTOP = 0x02, PCF50633_MBCC1_AUTORES = 0x04, PCF50633_MBCC1_RESUME = 0x08,
  PCF50633_MBCC1_RESTART = 0x10, PCF50633_MBCC1_PREWDTIME_60M = 0x20, PCF50633_MBCC1_WDTIME_1H = 0x00, PCF50633_MBCC1_WDTIME_2H = 0x40,
  PCF50633_MBCC1_WDTIME_4H = 0x80, PCF50633_MBCC1_WDTIME_6H = 0xc0
}
 
enum  pcf50633_reg_mbcc2 {
  PCF50633_MBCC2_VBATCOND_2V7 = 0x00, PCF50633_MBCC2_VBATCOND_2V85 = 0x01, PCF50633_MBCC2_VBATCOND_3V0 = 0x02, PCF50633_MBCC2_VBATCOND_3V15 = 0x03,
  PCF50633_MBCC2_VMAX_4V = 0x00, PCF50633_MBCC2_VMAX_4V20 = 0x28, PCF50633_MBCC2_VRESDEBTIME_64S = 0x80
}
 
enum  pcf50633_reg_mbcc7 {
  PCF50633_MBCC7_USB_100mA = 0x00, PCF50633_MBCC7_USB_500mA = 0x01, PCF50633_MBCC7_USB_1000mA = 0x02, PCF50633_MBCC7_USB_SUSPEND = 0x03,
  PCF50633_MBCC7_BATTEMP_EN = 0x04, PCF50633_MBCC7_BATSYSIMAX_1A6 = 0x00, PCF50633_MBCC7_BATSYSIMAX_1A8 = 0x40, PCF50633_MBCC7_BATSYSIMAX_2A0 = 0x80,
  PCF50633_MBCC7_BATSYSIMAX_2A2 = 0xc0
}
 
enum  pcf50633_reg_mbcc8 { PCF50633_MBCC8_USBENASUS = 0x10 }
 
enum  pcf50633_reg_mbcs1 {
  PCF50633_MBCS1_USBPRES = 0x01, PCF50633_MBCS1_USBOK = 0x02, PCF50633_MBCS1_ADAPTPRES = 0x04, PCF50633_MBCS1_ADAPTOK = 0x08,
  PCF50633_MBCS1_TBAT_OK = 0x00, PCF50633_MBCS1_TBAT_ABOVE = 0x10, PCF50633_MBCS1_TBAT_BELOW = 0x20, PCF50633_MBCS1_TBAT_UNDEF = 0x30,
  PCF50633_MBCS1_PREWDTEXP = 0x40, PCF50633_MBCS1_WDTEXP = 0x80
}
 
enum  pcf50633_reg_mbcs2_mbcmod {
  PCF50633_MBCS2_MBC_PLAY = 0x00, PCF50633_MBCS2_MBC_USB_PRE = 0x01, PCF50633_MBCS2_MBC_USB_PRE_WAIT = 0x02, PCF50633_MBCS2_MBC_USB_FAST = 0x03,
  PCF50633_MBCS2_MBC_USB_FAST_WAIT = 0x04, PCF50633_MBCS2_MBC_USB_SUSPEND = 0x05, PCF50633_MBCS2_MBC_ADP_PRE = 0x06, PCF50633_MBCS2_MBC_ADP_PRE_WAIT = 0x07,
  PCF50633_MBCS2_MBC_ADP_FAST = 0x08, PCF50633_MBCS2_MBC_ADP_FAST_WAIT = 0x09, PCF50633_MBCS2_MBC_BAT_FULL = 0x0a, PCF50633_MBCS2_MBC_HALT = 0x0b
}
 
enum  pcf50633_reg_mbcs2_chgstat { PCF50633_MBCS2_CHGS_NONE = 0x00, PCF50633_MBCS2_CHGS_ADAPTER = 0x10, PCF50633_MBCS2_CHGS_USB = 0x20, PCF50633_MBCS2_CHGS_BOTH = 0x30 }
 
enum  pcf50633_reg_mbcs3 {
  PCF50633_MBCS3_USBLIM_PLAY = 0x01, PCF50633_MBCS3_USBLIM_CGH = 0x02, PCF50633_MBCS3_TLIM_PLAY = 0x04, PCF50633_MBCS3_TLIM_CHG = 0x08,
  PCF50633_MBCS3_ILIM = 0x10, PCF50633_MBCS3_VLIM = 0x20, PCF50633_MBCS3_VBATSTAT = 0x40, PCF50633_MBCS3_VRES = 0x80
}
 

Functions

int pcf50633_mbc_usb_curlim_set (struct pcf50633 *pcf, int ma)
 
int pcf50633_mbc_get_status (struct pcf50633 *)
 
int pcf50633_mbc_get_usb_online_status (struct pcf50633 *)
 

Macro Definition Documentation

#define PCF50633_MBC_ADAPTER_ACTIVE   0x08

Definition at line 126 of file mbc.h.

#define PCF50633_MBC_ADAPTER_ONLINE   0x04

Definition at line 125 of file mbc.h.

#define PCF50633_MBC_USB_ACTIVE   0x02

Definition at line 124 of file mbc.h.

#define PCF50633_MBC_USB_ONLINE   0x01

Definition at line 123 of file mbc.h.

#define PCF50633_MBCC1_WDTIME_MASK   0xc0

Definition at line 43 of file mbc.h.

#define PCF50633_MBCC2_VBATCOND_MASK   0x03

Definition at line 119 of file mbc.h.

#define PCF50633_MBCC2_VMAX_MASK   0x3c

Definition at line 120 of file mbc.h.

#define PCF50633_MBCC7_USB_MASK   0x03

Definition at line 66 of file mbc.h.

#define PCF50633_MBCS2_MBC_MASK   0x0f

Definition at line 99 of file mbc.h.

#define PCF50633_MBCS2_RESSTAT_AUTO   0x40

Definition at line 106 of file mbc.h.

#define PCF50633_REG_MBCC1   0x43

Definition at line 19 of file mbc.h.

#define PCF50633_REG_MBCC2   0x44

Definition at line 20 of file mbc.h.

#define PCF50633_REG_MBCC3   0x45

Definition at line 21 of file mbc.h.

#define PCF50633_REG_MBCC4   0x46

Definition at line 22 of file mbc.h.

#define PCF50633_REG_MBCC5   0x47

Definition at line 23 of file mbc.h.

#define PCF50633_REG_MBCC6   0x48

Definition at line 24 of file mbc.h.

#define PCF50633_REG_MBCC7   0x49

Definition at line 25 of file mbc.h.

#define PCF50633_REG_MBCC8   0x4a

Definition at line 26 of file mbc.h.

#define PCF50633_REG_MBCS1   0x4b

Definition at line 27 of file mbc.h.

#define PCF50633_REG_MBCS2   0x4c

Definition at line 28 of file mbc.h.

#define PCF50633_REG_MBCS3   0x4d

Definition at line 29 of file mbc.h.

Enumeration Type Documentation

Enumerator:
PCF50633_MBCC1_CHGENA 
PCF50633_MBCC1_AUTOSTOP 
PCF50633_MBCC1_AUTORES 
PCF50633_MBCC1_RESUME 
PCF50633_MBCC1_RESTART 
PCF50633_MBCC1_PREWDTIME_60M 
PCF50633_MBCC1_WDTIME_1H 
PCF50633_MBCC1_WDTIME_2H 
PCF50633_MBCC1_WDTIME_4H 
PCF50633_MBCC1_WDTIME_6H 

Definition at line 31 of file mbc.h.

Enumerator:
PCF50633_MBCC2_VBATCOND_2V7 
PCF50633_MBCC2_VBATCOND_2V85 
PCF50633_MBCC2_VBATCOND_3V0 
PCF50633_MBCC2_VBATCOND_3V15 
PCF50633_MBCC2_VMAX_4V 
PCF50633_MBCC2_VMAX_4V20 
PCF50633_MBCC2_VRESDEBTIME_64S 

Definition at line 45 of file mbc.h.

Enumerator:
PCF50633_MBCC7_USB_100mA 
PCF50633_MBCC7_USB_500mA 
PCF50633_MBCC7_USB_1000mA 
PCF50633_MBCC7_USB_SUSPEND 
PCF50633_MBCC7_BATTEMP_EN 
PCF50633_MBCC7_BATSYSIMAX_1A6 
PCF50633_MBCC7_BATSYSIMAX_1A8 
PCF50633_MBCC7_BATSYSIMAX_2A0 
PCF50633_MBCC7_BATSYSIMAX_2A2 

Definition at line 55 of file mbc.h.

Enumerator:
PCF50633_MBCC8_USBENASUS 

Definition at line 68 of file mbc.h.

Enumerator:
PCF50633_MBCS1_USBPRES 
PCF50633_MBCS1_USBOK 
PCF50633_MBCS1_ADAPTPRES 
PCF50633_MBCS1_ADAPTOK 
PCF50633_MBCS1_TBAT_OK 
PCF50633_MBCS1_TBAT_ABOVE 
PCF50633_MBCS1_TBAT_BELOW 
PCF50633_MBCS1_TBAT_UNDEF 
PCF50633_MBCS1_PREWDTEXP 
PCF50633_MBCS1_WDTEXP 

Definition at line 72 of file mbc.h.

Enumerator:
PCF50633_MBCS2_CHGS_NONE 
PCF50633_MBCS2_CHGS_ADAPTER 
PCF50633_MBCS2_CHGS_USB 
PCF50633_MBCS2_CHGS_BOTH 

Definition at line 100 of file mbc.h.

Enumerator:
PCF50633_MBCS2_MBC_PLAY 
PCF50633_MBCS2_MBC_USB_PRE 
PCF50633_MBCS2_MBC_USB_PRE_WAIT 
PCF50633_MBCS2_MBC_USB_FAST 
PCF50633_MBCS2_MBC_USB_FAST_WAIT 
PCF50633_MBCS2_MBC_USB_SUSPEND 
PCF50633_MBCS2_MBC_ADP_PRE 
PCF50633_MBCS2_MBC_ADP_PRE_WAIT 
PCF50633_MBCS2_MBC_ADP_FAST 
PCF50633_MBCS2_MBC_ADP_FAST_WAIT 
PCF50633_MBCS2_MBC_BAT_FULL 
PCF50633_MBCS2_MBC_HALT 

Definition at line 85 of file mbc.h.

Enumerator:
PCF50633_MBCS3_USBLIM_PLAY 
PCF50633_MBCS3_USBLIM_CGH 
PCF50633_MBCS3_TLIM_PLAY 
PCF50633_MBCS3_TLIM_CHG 
PCF50633_MBCS3_ILIM 
PCF50633_MBCS3_VLIM 
PCF50633_MBCS3_VBATSTAT 
PCF50633_MBCS3_VRES 

Definition at line 108 of file mbc.h.

Function Documentation

int pcf50633_mbc_get_status ( struct pcf50633 )

Definition at line 113 of file pcf50633-charger.c.

int pcf50633_mbc_get_usb_online_status ( struct pcf50633 )

Definition at line 144 of file pcf50633-charger.c.

int pcf50633_mbc_usb_curlim_set ( struct pcf50633 pcf,
int  ma 
)

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