* [PATCH] rtc: fsl-ftm-alarm: enable acpi support
@ 2020-03-18 2:53 Peng Ma
2020-03-22 21:12 ` Alexandre Belloni
0 siblings, 1 reply; 3+ messages in thread
From: Peng Ma @ 2020-03-18 2:53 UTC (permalink / raw)
To: a.zummo, alexandre.belloni
Cc: linux-rtc, linux-kernel, leoyang.li, ran.wang_1, biwen.li, Peng Ma
This patch enables ACPI support in Rtc Flex timer driver.
Signed-off-by: Peng Ma <peng.ma@nxp.com>
---
drivers/rtc/rtc-fsl-ftm-alarm.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
index 9e6e994..c572044 100644
--- a/drivers/rtc/rtc-fsl-ftm-alarm.c
+++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
@@ -20,6 +20,7 @@
#include <linux/fsl/ftm.h>
#include <linux/rtc.h>
#include <linux/time.h>
+#include <linux/acpi.h>
#define FTM_SC_CLK(c) ((c) << FTM_SC_CLK_MASK_SHIFT)
@@ -265,10 +266,10 @@ static int ftm_rtc_probe(struct platform_device *pdev)
return PTR_ERR(rtc->base);
}
- irq = irq_of_parse_and_map(np, 0);
- if (irq <= 0) {
- dev_err(&pdev->dev, "unable to get IRQ from DT, %d\n", irq);
- return -EINVAL;
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0) {
+ dev_err(&pdev->dev, "can't get irq number\n");
+ return irq;
}
ret = devm_request_irq(&pdev->dev, irq, ftm_rtc_alarm_interrupt,
@@ -278,7 +279,9 @@ static int ftm_rtc_probe(struct platform_device *pdev)
return ret;
}
- rtc->big_endian = of_property_read_bool(np, "big-endian");
+ rtc->big_endian =
+ device_property_read_bool(&pdev->dev, "big-endian");
+
rtc->alarm_freq = (u32)FIXED_FREQ_CLK / (u32)MAX_FREQ_DIV;
rtc->rtc_dev->ops = &ftm_rtc_ops;
@@ -305,11 +308,18 @@ static const struct of_device_id ftm_rtc_match[] = {
{ },
};
+static const struct acpi_device_id ftm_imx_acpi_ids[] = {
+ {"NXP0011",},
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, ftm_imx_acpi_ids);
+
static struct platform_driver ftm_rtc_driver = {
.probe = ftm_rtc_probe,
.driver = {
.name = "ftm-alarm",
.of_match_table = ftm_rtc_match,
+ .acpi_match_table = ACPI_PTR(ftm_imx_acpi_ids),
},
};
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: fsl-ftm-alarm: enable acpi support
2020-03-18 2:53 [PATCH] rtc: fsl-ftm-alarm: enable acpi support Peng Ma
@ 2020-03-22 21:12 ` Alexandre Belloni
2020-03-23 0:53 ` [EXT] " Peng Ma
0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2020-03-22 21:12 UTC (permalink / raw)
To: Peng Ma
Cc: a.zummo, linux-rtc, linux-kernel, leoyang.li, ran.wang_1, biwen.li
On 18/03/2020 10:53:54+0800, Peng Ma wrote:
> This patch enables ACPI support in Rtc Flex timer driver.
>
> Signed-off-by: Peng Ma <peng.ma@nxp.com>
> ---
> drivers/rtc/rtc-fsl-ftm-alarm.c | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
Applied, thanks.
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [EXT] Re: [PATCH] rtc: fsl-ftm-alarm: enable acpi support
2020-03-22 21:12 ` Alexandre Belloni
@ 2020-03-23 0:53 ` Peng Ma
0 siblings, 0 replies; 3+ messages in thread
From: Peng Ma @ 2020-03-23 0:53 UTC (permalink / raw)
To: Alexandre Belloni
Cc: a.zummo, linux-rtc, linux-kernel, Leo Li, Ran Wang, Biwen Li
Hi Alexandre,
OK, Got it.
Thanks very much.
Best Regards,
Peng
>-----Original Message-----
>From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>Sent: 2020年3月23日 5:13
>To: Peng Ma <peng.ma@nxp.com>
>Cc: a.zummo@towertech.it; linux-rtc@vger.kernel.org;
>linux-kernel@vger.kernel.org; Leo Li <leoyang.li@nxp.com>; Ran Wang
><ran.wang_1@nxp.com>; Biwen Li <biwen.li@nxp.com>
>Subject: [EXT] Re: [PATCH] rtc: fsl-ftm-alarm: enable acpi support
>
>Caution: EXT Email
>
>On 18/03/2020 10:53:54+0800, Peng Ma wrote:
>> This patch enables ACPI support in Rtc Flex timer driver.
>>
>> Signed-off-by: Peng Ma <peng.ma@nxp.com>
>> ---
>> drivers/rtc/rtc-fsl-ftm-alarm.c | 20 +++++++++++++++-----
>> 1 file changed, 15 insertions(+), 5 deletions(-)
>>
>Applied, thanks.
>
>--
>Alexandre Belloni, Bootlin
>Embedded Linux and Kernel engineering
>https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbootlin.c
>om&data=02%7C01%7Cpeng.ma%40nxp.com%7Cde862f8556e5440c9dcf0
>8d7cea5c0b3%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6372050
>83604609156&sdata=cN%2BVcgd1GZcqKt3Qx7T6v3%2Fq%2FwPXIZPyUDx9
>vtoYdtI%3D&reserved=0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-23 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 2:53 [PATCH] rtc: fsl-ftm-alarm: enable acpi support Peng Ma
2020-03-22 21:12 ` Alexandre Belloni
2020-03-23 0:53 ` [EXT] " Peng Ma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).