Lines Matching refs:status
47 int status; in lis2dh_trigger_drdy_set() local
59 status = lis2dh->hw_tf->update_reg(dev, LIS2DH_REG_CTRL3, in lis2dh_trigger_drdy_set()
64 if ((handler == NULL) || (status < 0)) { in lis2dh_trigger_drdy_set()
65 return status; in lis2dh_trigger_drdy_set()
85 int status; in lis2dh_start_trigger_int1() local
91 status = lis2dh->hw_tf->read_reg(dev, LIS2DH_REG_CTRL1, &ctrl1); in lis2dh_start_trigger_int1()
92 if (unlikely(status < 0)) { in lis2dh_start_trigger_int1()
93 return status; in lis2dh_start_trigger_int1()
95 status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL1, in lis2dh_start_trigger_int1()
98 if (unlikely(status < 0)) { in lis2dh_start_trigger_int1()
99 return status; in lis2dh_start_trigger_int1()
105 status = lis2dh->hw_tf->read_data(dev, LIS2DH_REG_STATUS, in lis2dh_start_trigger_int1()
107 if (unlikely(status < 0)) { in lis2dh_start_trigger_int1()
108 return status; in lis2dh_start_trigger_int1()
114 status = lis2dh->hw_tf->write_reg(dev, LIS2DH_REG_CTRL1, ctrl1); in lis2dh_start_trigger_int1()
115 if (unlikely(status < 0)) { in lis2dh_start_trigger_int1()
116 return status; in lis2dh_start_trigger_int1()
145 int status; in lis2dh_trigger_anym_tap_set() local
159 status = lis2dh->hw_tf->update_reg(dev, LIS2DH_REG_CTRL3, in lis2dh_trigger_anym_tap_set()
164 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_trigger_anym_tap_set()
170 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_trigger_anym_tap_set()
175 status = lis2dh->hw_tf->read_reg(dev, in lis2dh_trigger_anym_tap_set()
180 status = lis2dh->hw_tf->read_reg(dev, in lis2dh_trigger_anym_tap_set()
192 if ((handler == NULL) || (status < 0)) { in lis2dh_trigger_anym_tap_set()
193 return status; in lis2dh_trigger_anym_tap_set()
226 int status = 0; in lis2dh_start_trigger_int2() local
237 status = lis2dh->hw_tf->write_reg(dev, reg, val); in lis2dh_start_trigger_int2()
238 if (status < 0) { in lis2dh_start_trigger_int2()
240 return status; in lis2dh_start_trigger_int2()
247 status = lis2dh->hw_tf->update_reg(dev, reg, mask, val); in lis2dh_start_trigger_int2()
248 if (status < 0) { in lis2dh_start_trigger_int2()
250 return status; in lis2dh_start_trigger_int2()
257 status = lis2dh->hw_tf->update_reg(dev, reg, mask, val); in lis2dh_start_trigger_int2()
258 if (status < 0) { in lis2dh_start_trigger_int2()
260 return status; in lis2dh_start_trigger_int2()
267 status = lis2dh->hw_tf->update_reg(dev, reg, mask, val); in lis2dh_start_trigger_int2()
268 if (status < 0) { in lis2dh_start_trigger_int2()
270 return status; in lis2dh_start_trigger_int2()
297 int status; in lis2dh_acc_slope_config() local
303 status = lis2dh->hw_tf->read_reg(dev, LIS2DH_REG_CTRL4, in lis2dh_acc_slope_config()
305 if (status < 0) { in lis2dh_acc_slope_config()
306 return status; in lis2dh_acc_slope_config()
327 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_acc_slope_config()
334 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_acc_slope_config()
349 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_acc_slope_config()
356 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_acc_slope_config()
361 return status; in lis2dh_acc_slope_config()
368 int status; in lis2dh_acc_hp_filter_set() local
370 status = lis2dh->hw_tf->update_reg(dev, LIS2DH_REG_CTRL2, in lis2dh_acc_hp_filter_set()
372 if (status < 0) { in lis2dh_acc_hp_filter_set()
376 return status; in lis2dh_acc_hp_filter_set()
424 int status; in lis2dh_thread_cb() local
429 status = lis2dh_start_trigger_int1(dev); in lis2dh_thread_cb()
431 if (unlikely(status < 0)) { in lis2dh_thread_cb()
432 LOG_ERR("lis2dh_start_trigger_int1: %d", status); in lis2dh_thread_cb()
440 status = lis2dh_start_trigger_int2(dev); in lis2dh_thread_cb()
442 if (unlikely(status < 0)) { in lis2dh_thread_cb()
443 LOG_ERR("lis2dh_start_trigger_int2: %d", status); in lis2dh_thread_cb()
471 status = lis2dh->hw_tf->read_reg(dev, in lis2dh_thread_cb()
476 if (status < 0) { in lis2dh_thread_cb()
477 LOG_ERR("clearing interrupt 2 failed: %d", status); in lis2dh_thread_cb()
489 status = lis2dh->hw_tf->read_reg(dev, LIS2DH_REG_CLICK_SRC, in lis2dh_thread_cb()
491 if (status < 0) { in lis2dh_thread_cb()
492 LOG_ERR("clearing interrupt 2 failed: %d", status); in lis2dh_thread_cb()
543 int status; in lis2dh_init_interrupt() local
571 status = 0; in lis2dh_init_interrupt()
576 status = gpio_pin_configure_dt(&cfg->gpio_drdy, GPIO_INPUT); in lis2dh_init_interrupt()
577 if (status < 0) { in lis2dh_init_interrupt()
580 return status; in lis2dh_init_interrupt()
587 status = gpio_add_callback(cfg->gpio_drdy.port, &lis2dh->gpio_int1_cb); in lis2dh_init_interrupt()
588 if (status < 0) { in lis2dh_init_interrupt()
590 return status; in lis2dh_init_interrupt()
611 status = 0; in lis2dh_init_interrupt()
616 status = gpio_pin_configure_dt(&cfg->gpio_int, GPIO_INPUT); in lis2dh_init_interrupt()
617 if (status < 0) { in lis2dh_init_interrupt()
620 return status; in lis2dh_init_interrupt()
628 status = gpio_add_callback(cfg->gpio_int.port, &lis2dh->gpio_int2_cb); in lis2dh_init_interrupt()
629 if (status < 0) { in lis2dh_init_interrupt()
630 LOG_ERR("Could not add gpio int2 callback (%d)", status); in lis2dh_init_interrupt()
631 return status; in lis2dh_init_interrupt()
639 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_init_interrupt()
644 if (status < 0) { in lis2dh_init_interrupt()
645 LOG_ERR("Interrupt disable reg write failed (%d)", status); in lis2dh_init_interrupt()
646 return status; in lis2dh_init_interrupt()
648 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_init_interrupt()
651 if (status < 0) { in lis2dh_init_interrupt()
652 LOG_ERR("Interrupt disable reg write failed (%d)", status); in lis2dh_init_interrupt()
653 return status; in lis2dh_init_interrupt()
657 status = lis2dh->hw_tf->write_data(dev, in lis2dh_init_interrupt()
662 if (status < 0) { in lis2dh_init_interrupt()
663 LOG_ERR("Burst write to THS failed (%d)", status); in lis2dh_init_interrupt()
664 return status; in lis2dh_init_interrupt()
669 status = lis2dh->hw_tf->write_reg(dev, in lis2dh_init_interrupt()
676 if (status < 0) { in lis2dh_init_interrupt()
677 LOG_ERR("enable reg write failed (%d)", status); in lis2dh_init_interrupt()
678 return status; in lis2dh_init_interrupt()
682 return status; in lis2dh_init_interrupt()