drivers: regulator: shell: drop PMIC conditional options
The regulator API supports all voltage/current ops, so there's no need to guard them under "PMIC". If a particular driver doesn't support the operations it will just return -ENOSYS and the command will fail. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
0a390b3ed6
commit
6dd395ddeb
1 changed files with 8 additions and 19 deletions
|
@ -53,9 +53,7 @@ static int cmd_reg_dis(const struct shell *sh, size_t argc, char **argv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if CONFIG_REGULATOR_PMIC
|
||||
static int cmd_pmic_set_vol(const struct shell *sh, size_t argc, char **argv)
|
||||
static int cmd_set_vol(const struct shell *sh, size_t argc, char **argv)
|
||||
{
|
||||
int lvol, uvol, ret;
|
||||
const struct device *reg_dev;
|
||||
|
@ -83,7 +81,7 @@ static int cmd_pmic_set_vol(const struct shell *sh, size_t argc, char **argv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cmd_pmic_set_ilim(const struct shell *sh, size_t argc, char **argv)
|
||||
static int cmd_set_ilim(const struct shell *sh, size_t argc, char **argv)
|
||||
{
|
||||
int lcur, ucur, ret;
|
||||
const struct device *reg_dev;
|
||||
|
@ -111,18 +109,6 @@ static int cmd_pmic_set_ilim(const struct shell *sh, size_t argc, char **argv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SHELL_STATIC_SUBCMD_SET_CREATE(pmic_set,
|
||||
SHELL_CMD_ARG(set_vol, NULL, "Set voltage (in mV)\n"
|
||||
"Usage: set_vol <device> <low limit (uV)> <high limit (uV)>",
|
||||
cmd_pmic_set_vol, 4, 0),
|
||||
SHELL_CMD_ARG(set_current, NULL, "Set current limit( in mA)\n"
|
||||
"Usage: set_current <device> <low limit (uA)> <high limit (uA)>",
|
||||
cmd_pmic_set_ilim, 4, 0),
|
||||
SHELL_SUBCMD_SET_END
|
||||
);
|
||||
|
||||
#endif /* CONFIG_REGULATOR_PMIC */
|
||||
|
||||
SHELL_STATIC_SUBCMD_SET_CREATE(regulator_set,
|
||||
SHELL_CMD_ARG(enable, NULL,
|
||||
"Enable regulator\n"
|
||||
|
@ -130,9 +116,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE(regulator_set,
|
|||
SHELL_CMD_ARG(disable, NULL,
|
||||
"Disable regulator\n"
|
||||
"Usage: disable <device>", cmd_reg_dis, 2, 0),
|
||||
#if CONFIG_REGULATOR_PMIC
|
||||
SHELL_CMD(pmic, &pmic_set, "PMIC management", NULL),
|
||||
#endif
|
||||
SHELL_CMD_ARG(set_vol, NULL, "Set voltage (in mV)\n"
|
||||
"Usage: set_vol <device> <low limit (uV)> <high limit (uV)>",
|
||||
cmd_set_vol, 4, 0),
|
||||
SHELL_CMD_ARG(set_current, NULL, "Set current limit( in mA)\n"
|
||||
"Usage: set_current <device> <low limit (uA)> <high limit (uA)>",
|
||||
cmd_set_ilim, 4, 0),
|
||||
SHELL_SUBCMD_SET_END
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue