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>-magn to maintain
24 * For multi-chip devices, use <device_name>-magn to distinguish which
29 .compatible = "st,lis3mdl-magn",
33 .compatible = "st,lsm303agr-magn",
37 .compatible = "st,lis2mdl",
41 .compatible = "st,lsm9ds1-magn",
45 .compatible = "st,iis2mdc",
52 static int st_magn_spi_probe(struct spi_device *spi) in st_magn_spi_probe() argument
59 st_sensors_dev_name_probe(&spi->dev, spi->modalias, sizeof(spi->modalias)); in st_magn_spi_probe()
61 settings = st_magn_get_settings(spi->modalias); in st_magn_spi_probe()
63 dev_err(&spi->dev, "device name %s not recognized.\n", in st_magn_spi_probe()
64 spi->modalias); in st_magn_spi_probe()
65 return -ENODEV; in st_magn_spi_probe()
68 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*mdata)); in st_magn_spi_probe()
70 return -ENOMEM; in st_magn_spi_probe()
73 mdata->sensor_settings = (struct st_sensor_settings *)settings; in st_magn_spi_probe()
75 err = st_sensors_spi_configure(indio_dev, spi); in st_magn_spi_probe()
94 MODULE_DEVICE_TABLE(spi, st_magn_id_table);
98 .name = "st-magn-spi",
107 MODULE_DESCRIPTION("STMicroelectronics magnetometers spi driver");