drivers: regulator: drop async enable
Drop the async enable function. This feature is rarely/never used, complicates driver design, and doesn't really follow the sync/async API design/naming used in other areas. In the future we can introduce regulator_enable_async if needed, with support from the driver class (no onoff). Note that drivers like PCA9420 did not implement any asynchronous behavior. regulator-fixed implemented in the past asynchronous behavior using work queues, an overkill for most GPIO driven regulators. Let's keep things simple for now and extend the API when needed, based on specific usecases. In the current implementation, reference counting is managed by the driver class. \isr-ok attribute is dropped, since calls are potentially blocking. Note that drivers like PCA9420 already violated such rule. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
e0c8de1e39
commit
a29bdc262c
7 changed files with 132 additions and 180 deletions
|
@ -14,7 +14,6 @@ LOG_MODULE_REGISTER(regulator_shell, CONFIG_REGULATOR_LOG_LEVEL);
|
|||
|
||||
static int cmd_reg_en(const struct shell *sh, size_t argc, char **argv)
|
||||
{
|
||||
struct onoff_client cli;
|
||||
const struct device *reg_dev;
|
||||
int ret;
|
||||
|
||||
|
@ -24,7 +23,7 @@ static int cmd_reg_en(const struct shell *sh, size_t argc, char **argv)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = regulator_enable(reg_dev, &cli);
|
||||
ret = regulator_enable(reg_dev);
|
||||
if (ret < 0) {
|
||||
shell_error(sh, "failed to enable regulator, error %d", ret);
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue