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
11 #include <linux/spi/spi.h>
18 struct spi_device *spi = to_spi_device(context); 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()
34 struct spi_device *spi = to_spi_device(context); in bmp280_regmap_spi_read() local
36 return spi_write_then_read(spi, reg, reg_size, val, val_size); in bmp280_regmap_spi_read()
42 struct spi_device *spi = to_spi_device(context); in bmp380_regmap_spi_read() local
47 return -EINVAL; in bmp380_regmap_spi_read()
50 * According to the BMP3xx datasheets, for a basic SPI read opertion, in bmp380_regmap_spi_read()
54 status = spi_write_then_read(spi, reg, 1, rx_buf, val_size + 1); in bmp380_regmap_spi_read()
78 static int bmp280_spi_probe(struct spi_device *spi) in bmp280_spi_probe() argument
80 const struct spi_device_id *id = spi_get_device_id(spi); in bmp280_spi_probe()
85 chip_info = spi_get_device_match_data(spi); in bmp280_spi_probe()
87 if (chip_info->spi_read_extra_byte) in bmp280_spi_probe()
92 regmap = devm_regmap_init(&spi->dev, in bmp280_spi_probe()
94 &spi->dev, in bmp280_spi_probe()
95 chip_info->regmap_config); in bmp280_spi_probe()
97 dev_err(&spi->dev, "failed to allocate register map\n"); in bmp280_spi_probe()
101 return bmp280_common_probe(&spi->dev, in bmp280_spi_probe()
104 id->name, in bmp280_spi_probe()
105 spi->irq); in bmp280_spi_probe()
109 { .compatible = "bosch,bmp085", .data = &bmp085_chip_info },
110 { .compatible = "bosch,bmp180", .data = &bmp180_chip_info },
111 { .compatible = "bosch,bmp181", .data = &bmp180_chip_info },
112 { .compatible = "bosch,bmp280", .data = &bmp280_chip_info },
113 { .compatible = "bosch,bme280", .data = &bme280_chip_info },
114 { .compatible = "bosch,bmp380", .data = &bmp380_chip_info },
115 { .compatible = "bosch,bmp580", .data = &bmp580_chip_info },
130 MODULE_DEVICE_TABLE(spi, bmp280_spi_id);
143 MODULE_DESCRIPTION("BMP280 SPI bus driver");