Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75eadb8f authored by Marcin Niestroj's avatar Marcin Niestroj Committed by Jonathan Cameron
Browse files

iio: bmi160: Add of device table for spi



From now on we can add bmi160 device to device-tree by specifying
compatible string.

Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 968bdbf8
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -7,10 +7,11 @@
 * the GNU General Public License.  See the file COPYING in the main
 * directory of this archive for more details.
 */
#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/acpi.h>
#include <linux/spi/spi.h>

#include "bmi160.h"

@@ -47,12 +48,21 @@ static const struct acpi_device_id bmi160_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);

#ifdef CONFIG_OF
static const struct of_device_id bmi160_of_match[] = {
	{ .compatible = "bosch,bmi160" },
	{ },
};
MODULE_DEVICE_TABLE(of, bmi160_of_match);
#endif

static struct spi_driver bmi160_spi_driver = {
	.probe		= bmi160_spi_probe,
	.remove		= bmi160_spi_remove,
	.id_table	= bmi160_spi_id,
	.driver = {
		.acpi_match_table	= ACPI_PTR(bmi160_acpi_match),
		.of_match_table		= of_match_ptr(bmi160_of_match),
		.name			= "bmi160_spi",
	},
};