.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | #include <linux/i2c.h> |
---|
2 | 3 | #include <linux/regmap.h> |
---|
3 | 4 | #include <linux/iio/iio.h> |
---|
.. | .. |
---|
20 | 21 | |
---|
21 | 22 | regmap = devm_regmap_init_i2c(client, &bmg160_regmap_i2c_conf); |
---|
22 | 23 | if (IS_ERR(regmap)) { |
---|
23 | | - dev_err(&client->dev, "Failed to register i2c regmap %d\n", |
---|
24 | | - (int)PTR_ERR(regmap)); |
---|
| 24 | + dev_err(&client->dev, "Failed to register i2c regmap: %pe\n", |
---|
| 25 | + regmap); |
---|
25 | 26 | return PTR_ERR(regmap); |
---|
26 | 27 | } |
---|
27 | 28 | |
---|
.. | .. |
---|
41 | 42 | static const struct acpi_device_id bmg160_acpi_match[] = { |
---|
42 | 43 | {"BMG0160", 0}, |
---|
43 | 44 | {"BMI055B", 0}, |
---|
| 45 | + {"BMI088B", 0}, |
---|
44 | 46 | {}, |
---|
45 | 47 | }; |
---|
46 | 48 | |
---|
.. | .. |
---|
49 | 51 | static const struct i2c_device_id bmg160_i2c_id[] = { |
---|
50 | 52 | {"bmg160", 0}, |
---|
51 | 53 | {"bmi055_gyro", 0}, |
---|
| 54 | + {"bmi088_gyro", 0}, |
---|
52 | 55 | {} |
---|
53 | 56 | }; |
---|
54 | 57 | |
---|
55 | 58 | MODULE_DEVICE_TABLE(i2c, bmg160_i2c_id); |
---|
56 | 59 | |
---|
| 60 | +static const struct of_device_id bmg160_of_match[] = { |
---|
| 61 | + { .compatible = "bosch,bmg160" }, |
---|
| 62 | + { .compatible = "bosch,bmi055_gyro" }, |
---|
| 63 | + { } |
---|
| 64 | +}; |
---|
| 65 | + |
---|
| 66 | +MODULE_DEVICE_TABLE(of, bmg160_of_match); |
---|
| 67 | + |
---|
57 | 68 | static struct i2c_driver bmg160_i2c_driver = { |
---|
58 | 69 | .driver = { |
---|
59 | 70 | .name = "bmg160_i2c", |
---|
60 | 71 | .acpi_match_table = ACPI_PTR(bmg160_acpi_match), |
---|
| 72 | + .of_match_table = bmg160_of_match, |
---|
61 | 73 | .pm = &bmg160_pm_ops, |
---|
62 | 74 | }, |
---|
63 | 75 | .probe = bmg160_i2c_probe, |
---|