Commit | Line | Data |
---|---|---|
0cdfcc0f MB |
1 | /* |
2 | * internal.h -- Voltage/Current Regulator framework internal code | |
3 | * | |
4 | * Copyright 2007, 2008 Wolfson Microelectronics PLC. | |
5 | * Copyright 2008 SlimLogic Ltd. | |
6 | * | |
7 | * Author: Liam Girdwood <lrg@slimlogic.co.uk> | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License as published by the | |
11 | * Free Software Foundation; either version 2 of the License, or (at your | |
12 | * option) any later version. | |
13 | * | |
14 | */ | |
15 | ||
16 | #ifndef __REGULATOR_INTERNAL_H | |
17 | #define __REGULATOR_INTERNAL_H | |
18 | ||
19 | /* | |
20 | * struct regulator | |
21 | * | |
22 | * One for each consumer device. | |
23 | */ | |
24 | struct regulator { | |
25 | struct device *dev; | |
26 | struct list_head list; | |
27 | unsigned int always_on:1; | |
28 | unsigned int bypass:1; | |
29 | int uA_load; | |
30 | int min_uV; | |
31 | int max_uV; | |
0630b614 | 32 | const char *supply_name; |
0cdfcc0f MB |
33 | struct device_attribute dev_attr; |
34 | struct regulator_dev *rdev; | |
35 | struct dentry *debugfs; | |
36 | }; | |
37 | ||
ef126a4a | 38 | #ifdef CONFIG_OF |
a0c7b164 MB |
39 | struct regulator_init_data *regulator_of_get_init_data(struct device *dev, |
40 | const struct regulator_desc *desc, | |
bfa21a0d | 41 | struct regulator_config *config, |
a0c7b164 | 42 | struct device_node **node); |
ef126a4a MB |
43 | #else |
44 | static inline struct regulator_init_data * | |
45 | regulator_of_get_init_data(struct device *dev, | |
46 | const struct regulator_desc *desc, | |
bfa21a0d | 47 | struct regulator_config *config, |
ef126a4a MB |
48 | struct device_node **node) |
49 | { | |
50 | return NULL; | |
51 | } | |
52 | #endif | |
a0c7b164 | 53 | |
a8bd42a9 DT |
54 | enum regulator_get_type { |
55 | NORMAL_GET, | |
56 | EXCLUSIVE_GET, | |
57 | OPTIONAL_GET, | |
58 | MAX_GET_TYPE | |
59 | }; | |
60 | ||
61 | struct regulator *_regulator_get(struct device *dev, const char *id, | |
62 | enum regulator_get_type get_type); | |
63 | ||
0cdfcc0f | 64 | #endif |