Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ab8500-gpadc.h File Reference

Go to the source code of this file.


#define BAT_CTRL   0x01
#define BTEMP_BALL   0x02
#define MAIN_CHARGER_V   0x03
#define ACC_DETECT1   0x04
#define ACC_DETECT2   0x05
#define ADC_AUX1   0x06
#define ADC_AUX2   0x07
#define MAIN_BAT_V   0x08
#define VBUS_V   0x09
#define MAIN_CHARGER_C   0x0A
#define USB_CHARGER_C   0x0B
#define BK_BAT_V   0x0C
#define DIE_TEMP   0x0D


struct ab8500_gpadcab8500_gpadc_get (char *name)
int ab8500_gpadc_convert (struct ab8500_gpadc *gpadc, u8 channel)
int ab8500_gpadc_read_raw (struct ab8500_gpadc *gpadc, u8 channel)
int ab8500_gpadc_ad_to_voltage (struct ab8500_gpadc *gpadc, u8 channel, int ad_value)

Macro Definition Documentation

#define ACC_DETECT1   0x04

Definition at line 16 of file ab8500-gpadc.h.

#define ACC_DETECT2   0x05

Definition at line 17 of file ab8500-gpadc.h.

#define ADC_AUX1   0x06

Definition at line 18 of file ab8500-gpadc.h.

#define ADC_AUX2   0x07

Definition at line 19 of file ab8500-gpadc.h.

#define BAT_CTRL   0x01

Definition at line 13 of file ab8500-gpadc.h.

#define BK_BAT_V   0x0C

Definition at line 24 of file ab8500-gpadc.h.

#define BTEMP_BALL   0x02

Definition at line 14 of file ab8500-gpadc.h.

#define DIE_TEMP   0x0D

Definition at line 25 of file ab8500-gpadc.h.

#define MAIN_BAT_V   0x08

Definition at line 20 of file ab8500-gpadc.h.

#define MAIN_CHARGER_C   0x0A

Definition at line 22 of file ab8500-gpadc.h.

#define MAIN_CHARGER_V   0x03

Definition at line 15 of file ab8500-gpadc.h.

#define USB_CHARGER_C   0x0B

Definition at line 23 of file ab8500-gpadc.h.

#define VBUS_V   0x09

Definition at line 21 of file ab8500-gpadc.h.

Function Documentation

int ab8500_gpadc_ad_to_voltage ( struct ab8500_gpadc gpadc,
u8  channel,
int  ad_value 

ab8500_gpadc_ad_to_voltage() - Convert a raw ADC value to a voltage

Definition at line 149 of file ab8500-gpadc.c.

int ab8500_gpadc_convert ( struct ab8500_gpadc gpadc,
u8  channel 

ab8500_gpadc_convert() - gpadc conversion : analog channel to be converted to digital data

This function converts the selected analog i/p to digital data.

Definition at line 247 of file ab8500-gpadc.c.

struct ab8500_gpadc* ab8500_gpadc_get ( char name)

ab8500_gpadc_get() - returns a reference to the primary AB8500 GPADC (i.e. the first GPADC in the instance list)

Definition at line 133 of file ab8500-gpadc.c.

int ab8500_gpadc_read_raw ( struct ab8500_gpadc gpadc,
u8  channel 

ab8500_gpadc_read_raw() - gpadc read : analog channel to be read

This function obtains the raw ADC value, this then needs to be converted by calling ab8500_gpadc_ad_to_voltage()

Definition at line 275 of file ab8500-gpadc.c.