Lines Matching +full:standby +full:- +full:gpios

4  * SPDX-License-Identifier: Apache-2.0
16 /* Does any devicetree instance have an enable-gpios property? */
20 /* Does any devicetree instance have a standby-gpios property? */
35 const struct can_transceiver_gpio_config *config = dev->config; in can_transceiver_gpio_set_state()
39 if (config->enable_gpio.port != NULL) { in can_transceiver_gpio_set_state()
40 err = gpio_pin_set_dt(&config->enable_gpio, enabled ? 1 : 0); in can_transceiver_gpio_set_state()
43 return -EIO; in can_transceiver_gpio_set_state()
49 if (config->standby_gpio.port != NULL) { in can_transceiver_gpio_set_state()
50 err = gpio_pin_set_dt(&config->standby_gpio, enabled ? 0 : 1); in can_transceiver_gpio_set_state()
52 LOG_ERR("failed to set standby GPIO pin (err %d)", err); in can_transceiver_gpio_set_state()
53 return -EIO; in can_transceiver_gpio_set_state()
75 const struct can_transceiver_gpio_config *config = dev->config; in can_transceiver_gpio_init()
79 if (config->enable_gpio.port != NULL) { in can_transceiver_gpio_init()
80 if (!gpio_is_ready_dt(&config->enable_gpio)) { in can_transceiver_gpio_init()
82 return -EINVAL; in can_transceiver_gpio_init()
86 err = gpio_pin_configure_dt(&config->enable_gpio, GPIO_OUTPUT_INACTIVE); in can_transceiver_gpio_init()
95 if (config->standby_gpio.port != NULL) { in can_transceiver_gpio_init()
96 if (!gpio_is_ready_dt(&config->standby_gpio)) { in can_transceiver_gpio_init()
97 LOG_ERR("standby pin GPIO device not ready"); in can_transceiver_gpio_init()
98 return -EINVAL; in can_transceiver_gpio_init()
101 /* CAN transceiver is put in standby during initialization */ in can_transceiver_gpio_init()
102 err = gpio_pin_configure_dt(&config->standby_gpio, GPIO_OUTPUT_ACTIVE); in can_transceiver_gpio_init()
104 LOG_ERR("failed to configure standby GPIO pin (err %d)", err); in can_transceiver_gpio_init()
130 CAN_TRANSCEIVER_GPIO_COND(inst, standby) \