summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorJohannes Kirchmair <johannes.kirchmair@sigmatek.at>2023-03-27 10:55:50 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2023-06-26 01:05:13 +0200
commit7e2a60efab8ad901c4743137857c1c5e18e27ed8 (patch)
treebaa7c52d938fe2a0a9f4f11a78ec745d303551d9 /drivers/rtc
parentfdd63f65ac25d0851dade4c7ba94a7a882b8d9c2 (diff)
rtc: rv3028: make rv3028 probeable from userspace
With this commit, it will be possible to bind a rv3028 device from userspace This is done by: echo rtc-rv3028 0x52 > /sys/bus/i2c/devices/i2c-XX/new_device Signed-off-by: Johannes Kirchmair <johannes.kirchmair@sigmatek.at> Link: https://lore.kernel.org/r/20230327085550.1721861-1-johannes.kirchmair@sigmatek.at Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-rv3028.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index 5595a4684f75..076e56f4e01a 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -994,12 +994,19 @@ static const __maybe_unused struct of_device_id rv3028_of_match[] = {
};
MODULE_DEVICE_TABLE(of, rv3028_of_match);
+static const struct i2c_device_id rv3028_id_table[] = {
+ { .name = "rv3028", },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, rv3028_id_table);
+
static struct i2c_driver rv3028_driver = {
.driver = {
.name = "rtc-rv3028",
.acpi_match_table = rv3028_i2c_acpi_match,
.of_match_table = of_match_ptr(rv3028_of_match),
},
+ .id_table = rv3028_id_table,
.probe = rv3028_probe,
};
module_i2c_driver(rv3028_driver);