forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
....@@ -67,11 +67,6 @@
6767 };
6868
6969 static const struct inv_icm42600_hw inv_icm42600_hw[INV_CHIP_NB] = {
70
- [INV_CHIP_ICM40608] = {
71
- .whoami = INV_ICM42600_WHOAMI_ICM40608,
72
- .name = "icm40608",
73
- .conf = &inv_icm42600_default_conf,
74
- },
7570 [INV_CHIP_ICM42600] = {
7671 .whoami = INV_ICM42600_WHOAMI_ICM42600,
7772 .name = "icm42600",
....@@ -95,10 +90,10 @@
9590 };
9691
9792 const struct iio_mount_matrix *
98
-inv_icm42600_get_mount_matrix(struct iio_dev *indio_dev,
93
+inv_icm42600_get_mount_matrix(const struct iio_dev *indio_dev,
9994 const struct iio_chan_spec *chan)
10095 {
101
- struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
96
+ const struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
10297
10398 return &st->orientation;
10499 }
....@@ -570,7 +565,7 @@
570565 bool open_drain;
571566 int ret;
572567
573
- if (chip < 0 || chip >= INV_CHIP_NB) {
568
+ if (chip <= INV_CHIP_INVALID || chip >= INV_CHIP_NB) {
574569 dev_err(dev, "invalid chip = %d\n", chip);
575570 return -ENODEV;
576571 }
....@@ -597,7 +592,7 @@
597592 st->chip = chip;
598593 st->map = regmap;
599594
600
- ret = of_iio_read_mount_matrix(dev, "mount-matrix", &st->orientation);
595
+ ret = iio_read_mount_matrix(dev, "mount-matrix", &st->orientation);
601596 if (ret) {
602597 dev_err(dev, "failed to retrieve mounting matrix %d\n", ret);
603598 return ret;