regulator: Add over current protection (OCP) support
Some regulators can automatically shut down when they detect an over current event. Add an op (set_over_current_protection) and a DT property + constraint to support this capability. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -148,6 +148,7 @@ struct regulator_ops {
|
||||
int (*get_current_limit) (struct regulator_dev *);
|
||||
|
||||
int (*set_input_current_limit) (struct regulator_dev *, int lim_uA);
|
||||
int (*set_over_current_protection) (struct regulator_dev *);
|
||||
|
||||
/* enable/disable regulator */
|
||||
int (*enable) (struct regulator_dev *);
|
||||
|
@@ -147,6 +147,7 @@ struct regulation_constraints {
|
||||
unsigned ramp_disable:1; /* disable ramp delay */
|
||||
unsigned soft_start:1; /* ramp voltage slowly */
|
||||
unsigned pull_down:1; /* pull down resistor when regulator off */
|
||||
unsigned over_current_protection:1; /* auto disable on over current */
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user