Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 
15 
16 struct device;
17 
18 #ifndef MFD_ABX500_H
19 #define MFD_ABX500_H
20 
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  */
42 };
43 
52  int temp;
53  int resist;
54 };
55 
62  int voltage;
63  int capacity;
64 };
65 
66 /* Forward declaration */
67 struct abx500_fg;
68 
109 };
110 
119  bool ena_maxi;
120  int chg_curr;
123 };
124 
156  int name;
181 };
182 
192  int critical;
193  int low;
194  int normal;
195  int high;
196  int full;
197 };
198 
211 };
212 
246  int temp_low;
249  int temp_now;
259  bool auto_trig;
261  int fg_res;
262  int n_btypes;
263  int batt_id;
273 };
274 
276  char **supplied_to;
278 };
279 
281  char **supplied_to;
284 };
285 
287  char **supplied_to;
289 };
290 
292  char **supplied_to;
294 };
295 
302 };
303 
305  u8 value);
307  u8 *value);
309  u8 first_reg, u8 *regvals, u8 numregs);
311  u8 first_reg, u8 *regvals, u8 numregs);
325  u8 reg, u8 bitmask, u8 bitvalues);
326 int abx500_get_chip_id(struct device *dev);
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);
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