Commit ac363ace authored by Kevin P. Fleming's avatar Kevin P. Fleming Committed by Alexandre Belloni
Browse files

rtc: abx80x: Add Device Tree matching table



Enable automatic loading of the module when a Device Tree overlay
specifies a device supported by this driver.

Signed-off-by: default avatarKevin P. Fleming <kevin+linux@km6g.us>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200528114617.166587-1-kevin+linux@km6g.us
parent c3b29bf6
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/bcd.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/rtc.h>
#include <linux/watchdog.h>

@@ -863,9 +864,57 @@ static const struct i2c_device_id abx80x_id[] = {
};
MODULE_DEVICE_TABLE(i2c, abx80x_id);

#ifdef CONFIG_OF
static const struct of_device_id abx80x_of_match[] = {
	{
		.compatible = "abracon,abx80x",
		.data = (void *)ABX80X
	},
	{
		.compatible = "abracon,ab0801",
		.data = (void *)AB0801
	},
	{
		.compatible = "abracon,ab0803",
		.data = (void *)AB0803
	},
	{
		.compatible = "abracon,ab0804",
		.data = (void *)AB0804
	},
	{
		.compatible = "abracon,ab0805",
		.data = (void *)AB0805
	},
	{
		.compatible = "abracon,ab1801",
		.data = (void *)AB1801
	},
	{
		.compatible = "abracon,ab1803",
		.data = (void *)AB1803
	},
	{
		.compatible = "abracon,ab1804",
		.data = (void *)AB1804
	},
	{
		.compatible = "abracon,ab1805",
		.data = (void *)AB1805
	},
	{
		.compatible = "microcrystal,rv1805",
		.data = (void *)RV1805
	},
	{ }
};
MODULE_DEVICE_TABLE(of, abx80x_of_match);
#endif

static struct i2c_driver abx80x_driver = {
	.driver		= {
		.name	= "rtc-abx80x",
		.of_match_table = of_match_ptr(abx80x_of_match),
	},
	.probe		= abx80x_probe,
	.id_table	= abx80x_id,