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()
951 mutex_lock(&data->mutex); in bmc150_accel_set_watermark()
952 data->watermark = val; in bmc150_accel_set_watermark()
953 mutex_unlock(&data->mutex); in bmc150_accel_set_watermark()
965 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_fifo_transfer()
970 ret = regmap_raw_read(data->regmap, BMC150_ACCEL_REG_FIFO_DATA, in bmc150_accel_fifo_transfer()
983 struct device *dev = regmap_get_device(data->regmap); in __bmc150_accel_fifo_flush()
991 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_FIFO_STATUS, &val); in __bmc150_accel_fifo_flush()
1011 data->old_timestamp = data->timestamp; in __bmc150_accel_fifo_flush()
1012 data->timestamp = iio_get_time_ns(indio_dev); in __bmc150_accel_fifo_flush()
1029 sample_period = (data->timestamp - data->old_timestamp); in __bmc150_accel_fifo_flush()
1031 tstamp = data->timestamp - (count - 1) * sample_period; in __bmc150_accel_fifo_flush()
1050 for_each_set_bit(bit, indio_dev->active_scan_mask, in __bmc150_accel_fifo_flush()
1051 indio_dev->masklength) in __bmc150_accel_fifo_flush()
1052 memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], in __bmc150_accel_fifo_flush()
1053 sizeof(data->scan.channels[0])); in __bmc150_accel_fifo_flush()
1055 iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, in __bmc150_accel_fifo_flush()
1069 mutex_lock(&data->mutex); in bmc150_accel_fifo_flush()
1071 mutex_unlock(&data->mutex); in bmc150_accel_fifo_flush()
1108 .shift = 16 - (bits), \
1122 .scan_index = -1, \
1140 * The range for the Bosch sensors is typically +-2g/4g/8g/16g, distributed
1143 * e.g. for +-2g and 12 bits: (4 / 2^12) * 9.80665 m/s^2 = 0.0095768... m/s^2
1229 struct iio_dev *indio_dev = pf->indio_dev; in bmc150_accel_trigger_handler()
1233 mutex_lock(&data->mutex); in bmc150_accel_trigger_handler()
1234 ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_REG_XOUT_L, in bmc150_accel_trigger_handler()
1235 data->buffer, AXIS_MAX * 2); in bmc150_accel_trigger_handler()
1236 mutex_unlock(&data->mutex); in bmc150_accel_trigger_handler()
1240 iio_push_to_buffers_with_timestamp(indio_dev, data->buffer, in bmc150_accel_trigger_handler()
1241 pf->timestamp); in bmc150_accel_trigger_handler()
1243 iio_trigger_notify_done(indio_dev->trig); in bmc150_accel_trigger_handler()
1251 struct bmc150_accel_data *data = t->data; in bmc150_accel_trig_reen()
1252 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_trig_reen()
1256 if (t == &t->data->triggers[BMC150_ACCEL_TRIGGER_DATA_READY]) in bmc150_accel_trig_reen()
1259 mutex_lock(&data->mutex); in bmc150_accel_trig_reen()
1261 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_trig_reen()
1264 mutex_unlock(&data->mutex); in bmc150_accel_trig_reen()
1273 struct bmc150_accel_data *data = t->data; in bmc150_accel_trigger_set_state()
1276 mutex_lock(&data->mutex); in bmc150_accel_trigger_set_state()
1278 if (t->enabled == state) { in bmc150_accel_trigger_set_state()
1279 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1283 if (t->setup) { in bmc150_accel_trigger_set_state()
1284 ret = t->setup(t, state); in bmc150_accel_trigger_set_state()
1286 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1291 ret = bmc150_accel_set_interrupt(data, t->intr, state); in bmc150_accel_trigger_set_state()
1293 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1297 t->enabled = state; in bmc150_accel_trigger_set_state()
1299 mutex_unlock(&data->mutex); in bmc150_accel_trigger_set_state()
1312 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_handle_roc_event()
1317 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_INT_STATUS_2, &val); in bmc150_accel_handle_roc_event()
1335 data->timestamp); in bmc150_accel_handle_roc_event()
1344 data->timestamp); in bmc150_accel_handle_roc_event()
1353 data->timestamp); in bmc150_accel_handle_roc_event()
1362 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_irq_thread_handler()
1366 mutex_lock(&data->mutex); in bmc150_accel_irq_thread_handler()
1368 if (data->fifo_mode) { in bmc150_accel_irq_thread_handler()
1375 if (data->ev_enable_state) { in bmc150_accel_irq_thread_handler()
1382 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_irq_thread_handler()
1393 mutex_unlock(&data->mutex); in bmc150_accel_irq_thread_handler()
1405 data->old_timestamp = data->timestamp; in bmc150_accel_irq_handler()
1406 data->timestamp = iio_get_time_ns(indio_dev); in bmc150_accel_irq_handler()
1409 if (data->triggers[i].enabled) { in bmc150_accel_irq_handler()
1410 iio_trigger_poll(data->triggers[i].indio_trig); in bmc150_accel_irq_handler()
1416 if (data->ev_enable_state || data->fifo_mode) in bmc150_accel_irq_handler()
1432 .name = "%s-dev%d",
1436 .name = "%s-any-motion-dev%d",
1446 for (i = from; i >= 0; i--) { in bmc150_accel_unregister_triggers()
1447 if (data->triggers[i].indio_trig) { in bmc150_accel_unregister_triggers()
1448 iio_trigger_unregister(data->triggers[i].indio_trig); in bmc150_accel_unregister_triggers()
1449 data->triggers[i].indio_trig = NULL; in bmc150_accel_unregister_triggers()
1457 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_triggers_setup()
1461 struct bmc150_accel_trigger *t = &data->triggers[i]; in bmc150_accel_triggers_setup()
1463 t->indio_trig = devm_iio_trigger_alloc(dev, in bmc150_accel_triggers_setup()
1465 indio_dev->name, in bmc150_accel_triggers_setup()
1467 if (!t->indio_trig) { in bmc150_accel_triggers_setup()
1468 ret = -ENOMEM; in bmc150_accel_triggers_setup()
1472 t->indio_trig->ops = &bmc150_accel_trigger_ops; in bmc150_accel_triggers_setup()
1473 t->intr = bmc150_accel_triggers[i].intr; in bmc150_accel_triggers_setup()
1474 t->data = data; in bmc150_accel_triggers_setup()
1475 t->setup = bmc150_accel_triggers[i].setup; in bmc150_accel_triggers_setup()
1476 iio_trigger_set_drvdata(t->indio_trig, t); in bmc150_accel_triggers_setup()
1478 ret = iio_trigger_register(t->indio_trig); in bmc150_accel_triggers_setup()
1484 bmc150_accel_unregister_triggers(data, i - 1); in bmc150_accel_triggers_setup()
1495 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_fifo_set_mode()
1499 ret = regmap_write(data->regmap, reg, data->fifo_mode); in bmc150_accel_fifo_set_mode()
1505 if (!data->fifo_mode) in bmc150_accel_fifo_set_mode()
1508 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_FIFO_CONFIG0, in bmc150_accel_fifo_set_mode()
1509 data->watermark); in bmc150_accel_fifo_set_mode()
1531 mutex_lock(&data->mutex); in bmc150_accel_buffer_postenable()
1533 if (!data->watermark) in bmc150_accel_buffer_postenable()
1541 data->fifo_mode = BMC150_ACCEL_FIFO_MODE_FIFO; in bmc150_accel_buffer_postenable()
1545 data->fifo_mode = 0; in bmc150_accel_buffer_postenable()
1551 mutex_unlock(&data->mutex); in bmc150_accel_buffer_postenable()
1563 mutex_lock(&data->mutex); in bmc150_accel_buffer_predisable()
1565 if (!data->fifo_mode) in bmc150_accel_buffer_predisable()
1570 data->fifo_mode = 0; in bmc150_accel_buffer_predisable()
1574 mutex_unlock(&data->mutex); in bmc150_accel_buffer_predisable()
1595 struct device *dev = regmap_get_device(data->regmap); in bmc150_accel_chip_init()
1603 regmap_write(data->regmap, BMC150_ACCEL_REG_RESET, in bmc150_accel_chip_init()
1607 ret = regmap_read(data->regmap, BMC150_ACCEL_REG_CHIP_ID, &val); in bmc150_accel_chip_init()
1616 data->chip_info = &bmc150_accel_chip_info_tbl[i]; in bmc150_accel_chip_init()
1621 if (!data->chip_info) { in bmc150_accel_chip_init()
1623 return -ENODEV; in bmc150_accel_chip_init()
1636 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_PMU_RANGE, in bmc150_accel_chip_init()
1643 data->range = BMC150_ACCEL_DEF_RANGE_4G; in bmc150_accel_chip_init()
1646 data->slope_thres = BMC150_ACCEL_DEF_SLOPE_THRESHOLD; in bmc150_accel_chip_init()
1647 data->slope_dur = BMC150_ACCEL_DEF_SLOPE_DURATION; in bmc150_accel_chip_init()
1653 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_chip_init()
1675 return -ENOMEM; in bmc150_accel_core_probe()
1680 data->regmap = regmap; in bmc150_accel_core_probe()
1681 data->type = type; in bmc150_accel_core_probe()
1683 if (!bmc150_apply_acpi_orientation(dev, &data->orientation)) { in bmc150_accel_core_probe()
1684 ret = iio_read_mount_matrix(dev, &data->orientation); in bmc150_accel_core_probe()
1693 data->regulators[0].supply = "vdd"; in bmc150_accel_core_probe()
1694 data->regulators[1].supply = "vddio"; in bmc150_accel_core_probe()
1696 ARRAY_SIZE(data->regulators), in bmc150_accel_core_probe()
1697 data->regulators); in bmc150_accel_core_probe()
1701 ret = regulator_bulk_enable(ARRAY_SIZE(data->regulators), in bmc150_accel_core_probe()
1702 data->regulators); in bmc150_accel_core_probe()
1708 * 2ms or 3ms power-on time according to datasheets, let's better in bmc150_accel_core_probe()
1717 mutex_init(&data->mutex); in bmc150_accel_core_probe()
1719 indio_dev->channels = data->chip_info->channels; in bmc150_accel_core_probe()
1720 indio_dev->num_channels = data->chip_info->num_channels; in bmc150_accel_core_probe()
1721 indio_dev->name = name ? name : data->chip_info->name; in bmc150_accel_core_probe()
1722 indio_dev->available_scan_masks = bmc150_accel_scan_masks; in bmc150_accel_core_probe()
1723 indio_dev->modes = INDIO_DIRECT_MODE; in bmc150_accel_core_probe()
1724 indio_dev->info = &bmc150_accel_info; in bmc150_accel_core_probe()
1727 indio_dev->modes |= INDIO_BUFFER_SOFTWARE; in bmc150_accel_core_probe()
1728 indio_dev->info = &bmc150_accel_info_fifo; in bmc150_accel_core_probe()
1757 * non-latched regardless of this settings (e.g. new data) we in bmc150_accel_core_probe()
1761 ret = regmap_write(data->regmap, BMC150_ACCEL_REG_INT_RST_LATCH, in bmc150_accel_core_probe()
1795 bmc150_accel_unregister_triggers(data, BMC150_ACCEL_TRIGGERS - 1); in bmc150_accel_core_probe()
1799 regulator_bulk_disable(ARRAY_SIZE(data->regulators), in bmc150_accel_core_probe()
1800 data->regulators); in bmc150_accel_core_probe()
1816 bmc150_accel_unregister_triggers(data, BMC150_ACCEL_TRIGGERS - 1); in bmc150_accel_core_remove()
1820 mutex_lock(&data->mutex); in bmc150_accel_core_remove()
1822 mutex_unlock(&data->mutex); in bmc150_accel_core_remove()
1824 regulator_bulk_disable(ARRAY_SIZE(data->regulators), in bmc150_accel_core_remove()
1825 data->regulators); in bmc150_accel_core_remove()
1835 mutex_lock(&data->mutex); in bmc150_accel_suspend()
1837 mutex_unlock(&data->mutex); in bmc150_accel_suspend()
1847 mutex_lock(&data->mutex); in bmc150_accel_resume()
1850 mutex_unlock(&data->mutex); in bmc150_accel_resume()
1852 if (data->resume_callback) in bmc150_accel_resume()
1853 data->resume_callback(dev); in bmc150_accel_resume()
1868 return -EAGAIN; in bmc150_accel_runtime_suspend()