* [PATCH] rtc: da9063: Fix ALARM interrupt registration.
@ 2014-11-20 9:54 Dmitry Lavnikevich
2014-11-20 11:23 ` Opensource [Steve Twiss]
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Lavnikevich @ 2014-11-20 9:54 UTC (permalink / raw)
To: support.opensource, a.zummo, rtc-linux, linux-kernel; +Cc: Dmitry Lavnikevich
Call platform_get_irq_byname() returns local IRQ number. Use
regmap_irq_get_virq() to get VIRQ instead.
This fixes rtc initialization error:
da9063-rtc da9063-rtc: Failed to request ALARM IRQ 1: -22
Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
---
drivers/rtc/rtc-da9063.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
index 731ed1a..04743a6 100644
--- a/drivers/rtc/rtc-da9063.c
+++ b/drivers/rtc/rtc-da9063.c
@@ -315,6 +315,7 @@ static int da9063_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rtc);
irq_alarm = platform_get_irq_byname(pdev, "ALARM");
+ irq_alarm = regmap_irq_get_virq(da9063->regmap_irq, irq_alarm);
ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL,
da9063_alarm_event,
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
--
2.1.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] rtc: da9063: Fix ALARM interrupt registration.
2014-11-20 9:54 [PATCH] rtc: da9063: Fix ALARM interrupt registration Dmitry Lavnikevich
@ 2014-11-20 11:23 ` Opensource [Steve Twiss]
2014-11-20 13:09 ` Dmitry Lavnikevich
0 siblings, 1 reply; 6+ messages in thread
From: Opensource [Steve Twiss] @ 2014-11-20 11:23 UTC (permalink / raw)
To: Dmitry Lavnikevich, Support Opensource, a.zummo, rtc-linux, linux-kernel
On 20 November 2014 09:55 Dmitry Lavnikevich wrote:
> Call platform_get_irq_byname() returns local IRQ number. Use
> regmap_irq_get_virq() to get VIRQ instead.
> This fixes rtc initialization error:
> da9063-rtc da9063-rtc: Failed to request ALARM IRQ 1: -22
>
> Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Hi Dmitry,
Please refer to the previous patch :
http://patchwork.ozlabs.org/patch/329051/
Using platform_get_irq_byname() to retrieve the IRQ number
returns the VIRQ number rather than the local IRQ number for
the device. Passing that value then into regmap_irq_get_virq()
causes a failure because the function is expecting the local
IRQ number (e.g. 0, 1, 2, 3, etc).
> ---
> drivers/rtc/rtc-da9063.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
> index 731ed1a..04743a6 100644
> --- a/drivers/rtc/rtc-da9063.c
> +++ b/drivers/rtc/rtc-da9063.c
> @@ -315,6 +315,7 @@ static int da9063_rtc_probe(struct platform_device
> *pdev)
> platform_set_drvdata(pdev, rtc);
>
> irq_alarm = platform_get_irq_byname(pdev, "ALARM");
> + irq_alarm = regmap_irq_get_virq(da9063->regmap_irq, irq_alarm);
> ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL,
> da9063_alarm_event,
> IRQF_TRIGGER_LOW |
> IRQF_ONESHOT,
> --
> 2.1.3
This patch above gives the following error when running on the DA9063:
da9063-rtc da9063-rtc: Failed to request ALARM IRQ -22: -22
da9063-rtc: probe of da9063-rtc failed with error -22
Regards,
Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rtc: da9063: Fix ALARM interrupt registration.
2014-11-20 11:23 ` Opensource [Steve Twiss]
@ 2014-11-20 13:09 ` Dmitry Lavnikevich
2014-11-20 14:43 ` Opensource [Steve Twiss]
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Lavnikevich @ 2014-11-20 13:09 UTC (permalink / raw)
To: Opensource [Steve Twiss]
Cc: Support Opensource, a.zummo, rtc-linux, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2150 bytes --]
> On 20Nov, 2014, at 12:23, Opensource [Steve Twiss] <stwiss.opensource@diasemi.com> wrote:
>
> On 20 November 2014 09:55 Dmitry Lavnikevich wrote:
>
>> Call platform_get_irq_byname() returns local IRQ number. Use
>> regmap_irq_get_virq() to get VIRQ instead.
>> This fixes rtc initialization error:
>> da9063-rtc da9063-rtc: Failed to request ALARM IRQ 1: -22
>>
>> Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
>
> Hi Dmitry,
>
> Please refer to the previous patch :
> http://patchwork.ozlabs.org/patch/329051/
Yes, Iâve seen this patch for da9055.
I have no hardware with da9055 to test it but as I understood from
da9055-core.c sources the difference is in regmap_add_irq_chip()
call. Looks like passing irq_base = -1 to it dynamically allocates
irq_base so call regmap_irq_chip_get_base() then returns base for
virtual IRQ.
In case of da9063 there is no use of
regmap_add_irq_chip/regmap_irq_chip_get_base and because of that
da9063-core registeres IRQ using irq_base=0 and therefore is local
instead of virtual.
>> ---
>> drivers/rtc/rtc-da9063.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
>> index 731ed1a..04743a6 100644
>> --- a/drivers/rtc/rtc-da9063.c
>> +++ b/drivers/rtc/rtc-da9063.c
>> @@ -315,6 +315,7 @@ static int da9063_rtc_probe(struct platform_device
>> *pdev)
>> platform_set_drvdata(pdev, rtc);
>>
>> irq_alarm = platform_get_irq_byname(pdev, "ALARM");
>> + irq_alarm = regmap_irq_get_virq(da9063->regmap_irq, irq_alarm);
>> ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL,
>> da9063_alarm_event,
>> IRQF_TRIGGER_LOW |
>> IRQF_ONESHOT,
>> --
>> 2.1.3
>
> This patch above gives the following error when running on the DA9063:
>
> da9063-rtc da9063-rtc: Failed to request ALARM IRQ -22: -22
> da9063-rtc: probe of da9063-rtc failed with error -22
I have tested this patch on pfla02 board and it was ok. On which
board this fail occured?
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] rtc: da9063: Fix ALARM interrupt registration.
2014-11-20 13:09 ` Dmitry Lavnikevich
@ 2014-11-20 14:43 ` Opensource [Steve Twiss]
2014-11-21 12:04 ` Dmitry Lavnikevich
0 siblings, 1 reply; 6+ messages in thread
From: Opensource [Steve Twiss] @ 2014-11-20 14:43 UTC (permalink / raw)
To: Dmitry Lavnikevich; +Cc: Support Opensource, a.zummo, rtc-linux, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2503 bytes --]
On 20 November 2014 13:09 Dmitry Lavnikevich wrote:
> > On 20Nov, 2014, at 12:23, Steve Twiss wrote:
> > On 20 November 2014 09:55 Dmitry Lavnikevich wrote:
> >
> >> Call platform_get_irq_byname() returns local IRQ number. Use
> >> regmap_irq_get_virq() to get VIRQ instead.
> >> This fixes rtc initialization error:
> >> da9063-rtc da9063-rtc: Failed to request ALARM IRQ 1: -22
> >>
> >> Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
> >
> > Hi Dmitry,
> >
> > Please refer to the previous patch :
> > http://patchwork.ozlabs.org/patch/329051/
>
> Yes, Iâve seen this patch for da9055.
> I have no hardware with da9055 to test it but as I understood from
> da9055-core.c sources the difference is in regmap_add_irq_chip()
> call. Looks like passing irq_base = -1 to it dynamically allocates
> irq_base so call regmap_irq_chip_get_base() then returns base for
> virtual IRQ.
Hi Dmitry,
-- that is what I expect ... mmm..
[...]
> >
> > da9063-rtc da9063-rtc: Failed to request ALARM IRQ -22: -22
> > da9063-rtc: probe of da9063-rtc failed with error -22
>
> I have tested this patch on pfla02 board and it was ok. On which
> board this fail occurred?
I am using a MCIMX6DL-SDP board -- although I the differences are in
my code base and not the platform in this case.
My apologies
Regards,
Steve
patch follows:
=== DIFF of drivers/regulator/da9063-regulator.c ... linux-next/v3.18-rc5
870,880c870,877
< regulators->irq_ldo_lim = regmap_irq_get_virq(da9063->regmap_irq, irq);
< if (regulators->irq_ldo_lim >= 0) {
< ret = request_threaded_irq(regulators->irq_ldo_lim,
< NULL, da9063_ldo_lim_event,
< IRQF_TRIGGER_LOW | IRQF_ONESHOT,
< "LDO_LIM", regulators);
< if (ret) {
< dev_err(&pdev->dev,
< "Failed to request LDO_LIM IRQ.\n");
< regulators->irq_ldo_lim = -ENXIO;
< }
---
> ret = request_threaded_irq(irq,
> NULL, da9063_ldo_lim_event,
> IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> "LDO_LIM", regulators);
> if (ret) {
> dev_err(&pdev->dev,
> "Failed to request LDO_LIM IRQ.\n");
> regulators->irq_ldo_lim = -ENXIO;
=== DIFF of drivers/mfd/da9063-core.c ... linux-next/v3.18-rc5 <> InSparse
121c121
< da9063->irq_base = 0;
---
> da9063->irq_base = -1;
170a171,172
> da9063->irq_base = regmap_irq_chip_get_base(da9063->regmap_irq);
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rtc: da9063: Fix ALARM interrupt registration.
2014-11-20 14:43 ` Opensource [Steve Twiss]
@ 2014-11-21 12:04 ` Dmitry Lavnikevich
2014-11-21 13:23 ` Opensource [Steve Twiss]
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Lavnikevich @ 2014-11-21 12:04 UTC (permalink / raw)
To: Opensource [Steve Twiss]
Cc: Support Opensource, a.zummo, rtc-linux, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 982 bytes --]
> On 20Nov, 2014, at 15:43, Opensource [Steve Twiss] <stwiss.opensource@diasemi.com> wrote:
>
> On 20 November 2014 13:09 Dmitry Lavnikevich wrote:
> [...]
>>>
>>> da9063-rtc da9063-rtc: Failed to request ALARM IRQ -22: -22
>>> da9063-rtc: probe of da9063-rtc failed with error -22
>>
>> I have tested this patch on pfla02 board and it was ok. On which
>> board this fail occurred?
>
> I am using a MCIMX6DL-SDP board -- although I the differences are in
> my code base and not the platform in this case.
> My apologies
>
> Regards,
> Steve
>
> patch follows:
[â¦]
I see that your code also fixes the issue. And it is more consistent with da9055 implementation.
So there is no need for my fix if yours is already there. Is it already accepted on some mainline branch?
If not then are you going to submit it soon?ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] rtc: da9063: Fix ALARM interrupt registration.
2014-11-21 12:04 ` Dmitry Lavnikevich
@ 2014-11-21 13:23 ` Opensource [Steve Twiss]
0 siblings, 0 replies; 6+ messages in thread
From: Opensource [Steve Twiss] @ 2014-11-21 13:23 UTC (permalink / raw)
To: Dmitry Lavnikevich; +Cc: Support Opensource, a.zummo, rtc-linux, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1303 bytes --]
On 21 November 2014 12:04 Dmitry Lavnikevich wrote:
> > On 20Nov, 2014, at 15:43, Steve Twiss wrote:
> > On 20 November 2014 13:09 Dmitry Lavnikevich wrote:
> > [...]
> >>>
> >>> da9063-rtc da9063-rtc: Failed to request ALARM IRQ -22: -22
> >>> da9063-rtc: probe of da9063-rtc failed with error -22
> >>
> >> I have tested this patch on pfla02 board and it was ok. On which
> >> board this fail occurred?
> >
> > I am using a MCIMX6DL-SDP board -- although I the differences are in
> > my code base and not the platform in this case.
> > My apologies
> >
> > Regards,
> > Steve
> >
> > patch follows:
> [â¦]
>
> I see that your code also fixes the issue. And it is more consistent with
> da9055 implementation.
> So there is no need for my fix if yours is already there. Is it already accepted
> on some mainline branch?
Hi Dmitry,
No, unfortunately -- I have not had time to send it to the kernel -- it has been
in my buffer for a long time
> If not then are you going to submit it soon?
If you want to submit this, then I will support with Ack: and Tested-by:
but probably it will be quicker not to wait for me.
Regards,
Stephen
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-11-21 13:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-20 9:54 [PATCH] rtc: da9063: Fix ALARM interrupt registration Dmitry Lavnikevich
2014-11-20 11:23 ` Opensource [Steve Twiss]
2014-11-20 13:09 ` Dmitry Lavnikevich
2014-11-20 14:43 ` Opensource [Steve Twiss]
2014-11-21 12:04 ` Dmitry Lavnikevich
2014-11-21 13:23 ` Opensource [Steve Twiss]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®