dt-bindings: mtd: ingenic: Use standard ecc-engine property
[linux/fpc-iii.git] / drivers / iio / accel / adxl372_spi.c
blobe14e655ef1652ff4ab3de4fc9c267c9ff699985c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * ADXL372 3-Axis Digital Accelerometer SPI driver
5 * Copyright 2018 Analog Devices Inc.
6 */
8 #include <linux/module.h>
9 #include <linux/regmap.h>
10 #include <linux/spi/spi.h>
12 #include "adxl372.h"
14 static const struct regmap_config adxl372_spi_regmap_config = {
15 .reg_bits = 7,
16 .pad_bits = 1,
17 .val_bits = 8,
18 .read_flag_mask = BIT(0),
19 .readable_noinc_reg = adxl372_readable_noinc_reg,
22 static int adxl372_spi_probe(struct spi_device *spi)
24 const struct spi_device_id *id = spi_get_device_id(spi);
25 struct regmap *regmap;
27 regmap = devm_regmap_init_spi(spi, &adxl372_spi_regmap_config);
28 if (IS_ERR(regmap))
29 return PTR_ERR(regmap);
31 return adxl372_probe(&spi->dev, regmap, spi->irq, id->name);
34 static const struct spi_device_id adxl372_spi_id[] = {
35 { "adxl372", 0 },
38 MODULE_DEVICE_TABLE(spi, adxl372_spi_id);
40 static struct spi_driver adxl372_spi_driver = {
41 .driver = {
42 .name = "adxl372_spi",
44 .probe = adxl372_spi_probe,
45 .id_table = adxl372_spi_id,
48 module_spi_driver(adxl372_spi_driver);
50 MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>");
51 MODULE_DESCRIPTION("Analog Devices ADXL372 3-axis accelerometer SPI driver");
52 MODULE_LICENSE("GPL");