Lines Matching +full:powered +full:- +full:on

5  * SPDX-License-Identifier: Apache-2.0
39 /* Only run action if the device is on the specified domain */ in pd_on_domain_visitor()
40 if (!dev->pm || (dev->pm_base->domain != visitor_context->domain)) { in pd_on_domain_visitor()
44 (void)pm_device_action_run(dev, visitor_context->action); in pd_on_domain_visitor()
56 const struct pd_gpio_config *cfg = dev->config; in pd_gpio_pm_action()
57 struct pd_gpio_data *data = dev->data; in pd_gpio_pm_action()
64 return -ENOTSUP; in pd_gpio_pm_action()
70 k_sleep(data->next_boot); in pd_gpio_pm_action()
71 /* Switch power on */ in pd_gpio_pm_action()
72 gpio_pin_set_dt(&cfg->enable, 1); in pd_gpio_pm_action()
73 LOG_INF("%s is now ON", dev->name); in pd_gpio_pm_action()
75 k_sleep(K_USEC(cfg->startup_delay_us)); in pd_gpio_pm_action()
77 /* Notify devices on the domain they are now powered */ in pd_gpio_pm_action()
84 /* Notify devices on the domain that power is going down */ in pd_gpio_pm_action()
89 gpio_pin_set_dt(&cfg->enable, 0); in pd_gpio_pm_action()
90 LOG_INF("%s is now OFF", dev->name); in pd_gpio_pm_action()
92 next_boot_ticks = k_uptime_ticks() + k_us_to_ticks_ceil32(cfg->off_on_delay_us); in pd_gpio_pm_action()
93 data->next_boot = K_TIMEOUT_ABS_TICKS(next_boot_ticks); in pd_gpio_pm_action()
96 /* Actively control the enable pin now that the device is powered */ in pd_gpio_pm_action()
97 gpio_pin_configure_dt(&cfg->enable, GPIO_OUTPUT_INACTIVE); in pd_gpio_pm_action()
98 LOG_DBG("%s is OFF and powered", dev->name); in pd_gpio_pm_action()
101 /* Let the enable pin float while device is not powered */ in pd_gpio_pm_action()
102 gpio_pin_configure_dt(&cfg->enable, GPIO_DISCONNECTED); in pd_gpio_pm_action()
103 LOG_DBG("%s is OFF and not powered", dev->name); in pd_gpio_pm_action()
106 rc = -ENOTSUP; in pd_gpio_pm_action()
114 const struct pd_gpio_config *cfg = dev->config; in pd_gpio_init()
115 struct pd_gpio_data *data = dev->data; in pd_gpio_init()
117 if (!gpio_is_ready_dt(&cfg->enable)) { in pd_gpio_init()
118 LOG_ERR("GPIO port %s is not ready", cfg->enable.port->name); in pd_gpio_init()
119 return -ENODEV; in pd_gpio_init()
122 data->next_boot = K_TIMEOUT_ABS_US(cfg->off_on_delay_us); in pd_gpio_init()