Skip to contentSkip to conversation

rtc: fix for the DA9052 rtc device registration

PATCH Superseded Ashish Jangam 2 participants 3 messages Mar 15, 2013 – Mar 19, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: fix for the DA9052 rtc device registration

DA9052/53 MFD core handles only virtual irq therefore rtc driver needs to be updated to work on virtual irq. Without this update DA9052/53 rtc driver will fail during its registration.
Also getting irq by it name is no longer supported in DA9052/53 core.

---
 drivers/rtc/rtc-da9052.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/rtc/rtc-da9052.c +4 -4
index 60b826e..e22c950 100644
@@ -239,10 +239,10 @@ static int da9052_rtc_probe(struct platform_device *pdev)
 
 	rtc->da9052 = dev_get_drvdata(pdev->dev.parent);
 	platform_set_drvdata(pdev, rtc);
-	rtc->irq = platform_get_irq_byname(pdev, "ALM");
-	ret = request_threaded_irq(rtc->irq, NULL, da9052_rtc_irq,
-				   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-				   "ALM", rtc);
+	rtc->irq =  DA9052_IRQ_ALARM;
+
+	ret = da9052_request_irq(rtc->da9052, rtc->irq, "ALM",
+				da9052_rtc_irq, rtc);
 	if (ret != 0) {
 		rtc_err(rtc->da9052, "irq registration failed: %d\n", ret);
 		return ret;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 14 lines · On Fri, 15 Mar 2013 13:59:39 +0530 Ashish Jangam…

DA9052/53 MFD core handles only virtual irq therefore rtc driver needs to be updated to work on virtual irq. Without this update DA9052/53 rtc driver will fail during its registration.
Also getting irq by it name is no longer supported in DA9052/53 core.

...

drivers/rtc/rtc-da9052.c +0 -1
@@ -239,10 +239,10 @@ static int da9052_rtc_probe(struct platform_device *pdev)
 
 	rtc->da9052 = dev_get_drvdata(pdev->dev.parent);
 	platform_set_drvdata(pdev, rtc);
-	rtc->irq = platform_get_irq_byname(pdev, "ALM");

drivers/rtc/rtc-da9052.c static int da9052_rtc_probe(struct platform_device *pdev) · line 248

Quoted 10 lines
drivers/rtc/rtc-da9052.c +4 -3
-	ret = request_threaded_irq(rtc->irq, NULL, da9052_rtc_irq,
-				   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-				   "ALM", rtc);
+	rtc->irq =  DA9052_IRQ_ALARM;
+
+	ret = da9052_request_irq(rtc->da9052, rtc->irq, "ALM",
+				da9052_rtc_irq, rtc);
 	if (ret != 0) {
 		rtc_err(rtc->da9052, "irq registration failed: %d\n", ret);
 		return ret;

drivers/rtc/rtc-da9052.c was converted to use devm_request_threaded_irq() after linux-3.8, so I cannot apply this patch to mainline. Can you please prepare a patch against 3.9-rc3?

Do you believe that the patch should be backported into -stable kernels? If so, Greg will need a different version of it - ie, the one you have just sent. Please send that to him at the appropriate time (say, when you see me drop the 3.9-rc3 version from the -mm tree).

#2 lore raw
Quoted 22 lines · Andrew Morton
Quoted 20 lines · On Fri, 15 Mar 2013 13:59:39 +0530 Ashish Jangam…

DA9052/53 MFD core handles only virtual irq therefore rtc driver needs to be updated to work on virtual irq. Without this update DA9052/53 rtc driver will fail during its registration.
Also getting irq by it name is no longer supported in DA9052/53 core.

...

drivers/rtc/rtc-da9052.c +3 -4
@@ -239,10 +239,10 @@ static int da9052_rtc_probe(struct platform_device *pdev)
 
 	rtc->da9052 = dev_get_drvdata(pdev->dev.parent);
 	platform_set_drvdata(pdev, rtc);
-	rtc->irq = platform_get_irq_byname(pdev, "ALM");
-	ret = request_threaded_irq(rtc->irq, NULL, da9052_rtc_irq,
-				   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-				   "ALM", rtc);
+	rtc->irq =  DA9052_IRQ_ALARM;
+
+	ret = da9052_request_irq(rtc->da9052, rtc->irq, "ALM",
Quoted 8 lines

drivers/rtc/rtc-da9052.c static int da9052_rtc_probe(struct platform_device *pdev) · line 248

Quoted 4 lines
drivers/rtc/rtc-da9052.c +1 -0
+				da9052_rtc_irq, rtc);
 	if (ret != 0) {
 		rtc_err(rtc->da9052, "irq registration failed: %d\n", ret);
 		return ret;

drivers/rtc/rtc-da9052.c was converted to use devm_request_threaded_irq() after linux-3.8, so I cannot apply this patch to mainline. Can you please prepare a patch against 3.9-rc3?

Yes.

Quoted 5 lines

Do you believe that the patch should be backported into -stable kernels? If so, Greg will need a different version of it - ie, the one you have just sent. Please send that to him at the appropriate time (say, when you see me drop the 3.9-rc3 version from the -mm tree).

Ok, I will do the necessary.