2 * IIO accel SPI driver for Freescale MMA7455L 3-axis 10-bit accelerometer
3 * Copyright 2015 Joachim Eastwood <manabian@gmail.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
10 #include <linux/module.h>
11 #include <linux/regmap.h>
12 #include <linux/spi/spi.h>
16 static int mma7455_spi_probe(struct spi_device
*spi
)
18 const struct spi_device_id
*id
= spi_get_device_id(spi
);
19 struct regmap
*regmap
;
21 regmap
= devm_regmap_init_spi(spi
, &mma7455_core_regmap
);
23 return PTR_ERR(regmap
);
25 return mma7455_core_probe(&spi
->dev
, regmap
, id
->name
);
28 static int mma7455_spi_remove(struct spi_device
*spi
)
30 return mma7455_core_remove(&spi
->dev
);
33 static const struct spi_device_id mma7455_spi_ids
[] = {
38 MODULE_DEVICE_TABLE(spi
, mma7455_spi_ids
);
40 static struct spi_driver mma7455_spi_driver
= {
41 .probe
= mma7455_spi_probe
,
42 .remove
= mma7455_spi_remove
,
43 .id_table
= mma7455_spi_ids
,
45 .name
= "mma7455-spi",
48 module_spi_driver(mma7455_spi_driver
);
50 MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
51 MODULE_DESCRIPTION("Freescale MMA7455L SPI accelerometer driver");
52 MODULE_LICENSE("GPL v2");