aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/regulator/core.c1
-rw-r--r--include/linux/regulator/driver.h40
-rw-r--r--include/linux/regulator/machine.h41
3 files changed, 81 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index ea12c68c327f..fda44009024d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -656,6 +656,7 @@ static void print_constraints(struct regulator_dev *rdev)
656/** 656/**
657 * set_machine_constraints - sets regulator constraints 657 * set_machine_constraints - sets regulator constraints
658 * @rdev: regulator source 658 * @rdev: regulator source
659 * @constraints: constraints to apply
659 * 660 *
660 * Allows platform initialisation code to define and constrain 661 * Allows platform initialisation code to define and constrain
661 * regulator circuits e.g. valid voltage/current ranges, etc. NOTE: 662 * regulator circuits e.g. valid voltage/current ranges, etc. NOTE:
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index e37d80561985..84c3737c2d26 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -24,7 +24,37 @@ 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 reguator 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: Set the current for the regulator within the range specified.
39 * The driver should select the current closest to min_uA.
40 * @get_current: Return the currently configured current for the regulator.
41 *
42 * @set_current_limit: Configure a limit for a current-limited regulator.
43 * @get_current_limit: Get the limit for a current-limited regulator.
44 *
45 * @set_mode: Set the operating mode for the regulator.
46 * @get_mode: Get the current operating mode for the regulator.
47 * @get_optimum_mode: Get the most efficient operating mode for the regulator
48 * when running with the specified parameters.
49 *
50 * @set_suspend_voltage: Set the voltage for the regulator when the system
51 * is suspended.
52 * @set_suspend_enable: Mark the regulator as enabled when the system is
53 * suspended.
54 * @set_suspend_disable: Mark the regulator as disabled when the system is
55 * suspended.
56 * @set_suspend_mode: Set the operating mode for the regulator when the
57 * system is suspended.
28 */ 58 */
29struct regulator_ops { 59struct regulator_ops {
30 60
@@ -75,6 +105,14 @@ enum regulator_type {
75/** 105/**
76 * struct regulator_desc - Regulator descriptor 106 * struct regulator_desc - Regulator descriptor
77 * 107 *
108 * Each regulator registered with the core is described with a structure of
109 * this type.
110 *
111 * @name: Identifying name for the regulator.
112 * @id: Numerical identifier for the regulator.
113 * @ops: Regulator operations table.
114 * @type: Indicates if the regulator is a voltage or current regulator.
115 * @owner: Module providing the regulator, used for refcounting.
78 */ 116 */
79struct regulator_desc { 117struct regulator_desc {
80 const char *name; 118 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 */
48struct regulator_state { 52struct 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 */
59struct regulation_constraints { 87struct 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 */
97struct regulator_consumer_supply { 128struct 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 */
107struct regulator_init_data { 148struct regulator_init_data {
108 struct device *supply_regulator_dev; /* or NULL for LINE */ 149 struct device *supply_regulator_dev; /* or NULL for LINE */