File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2767,6 +2767,12 @@ static int _regulator_set_voltage_time(struct regulator_dev *rdev,
2767
2767
ramp_delay = rdev -> desc -> ramp_delay ;
2768
2768
else if (rdev -> constraints -> settling_time )
2769
2769
return rdev -> constraints -> settling_time ;
2770
+ else if (rdev -> constraints -> settling_time_up &&
2771
+ (new_uV > old_uV ))
2772
+ return rdev -> constraints -> settling_time_up ;
2773
+ else if (rdev -> constraints -> settling_time_down &&
2774
+ (new_uV < old_uV ))
2775
+ return rdev -> constraints -> settling_time_down ;
2770
2776
2771
2777
if (ramp_delay == 0 ) {
2772
2778
rdev_dbg (rdev , "ramp_delay not set\n" );
Original file line number Diff line number Diff line change @@ -90,6 +90,25 @@ static void of_get_regulation_constraints(struct device_node *np,
90
90
if (!ret )
91
91
constraints -> settling_time = pval ;
92
92
93
+ ret = of_property_read_u32 (np , "regulator-settling-time-up-us" , & pval );
94
+ if (!ret )
95
+ constraints -> settling_time_up = pval ;
96
+ if (constraints -> settling_time_up && constraints -> settling_time ) {
97
+ pr_warn ("%s: ambiguous configuration for settling time, ignoring 'regulator-settling-time-up-us'\n" ,
98
+ np -> name );
99
+ constraints -> settling_time_up = 0 ;
100
+ }
101
+
102
+ ret = of_property_read_u32 (np , "regulator-settling-time-down-us" ,
103
+ & pval );
104
+ if (!ret )
105
+ constraints -> settling_time_down = pval ;
106
+ if (constraints -> settling_time_down && constraints -> settling_time ) {
107
+ pr_warn ("%s: ambiguous configuration for settling time, ignoring 'regulator-settling-time-down-us'\n" ,
108
+ np -> name );
109
+ constraints -> settling_time_down = 0 ;
110
+ }
111
+
93
112
ret = of_property_read_u32 (np , "regulator-enable-ramp-delay" , & pval );
94
113
if (!ret )
95
114
constraints -> enable_time = pval ;
Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ struct regulator_state {
110
110
* @ramp_delay: Time to settle down after voltage change (unit: uV/us)
111
111
* @settling_time: Time to settle down after voltage change when voltage
112
112
* change is non-linear (unit: microseconds).
113
+ * @settling_time_up: Time to settle down after voltage increase when voltage
114
+ * change is non-linear (unit: microseconds).
115
+ * @settling_time_down : Time to settle down after voltage decrease when
116
+ * voltage change is non-linear (unit: microseconds).
113
117
* @active_discharge: Enable/disable active discharge. The enum
114
118
* regulator_active_discharge values are used for
115
119
* initialisation.
@@ -152,6 +156,8 @@ struct regulation_constraints {
152
156
153
157
unsigned int ramp_delay ;
154
158
unsigned int settling_time ;
159
+ unsigned int settling_time_up ;
160
+ unsigned int settling_time_down ;
155
161
unsigned int enable_time ;
156
162
157
163
unsigned int active_discharge ;
You can’t perform that action at this time.
0 commit comments