Lines Matching +full:spi +full:- +full:compatible
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2012-2013 STMicroelectronics Inc.
13 #include <linux/spi/spi.h>
21 * For new single-chip sensors use <device_name> as compatible string.
22 * For old single-chip devices keep <device_name>-accel to maintain
27 /* An older compatible */
28 .compatible = "st,lis302dl-spi",
32 .compatible = "st,lis3lv02dl-accel",
36 .compatible = "st,lis3dh-accel",
40 .compatible = "st,lsm330d-accel",
44 .compatible = "st,lsm330dl-accel",
48 .compatible = "st,lsm330dlc-accel",
52 .compatible = "st,lis331dlh-accel",
56 .compatible = "st,lsm330-accel",
60 .compatible = "st,lsm303agr-accel",
64 .compatible = "st,lis2dh12-accel",
68 .compatible = "st,lis3l02dq",
72 .compatible = "st,lng2dm-accel",
76 .compatible = "st,h3lis331dl-accel",
80 .compatible = "st,lis331dl-accel",
84 .compatible = "st,lis2dw12",
88 .compatible = "st,lis3dhh",
92 .compatible = "st,lis3de",
96 .compatible = "st,lis302dl",
103 static int st_accel_spi_probe(struct spi_device *spi) in st_accel_spi_probe() argument
110 st_sensors_dev_name_probe(&spi->dev, spi->modalias, sizeof(spi->modalias)); in st_accel_spi_probe()
112 settings = st_accel_get_settings(spi->modalias); in st_accel_spi_probe()
114 dev_err(&spi->dev, "device name %s not recognized.\n", in st_accel_spi_probe()
115 spi->modalias); in st_accel_spi_probe()
116 return -ENODEV; in st_accel_spi_probe()
119 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adata)); in st_accel_spi_probe()
121 return -ENOMEM; in st_accel_spi_probe()
124 adata->sensor_settings = (struct st_sensor_settings *)settings; in st_accel_spi_probe()
126 err = st_sensors_spi_configure(indio_dev, spi); in st_accel_spi_probe()
157 MODULE_DEVICE_TABLE(spi, st_accel_id_table);
161 .name = "st-accel-spi",
170 MODULE_DESCRIPTION("STMicroelectronics accelerometers spi driver");