Lines Matching +full:regulator +full:- +full:active +full:- +full:discharge
5 * SPDX-License-Identifier: Apache-2.0
14 #include <zephyr/drivers/regulator.h>
24 return -EINVAL; in strtomicro()
28 if (tolower(inp[len - 1]) != units) { in strtomicro()
29 return -EINVAL; in strtomicro()
32 if ((len > 2) && (inp[len - 2] == 'u')) { in strtomicro()
34 end = len - 3; in strtomicro()
35 } else if ((len > 2) && (inp[len - 2] == 'm')) { in strtomicro()
37 end = len - 3; in strtomicro()
38 } else if (isdigit((unsigned char)inp[len - 2]) > 0) { in strtomicro()
40 end = len - 2; in strtomicro()
42 return -EINVAL; in strtomicro()
46 if (inp[0] == '-') { in strtomicro()
47 mult *= -1; in strtomicro()
60 (int32_t)(inp[i] - '0') * mult / decdiv; in strtomicro()
67 return -EINVAL; in strtomicro()
94 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_enable()
95 return -ENODEV; in cmd_enable()
100 shell_error(sh, "Could not enable regulator (%d)", ret); in cmd_enable()
116 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_disable()
117 return -ENODEV; in cmd_disable()
122 shell_error(sh, "Could not disable regulator (%d)", ret); in cmd_disable()
137 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_is_enabled()
138 return -ENODEV; in cmd_is_enabled()
142 shell_print(sh, "Regulator is enabled"); in cmd_is_enabled()
144 shell_print(sh, "Regulator is disabled"); in cmd_is_enabled()
160 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_vlist()
161 return -ENODEV; in cmd_vlist()
190 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_vset()
191 return -ENODEV; in cmd_vset()
229 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_vget()
230 return -ENODEV; in cmd_vget()
254 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_clist()
255 return -ENODEV; in cmd_clist()
284 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_iset()
285 return -ENODEV; in cmd_iset()
322 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_iget()
323 return -ENODEV; in cmd_iget()
347 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_modeset()
348 return -ENODEV; in cmd_modeset()
372 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_modeget()
373 return -ENODEV; in cmd_modeget()
397 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_adset()
398 return -ENODEV; in cmd_adset()
407 return -EINVAL; in cmd_adset()
412 shell_error(sh, "Could not set active discharge (%d)", ret); in cmd_adset()
429 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_adget()
430 return -ENODEV; in cmd_adget()
435 shell_error(sh, "Could not get active discharge (%d)", ret); in cmd_adget()
439 shell_print(sh, "Active Discharge: %s", ad ? "enabled" : "disabled"); in cmd_adget()
454 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_errors()
455 return -ENODEV; in cmd_errors()
484 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_dvsset()
485 return -ENODEV; in cmd_dvsset()
512 shell_error(sh, "Regulator device %s not available", argv[1]); in cmd_shipmode()
513 return -ENODEV; in cmd_shipmode()
529 entry->syntax = (dev != NULL) ? dev->name : NULL; in device_name_get()
530 entry->handler = NULL; in device_name_get()
531 entry->help = NULL; in device_name_get()
532 entry->subcmd = NULL; in device_name_get()
540 "Enable regulator\n"
544 "Disable regulator\n"
548 "Report whether regulator is enabled or disabled\n"
580 "Set regulator mode\n"
584 "Get regulator mode\n"
588 "Set active discharge\n"
592 "Get active discharge\n"
600 "Set regulator dynamic voltage scaling state\n"
604 "Enable regulator ship mode\n"
609 SHELL_CMD_REGISTER(regulator, &sub_regulator_cmds, "Regulator playground",