Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
linux
mfd
abx500.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2007-2009 ST-Ericsson AB
3
* License terms: GNU General Public License (GPL) version 2
4
*
5
* ABX500 core access functions.
6
* The abx500 interface is used for the Analog Baseband chips.
7
*
8
* Author: Mattias Wallin <
[email protected]
>
9
* Author: Mattias Nilsson <
[email protected]
>
10
* Author: Bengt Jonsson <
[email protected]
>
11
* Author: Rickard Andersson <
[email protected]
>
12
*/
13
14
#include <
linux/regulator/machine.h
>
15
16
struct
device
;
17
18
#ifndef MFD_ABX500_H
19
#define MFD_ABX500_H
20
25
struct
abx500_init_settings
{
26
u8
bank
;
27
u8
reg
;
28
u8
setting
;
29
};
30
31
/* Battery driver related data */
32
/*
33
* ADC for the battery thermistor.
34
* When using the ABx500_ADC_THERM_BATCTRL the battery ID resistor is combined
35
* with a NTC resistor to both identify the battery and to measure its
36
* temperature. Different phone manufactures uses different techniques to both
37
* identify the battery and to read its temperature.
38
*/
39
enum
abx500_adc_therm
{
40
ABx500_ADC_THERM_BATCTRL
,
41
ABx500_ADC_THERM_BATTEMP
,
42
};
43
51
struct
abx500_res_to_temp
{
52
int
temp
;
53
int
resist
;
54
};
55
61
struct
abx500_v_to_cap
{
62
int
voltage
;
63
int
capacity
;
64
};
65
66
/* Forward declaration */
67
struct
abx500_fg;
68
93
struct
abx500_fg_parameters
{
94
int
recovery_sleep_timer
;
95
int
recovery_total_time
;
96
int
init_timer
;
97
int
init_discard_time
;
98
int
init_total_time
;
99
int
high_curr_time
;
100
int
accu_charging
;
101
int
accu_high_curr
;
102
int
high_curr_threshold
;
103
int
lowbat_threshold
;
104
int
overbat_threshold
;
105
int
battok_falling_th_sel0
;
106
int
battok_raising_th_sel1
;
107
int
user_cap_limit
;
108
int
maint_thres
;
109
};
110
118
struct
abx500_maxim_parameters
{
119
bool
ena_maxi
;
120
int
chg_curr
;
121
int
wait_cycles
;
122
int
charger_curr_step
;
123
};
124
155
struct
abx500_battery_type
{
156
int
name
;
157
int
resis_high
;
158
int
resis_low
;
159
int
charge_full_design
;
160
int
nominal_voltage
;
161
int
termination_vol
;
162
int
termination_curr
;
163
int
recharge_vol
;
164
int
normal_cur_lvl
;
165
int
normal_vol_lvl
;
166
int
maint_a_cur_lvl
;
167
int
maint_a_vol_lvl
;
168
int
maint_a_chg_timer_h
;
169
int
maint_b_cur_lvl
;
170
int
maint_b_vol_lvl
;
171
int
maint_b_chg_timer_h
;
172
int
low_high_cur_lvl
;
173
int
low_high_vol_lvl
;
174
int
battery_resistance
;
175
int
n_temp_tbl_elements
;
176
struct
abx500_res_to_temp
*
r_to_t_tbl
;
177
int
n_v_cap_tbl_elements
;
178
struct
abx500_v_to_cap
*
v_to_cap_tbl
;
179
int
n_batres_tbl_elements
;
180
struct
batres_vs_temp
*
batres_tbl
;
181
};
182
191
struct
abx500_bm_capacity_levels
{
192
int
critical
;
193
int
low
;
194
int
normal
;
195
int
high
;
196
int
full
;
197
};
198
206
struct
abx500_bm_charger_parameters
{
207
int
usb_volt_max
;
208
int
usb_curr_max
;
209
int
ac_volt_max
;
210
int
ac_curr_max
;
211
};
212
244
struct
abx500_bm_data
{
245
int
temp_under
;
246
int
temp_low
;
247
int
temp_high
;
248
int
temp_over
;
249
int
temp_now
;
250
int
temp_interval_chg
;
251
int
temp_interval_nochg
;
252
int
main_safety_tmr_h
;
253
int
usb_safety_tmr_h
;
254
int
bkup_bat_v
;
255
int
bkup_bat_i
;
256
bool
no_maintenance
;
257
bool
chg_unknown_bat
;
258
bool
enable_overshoot
;
259
bool
auto_trig
;
260
enum
abx500_adc_therm
adc_therm
;
261
int
fg_res
;
262
int
n_btypes
;
263
int
batt_id
;
264
int
interval_charging
;
265
int
interval_not_charging
;
266
int
temp_hysteresis
;
267
int
gnd_lift_resistance
;
268
const
struct
abx500_maxim_parameters
*
maxi
;
269
const
struct
abx500_bm_capacity_levels
*
cap_levels
;
270
const
struct
abx500_battery_type
*
bat_type
;
271
const
struct
abx500_bm_charger_parameters
*
chg_params
;
272
const
struct
abx500_fg_parameters
*
fg_params
;
273
};
274
275
struct
abx500_chargalg_platform_data
{
276
char
**
supplied_to
;
277
size_t
num_supplicants
;
278
};
279
280
struct
abx500_charger_platform_data
{
281
char
**
supplied_to
;
282
size_t
num_supplicants
;
283
bool
autopower_cfg
;
284
};
285
286
struct
abx500_btemp_platform_data
{
287
char
**
supplied_to
;
288
size_t
num_supplicants
;
289
};
290
291
struct
abx500_fg_platform_data
{
292
char
**
supplied_to
;
293
size_t
num_supplicants
;
294
};
295
296
struct
abx500_bm_plat_data
{
297
struct
abx500_bm_data
*
battery
;
298
struct
abx500_charger_platform_data
*
charger
;
299
struct
abx500_btemp_platform_data
*
btemp
;
300
struct
abx500_fg_platform_data
*
fg
;
301
struct
abx500_chargalg_platform_data
*
chargalg
;
302
};
303
304
int
abx500_set_register_interruptible
(
struct
device
*
dev
,
u8
bank,
u8
reg
,
305
u8
value
);
306
int
abx500_get_register_interruptible
(
struct
device
*
dev
,
u8
bank,
u8
reg
,
307
u8
*
value
);
308
int
abx500_get_register_page_interruptible
(
struct
device
*
dev
,
u8
bank,
309
u8
first_reg,
u8
*regvals,
u8
numregs);
310
int
abx500_set_register_page_interruptible
(
struct
device
*
dev
,
u8
bank,
311
u8
first_reg,
u8
*regvals,
u8
numregs);
324
int
abx500_mask_and_set_register_interruptible
(
struct
device
*
dev
,
u8
bank,
325
u8
reg
,
u8
bitmask
,
u8
bitvalues);
326
int
abx500_get_chip_id
(
struct
device
*
dev
);
327
int
abx500_event_registers_startup_state_get
(
struct
device
*
dev
,
u8
*
event
);
328
int
abx500_startup_irq_enabled
(
struct
device
*
dev
,
unsigned
int
irq);
329
330
struct
abx500_ops
{
331
int
(*
get_chip_id
) (
struct
device
*);
332
int
(*
get_register
) (
struct
device
*,
u8
,
u8
,
u8
*);
333
int
(*
set_register
) (
struct
device
*,
u8
,
u8
,
u8
);
334
int
(*
get_register_page
) (
struct
device
*,
u8
,
u8
,
u8
*,
u8
);
335
int
(*
set_register_page
) (
struct
device
*,
u8
,
u8
,
u8
*,
u8
);
336
int
(*
mask_and_set_register
) (
struct
device
*,
u8
,
u8
,
u8
,
u8
);
337
int
(*
event_registers_startup_state_get
) (
struct
device
*,
u8
*);
338
int
(*
startup_irq_enabled
) (
struct
device
*,
unsigned
int
);
339
};
340
341
int
abx500_register_ops
(
struct
device
*core_dev,
struct
abx500_ops
*ops);
342
void
abx500_remove_ops
(
struct
device
*
dev
);
343
#endif
Generated on Thu Jan 10 2013 14:51:52 for Linux Kernel by
1.8.2