Lines Matching +full:mount +full:- +full:matrix

1 // SPDX-License-Identifier: GPL-2.0-only
3 * 3-axis accelerometer driver supporting many Bosch-Sensortec chips
26 #include "bmc150-accel.h"
212 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_set_mode()
216 int dur_val = -1; in bmc150_accel_set_mode()
231 return -EINVAL; in bmc150_accel_set_mode()
238 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_PMU_LPW, lpw_bits); in bmc150_accel_set_mode()
256 ret = regmap_write(data->regmap, in bmc150_accel_set_bw()
262 data->bw_bits = in bmc150_accel_set_bw()
268 return -EINVAL; in bmc150_accel_set_bw()
273 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_update_slope()
276 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_6, in bmc150_accel_update_slope()
277 data->slope_thres); in bmc150_accel_update_slope()
283 ret = regmap_update_bits(data->regmap, BMC150_ACCEL_REG_INT_5, in bmc150_accel_update_slope()
284 BMC150_ACCEL_SLOPE_DUR_MASK, data->slope_dur); in bmc150_accel_update_slope()
290 dev_dbg(dev, "%x %x\n", data->slope_thres, data->slope_dur); in bmc150_accel_update_slope()
299 return bmc150_accel_update_slope(t->data); in bmc150_accel_any_motion_setup()
310 if (bmc150_accel_samp_freq_table[i].bw_bits == data->bw_bits) { in bmc150_accel_get_bw()
317 return -EINVAL; in bmc150_accel_get_bw()
326 if (bmc150_accel_sample_upd_time[i].bw_bits == data->bw_bits) in bmc150_accel_get_startup_times()
335 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_set_power_state()
364 * There are 2 variants of the BOSC0200 ACPI node. Some 2-in-1s with 360 degree
365 * hinges declare 2 I2C ACPI-resources for 2 accelerometers, 1 in the display
366 * and 1 in the base of the 2-in-1. On these 2-in-1s the ROMS ACPI object
367 * contains the mount-matrix for the sensor in the display and ROMK contains
368 * the mount-matrix for the sensor in the base. On devices using a single
369 * sensor there is a ROTM ACPI object which contains the mount-matrix.
373 * Yoga devices with 2 accelerometers using ROMS + ROMK for the mount-matrices:
377 * Tablets using a single accelerometer using ROTM for the mount-matrix:
397 if (strcmp(dev_name(dev), "i2c-BOSC0200:base") == 0) { in bmc150_apply_bosc0200_acpi_orientation()
399 label = "accel-base"; in bmc150_apply_bosc0200_acpi_orientation()
402 label = "accel-display"; in bmc150_apply_bosc0200_acpi_orientation()
405 if (acpi_has_method(adev->handle, "ROTM")) { in bmc150_apply_bosc0200_acpi_orientation()
407 } else if (acpi_has_method(adev->handle, alt_name)) { in bmc150_apply_bosc0200_acpi_orientation()
409 indio_dev->label = label; in bmc150_apply_bosc0200_acpi_orientation()
414 status = acpi_evaluate_object(adev->handle, name, NULL, &buffer); in bmc150_apply_bosc0200_acpi_orientation()
416 dev_warn(dev, "Failed to get ACPI mount matrix: %d\n", status); in bmc150_apply_bosc0200_acpi_orientation()
421 if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count != 3) in bmc150_apply_bosc0200_acpi_orientation()
424 elements = obj->package.elements; in bmc150_apply_bosc0200_acpi_orientation()
435 case -1: str = "-1"; break; in bmc150_apply_bosc0200_acpi_orientation()
440 orientation->rotation[i * 3 + j] = str; in bmc150_apply_bosc0200_acpi_orientation()
448 dev_warn(dev, "Unknown ACPI mount matrix format, ignoring\n"); in bmc150_apply_bosc0200_acpi_orientation()
458 if (strcmp(dev_name(dev), "i2c-DUAL250E:base") == 0) in bmc150_apply_dual250e_acpi_orientation()
459 indio_dev->label = "accel-base"; in bmc150_apply_dual250e_acpi_orientation()
461 indio_dev->label = "accel-display"; in bmc150_apply_dual250e_acpi_orientation()
463 return false; /* DUAL250E fwnodes have no mount matrix info */ in bmc150_apply_dual250e_acpi_orientation()
546 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_interrupts_setup()
552 * so we try to detect which IRQ it is based on the interrupt-names. in bmc150_accel_interrupts_setup()
553 * Without interrupt-names, we assume the irq belongs to INT1. in bmc150_accel_interrupts_setup()
556 if (data->type == BOSCH_BMC156 || in bmc150_accel_interrupts_setup()
557 irq == of_irq_get_byname(dev->of_node, "INT2")) in bmc150_accel_interrupts_setup()
561 data->interrupts[i].info = &irq_info[i]; in bmc150_accel_interrupts_setup()
567 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_set_interrupt()
568 struct bmc150_accel_interrupt *intr = &data->interrupts[i]; in bmc150_accel_set_interrupt()
569 const struct bmc150_accel_interrupt_info *info = intr->info; in bmc150_accel_set_interrupt()
573 if (atomic_inc_return(&intr->users) > 1) in bmc150_accel_set_interrupt()
576 if (atomic_dec_return(&intr->users) > 0) in bmc150_accel_set_interrupt()
594 ret = regmap_update_bits(data->regmap, info->map_reg, info->map_bitmask, in bmc150_accel_set_interrupt()
595 (state ? info->map_bitmask : 0)); in bmc150_accel_set_interrupt()
602 ret = regmap_update_bits(data->regmap, info->en_reg, info->en_bitmask, in bmc150_accel_set_interrupt()
603 (state ? info->en_bitmask : 0)); in bmc150_accel_set_interrupt()
618 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_set_scale()
621 for (i = 0; i < ARRAY_SIZE(data->chip_info->scale_table); ++i) { in bmc150_accel_set_scale()
622 if (data->chip_info->scale_table[i].scale == val) { in bmc150_accel_set_scale()
623 ret = regmap_write(data->regmap, in bmc150_accel_set_scale()
625 data->chip_info->scale_table[i].reg_range); in bmc150_accel_set_scale()
631 data->range = data->chip_info->scale_table[i].reg_range; in bmc150_accel_set_scale()
636 return -EINVAL; in bmc150_accel_set_scale()
641 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_get_temp()
645 mutex_lock(&data->mutex); in bmc150_accel_get_temp()
647 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_TEMP, &value); in bmc150_accel_get_temp()
650 mutex_unlock(&data->mutex); in bmc150_accel_get_temp()
655 mutex_unlock(&data->mutex); in bmc150_accel_get_temp()
664 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_get_axis()
666 int axis = chan->scan_index; in bmc150_accel_get_axis()
669 mutex_lock(&data->mutex); in bmc150_accel_get_axis()
672 mutex_unlock(&data->mutex); in bmc150_accel_get_axis()
676 ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_AXIS_TO_REG(axis), in bmc150_accel_get_axis()
681 mutex_unlock(&data->mutex); in bmc150_accel_get_axis()
684 *val = sign_extend32(le16_to_cpu(raw_val) >> chan->scan_type.shift, in bmc150_accel_get_axis()
685 chan->scan_type.realbits - 1); in bmc150_accel_get_axis()
687 mutex_unlock(&data->mutex); in bmc150_accel_get_axis()
703 switch (chan->type) { in bmc150_accel_read_raw()
708 return -EBUSY; in bmc150_accel_read_raw()
712 return -EINVAL; in bmc150_accel_read_raw()
715 if (chan->type == IIO_TEMP) { in bmc150_accel_read_raw()
719 return -EINVAL; in bmc150_accel_read_raw()
723 switch (chan->type) { in bmc150_accel_read_raw()
731 int st_size = ARRAY_SIZE(data->chip_info->scale_table); in bmc150_accel_read_raw()
734 si = &data->chip_info->scale_table[i]; in bmc150_accel_read_raw()
735 if (si->reg_range == data->range) { in bmc150_accel_read_raw()
736 *val2 = si->scale; in bmc150_accel_read_raw()
740 return -EINVAL; in bmc150_accel_read_raw()
743 return -EINVAL; in bmc150_accel_read_raw()
746 mutex_lock(&data->mutex); in bmc150_accel_read_raw()
748 mutex_unlock(&data->mutex); in bmc150_accel_read_raw()
751 return -EINVAL; in bmc150_accel_read_raw()
764 mutex_lock(&data->mutex); in bmc150_accel_write_raw()
766 mutex_unlock(&data->mutex); in bmc150_accel_write_raw()
770 return -EINVAL; in bmc150_accel_write_raw()
772 mutex_lock(&data->mutex); in bmc150_accel_write_raw()
774 mutex_unlock(&data->mutex); in bmc150_accel_write_raw()
777 ret = -EINVAL; in bmc150_accel_write_raw()
795 *val = data->slope_thres; in bmc150_accel_read_event()
798 *val = data->slope_dur; in bmc150_accel_read_event()
801 return -EINVAL; in bmc150_accel_read_event()
816 if (data->ev_enable_state) in bmc150_accel_write_event()
817 return -EBUSY; in bmc150_accel_write_event()
821 data->slope_thres = val & BMC150_ACCEL_SLOPE_THRES_MASK; in bmc150_accel_write_event()
824 data->slope_dur = val & BMC150_ACCEL_SLOPE_DUR_MASK; in bmc150_accel_write_event()
827 return -EINVAL; in bmc150_accel_write_event()
840 return data->ev_enable_state; in bmc150_accel_read_event_config()
852 if (state == data->ev_enable_state) in bmc150_accel_write_event_config()
855 mutex_lock(&data->mutex); in bmc150_accel_write_event_config()
860 mutex_unlock(&data->mutex); in bmc150_accel_write_event_config()
864 data->ev_enable_state = state; in bmc150_accel_write_event_config()
865 mutex_unlock(&data->mutex); in bmc150_accel_write_event_config()
877 if (data->triggers[i].indio_trig == trig) in bmc150_accel_validate_trigger()
881 return -EINVAL; in bmc150_accel_validate_trigger()
892 mutex_lock(&data->mutex); in bmc150_accel_get_fifo_watermark()
893 wm = data->watermark; in bmc150_accel_get_fifo_watermark()
894 mutex_unlock(&data->mutex); in bmc150_accel_get_fifo_watermark()
907 mutex_lock(&data->mutex); in bmc150_accel_get_fifo_state()
908 state = data->fifo_mode; in bmc150_accel_get_fifo_state()
909 mutex_unlock(&data->mutex); in bmc150_accel_get_fifo_state()
920 return &data->orientation; in bmc150_accel_get_mount_matrix()
964 mutex_lock(&data->mutex); in bmc150_accel_set_watermark()
965 data->watermark = val; in bmc150_accel_set_watermark()
966 mutex_unlock(&data->mutex); in bmc150_accel_set_watermark()
978 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_fifo_transfer()
983 ret = regmap_raw_read(data->regmap, BMC150_ACCEL_REG_FIFO_DATA, in bmc150_accel_fifo_transfer()
996 struct device *dev = regmap_get_device(data->regmap); in __bmc150_accel_fifo_flush()
1004 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_FIFO_STATUS, &val); in __bmc150_accel_fifo_flush()
1024 data->old_timestamp = data->timestamp; in __bmc150_accel_fifo_flush()
1025 data->timestamp = iio_get_time_ns(indio_dev); in __bmc150_accel_fifo_flush()
1042 sample_period = (data->timestamp - data->old_timestamp); in __bmc150_accel_fifo_flush()
1044 tstamp = data->timestamp - (count - 1) * sample_period; in __bmc150_accel_fifo_flush()
1063 for_each_set_bit(bit, indio_dev->active_scan_mask, in __bmc150_accel_fifo_flush()
1064 indio_dev->masklength) in __bmc150_accel_fifo_flush()
1065 memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], in __bmc150_accel_fifo_flush()
1066 sizeof(data->scan.channels[0])); in __bmc150_accel_fifo_flush()
1068 iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, in __bmc150_accel_fifo_flush()
1082 mutex_lock(&data->mutex); in bmc150_accel_fifo_flush()
1084 mutex_unlock(&data->mutex); in bmc150_accel_fifo_flush()
1121 .shift = 16 - (bits), \
1135 .scan_index = -1, \
1153 * The range for the Bosch sensors is typically +-2g/4g/8g/16g, distributed
1156 * e.g. for +-2g and 12 bits: (4 / 2^12) * 9.80665 m/s^2 = 0.0095768... m/s^2
1242 struct iio_dev *indio_dev = pf->indio_dev; in bmc150_accel_trigger_handler()
1246 mutex_lock(&data->mutex); in bmc150_accel_trigger_handler()
1247 ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_REG_XOUT_L, in bmc150_accel_trigger_handler()
1248 data->buffer, AXIS_MAX * 2); in bmc150_accel_trigger_handler()
1249 mutex_unlock(&data->mutex); in bmc150_accel_trigger_handler()
1253 iio_push_to_buffers_with_timestamp(indio_dev, data->buffer, in bmc150_accel_trigger_handler()
1254 pf->timestamp); in bmc150_accel_trigger_handler()
1256 iio_trigger_notify_done(indio_dev->trig); in bmc150_accel_trigger_handler()
1264 struct bmc150_accel_data *data = t->data; in bmc150_accel_trig_reen()
1265 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_trig_reen()
1269 if (t == &t->data->triggers[BMC150_ACCEL_TRIGGER_DATA_READY]) in bmc150_accel_trig_reen()
1272 mutex_lock(&data->mutex); in bmc150_accel_trig_reen()
1274 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_trig_reen()
1277 mutex_unlock(&data->mutex); in bmc150_accel_trig_reen()
1286 struct bmc150_accel_data *data = t->data; in bmc150_accel_trigger_set_state()
1289 mutex_lock(&data->mutex); in bmc150_accel_trigger_set_state()
1291 if (t->enabled == state) { in bmc150_accel_trigger_set_state()
1292 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1296 if (t->setup) { in bmc150_accel_trigger_set_state()
1297 ret = t->setup(t, state); in bmc150_accel_trigger_set_state()
1299 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1304 ret = bmc150_accel_set_interrupt(data, t->intr, state); in bmc150_accel_trigger_set_state()
1306 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1310 t->enabled = state; in bmc150_accel_trigger_set_state()
1312 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1325 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_handle_roc_event()
1330 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_INT_STATUS_2, &val); in bmc150_accel_handle_roc_event()
1348 data->timestamp); in bmc150_accel_handle_roc_event()
1357 data->timestamp); in bmc150_accel_handle_roc_event()
1366 data->timestamp); in bmc150_accel_handle_roc_event()
1375 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_irq_thread_handler()
1379 mutex_lock(&data->mutex); in bmc150_accel_irq_thread_handler()
1381 if (data->fifo_mode) { in bmc150_accel_irq_thread_handler()
1388 if (data->ev_enable_state) { in bmc150_accel_irq_thread_handler()
1395 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_irq_thread_handler()
1406 mutex_unlock(&data->mutex); in bmc150_accel_irq_thread_handler()
1418 data->old_timestamp = data->timestamp; in bmc150_accel_irq_handler()
1419 data->timestamp = iio_get_time_ns(indio_dev); in bmc150_accel_irq_handler()
1422 if (data->triggers[i].enabled) { in bmc150_accel_irq_handler()
1423 iio_trigger_poll(data->triggers[i].indio_trig); in bmc150_accel_irq_handler()
1429 if (data->ev_enable_state || data->fifo_mode) in bmc150_accel_irq_handler()
1445 .name = "%s-dev%d",
1449 .name = "%s-any-motion-dev%d",
1459 for (i = from; i >= 0; i--) { in bmc150_accel_unregister_triggers()
1460 if (data->triggers[i].indio_trig) { in bmc150_accel_unregister_triggers()
1461 iio_trigger_unregister(data->triggers[i].indio_trig); in bmc150_accel_unregister_triggers()
1462 data->triggers[i].indio_trig = NULL; in bmc150_accel_unregister_triggers()
1470 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_triggers_setup()
1474 struct bmc150_accel_trigger *t = &data->triggers[i]; in bmc150_accel_triggers_setup()
1476 t->indio_trig = devm_iio_trigger_alloc(dev, in bmc150_accel_triggers_setup()
1478 indio_dev->name, in bmc150_accel_triggers_setup()
1480 if (!t->indio_trig) { in bmc150_accel_triggers_setup()
1481 ret = -ENOMEM; in bmc150_accel_triggers_setup()
1485 t->indio_trig->ops = &bmc150_accel_trigger_ops; in bmc150_accel_triggers_setup()
1486 t->intr = bmc150_accel_triggers[i].intr; in bmc150_accel_triggers_setup()
1487 t->data = data; in bmc150_accel_triggers_setup()
1488 t->setup = bmc150_accel_triggers[i].setup; in bmc150_accel_triggers_setup()
1489 iio_trigger_set_drvdata(t->indio_trig, t); in bmc150_accel_triggers_setup()
1491 ret = iio_trigger_register(t->indio_trig); in bmc150_accel_triggers_setup()
1497 bmc150_accel_unregister_triggers(data, i - 1); in bmc150_accel_triggers_setup()
1508 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_fifo_set_mode()
1512 ret = regmap_write(data->regmap, reg, data->fifo_mode); in bmc150_accel_fifo_set_mode()
1518 if (!data->fifo_mode) in bmc150_accel_fifo_set_mode()
1521 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_FIFO_CONFIG0, in bmc150_accel_fifo_set_mode()
1522 data->watermark); in bmc150_accel_fifo_set_mode()
1544 mutex_lock(&data->mutex); in bmc150_accel_buffer_postenable()
1546 if (!data->watermark) in bmc150_accel_buffer_postenable()
1554 data->fifo_mode = BMC150_ACCEL_FIFO_MODE_FIFO; in bmc150_accel_buffer_postenable()
1558 data->fifo_mode = 0; in bmc150_accel_buffer_postenable()
1564 mutex_unlock(&data->mutex); in bmc150_accel_buffer_postenable()
1576 mutex_lock(&data->mutex); in bmc150_accel_buffer_predisable()
1578 if (!data->fifo_mode) in bmc150_accel_buffer_predisable()
1583 data->fifo_mode = 0; in bmc150_accel_buffer_predisable()
1587 mutex_unlock(&data->mutex); in bmc150_accel_buffer_predisable()
1608 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_chip_init()
1616 regmap_write(data->regmap, BMC150_ACCEL_REG_RESET, in bmc150_accel_chip_init()
1620 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_CHIP_ID, &val); in bmc150_accel_chip_init()
1629 data->chip_info = &bmc150_accel_chip_info_tbl[i]; in bmc150_accel_chip_init()
1634 if (!data->chip_info) { in bmc150_accel_chip_init()
1636 return -ENODEV; in bmc150_accel_chip_init()
1649 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_PMU_RANGE, in bmc150_accel_chip_init()
1656 data->range = BMC150_ACCEL_DEF_RANGE_4G; in bmc150_accel_chip_init()
1659 data->slope_thres = BMC150_ACCEL_DEF_SLOPE_THRESHOLD; in bmc150_accel_chip_init()
1660 data->slope_dur = BMC150_ACCEL_DEF_SLOPE_DURATION; in bmc150_accel_chip_init()
1666 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_chip_init()
1688 return -ENOMEM; in bmc150_accel_core_probe()
1693 data->regmap = regmap; in bmc150_accel_core_probe()
1694 data->type = type; in bmc150_accel_core_probe()
1696 if (!bmc150_apply_acpi_orientation(dev, &data->orientation)) { in bmc150_accel_core_probe()
1697 ret = iio_read_mount_matrix(dev, &data->orientation); in bmc150_accel_core_probe()
1706 data->regulators[0].supply = "vdd"; in bmc150_accel_core_probe()
1707 data->regulators[1].supply = "vddio"; in bmc150_accel_core_probe()
1709 ARRAY_SIZE(data->regulators), in bmc150_accel_core_probe()
1710 data->regulators); in bmc150_accel_core_probe()
1714 ret = regulator_bulk_enable(ARRAY_SIZE(data->regulators), in bmc150_accel_core_probe()
1715 data->regulators); in bmc150_accel_core_probe()
1721 * 2ms or 3ms power-on time according to datasheets, let's better in bmc150_accel_core_probe()
1730 mutex_init(&data->mutex); in bmc150_accel_core_probe()
1732 indio_dev->channels = data->chip_info->channels; in bmc150_accel_core_probe()
1733 indio_dev->num_channels = data->chip_info->num_channels; in bmc150_accel_core_probe()
1734 indio_dev->name = name ? name : data->chip_info->name; in bmc150_accel_core_probe()
1735 indio_dev->available_scan_masks = bmc150_accel_scan_masks; in bmc150_accel_core_probe()
1736 indio_dev->modes = INDIO_DIRECT_MODE; in bmc150_accel_core_probe()
1737 indio_dev->info = &bmc150_accel_info; in bmc150_accel_core_probe()
1740 indio_dev->modes |= INDIO_BUFFER_SOFTWARE; in bmc150_accel_core_probe()
1741 indio_dev->info = &bmc150_accel_info_fifo; in bmc150_accel_core_probe()
1770 * non-latched regardless of this settings (e.g. new data) we in bmc150_accel_core_probe()
1774 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_core_probe()
1808 bmc150_accel_unregister_triggers(data, BMC150_ACCEL_TRIGGERS - 1); in bmc150_accel_core_probe()
1812 regulator_bulk_disable(ARRAY_SIZE(data->regulators), in bmc150_accel_core_probe()
1813 data->regulators); in bmc150_accel_core_probe()
1829 bmc150_accel_unregister_triggers(data, BMC150_ACCEL_TRIGGERS - 1); in bmc150_accel_core_remove()
1833 mutex_lock(&data->mutex); in bmc150_accel_core_remove()
1835 mutex_unlock(&data->mutex); in bmc150_accel_core_remove()
1837 regulator_bulk_disable(ARRAY_SIZE(data->regulators), in bmc150_accel_core_remove()
1838 data->regulators); in bmc150_accel_core_remove()
1848 mutex_lock(&data->mutex); in bmc150_accel_suspend()
1850 mutex_unlock(&data->mutex); in bmc150_accel_suspend()
1860 mutex_lock(&data->mutex); in bmc150_accel_resume()
1863 mutex_unlock(&data->mutex); in bmc150_accel_resume()
1865 if (data->resume_callback) in bmc150_accel_resume()
1866 data->resume_callback(dev); in bmc150_accel_resume()
1881 return -EAGAIN; in bmc150_accel_runtime_suspend()