Lines Matching +full:data +full:- +full:ready
4 * SPDX-License-Identifier: Apache-2.0
37 struct ili2132a_data *data = CONTAINER_OF(cb, struct ili2132a_data, gpio_cb); in gpio_isr() local
39 k_work_submit(&data->work); in gpio_isr()
44 const struct ili2132a_config *dev_cfg = dev->config; in ili2132a_process()
49 ret = i2c_read_dt(&dev_cfg->i2c, buf, sizeof(buf)); in ili2132a_process()
51 LOG_ERR("Failed to read data: %d", ret); in ili2132a_process()
68 struct ili2132a_data *data = CONTAINER_OF(work_item, struct ili2132a_data, work); in ili2132a_work_handler() local
70 ili2132a_process(data->dev); in ili2132a_work_handler()
75 struct ili2132a_data *data = dev->data; in ili2132a_init() local
76 const struct ili2132a_config *dev_cfg = dev->config; in ili2132a_init()
79 if (!i2c_is_ready_dt(&dev_cfg->i2c)) { in ili2132a_init()
80 LOG_ERR("%s is not ready", dev_cfg->i2c.bus->name); in ili2132a_init()
81 return -ENODEV; in ili2132a_init()
84 if (!gpio_is_ready_dt(&dev_cfg->rst)) { in ili2132a_init()
85 LOG_ERR("Reset GPIO controller device not ready"); in ili2132a_init()
86 return -ENODEV; in ili2132a_init()
89 if (!gpio_is_ready_dt(&dev_cfg->irq)) { in ili2132a_init()
90 LOG_ERR("Interrupt GPIO controller device not ready"); in ili2132a_init()
91 return -ENODEV; in ili2132a_init()
94 data->dev = dev; in ili2132a_init()
96 ret = gpio_pin_configure_dt(&dev_cfg->irq, GPIO_INPUT); in ili2132a_init()
102 ret = gpio_pin_configure_dt(&dev_cfg->rst, GPIO_OUTPUT_ACTIVE); in ili2132a_init()
108 ret = gpio_pin_set_dt(&dev_cfg->rst, 0); in ili2132a_init()
113 gpio_init_callback(&data->gpio_cb, gpio_isr, BIT(dev_cfg->irq.pin)); in ili2132a_init()
114 ret = gpio_add_callback(dev_cfg->irq.port, &data->gpio_cb); in ili2132a_init()
120 ret = gpio_pin_interrupt_configure_dt(&dev_cfg->irq, GPIO_INT_EDGE_FALLING); in ili2132a_init()
126 k_work_init(&data->work, ili2132a_work_handler); in ili2132a_init()