Lines Matching +full:drdy +full:- +full:pulsed
6 * SPDX-License-Identifier: Apache-2.0
32 const struct lps2xdf_config *const cfg = dev->config; in lps2xdf_config_int()
33 const struct lps2xdf_chip_api *chip_api = cfg->chip_api; in lps2xdf_config_int()
35 return chip_api->config_interrupt(dev); in lps2xdf_config_int()
42 const struct lps2xdf_config *const cfg = dev->config; in lps2xdf_trigger_set()
43 const struct lps2xdf_chip_api *chip_api = cfg->chip_api; in lps2xdf_trigger_set()
45 return chip_api->trigger_set(dev, trig, handler); in lps2xdf_trigger_set()
51 k_sem_give(&lps2xdf->intr_sem); in lps2xdf_intr_callback()
53 k_work_submit(&lps2xdf->work); in lps2xdf_intr_callback()
64 const struct lps2xdf_config *cfg = lps2xdf->dev->config; in lps2xdf_gpio_callback()
67 ret = gpio_pin_interrupt_configure_dt(&cfg->gpio_int, GPIO_INT_DISABLE); in lps2xdf_gpio_callback()
69 LOG_ERR("%s: Not able to configure pin_int", dev->name); in lps2xdf_gpio_callback()
78 const struct device *dev = lps2xdf->dev; in lps2xdf_thread()
79 const struct lps2xdf_config *const cfg = dev->config; in lps2xdf_thread()
80 const struct lps2xdf_chip_api *chip_api = cfg->chip_api; in lps2xdf_thread()
83 k_sem_take(&lps2xdf->intr_sem, K_FOREVER); in lps2xdf_thread()
84 chip_api->handle_interrupt(dev); in lps2xdf_thread()
94 const struct device *dev = lps2xdf->dev; in lps2xdf_work_cb()
95 const struct lps2xdf_config *const cfg = dev->config; in lps2xdf_work_cb()
96 const struct lps2xdf_chip_api *chip_api = cfg->chip_api; in lps2xdf_work_cb()
98 chip_api->handle_interrupt(dev); in lps2xdf_work_cb()
107 const struct device *dev = target->dev; in lps2xdf_ibi_cb()
108 struct lps2xdf_data *lps2xdf = dev->data; in lps2xdf_ibi_cb()
120 struct lps2xdf_data *lps2xdf = dev->data; in lps2xdf_init_interrupt()
121 const struct lps2xdf_config *cfg = dev->config; in lps2xdf_init_interrupt()
125 if (!gpio_is_ready_dt(&cfg->gpio_int) && !ON_I3C_BUS(cfg)) { in lps2xdf_init_interrupt()
126 if (cfg->gpio_int.port) { in lps2xdf_init_interrupt()
127 LOG_ERR("%s: device %s is not ready", dev->name, in lps2xdf_init_interrupt()
128 cfg->gpio_int.port->name); in lps2xdf_init_interrupt()
129 return -ENODEV; in lps2xdf_init_interrupt()
132 LOG_DBG("%s: gpio_int not defined in DT", dev->name); in lps2xdf_init_interrupt()
136 lps2xdf->dev = dev; in lps2xdf_init_interrupt()
139 k_sem_init(&lps2xdf->intr_sem, 0, K_SEM_MAX_LIMIT); in lps2xdf_init_interrupt()
141 k_thread_create(&lps2xdf->thread, lps2xdf->thread_stack, in lps2xdf_init_interrupt()
147 lps2xdf->work.handler = lps2xdf_work_cb; in lps2xdf_init_interrupt()
151 ret = gpio_pin_configure_dt(&cfg->gpio_int, GPIO_INPUT); in lps2xdf_init_interrupt()
157 LOG_INF("%s: int on %s.%02u", dev->name, cfg->gpio_int.port->name, in lps2xdf_init_interrupt()
158 cfg->gpio_int.pin); in lps2xdf_init_interrupt()
160 gpio_init_callback(&lps2xdf->gpio_cb, in lps2xdf_init_interrupt()
162 BIT(cfg->gpio_int.pin)); in lps2xdf_init_interrupt()
164 ret = gpio_add_callback(cfg->gpio_int.port, &lps2xdf->gpio_cb); in lps2xdf_init_interrupt()
171 LOG_DBG("drdy_pulsed is %d", (int)cfg->drdy_pulsed); in lps2xdf_init_interrupt()
173 /* enable drdy in pulsed/latched mode */ in lps2xdf_init_interrupt()
182 if (cfg->i3c.bus != NULL) { in lps2xdf_init_interrupt()
184 lps2xdf->i3c_dev->ibi_cb = lps2xdf_ibi_cb; in lps2xdf_init_interrupt()
186 if (i3c_ibi_enable(lps2xdf->i3c_dev) != 0) { in lps2xdf_init_interrupt()
188 return -EIO; in lps2xdf_init_interrupt()
195 return gpio_pin_interrupt_configure_dt(&cfg->gpio_int, in lps2xdf_init_interrupt()