2 #include <linux/regmap.h>
3 #include <linux/iio/iio.h>
4 #include <linux/module.h>
5 #include <linux/acpi.h>
9 static const struct regmap_config bmg160_regmap_i2c_conf
= {
15 static int bmg160_i2c_probe(struct i2c_client
*client
,
16 const struct i2c_device_id
*id
)
18 struct regmap
*regmap
;
19 const char *name
= NULL
;
21 regmap
= devm_regmap_init_i2c(client
, &bmg160_regmap_i2c_conf
);
23 dev_err(&client
->dev
, "Failed to register i2c regmap %d\n",
24 (int)PTR_ERR(regmap
));
25 return PTR_ERR(regmap
);
31 return bmg160_core_probe(&client
->dev
, regmap
, client
->irq
, name
);
34 static int bmg160_i2c_remove(struct i2c_client
*client
)
36 bmg160_core_remove(&client
->dev
);
41 static const struct acpi_device_id bmg160_acpi_match
[] = {
47 MODULE_DEVICE_TABLE(acpi
, bmg160_acpi_match
);
49 static const struct i2c_device_id bmg160_i2c_id
[] = {
55 MODULE_DEVICE_TABLE(i2c
, bmg160_i2c_id
);
57 static struct i2c_driver bmg160_i2c_driver
= {
60 .acpi_match_table
= ACPI_PTR(bmg160_acpi_match
),
63 .probe
= bmg160_i2c_probe
,
64 .remove
= bmg160_i2c_remove
,
65 .id_table
= bmg160_i2c_id
,
67 module_i2c_driver(bmg160_i2c_driver
);
69 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
70 MODULE_LICENSE("GPL v2");
71 MODULE_DESCRIPTION("BMG160 I2C Gyro driver");