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 chip_info = device_get_match_data(&spi->dev); in bmp280_spi_probe()
63 chip_info = (const struct bmp280_chip_info *) id->driver_data; in bmp280_spi_probe()
65 regmap = devm_regmap_init(&spi->dev, in bmp280_spi_probe()
67 &spi->dev, in bmp280_spi_probe()
68 chip_info->regmap_config); in bmp280_spi_probe()
70 dev_err(&spi->dev, "failed to allocate register map\n"); in bmp280_spi_probe()
74 return bmp280_common_probe(&spi->dev, in bmp280_spi_probe()
77 id->name, in bmp280_spi_probe()
78 spi->irq); in bmp280_spi_probe()
82 { .compatible = "bosch,bmp085", .data = &bmp180_chip_info },
83 { .compatible = "bosch,bmp180", .data = &bmp180_chip_info },
84 { .compatible = "bosch,bmp181", .data = &bmp180_chip_info },
85 { .compatible = "bosch,bmp280", .data = &bmp280_chip_info },
86 { .compatible = "bosch,bme280", .data = &bme280_chip_info },
87 { .compatible = "bosch,bmp380", .data = &bmp380_chip_info },
88 { .compatible = "bosch,bmp580", .data = &bmp580_chip_info },
103 MODULE_DEVICE_TABLE(spi, bmp280_spi_id);
116 MODULE_DESCRIPTION("BMP280 SPI bus driver");