| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | #include <linux/module.h> |
|---|
| 2 | 3 | #include <linux/i2c.h> |
|---|
| 3 | | -#include <linux/acpi.h> |
|---|
| 4 | | -#include <linux/of.h> |
|---|
| 5 | 4 | #include <linux/regmap.h> |
|---|
| 6 | 5 | |
|---|
| 7 | 6 | #include "bmp280.h" |
|---|
| .. | .. |
|---|
| 37 | 36 | client->irq); |
|---|
| 38 | 37 | } |
|---|
| 39 | 38 | |
|---|
| 40 | | -static int bmp280_i2c_remove(struct i2c_client *client) |
|---|
| 41 | | -{ |
|---|
| 42 | | - return bmp280_common_remove(&client->dev); |
|---|
| 43 | | -} |
|---|
| 44 | | - |
|---|
| 45 | | -static const struct acpi_device_id bmp280_acpi_i2c_match[] = { |
|---|
| 46 | | - {"BMP0280", BMP280_CHIP_ID }, |
|---|
| 47 | | - {"BMP0180", BMP180_CHIP_ID }, |
|---|
| 48 | | - {"BMP0085", BMP180_CHIP_ID }, |
|---|
| 49 | | - {"BME0280", BME280_CHIP_ID }, |
|---|
| 50 | | - { }, |
|---|
| 51 | | -}; |
|---|
| 52 | | -MODULE_DEVICE_TABLE(acpi, bmp280_acpi_i2c_match); |
|---|
| 53 | | - |
|---|
| 54 | | -#ifdef CONFIG_OF |
|---|
| 55 | 39 | static const struct of_device_id bmp280_of_i2c_match[] = { |
|---|
| 56 | 40 | { .compatible = "bosch,bme280", .data = (void *)BME280_CHIP_ID }, |
|---|
| 57 | 41 | { .compatible = "bosch,bmp280", .data = (void *)BMP280_CHIP_ID }, |
|---|
| .. | .. |
|---|
| 60 | 44 | { }, |
|---|
| 61 | 45 | }; |
|---|
| 62 | 46 | MODULE_DEVICE_TABLE(of, bmp280_of_i2c_match); |
|---|
| 63 | | -#else |
|---|
| 64 | | -#define bmp280_of_i2c_match NULL |
|---|
| 65 | | -#endif |
|---|
| 66 | 47 | |
|---|
| 67 | 48 | static const struct i2c_device_id bmp280_i2c_id[] = { |
|---|
| 68 | 49 | {"bmp280", BMP280_CHIP_ID }, |
|---|
| .. | .. |
|---|
| 76 | 57 | static struct i2c_driver bmp280_i2c_driver = { |
|---|
| 77 | 58 | .driver = { |
|---|
| 78 | 59 | .name = "bmp280", |
|---|
| 79 | | - .acpi_match_table = ACPI_PTR(bmp280_acpi_i2c_match), |
|---|
| 80 | | - .of_match_table = of_match_ptr(bmp280_of_i2c_match), |
|---|
| 60 | + .of_match_table = bmp280_of_i2c_match, |
|---|
| 81 | 61 | .pm = &bmp280_dev_pm_ops, |
|---|
| 82 | 62 | }, |
|---|
| 83 | 63 | .probe = bmp280_i2c_probe, |
|---|
| 84 | | - .remove = bmp280_i2c_remove, |
|---|
| 85 | 64 | .id_table = bmp280_i2c_id, |
|---|
| 86 | 65 | }; |
|---|
| 87 | 66 | module_i2c_driver(bmp280_i2c_driver); |
|---|