linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Ardö" <bjorn.ardo@axis.com>
To: <wsa@kernel.org>
Cc: linux-i2c@vger.kernel.org, kernel@axis.com,
	"Björn Ardö" <bjorn.ardo@axis.com>
Subject: [PATCH] i2c: slave-eeprom: add an of_match_table
Date: Tue, 4 May 2021 15:52:09 +0200	[thread overview]
Message-ID: <20210504135209.4757-1-bjorn.ardo@axis.com> (raw)

This is needed since commit af503716ac14 ("i2c: core: report OF style
module alias for devices registered via OF").

Signed-off-by: Björn Ardö <bjorn.ardo@axis.com>
---
 drivers/i2c/i2c-slave-eeprom.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c
index 5c7ae421cacf..89274b72b369 100644
--- a/drivers/i2c/i2c-slave-eeprom.c
+++ b/drivers/i2c/i2c-slave-eeprom.c
@@ -204,9 +204,23 @@ static const struct i2c_device_id i2c_slave_eeprom_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, i2c_slave_eeprom_id);
 
+static const struct of_device_id i2c_slave_eeprom_match[] = {
+	{ .compatible = "linux,slave-24c02", },
+	{ .compatible = "linux,slave-24c02ro", },
+	{ .compatible = "linux,slave-24c32", },
+	{ .compatible = "linux,slave-24c32ro", },
+	{ .compatible = "linux,slave-24c64", },
+	{ .compatible = "linux,slave-24c64ro", },
+	{ .compatible = "linux,slave-24c512", },
+	{ .compatible = "linux,slave-24c512ro", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, i2c_slave_eeprom_match);
+
 static struct i2c_driver i2c_slave_eeprom_driver = {
 	.driver = {
 		.name = "i2c-slave-eeprom",
+		.of_match_table = i2c_slave_eeprom_match,
 	},
 	.probe = i2c_slave_eeprom_probe,
 	.remove = i2c_slave_eeprom_remove,
-- 
2.20.1


             reply	other threads:[~2021-05-04 13:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 13:52 Björn Ardö [this message]
2021-06-26 10:31 ` [PATCH] i2c: slave-eeprom: add an of_match_table Wolfram Sang
2021-08-20 12:07   ` Bjorn Ardo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210504135209.4757-1-bjorn.ardo@axis.com \
    --to=bjorn.ardo@axis.com \
    --cc=kernel@axis.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).