drivers: regulator: add get_mode API
Add a new API to query the configured regulator mode. Updated fake driver and API tests. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
fbba106a23
commit
1ca1f25918
4 changed files with 89 additions and 0 deletions
|
@ -37,6 +37,8 @@ DEFINE_FAKE_VALUE_FUNC(int, regulator_fake_get_current_limit,
|
|||
const struct device *, int32_t *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, regulator_fake_set_mode, const struct device *,
|
||||
regulator_mode_t);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, regulator_fake_get_mode, const struct device *,
|
||||
regulator_mode_t *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, regulator_fake_get_error_flags,
|
||||
const struct device *, regulator_error_flags_t *);
|
||||
|
||||
|
@ -50,6 +52,7 @@ static struct regulator_driver_api api = {
|
|||
.set_current_limit = regulator_fake_set_current_limit,
|
||||
.get_current_limit = regulator_fake_get_current_limit,
|
||||
.set_mode = regulator_fake_set_mode,
|
||||
.get_mode = regulator_fake_get_mode,
|
||||
.get_error_flags = regulator_fake_get_error_flags,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue