forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * STMicroelectronics st_lsm6dsx i2c driver
34 *
....@@ -5,15 +6,12 @@
56 *
67 * Lorenzo Bianconi <lorenzo.bianconi@st.com>
78 * Denis Ciocca <denis.ciocca@st.com>
8
- *
9
- * Licensed under the GPL-2.
109 */
1110
1211 #include <linux/kernel.h>
1312 #include <linux/module.h>
1413 #include <linux/i2c.h>
1514 #include <linux/slab.h>
16
-#include <linux/of.h>
1715 #include <linux/regmap.h>
1816
1917 #include "st_lsm6dsx.h"
....@@ -36,8 +34,7 @@
3634 return PTR_ERR(regmap);
3735 }
3836
39
- return st_lsm6dsx_probe(&client->dev, client->irq,
40
- hw_id, id->name, regmap);
37
+ return st_lsm6dsx_probe(&client->dev, client->irq, hw_id, regmap);
4138 }
4239
4340 static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
....@@ -61,6 +58,42 @@
6158 .compatible = "st,ism330dlc",
6259 .data = (void *)ST_ISM330DLC_ID,
6360 },
61
+ {
62
+ .compatible = "st,lsm6dso",
63
+ .data = (void *)ST_LSM6DSO_ID,
64
+ },
65
+ {
66
+ .compatible = "st,asm330lhh",
67
+ .data = (void *)ST_ASM330LHH_ID,
68
+ },
69
+ {
70
+ .compatible = "st,lsm6dsox",
71
+ .data = (void *)ST_LSM6DSOX_ID,
72
+ },
73
+ {
74
+ .compatible = "st,lsm6dsr",
75
+ .data = (void *)ST_LSM6DSR_ID,
76
+ },
77
+ {
78
+ .compatible = "st,lsm6ds3tr-c",
79
+ .data = (void *)ST_LSM6DS3TRC_ID,
80
+ },
81
+ {
82
+ .compatible = "st,ism330dhcx",
83
+ .data = (void *)ST_ISM330DHCX_ID,
84
+ },
85
+ {
86
+ .compatible = "st,lsm9ds1-imu",
87
+ .data = (void *)ST_LSM9DS1_ID,
88
+ },
89
+ {
90
+ .compatible = "st,lsm6ds0",
91
+ .data = (void *)ST_LSM6DS0_ID,
92
+ },
93
+ {
94
+ .compatible = "st,lsm6dsrx",
95
+ .data = (void *)ST_LSM6DSRX_ID,
96
+ },
6497 {},
6598 };
6699 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
....@@ -71,6 +104,15 @@
71104 { ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
72105 { ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
73106 { ST_ISM330DLC_DEV_NAME, ST_ISM330DLC_ID },
107
+ { ST_LSM6DSO_DEV_NAME, ST_LSM6DSO_ID },
108
+ { ST_ASM330LHH_DEV_NAME, ST_ASM330LHH_ID },
109
+ { ST_LSM6DSOX_DEV_NAME, ST_LSM6DSOX_ID },
110
+ { ST_LSM6DSR_DEV_NAME, ST_LSM6DSR_ID },
111
+ { ST_LSM6DS3TRC_DEV_NAME, ST_LSM6DS3TRC_ID },
112
+ { ST_ISM330DHCX_DEV_NAME, ST_ISM330DHCX_ID },
113
+ { ST_LSM9DS1_DEV_NAME, ST_LSM9DS1_ID },
114
+ { ST_LSM6DS0_DEV_NAME, ST_LSM6DS0_ID },
115
+ { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID },
74116 {},
75117 };
76118 MODULE_DEVICE_TABLE(i2c, st_lsm6dsx_i2c_id_table);
....@@ -79,7 +121,7 @@
79121 .driver = {
80122 .name = "st_lsm6dsx_i2c",
81123 .pm = &st_lsm6dsx_pm_ops,
82
- .of_match_table = of_match_ptr(st_lsm6dsx_i2c_of_match),
124
+ .of_match_table = st_lsm6dsx_i2c_of_match,
83125 },
84126 .probe = st_lsm6dsx_i2c_probe,
85127 .id_table = st_lsm6dsx_i2c_id_table,