The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: "André Draszik" <andre.draszik@linaro.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>, Lee Jones <lee@kernel.org>,
	Peter Griffin <peter.griffin@linaro.org>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	Will McVicker <willmcvicker@google.com>,
	Juan Yescas <jyescas@google.com>,
	Douglas Anderson <dianders@chromium.org>,
	kernel-team@android.com,
	Kaustabh Chakraborty <kauschluss@disroot.org>,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH 2/3] rtc: s5m: query platform device IRQ resource for alarm IRQ
Date: Fri, 14 Nov 2025 16:58:21 +0100	[thread overview]
Message-ID: <2025111415582194c6ee16@mail.local> (raw)
In-Reply-To: <20251114-s5m-alarm-v1-2-c9b3bebae65f@linaro.org>

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@linaro.org>

Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.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

  reply	other threads:[~2025-11-14 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 11:47 [PATCH 0/3] Samsung mfd/rtc driver alarm IRQ simplification André Draszik
2025-11-14 11:47 ` [PATCH 1/3] mfd: sec: add rtc alarm IRQ as platform device resource André Draszik
2025-11-14 11:47 ` [PATCH 2/3] rtc: s5m: query platform device IRQ resource for alarm IRQ André Draszik
2025-11-14 15:58   ` Alexandre Belloni [this message]
2025-11-14 11:47 ` [PATCH 3/3] mfd: sec: drop now unused struct sec_pmic_dev::irq_data André Draszik
2025-11-20 10:35   ` Lee Jones
2025-11-20 14:38     ` André Draszik
2025-11-20 10:31 ` [PATCH 0/3] Samsung mfd/rtc driver alarm IRQ simplification Lee Jones
2025-11-20 10:32   ` André Draszik

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=2025111415582194c6ee16@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=andre.draszik@linaro.org \
    --cc=dianders@chromium.org \
    --cc=jyescas@google.com \
    --cc=kauschluss@disroot.org \
    --cc=kernel-team@android.com \
    --cc=krzk@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=willmcvicker@google.com \
    /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