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>-gyro to maintain
27 .compatible = "st,l3g4200d-gyro",
31 .compatible = "st,lsm330d-gyro",
35 .compatible = "st,lsm330dl-gyro",
39 .compatible = "st,lsm330dlc-gyro",
43 .compatible = "st,l3gd20-gyro",
47 .compatible = "st,l3gd20h-gyro",
51 .compatible = "st,l3g4is-gyro",
55 .compatible = "st,lsm330-gyro",
59 .compatible = "st,lsm9ds0-gyro",
66 static int st_gyro_spi_probe(struct spi_device *spi) in st_gyro_spi_probe() argument
73 st_sensors_dev_name_probe(&spi->dev, spi->modalias, sizeof(spi->modalias)); in st_gyro_spi_probe()
75 settings = st_gyro_get_settings(spi->modalias); in st_gyro_spi_probe()
77 dev_err(&spi->dev, "device name %s not recognized.\n", in st_gyro_spi_probe()
78 spi->modalias); in st_gyro_spi_probe()
79 return -ENODEV; in st_gyro_spi_probe()
82 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*gdata)); in st_gyro_spi_probe()
84 return -ENOMEM; in st_gyro_spi_probe()
87 gdata->sensor_settings = (struct st_sensor_settings *)settings; in st_gyro_spi_probe()
89 err = st_sensors_spi_configure(indio_dev, spi); in st_gyro_spi_probe()
112 MODULE_DEVICE_TABLE(spi, st_gyro_id_table);
116 .name = "st-gyro-spi",
125 MODULE_DESCRIPTION("STMicroelectronics gyroscopes spi driver");