Lines Matching +full:regulator +full:- +full:gpio
3 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/drivers/gpio.h>
10 #include <zephyr/drivers/regulator.h>
12 #include <zephyr/dt-bindings/gpio/nordic-npm6001-gpio.h>
13 #include <zephyr/dt-bindings/regulator/npm6001.h>
25 static const struct device *const gpio = DEVICE_DT_GET_ONE(nordic_npm6001_gpio); variable
49 if (!device_is_ready(gpio)) { in main()
50 printk("nPM6001 GPIO device not ready\n"); in main()
62 printk("nPM6001 %s regulator device not ready\n", in main()
93 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_voltages()
94 return -ENODEV; in cmd_regulator_voltages()
118 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_enable()
119 return -ENODEV; in cmd_regulator_enable()
124 shell_error(sh, "Could not enable regulator (%d)", ret); in cmd_regulator_enable()
140 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_disable()
141 return -ENODEV; in cmd_regulator_disable()
146 shell_error(sh, "Could not disable regulator (%d)", ret); in cmd_regulator_disable()
161 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_set()
162 return -ENODEV; in cmd_regulator_set()
191 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_get()
192 return -ENODEV; in cmd_regulator_get()
216 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_modeset()
217 return -ENODEV; in cmd_regulator_modeset()
226 return -EINVAL; in cmd_regulator_modeset()
248 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_modeget()
249 return -ENODEV; in cmd_regulator_modeget()
264 return -EINVAL; in cmd_regulator_modeget()
280 shell_error(sh, "Invalid regulator: %s", argv[1]); in cmd_regulator_errors()
281 return -ENODEV; in cmd_regulator_errors()
309 {"high-drive", no_argument, &high_drive, 1}, in cmd_gpio_configure()
310 {"pull-down", no_argument, &pull_down, 1}, in cmd_gpio_configure()
320 &long_index)) != -1) { in cmd_gpio_configure()
341 return -EINVAL; in cmd_gpio_configure()
357 ret = gpio_pin_configure(gpio, pin, flags); in cmd_gpio_configure()
373 val = gpio_pin_get(gpio, pin); in cmd_gpio_get()
393 ret = gpio_pin_set(gpio, pin, val); in cmd_gpio_set()
409 ret = gpio_pin_toggle(gpio, pin); in cmd_gpio_toggle()
458 SHELL_CMD(list, NULL, "List regulator names",
462 SHELL_CMD_ARG(enable, NULL, "Enable regulator",
464 SHELL_CMD_ARG(disable, NULL, "Disable regulator",
479 SHELL_CMD_ARG(configure, NULL, "Configure GPIO",
481 SHELL_CMD_ARG(get, NULL, "Get GPIO level",
483 SHELL_CMD_ARG(set, NULL, "Set GPIO level",
485 SHELL_CMD_ARG(toggle, NULL, "Toggle GPIO level",
499 SHELL_CMD(regulator, &sub_npm6001_regulator_cmds,
501 SHELL_CMD(gpio, &sub_npm6001_gpio_cmds, "GPIO",