.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * MPU3050 gyroscope driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
551 | 552 | toread = bytes_per_datum; |
---|
552 | 553 | offset = 1; |
---|
553 | 554 | /* Put in some dummy value */ |
---|
554 | | - fifo_values[0] = 0xAAAA; |
---|
| 555 | + fifo_values[0] = cpu_to_be16(0xAAAA); |
---|
555 | 556 | } |
---|
556 | 557 | |
---|
557 | 558 | ret = regmap_bulk_read(mpu3050->map, |
---|
.. | .. |
---|
672 | 673 | |
---|
673 | 674 | static const struct iio_buffer_setup_ops mpu3050_buffer_setup_ops = { |
---|
674 | 675 | .preenable = mpu3050_buffer_preenable, |
---|
675 | | - .postenable = iio_triggered_buffer_postenable, |
---|
676 | | - .predisable = iio_triggered_buffer_predisable, |
---|
677 | 676 | .postdisable = mpu3050_buffer_postdisable, |
---|
678 | 677 | }; |
---|
679 | 678 | |
---|
.. | .. |
---|
873 | 872 | ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, |
---|
874 | 873 | MPU3050_PWR_MGM_SLEEP, 0); |
---|
875 | 874 | if (ret) { |
---|
| 875 | + regulator_bulk_disable(ARRAY_SIZE(mpu3050->regs), mpu3050->regs); |
---|
876 | 876 | dev_err(mpu3050->dev, "error setting power mode\n"); |
---|
877 | 877 | return ret; |
---|
878 | 878 | } |
---|
879 | | - msleep(10); |
---|
| 879 | + usleep_range(10000, 20000); |
---|
880 | 880 | |
---|
881 | 881 | return 0; |
---|
882 | 882 | } |
---|
.. | .. |
---|
1161 | 1161 | mpu3050->divisor = 99; |
---|
1162 | 1162 | |
---|
1163 | 1163 | /* Read the mounting matrix, if present */ |
---|
1164 | | - ret = of_iio_read_mount_matrix(dev, "mount-matrix", |
---|
1165 | | - &mpu3050->orientation); |
---|
| 1164 | + ret = iio_read_mount_matrix(dev, "mount-matrix", &mpu3050->orientation); |
---|
1166 | 1165 | if (ret) |
---|
1167 | 1166 | return ret; |
---|
1168 | 1167 | |
---|
.. | .. |
---|
1209 | 1208 | if (ret) |
---|
1210 | 1209 | goto err_power_down; |
---|
1211 | 1210 | |
---|
1212 | | - indio_dev->dev.parent = dev; |
---|
1213 | 1211 | indio_dev->channels = mpu3050_channels; |
---|
1214 | 1212 | indio_dev->num_channels = ARRAY_SIZE(mpu3050_channels); |
---|
1215 | 1213 | indio_dev->info = &mpu3050_info; |
---|