Lines Matching +full:spi +full:- +full:compatible
1 // SPDX-License-Identifier: GPL-2.0-only
3 * SPI interface for the BMP280 driver
5 * Inspired by the older BMP085 driver drivers/misc/bmp085-spi.c
8 #include <linux/spi/spi.h>
18 struct spi_device *spi = to_spi_device(dev); in bmp280_regmap_spi_write() local
23 * The SPI register address (= full register address without bit 7) and in bmp280_regmap_spi_write()
28 return spi_write_then_read(spi, buf, 2, NULL, 0); in bmp280_regmap_spi_write()
35 struct spi_device *spi = to_spi_device(dev); in bmp280_regmap_spi_read() local
37 return spi_write_then_read(spi, reg, reg_size, val, val_size); in bmp280_regmap_spi_read()
47 static int bmp280_spi_probe(struct spi_device *spi) in bmp280_spi_probe() argument
49 const struct spi_device_id *id = spi_get_device_id(spi); in bmp280_spi_probe()
54 spi->bits_per_word = 8; in bmp280_spi_probe()
55 ret = spi_setup(spi); in bmp280_spi_probe()
57 dev_err(&spi->dev, "spi_setup failed!\n"); in bmp280_spi_probe()
61 switch (id->driver_data) { in bmp280_spi_probe()
73 return -EINVAL; in bmp280_spi_probe()
76 regmap = devm_regmap_init(&spi->dev, in bmp280_spi_probe()
78 &spi->dev, in bmp280_spi_probe()
81 dev_err(&spi->dev, "failed to allocate register map\n"); in bmp280_spi_probe()
85 return bmp280_common_probe(&spi->dev, in bmp280_spi_probe()
87 id->driver_data, in bmp280_spi_probe()
88 id->name, in bmp280_spi_probe()
89 spi->irq); in bmp280_spi_probe()
93 { .compatible = "bosch,bmp085", },
94 { .compatible = "bosch,bmp180", },
95 { .compatible = "bosch,bmp181", },
96 { .compatible = "bosch,bmp280", },
97 { .compatible = "bosch,bme280", },
98 { .compatible = "bosch,bmp380", },
111 MODULE_DEVICE_TABLE(spi, bmp280_spi_id);
124 MODULE_DESCRIPTION("BMP280 SPI bus driver");