diff options
Diffstat (limited to 'include/linux/regulator')
-rw-r--r-- | include/linux/regulator/consumer.h | 8 | ||||
-rw-r--r-- | include/linux/regulator/driver.h | 37 | ||||
-rw-r--r-- | include/linux/regulator/machine.h | 41 |
3 files changed, 81 insertions, 5 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index afdc4558bb94..801bf77ff4e2 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -104,10 +104,10 @@ struct regulator; | |||
104 | /** | 104 | /** |
105 | * struct regulator_bulk_data - Data used for bulk regulator operations. | 105 | * struct regulator_bulk_data - Data used for bulk regulator operations. |
106 | * | 106 | * |
107 | * @supply The name of the supply. Initialised by the user before | 107 | * @supply: The name of the supply. Initialised by the user before |
108 | * using the bulk regulator APIs. | 108 | * using the bulk regulator APIs. |
109 | * @consumer The regulator consumer for the supply. This will be managed | 109 | * @consumer: The regulator consumer for the supply. This will be managed |
110 | * by the bulk API. | 110 | * by the bulk API. |
111 | * | 111 | * |
112 | * The regulator APIs provide a series of regulator_bulk_() API calls as | 112 | * The regulator APIs provide a series of regulator_bulk_() API calls as |
113 | * a convenience to consumers which require multiple supplies. This | 113 | * a convenience to consumers which require multiple supplies. This |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index e37d80561985..2dae05705f13 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -24,7 +24,33 @@ struct regulator_init_data; | |||
24 | /** | 24 | /** |
25 | * struct regulator_ops - regulator operations. | 25 | * struct regulator_ops - regulator operations. |
26 | * | 26 | * |
27 | * This struct describes regulator operations. | 27 | * This struct describes regulator operations which can be implemented by |
28 | * regulator chip drivers. | ||
29 | * | ||
30 | * @enable: Enable the regulator. | ||
31 | * @disable: Disable the regulator. | ||
32 | * @is_enabled: Return 1 if the regulator is enabled, 0 otherwise. | ||
33 | * | ||
34 | * @set_voltage: Set the voltage for the regulator within the range specified. | ||
35 | * The driver should select the voltage closest to min_uV. | ||
36 | * @get_voltage: Return the currently configured voltage for the regulator. | ||
37 | * | ||
38 | * @set_current_limit: Configure a limit for a current-limited regulator. | ||
39 | * @get_current_limit: Get the limit for a current-limited regulator. | ||
40 | * | ||
41 | * @set_mode: Set the operating mode for the regulator. | ||
42 | * @get_mode: Get the current operating mode for the regulator. | ||
43 | * @get_optimum_mode: Get the most efficient operating mode for the regulator | ||
44 | * when running with the specified parameters. | ||
45 | * | ||
46 | * @set_suspend_voltage: Set the voltage for the regulator when the system | ||
47 | * is suspended. | ||
48 | * @set_suspend_enable: Mark the regulator as enabled when the system is | ||
49 | * suspended. | ||
50 | * @set_suspend_disable: Mark the regulator as disabled when the system is | ||
51 | * suspended. | ||
52 | * @set_suspend_mode: Set the operating mode for the regulator when the | ||
53 | * system is suspended. | ||
28 | */ | 54 | */ |
29 | struct regulator_ops { | 55 | struct regulator_ops { |
30 | 56 | ||
@@ -75,6 +101,15 @@ enum regulator_type { | |||
75 | /** | 101 | /** |
76 | * struct regulator_desc - Regulator descriptor | 102 | * struct regulator_desc - Regulator descriptor |
77 | * | 103 | * |
104 | * Each regulator registered with the core is described with a structure of | ||
105 | * this type. | ||
106 | * | ||
107 | * @name: Identifying name for the regulator. | ||
108 | * @id: Numerical identifier for the regulator. | ||
109 | * @ops: Regulator operations table. | ||
110 | * @irq: Interrupt number for the regulator. | ||
111 | * @type: Indicates if the regulator is a voltage or current regulator. | ||
112 | * @owner: Module providing the regulator, used for refcounting. | ||
78 | */ | 113 | */ |
79 | struct regulator_desc { | 114 | struct regulator_desc { |
80 | const char *name; | 115 | const char *name; |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index c6d69331a81e..3794773b23d2 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -44,6 +44,10 @@ struct regulator; | |||
44 | * struct regulator_state - regulator state during low power syatem states | 44 | * struct regulator_state - regulator state during low power syatem states |
45 | * | 45 | * |
46 | * This describes a regulators state during a system wide low power state. | 46 | * This describes a regulators state during a system wide low power state. |
47 | * | ||
48 | * @uV: Operating voltage during suspend. | ||
49 | * @mode: Operating mode during suspend. | ||
50 | * @enabled: Enabled during suspend. | ||
47 | */ | 51 | */ |
48 | struct regulator_state { | 52 | struct regulator_state { |
49 | int uV; /* suspend voltage */ | 53 | int uV; /* suspend voltage */ |
@@ -55,6 +59,30 @@ struct regulator_state { | |||
55 | * struct regulation_constraints - regulator operating constraints. | 59 | * struct regulation_constraints - regulator operating constraints. |
56 | * | 60 | * |
57 | * This struct describes regulator and board/machine specific constraints. | 61 | * This struct describes regulator and board/machine specific constraints. |
62 | * | ||
63 | * @name: Descriptive name for the constraints, used for display purposes. | ||
64 | * | ||
65 | * @min_uV: Smallest voltage consumers may set. | ||
66 | * @max_uV: Largest voltage consumers may set. | ||
67 | * | ||
68 | * @min_uA: Smallest consumers consumers may set. | ||
69 | * @max_uA: Largest current consumers may set. | ||
70 | * | ||
71 | * @valid_modes_mask: Mask of modes which may be configured by consumers. | ||
72 | * @valid_ops_mask: Operations which may be performed by consumers. | ||
73 | * | ||
74 | * @always_on: Set if the regulator should never be disabled. | ||
75 | * @boot_on: Set if the regulator is enabled when the system is initially | ||
76 | * started. | ||
77 | * @apply_uV: Apply the voltage constraint when initialising. | ||
78 | * | ||
79 | * @input_uV: Input voltage for regulator when supplied by another regulator. | ||
80 | * | ||
81 | * @state_disk: State for regulator when system is suspended in disk mode. | ||
82 | * @state_mem: State for regulator when system is suspended in mem mode. | ||
83 | * @state_standby: State for regulator when system is suspended in standby | ||
84 | * mode. | ||
85 | * @initial_state: Suspend state to set by default. | ||
58 | */ | 86 | */ |
59 | struct regulation_constraints { | 87 | struct regulation_constraints { |
60 | 88 | ||
@@ -93,6 +121,9 @@ struct regulation_constraints { | |||
93 | * struct regulator_consumer_supply - supply -> device mapping | 121 | * struct regulator_consumer_supply - supply -> device mapping |
94 | * | 122 | * |
95 | * This maps a supply name to a device. | 123 | * This maps a supply name to a device. |
124 | * | ||
125 | * @dev: Device structure for the consumer. | ||
126 | * @supply: Name for the supply. | ||
96 | */ | 127 | */ |
97 | struct regulator_consumer_supply { | 128 | struct regulator_consumer_supply { |
98 | struct device *dev; /* consumer */ | 129 | struct device *dev; /* consumer */ |
@@ -103,6 +134,16 @@ struct regulator_consumer_supply { | |||
103 | * struct regulator_init_data - regulator platform initialisation data. | 134 | * struct regulator_init_data - regulator platform initialisation data. |
104 | * | 135 | * |
105 | * Initialisation constraints, our supply and consumers supplies. | 136 | * Initialisation constraints, our supply and consumers supplies. |
137 | * | ||
138 | * @supply_regulator_dev: Parent regulator (if any). | ||
139 | * | ||
140 | * @constraints: Constraints. These must be specified for the regulator to | ||
141 | * be usable. | ||
142 | * @num_consumer_supplies: Number of consumer device supplies. | ||
143 | * @consumer_supplies: Consumer device supply configuration. | ||
144 | * | ||
145 | * @regulator_init: Callback invoked when the regulator has been registered. | ||
146 | * @driver_data: Data passed to regulator_init. | ||
106 | */ | 147 | */ |
107 | struct regulator_init_data { | 148 | struct regulator_init_data { |
108 | struct device *supply_regulator_dev; /* or NULL for LINE */ | 149 | struct device *supply_regulator_dev; /* or NULL for LINE */ |