Linux Kernel
3.7.1
|
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/kobject.h>
#include <linux/mfd/abx500/ab8500.h>
#include <linux/mfd/abx500.h>
#include <linux/slab.h>
#include <linux/mfd/abx500/ab8500-bm.h>
#include <linux/delay.h>
#include <linux/mfd/abx500/ab8500-gpadc.h>
#include <linux/time.h>
#include <linux/completion.h>
Go to the source code of this file.
Data Structures | |
struct | ab8500_fg_interrupts |
struct | ab8500_fg_avg_cap |
struct | ab8500_fg_battery_capacity |
struct | ab8500_fg_flags |
struct | inst_curr_result_list |
struct | ab8500_fg |
struct | ab8500_fg_sysfs_entry |
Macros | |
#define | MILLI_TO_MICRO 1000 |
#define | FG_LSB_IN_MA 1627 |
#define | QLSB_NANO_AMP_HOURS_X10 1129 |
#define | INS_CURR_TIMEOUT (3 * HZ) |
#define | SEC_TO_SAMPLE(S) (S * 4) |
#define | NBR_AVG_SAMPLES 20 |
#define | LOW_BAT_CHECK_INTERVAL (2 * HZ) |
#define | VALID_CAPACITY_SEC (45 * 60) /* 45 minutes */ |
#define | BATT_OK_MIN 2360 /* mV */ |
#define | BATT_OK_INCREMENT 50 /* mV */ |
#define | BATT_OK_MAX_NR_INCREMENTS 0xE |
#define | BATT_OVV 0x01 |
#define | interpolate(x, x1, y1, x2, y2) ((y1) + ((((y2) - (y1)) * ((x) - (x1))) / ((x2) - (x1)))); |
#define | to_ab8500_fg_device_info(x) |
#define ab8500_fg_resume NULL |
Definition at line 2411 of file ab8500_fg.c.
#define ab8500_fg_suspend NULL |
Definition at line 2410 of file ab8500_fg.c.
#define BATT_OK_INCREMENT 50 /* mV */ |
Definition at line 48 of file ab8500_fg.c.
#define BATT_OK_MAX_NR_INCREMENTS 0xE |
Definition at line 49 of file ab8500_fg.c.
#define BATT_OK_MIN 2360 /* mV */ |
Definition at line 47 of file ab8500_fg.c.
#define BATT_OVV 0x01 |
Definition at line 52 of file ab8500_fg.c.
#define FG_LSB_IN_MA 1627 |
Definition at line 36 of file ab8500_fg.c.
#define INS_CURR_TIMEOUT (3 * HZ) |
Definition at line 38 of file ab8500_fg.c.
#define interpolate | ( | x, | |
x1, | |||
y1, | |||
x2, | |||
y2 | |||
) | ((y1) + ((((y2) - (y1)) * ((x) - (x1))) / ((x2) - (x1)))); |
Definition at line 54 of file ab8500_fg.c.
#define LOW_BAT_CHECK_INTERVAL (2 * HZ) |
Definition at line 44 of file ab8500_fg.c.
#define MILLI_TO_MICRO 1000 |
Definition at line 35 of file ab8500_fg.c.
#define NBR_AVG_SAMPLES 20 |
Definition at line 42 of file ab8500_fg.c.
#define QLSB_NANO_AMP_HOURS_X10 1129 |
Definition at line 37 of file ab8500_fg.c.
Definition at line 40 of file ab8500_fg.c.
#define to_ab8500_fg_device_info | ( | x | ) |
Definition at line 57 of file ab8500_fg.c.
#define VALID_CAPACITY_SEC (45 * 60) /* 45 minutes */ |
Definition at line 46 of file ab8500_fg.c.
Definition at line 100 of file ab8500_fg.c.
Definition at line 90 of file ab8500_fg.c.
Definition at line 70 of file ab8500_fg.c.
ab8500_fg_get() - returns a reference to the primary AB8500 fuel gauge (i.e. the first fuel gauge in the instance list)
Definition at line 234 of file ab8500_fg.c.
ab8500_fg_inst_curr_blocking() - battery instantaneous current : pointer to the ab8500_fg structure : battery instantenous current(on success)
Returns 0 else error code
Definition at line 684 of file ab8500_fg.c.
ab8500_fg_inst_curr_done() - check if fg conversion is done : pointer to the ab8500_fg structure
Returns 1 if conversion done, 0 if still waiting
Definition at line 577 of file ab8500_fg.c.
ab8500_fg_inst_curr_finalize() - battery instantaneous current : pointer to the ab8500_fg structure : battery instantenous current(on success)
Returns 0 or an error code Note: This is part "two" and has to be called at earliest 250 ms after ab8500_fg_inst_curr_start()
Definition at line 591 of file ab8500_fg.c.
ab8500_fg_inst_curr_start() - start battery instantaneous current : pointer to the ab8500_fg structure
Returns 0 or error code Note: This is part "one" and has to be called before ab8500_fg_inst_curr_finalize()
Definition at line 527 of file ab8500_fg.c.
ab8500_fg_reinit() - forces FG algorithm to reinitialize with current values
This function can be used to force the FG algorithm to recalculate a new voltage based battery capacity.
Definition at line 2229 of file ab8500_fg.c.
MODULE_ALIAS | ( | "platform:ab8500-fg" | ) |
MODULE_AUTHOR | ( | "Johan | Palsson, |
Karl Komierowski" | |||
) |
MODULE_DESCRIPTION | ( | "AB8500 Fuel Gauge driver" | ) |
module_exit | ( | ab8500_fg_exit | ) |
MODULE_LICENSE | ( | "GPL v2" | ) |
subsys_initcall_sync | ( | ab8500_fg_init | ) |