1 // SPDX-License-Identifier: GPL-2.0
3 * FXOS8700 - NXP IMU, SPI bits
5 #include <linux/module.h>
6 #include <linux/mod_devicetable.h>
7 #include <linux/regmap.h>
8 #include <linux/spi/spi.h>
12 static int fxos8700_spi_probe(struct spi_device *spi)
14 struct regmap *regmap;
15 const struct spi_device_id *id = spi_get_device_id(spi);
17 regmap = devm_regmap_init_spi(spi, &fxos8700_regmap_config);
19 dev_err(&spi->dev, "Failed to register spi regmap %ld\n", PTR_ERR(regmap));
20 return PTR_ERR(regmap);
23 return fxos8700_core_probe(&spi->dev, regmap, id->name, true);
26 static const struct spi_device_id fxos8700_spi_id[] = {
30 MODULE_DEVICE_TABLE(spi, fxos8700_spi_id);
32 static const struct acpi_device_id fxos8700_acpi_match[] = {
36 MODULE_DEVICE_TABLE(acpi, fxos8700_acpi_match);
38 static const struct of_device_id fxos8700_of_match[] = {
39 { .compatible = "nxp,fxos8700" },
42 MODULE_DEVICE_TABLE(of, fxos8700_of_match);
44 static struct spi_driver fxos8700_spi_driver = {
45 .probe = fxos8700_spi_probe,
46 .id_table = fxos8700_spi_id,
48 .acpi_match_table = fxos8700_acpi_match,
49 .of_match_table = fxos8700_of_match,
50 .name = "fxos8700_spi",
53 module_spi_driver(fxos8700_spi_driver);
55 MODULE_AUTHOR("Robert Jones <rjones@gateworks.com>");
56 MODULE_DESCRIPTION("FXOS8700 SPI driver");
57 MODULE_LICENSE("GPL v2");