[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025111415582194c6ee16@mail.local>
Date: Fri, 14 Nov 2025 16:58:21 +0100
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: André Draszik <andre.draszik@...aro.org>
Cc: Krzysztof Kozlowski <krzk@...nel.org>, Lee Jones <lee@...nel.org>,
Peter Griffin <peter.griffin@...aro.org>,
Tudor Ambarus <tudor.ambarus@...aro.org>,
Will McVicker <willmcvicker@...gle.com>,
Juan Yescas <jyescas@...gle.com>,
Douglas Anderson <dianders@...omium.org>, kernel-team@...roid.com,
Kaustabh Chakraborty <kauschluss@...root.org>,
linux-kernel@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-rtc@...r.kernel.org
Subject: Re: [PATCH 2/3] rtc: s5m: query platform device IRQ resource for
alarm IRQ
On 14/11/2025 11:47:22+0000, André Draszik wrote:
> The core driver now exposes the alarm IRQ as a resource, so we can drop
> the lookup from here to simplify the code and make adding support for
> additional variants easier in this driver.
>
> Signed-off-by: André Draszik <andre.draszik@...aro.org>
Acked-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
> ---
> drivers/rtc/rtc-s5m.c | 21 ++++++++-------------
> 1 file changed, 8 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> index a7220b4d0e8dd35786b060e2a4106e2a39fe743f..c6ed5a4ca8a0e4554b1c88c879b01fc384735007 100644
> --- a/drivers/rtc/rtc-s5m.c
> +++ b/drivers/rtc/rtc-s5m.c
> @@ -15,7 +15,6 @@
> #include <linux/rtc.h>
> #include <linux/platform_device.h>
> #include <linux/mfd/samsung/core.h>
> -#include <linux/mfd/samsung/irq.h>
> #include <linux/mfd/samsung/rtc.h>
> #include <linux/mfd/samsung/s2mps14.h>
>
> @@ -683,22 +682,18 @@ static int s5m_rtc_probe(struct platform_device *pdev)
> case S2MPS15X:
> regmap_cfg = &s2mps14_rtc_regmap_config;
> info->regs = &s2mps15_rtc_regs;
> - alarm_irq = S2MPS14_IRQ_RTCA0;
> break;
> case S2MPS14X:
> regmap_cfg = &s2mps14_rtc_regmap_config;
> info->regs = &s2mps14_rtc_regs;
> - alarm_irq = S2MPS14_IRQ_RTCA0;
> break;
> case S2MPS13X:
> regmap_cfg = &s2mps14_rtc_regmap_config;
> info->regs = &s2mps13_rtc_regs;
> - alarm_irq = S2MPS14_IRQ_RTCA0;
> break;
> case S5M8767X:
> regmap_cfg = &s5m_rtc_regmap_config;
> info->regs = &s5m_rtc_regs;
> - alarm_irq = S5M8767_IRQ_RTCA1;
> break;
> default:
> return dev_err_probe(&pdev->dev, -ENODEV,
> @@ -719,7 +714,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
> "Failed to allocate regmap\n");
> } else if (device_type == S2MPG10) {
> info->regs = &s2mpg10_rtc_regs;
> - alarm_irq = S2MPG10_IRQ_RTCA0;
> } else {
> return dev_err_probe(&pdev->dev, -ENODEV,
> "Unsupported device type %d\n",
> @@ -730,13 +724,14 @@ static int s5m_rtc_probe(struct platform_device *pdev)
> info->s5m87xx = s5m87xx;
> info->device_type = device_type;
>
> - if (s5m87xx->irq_data) {
> - info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq);
> - if (info->irq <= 0)
> - return dev_err_probe(&pdev->dev, -EINVAL,
> - "Failed to get virtual IRQ %d\n",
> - alarm_irq);
> - }
> + alarm_irq = platform_get_irq_byname_optional(pdev, "alarm");
> + if (alarm_irq > 0)
> + info->irq = alarm_irq;
> + else if (alarm_irq == -ENXIO)
> + info->irq = 0;
> + else
> + return dev_err_probe(&pdev->dev, alarm_irq ? : -EINVAL,
> + "IRQ 'alarm' not found\n");
>
> platform_set_drvdata(pdev, info);
>
>
> --
> 2.52.0.rc1.455.g30608eb744-goog
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists