1 // SPDX-License-Identifier: GPL-2.0
3 * FXOS8700 - NXP IMU, I2C bits
5 * 7-bit I2C slave address determined by SA1 and SA0 logic level
6 * inputs represented in the following table:
7 * SA1 | SA0 | Slave Address
13 #include <linux/acpi.h>
14 #include <linux/i2c.h>
15 #include <linux/module.h>
16 #include <linux/mod_devicetable.h>
17 #include <linux/regmap.h>
21 static int fxos8700_i2c_probe(struct i2c_client
*client
,
22 const struct i2c_device_id
*id
)
24 struct regmap
*regmap
;
25 const char *name
= NULL
;
27 regmap
= devm_regmap_init_i2c(client
, &fxos8700_regmap_config
);
29 dev_err(&client
->dev
, "Failed to register i2c regmap %d\n",
30 (int)PTR_ERR(regmap
));
31 return PTR_ERR(regmap
);
37 return fxos8700_core_probe(&client
->dev
, regmap
, name
, false);
40 static const struct i2c_device_id fxos8700_i2c_id
[] = {
44 MODULE_DEVICE_TABLE(i2c
, fxos8700_i2c_id
);
46 static const struct acpi_device_id fxos8700_acpi_match
[] = {
50 MODULE_DEVICE_TABLE(acpi
, fxos8700_acpi_match
);
52 static const struct of_device_id fxos8700_of_match
[] = {
53 { .compatible
= "nxp,fxos8700" },
56 MODULE_DEVICE_TABLE(of
, fxos8700_of_match
);
58 static struct i2c_driver fxos8700_i2c_driver
= {
60 .name
= "fxos8700_i2c",
61 .acpi_match_table
= ACPI_PTR(fxos8700_acpi_match
),
62 .of_match_table
= fxos8700_of_match
,
64 .probe
= fxos8700_i2c_probe
,
65 .id_table
= fxos8700_i2c_id
,
67 module_i2c_driver(fxos8700_i2c_driver
);
69 MODULE_AUTHOR("Robert Jones <rjones@gateworks.com>");
70 MODULE_DESCRIPTION("FXOS8700 I2C driver");
71 MODULE_LICENSE("GPL v2");