From c4b12f89f5aefe559522e4e41528a6c719fcdcdb Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Mon, 23 Jan 2023 21:02:16 +0100 Subject: rtc: rv3032: use IRQ flags obtained from fwnode Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-11-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rv3032.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/rtc/rtc-rv3032.c') diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c index c3bee305eacc..bf6954ec5943 100644 --- a/drivers/rtc/rtc-rv3032.c +++ b/drivers/rtc/rtc-rv3032.c @@ -930,9 +930,14 @@ static int rv3032_probe(struct i2c_client *client) return PTR_ERR(rv3032->rtc); if (client->irq > 0) { + unsigned long irqflags = IRQF_TRIGGER_LOW; + + if (dev_fwnode(&client->dev)) + irqflags = 0; + ret = devm_request_threaded_irq(&client->dev, client->irq, NULL, rv3032_handle_irq, - IRQF_TRIGGER_LOW | IRQF_ONESHOT, + irqflags | IRQF_ONESHOT, "rv3032", rv3032); if (ret) { dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n"); -- cgit v1.2.3-58-ga151 From 2d433e9c897dcb0b70ef17b536f61430b1e151d4 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Tue, 14 Feb 2023 21:27:15 +0100 Subject: rtc: rv3032: add ACPI support The RV-3032 has been assigned the MCRY3032 ACPI ID. Link: https://lore.kernel.org/r/20230214202716.565749-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rv3032.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/rtc/rtc-rv3032.c') diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c index bf6954ec5943..1ff4f2e6fa77 100644 --- a/drivers/rtc/rtc-rv3032.c +++ b/drivers/rtc/rtc-rv3032.c @@ -980,6 +980,12 @@ static int rv3032_probe(struct i2c_client *client) return 0; } +static const struct acpi_device_id rv3032_i2c_acpi_match[] = { + { "MCRY3032" }, + { } +}; +MODULE_DEVICE_TABLE(acpi, rv3032_i2c_acpi_match); + static const __maybe_unused struct of_device_id rv3032_of_match[] = { { .compatible = "microcrystal,rv3032", }, { } @@ -989,6 +995,7 @@ MODULE_DEVICE_TABLE(of, rv3032_of_match); static struct i2c_driver rv3032_driver = { .driver = { .name = "rtc-rv3032", + .acpi_match_table = rv3032_i2c_acpi_match, .of_match_table = of_match_ptr(rv3032_of_match), }, .probe_new = rv3032_probe, -- cgit v1.2.3-58-ga151