Lines Matching +full:check +full:- +full:common +full:- +full:files
4 * SPDX-License-Identifier: Apache-2.0
8 * @file File that collects common data and configs for RS1718S chip. The file
9 * doesn't provide any API itself. The feature-specific API should be provided
10 * in separated files e.g. GPIO API.
33 k_work_submit(&data->alert_worker); in rt1718s_alert_callback()
39 const struct device *const dev = data->dev; in rt1718s_alert_worker()
40 const struct rt1718s_config *const config = dev->config; in rt1718s_alert_worker()
45 k_sem_take(&data->lock_tcpci, K_FOREVER); in rt1718s_alert_worker()
50 k_sem_give(&data->lock_tcpci); in rt1718s_alert_worker()
56 * defined by the TCPCI specification - "A masked in rt1718s_alert_worker()
65 k_sem_give(&data->lock_tcpci); in rt1718s_alert_worker()
70 k_sem_give(&data->lock_tcpci); in rt1718s_alert_worker()
80 } while (gpio_pin_get_dt(&config->irq_gpio)); in rt1718s_alert_worker()
85 const struct rt1718s_config *const config = dev->config; in rt1718s_init()
86 struct rt1718s_data *data = dev->data; in rt1718s_init()
89 /* Check I2C is ready */ in rt1718s_init()
90 if (!device_is_ready(config->i2c_dev.bus)) { in rt1718s_init()
91 LOG_ERR("%s device not ready", config->i2c_dev.bus->name); in rt1718s_init()
92 return -ENODEV; in rt1718s_init()
95 k_sem_init(&data->lock_tcpci, 1, 1); in rt1718s_init()
98 if (!gpio_is_ready_dt(&config->irq_gpio)) { in rt1718s_init()
99 LOG_ERR("%s device not ready", config->irq_gpio.port->name); in rt1718s_init()
100 return -ENODEV; in rt1718s_init()
104 k_work_init(&data->alert_worker, rt1718s_alert_worker); in rt1718s_init()
106 gpio_pin_configure_dt(&config->irq_gpio, GPIO_INPUT); in rt1718s_init()
108 gpio_init_callback(&data->gpio_cb, rt1718s_alert_callback, in rt1718s_init()
109 BIT(config->irq_gpio.pin)); in rt1718s_init()
111 ret = gpio_add_callback(config->irq_gpio.port, &data->gpio_cb); in rt1718s_init()
116 gpio_pin_interrupt_configure_dt(&config->irq_gpio, GPIO_INT_EDGE_TO_ACTIVE); in rt1718s_init()