* [PATCH v1 02/16] dt-bindings: rtc: mediatek: add bindings for PMIC RTC
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2018-03-23 9:14 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 9:41 ` Alexandre Belloni
2018-03-23 9:15 ` [PATCH v1 03/16] dt-bindings: mfd: mediatek: add a description for MT6323 RTC sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (10 subsequent siblings)
11 siblings, 1 reply; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:14 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add device-tree binding for MediaTek PMIC based RTC.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
.../devicetree/bindings/rtc/rtc-mt6397.txt | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
new file mode 100644
index 0000000..83ff6be
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
@@ -0,0 +1,39 @@
+Device-Tree bindings for MediaTek PMIC based RTC
+
+MediaTek PMIC based RTC is an independent function of MediaTek PMIC which
+is working as a multi-function device (MFD). And the RTC can be configured and
+set up via PMIC wrapper bus. Which is also common resource shared among the
+other functions present on the PMIC.
+
+For MediaTek PMIC wrapper bus bindings, see:
+Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
+
+Required parent node:
+- pmic
+ For MediaTek PMIC MFD bindings, see:
+ Documentation/devicetree/bindings/mfd/mt6397.txt
+
+Required properties:
+- compatible: Should be one of follows
+ "mediatek,mt6323-rtc": for MT6323 PMIC
+ "mediatek,mt6397-rtc": for MT6397 PMIC
+
+Optional child node:
+- power-off
+ For Power-Off Device for MediaTek PMIC RTC bindings, see:
+ Documentation/devicetree/bindings/power/reset/mt6397-rtc-poweroff.txt
+
+Example:
+
+ pmic {
+ compatible = "mediatek,mt6323";
+
+ ...
+ rtc {
+ compatible = "mediatek,mt6323-rtc";
+
+ power-off {
+ compatible = "mediatek,mt6323-rtc-poweroff";
+ };
+ };
+};
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* Re: [PATCH v1 02/16] dt-bindings: rtc: mediatek: add bindings for PMIC RTC
2018-03-23 9:14 ` [PATCH v1 02/16] dt-bindings: rtc: mediatek: add bindings for PMIC RTC sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:41 ` Alexandre Belloni
[not found] ` <20180323094118.GC3417-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
0 siblings, 1 reply; 46+ messages in thread
From: Alexandre Belloni @ 2018-03-23 9:41 UTC (permalink / raw)
To: sean.wang
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
Hi,
On 23/03/2018 at 17:14:59 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> Add device-tree binding for MediaTek PMIC based RTC.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> .../devicetree/bindings/rtc/rtc-mt6397.txt | 39 ++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
>
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
> new file mode 100644
> index 0000000..83ff6be
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
> @@ -0,0 +1,39 @@
> +Device-Tree bindings for MediaTek PMIC based RTC
> +
> +MediaTek PMIC based RTC is an independent function of MediaTek PMIC which
> +is working as a multi-function device (MFD). And the RTC can be configured and
> +set up via PMIC wrapper bus. Which is also common resource shared among the
> +other functions present on the PMIC.
> +
> +For MediaTek PMIC wrapper bus bindings, see:
> +Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
> +
> +Required parent node:
> +- pmic
> + For MediaTek PMIC MFD bindings, see:
> + Documentation/devicetree/bindings/mfd/mt6397.txt
> +
> +Required properties:
> +- compatible: Should be one of follows
> + "mediatek,mt6323-rtc": for MT6323 PMIC
> + "mediatek,mt6397-rtc": for MT6397 PMIC
> +
> +Optional child node:
> +- power-off
> + For Power-Off Device for MediaTek PMIC RTC bindings, see:
> + Documentation/devicetree/bindings/power/reset/mt6397-rtc-poweroff.txt
> +
> +Example:
> +
> + pmic {
> + compatible = "mediatek,mt6323";
> +
> + ...
> + rtc {
> + compatible = "mediatek,mt6323-rtc";
> +
> + power-off {
> + compatible = "mediatek,mt6323-rtc-poweroff";
> + };
I'm pretty sure the whole point of mfd is to avoid having the poweroff
controller under the rtc
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 46+ messages in thread
* [PATCH v1 03/16] dt-bindings: mfd: mediatek: add a description for MT6323 RTC
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-03-23 9:14 ` [PATCH v1 02/16] dt-bindings: rtc: mediatek: add bindings for PMIC RTC sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-26 22:24 ` Rob Herring
2018-03-28 11:13 ` Lee Jones
2018-03-23 9:15 ` [PATCH v1 04/16] mfd: mt6397: add MT6323 RTC support into MT6397 driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (9 subsequent siblings)
11 siblings, 2 replies; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add a description for MT6323 RTC and link it to the detailed binding
documentation.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
index d1df77f..11a748d 100644
--- a/Documentation/devicetree/bindings/mfd/mt6397.txt
+++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
@@ -22,8 +22,10 @@ compatible: "mediatek,mt6397" or "mediatek,mt6323"
Optional subnodes:
- rtc
- Required properties:
+ Required properties: Should be one of follows
+ - compatible: "mediatek,mt6323-rtc"
- compatible: "mediatek,mt6397-rtc"
+ For details, see Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
- regulators
Required properties:
- compatible: "mediatek,mt6397-regulator"
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* Re: [PATCH v1 03/16] dt-bindings: mfd: mediatek: add a description for MT6323 RTC
2018-03-23 9:15 ` [PATCH v1 03/16] dt-bindings: mfd: mediatek: add a description for MT6323 RTC sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-26 22:24 ` Rob Herring
2018-03-28 11:13 ` Lee Jones
1 sibling, 0 replies; 46+ messages in thread
From: Rob Herring @ 2018-03-26 22:24 UTC (permalink / raw)
To: sean.wang
Cc: mark.rutland, sre, lee.jones, a.zummo, alexandre.belloni,
eddie.huang, devicetree, linux-rtc, linux-pm, linux-mediatek,
linux-kernel
On Fri, Mar 23, 2018 at 05:15:00PM +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> Add a description for MT6323 RTC and link it to the detailed binding
> documentation.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 03/16] dt-bindings: mfd: mediatek: add a description for MT6323 RTC
2018-03-23 9:15 ` [PATCH v1 03/16] dt-bindings: mfd: mediatek: add a description for MT6323 RTC sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-26 22:24 ` Rob Herring
@ 2018-03-28 11:13 ` Lee Jones
1 sibling, 0 replies; 46+ messages in thread
From: Lee Jones @ 2018-03-28 11:13 UTC (permalink / raw)
To: sean.wang
Cc: robh+dt, mark.rutland, sre, a.zummo, alexandre.belloni,
eddie.huang, devicetree, linux-rtc, linux-pm, linux-mediatek,
linux-kernel
On Fri, 23 Mar 2018, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> Add a description for MT6323 RTC and link it to the detailed binding
> documentation.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Acked-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 46+ messages in thread
* [PATCH v1 04/16] mfd: mt6397: add MT6323 RTC support into MT6397 driver
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-03-23 9:14 ` [PATCH v1 02/16] dt-bindings: rtc: mediatek: add bindings for PMIC RTC sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 9:15 ` [PATCH v1 03/16] dt-bindings: mfd: mediatek: add a description for MT6323 RTC sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
[not found] ` <90320622cb491b9d3251e2ce9d0501422f47660f.1521794177.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-03-23 9:15 ` [PATCH v1 05/16] rtc: mediatek: add MT6323 support to RTC driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (8 subsequent siblings)
11 siblings, 1 reply; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add compatible string as "mt6323-rtc" that will make the OF core spawn
child devices for the RTC subnode of that MT6323 MFD node.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/mfd/mt6397-core.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 77b64bd..f71874a 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 MediaTek Inc.
+ * Copyright (c) 2014-2018 MediaTek Inc.
* Author: Flora Fu, MediaTek
*
* This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,9 @@
#include <linux/mfd/mt6397/registers.h>
#include <linux/mfd/mt6323/registers.h>
+#define MT6323_RTC_BASE 0x8000
+#define MT6323_RTC_SIZE 0x3e
+
#define MT6397_RTC_BASE 0xe000
#define MT6397_RTC_SIZE 0x3e
@@ -30,6 +33,19 @@
#define MT6391_CID_CODE 0x91
#define MT6397_CID_CODE 0x97
+static const struct resource mt6323_rtc_resources[] = {
+ {
+ .start = MT6323_RTC_BASE,
+ .end = MT6323_RTC_BASE + MT6323_RTC_SIZE,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = MT6323_IRQ_STATUS_RTC,
+ .end = MT6323_IRQ_STATUS_RTC,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
static const struct resource mt6397_rtc_resources[] = {
{
.start = MT6397_RTC_BASE,
@@ -55,6 +71,11 @@ static const struct resource mt6397_keys_resources[] = {
static const struct mfd_cell mt6323_devs[] = {
{
+ .name = "mt6323-rtc",
+ .num_resources = ARRAY_SIZE(mt6323_rtc_resources),
+ .resources = mt6323_rtc_resources,
+ .of_compatible = "mediatek,mt6323-rtc",
+ }, {
.name = "mt6323-regulator",
.of_compatible = "mediatek,mt6323-regulator"
}, {
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH v1 05/16] rtc: mediatek: add MT6323 support to RTC driver
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (2 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 04/16] mfd: mt6397: add MT6323 RTC support into MT6397 driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 10:01 ` Alexandre Belloni
2018-03-23 9:15 ` [PATCH v1 07/16] rtc: mediatek: replace a poll with regmap_read_poll_timeout sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (7 subsequent siblings)
11 siblings, 1 reply; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Just to add MT6323 support to the existent RTC driver.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/rtc/rtc-mt6397.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 385f830..0df7ccd 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -398,6 +398,7 @@ static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
mt6397_rtc_resume);
static const struct of_device_id mt6397_rtc_of_match[] = {
+ { .compatible = "mediatek,mt6323-rtc", },
{ .compatible = "mediatek,mt6397-rtc", },
{ }
};
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* Re: [PATCH v1 05/16] rtc: mediatek: add MT6323 support to RTC driver
2018-03-23 9:15 ` [PATCH v1 05/16] rtc: mediatek: add MT6323 support to RTC driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 10:01 ` Alexandre Belloni
2018-03-24 7:06 ` Sean Wang
0 siblings, 1 reply; 46+ messages in thread
From: Alexandre Belloni @ 2018-03-23 10:01 UTC (permalink / raw)
To: sean.wang
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
Hi,
The subject line should be rtc: mt6397: (to differentiate with rtc-mt7622)
On 23/03/2018 at 17:15:02 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> Just to add MT6323 support to the existent RTC driver.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index 385f830..0df7ccd 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -398,6 +398,7 @@ static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
> mt6397_rtc_resume);
>
> static const struct of_device_id mt6397_rtc_of_match[] = {
> + { .compatible = "mediatek,mt6323-rtc", },
> { .compatible = "mediatek,mt6397-rtc", },
> { }
> };
> --
> 2.7.4
>
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 05/16] rtc: mediatek: add MT6323 support to RTC driver
2018-03-23 10:01 ` Alexandre Belloni
@ 2018-03-24 7:06 ` Sean Wang
0 siblings, 0 replies; 46+ messages in thread
From: Sean Wang @ 2018-03-24 7:06 UTC (permalink / raw)
To: Alexandre Belloni
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
On Fri, 2018-03-23 at 11:01 +0100, Alexandre Belloni wrote:
> Hi,
>
> The subject line should be rtc: mt6397: (to differentiate with rtc-mt7622)
>
Sure, I will change subject line into rtc: mt6397: along with the other
related patches.
> On 23/03/2018 at 17:15:02 +0800, sean.wang@mediatek.com wrote:
> > From: Sean Wang <sean.wang@mediatek.com>
> >
> > Just to add MT6323 support to the existent RTC driver.
> >
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> > drivers/rtc/rtc-mt6397.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> > index 385f830..0df7ccd 100644
> > --- a/drivers/rtc/rtc-mt6397.c
> > +++ b/drivers/rtc/rtc-mt6397.c
> > @@ -398,6 +398,7 @@ static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_rtc_suspend,
> > mt6397_rtc_resume);
> >
> > static const struct of_device_id mt6397_rtc_of_match[] = {
> > + { .compatible = "mediatek,mt6323-rtc", },
> > { .compatible = "mediatek,mt6397-rtc", },
> > { }
> > };
> > --
> > 2.7.4
> >
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* [PATCH v1 07/16] rtc: mediatek: replace a poll with regmap_read_poll_timeout
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (3 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 05/16] rtc: mediatek: add MT6323 support to RTC driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 9:15 ` [PATCH v1 08/16] rtc: mediatek: remove unnecessary irq_dispose_mapping sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (6 subsequent siblings)
11 siblings, 0 replies; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Reuse the helper regmap_read_poll_timeout instead to simpify the logic.
Furthermore, the time for a wait in each iteration changed from cpu_relax
to 20us is for matching the usage of the helper, but it wouldn't acctually
break any the existent functionality according to a good test on MT6323
PMIC.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/rtc/rtc-mt6397.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 4411c08..b62eaa8 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -18,6 +18,7 @@
#include <linux/regmap.h>
#include <linux/rtc.h>
#include <linux/irqdomain.h>
+#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
@@ -63,6 +64,9 @@
#define RTC_NUM_YEARS 128
#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
+#define MTK_RTC_POLL_DELAY_US 10
+#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
+
struct mt6397_rtc {
struct device *dev;
struct rtc_device *rtc_dev;
@@ -74,7 +78,6 @@ struct mt6397_rtc {
static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
{
- unsigned long timeout = jiffies + HZ;
int ret;
u32 data;
@@ -82,19 +85,13 @@ static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
if (ret < 0)
return ret;
- while (1) {
- ret = regmap_read(rtc->regmap, rtc->addr_base + RTC_BBPU,
- &data);
- if (ret < 0)
- break;
- if (!(data & RTC_BBPU_CBUSY))
- break;
- if (time_after(jiffies, timeout)) {
- ret = -ETIMEDOUT;
- break;
- }
- cpu_relax();
- }
+ ret = regmap_read_poll_timeout(rtc->regmap,
+ rtc->addr_base + RTC_BBPU, data,
+ !(data & RTC_BBPU_CBUSY),
+ MTK_RTC_POLL_DELAY_US,
+ MTK_RTC_POLL_TIMEOUT);
+ if (ret)
+ dev_err(rtc->dev, "failed to write WRTGE: %d\n", ret);
return ret;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH v1 08/16] rtc: mediatek: remove unnecessary irq_dispose_mapping
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (4 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 07/16] rtc: mediatek: replace a poll with regmap_read_poll_timeout sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 10:38 ` Alexandre Belloni
2018-03-23 9:15 ` [PATCH v1 09/16] rtc: mediatek: convert to use device managed functions sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (5 subsequent siblings)
11 siblings, 1 reply; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
It's unnecessary doing irq_dispose_mapping as a reverse operation for
platform_get_irq.
Ususally, irq_dispose_mapping should be called in error path or module
removal to release the resources for irq_of_parse_and_map requested.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/rtc/rtc-mt6397.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index b62eaa8..cefb83b 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -17,7 +17,6 @@
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
-#include <linux/irqdomain.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/of_address.h>
@@ -336,7 +335,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
rtc->irq, ret);
- goto out_dispose_irq;
+ return ret;
}
device_init_wakeup(&pdev->dev, 1);
@@ -353,8 +352,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
out_free_irq:
free_irq(rtc->irq, rtc->rtc_dev);
-out_dispose_irq:
- irq_dispose_mapping(rtc->irq);
+
return ret;
}
@@ -364,7 +362,6 @@ static int mtk_rtc_remove(struct platform_device *pdev)
rtc_device_unregister(rtc->rtc_dev);
free_irq(rtc->irq, rtc->rtc_dev);
- irq_dispose_mapping(rtc->irq);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* Re: [PATCH v1 08/16] rtc: mediatek: remove unnecessary irq_dispose_mapping
2018-03-23 9:15 ` [PATCH v1 08/16] rtc: mediatek: remove unnecessary irq_dispose_mapping sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 10:38 ` Alexandre Belloni
2018-03-26 2:22 ` Sean Wang
0 siblings, 1 reply; 46+ messages in thread
From: Alexandre Belloni @ 2018-03-23 10:38 UTC (permalink / raw)
To: sean.wang
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
On 23/03/2018 at 17:15:05 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> It's unnecessary doing irq_dispose_mapping as a reverse operation for
> platform_get_irq.
>
> Ususally, irq_dispose_mapping should be called in error path or module
> removal to release the resources for irq_of_parse_and_map requested.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index b62eaa8..cefb83b 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -17,7 +17,6 @@
> #include <linux/module.h>
> #include <linux/regmap.h>
> #include <linux/rtc.h>
> -#include <linux/irqdomain.h>
> #include <linux/jiffies.h>
> #include <linux/platform_device.h>
> #include <linux/of_address.h>
> @@ -336,7 +335,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> if (ret) {
> dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
> rtc->irq, ret);
> - goto out_dispose_irq;
> + return ret;
> }
>
> device_init_wakeup(&pdev->dev, 1);
> @@ -353,8 +352,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
>
> out_free_irq:
> free_irq(rtc->irq, rtc->rtc_dev);
> -out_dispose_irq:
> - irq_dispose_mapping(rtc->irq);
> +
Don't you still have a irq_create_mapping?
> return ret;
> }
>
> @@ -364,7 +362,6 @@ static int mtk_rtc_remove(struct platform_device *pdev)
>
> rtc_device_unregister(rtc->rtc_dev);
> free_irq(rtc->irq, rtc->rtc_dev);
> - irq_dispose_mapping(rtc->irq);
>
> return 0;
> }
> --
> 2.7.4
>
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 08/16] rtc: mediatek: remove unnecessary irq_dispose_mapping
2018-03-23 10:38 ` Alexandre Belloni
@ 2018-03-26 2:22 ` Sean Wang
0 siblings, 0 replies; 46+ messages in thread
From: Sean Wang @ 2018-03-26 2:22 UTC (permalink / raw)
To: Alexandre Belloni
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
On Fri, 2018-03-23 at 11:38 +0100, Alexandre Belloni wrote:
> On 23/03/2018 at 17:15:05 +0800, sean.wang@mediatek.com wrote:
> > From: Sean Wang <sean.wang@mediatek.com>
> >
> > It's unnecessary doing irq_dispose_mapping as a reverse operation for
> > platform_get_irq.
> >
> > Ususally, irq_dispose_mapping should be called in error path or module
> > removal to release the resources for irq_of_parse_and_map requested.
> >
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> > drivers/rtc/rtc-mt6397.c | 7 ++-----
> > 1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> > index b62eaa8..cefb83b 100644
> > --- a/drivers/rtc/rtc-mt6397.c
> > +++ b/drivers/rtc/rtc-mt6397.c
> > @@ -17,7 +17,6 @@
> > #include <linux/module.h>
> > #include <linux/regmap.h>
> > #include <linux/rtc.h>
> > -#include <linux/irqdomain.h>
> > #include <linux/jiffies.h>
> > #include <linux/platform_device.h>
> > #include <linux/of_address.h>
> > @@ -336,7 +335,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> > if (ret) {
> > dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
> > rtc->irq, ret);
> > - goto out_dispose_irq;
> > + return ret;
> > }
> >
> > device_init_wakeup(&pdev->dev, 1);
> > @@ -353,8 +352,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> >
> > out_free_irq:
> > free_irq(rtc->irq, rtc->rtc_dev);
> > -out_dispose_irq:
> > - irq_dispose_mapping(rtc->irq);
> > +
>
> Don't you still have a irq_create_mapping?
>
Sorry for that I didn't mention in the beginning that the series must
depend on another patch [1]. With the patch, the job irq_create_mapping
had been moved from rtc to mfd, so here it should be better to cleanup
up irq_dispose_mapping in all paths.
[1] https://patchwork.kernel.org/patch/9954643/
> > return ret;
> > }
> >
> > @@ -364,7 +362,6 @@ static int mtk_rtc_remove(struct platform_device *pdev)
> >
> > rtc_device_unregister(rtc->rtc_dev);
> > free_irq(rtc->irq, rtc->rtc_dev);
> > - irq_dispose_mapping(rtc->irq);
> >
> > return 0;
> > }
> > --
> > 2.7.4
> >
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* [PATCH v1 09/16] rtc: mediatek: convert to use device managed functions
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (5 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 08/16] rtc: mediatek: remove unnecessary irq_dispose_mapping sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 10:50 ` Alexandre Belloni
2018-03-23 9:15 ` [PATCH v1 10/16] rtc: mediatek: add devm_of_platform_populate sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (4 subsequent siblings)
11 siblings, 1 reply; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Use device managed operation to simplify error handling, reduce source
code size, and reduce the likelyhood of bugs, and remove our removal
callback which contains anything already done by device managed functions.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/rtc/rtc-mt6397.c | 31 ++++++++-----------------------
1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index cefb83b..bfc5d6f 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -14,6 +14,7 @@
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
@@ -328,10 +329,10 @@ static int mtk_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rtc);
- ret = request_threaded_irq(rtc->irq, NULL,
- mtk_rtc_irq_handler_thread,
- IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
- "mt6397-rtc", rtc);
+ ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
+ mtk_rtc_irq_handler_thread,
+ IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
+ "mt6397-rtc", rtc);
if (ret) {
dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
rtc->irq, ret);
@@ -340,30 +341,15 @@ static int mtk_rtc_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1);
- rtc->rtc_dev = rtc_device_register("mt6397-rtc", &pdev->dev,
- &mtk_rtc_ops, THIS_MODULE);
+ rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "mt6397-rtc",
+ &mtk_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc->rtc_dev)) {
dev_err(&pdev->dev, "register rtc device failed\n");
ret = PTR_ERR(rtc->rtc_dev);
- goto out_free_irq;
+ return ret;
}
return 0;
-
-out_free_irq:
- free_irq(rtc->irq, rtc->rtc_dev);
-
- return ret;
-}
-
-static int mtk_rtc_remove(struct platform_device *pdev)
-{
- struct mt6397_rtc *rtc = platform_get_drvdata(pdev);
-
- rtc_device_unregister(rtc->rtc_dev);
- free_irq(rtc->irq, rtc->rtc_dev);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -405,7 +391,6 @@ static struct platform_driver mtk_rtc_driver = {
.pm = &mt6397_pm_ops,
},
.probe = mtk_rtc_probe,
- .remove = mtk_rtc_remove,
};
module_platform_driver(mtk_rtc_driver);
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* Re: [PATCH v1 09/16] rtc: mediatek: convert to use device managed functions
2018-03-23 9:15 ` [PATCH v1 09/16] rtc: mediatek: convert to use device managed functions sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 10:50 ` Alexandre Belloni
2018-03-26 4:07 ` Sean Wang
0 siblings, 1 reply; 46+ messages in thread
From: Alexandre Belloni @ 2018-03-23 10:50 UTC (permalink / raw)
To: sean.wang
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
On 23/03/2018 at 17:15:06 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> Use device managed operation to simplify error handling, reduce source
> code size, and reduce the likelyhood of bugs, and remove our removal
> callback which contains anything already done by device managed functions.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> drivers/rtc/rtc-mt6397.c | 31 ++++++++-----------------------
> 1 file changed, 8 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index cefb83b..bfc5d6f 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -14,6 +14,7 @@
>
> #include <linux/delay.h>
> #include <linux/init.h>
> +#include <linux/interrupt.h>
> #include <linux/module.h>
> #include <linux/regmap.h>
> #include <linux/rtc.h>
> @@ -328,10 +329,10 @@ static int mtk_rtc_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, rtc);
>
> - ret = request_threaded_irq(rtc->irq, NULL,
> - mtk_rtc_irq_handler_thread,
> - IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
> - "mt6397-rtc", rtc);
> + ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
> + mtk_rtc_irq_handler_thread,
> + IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
> + "mt6397-rtc", rtc);
> if (ret) {
> dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
> rtc->irq, ret);
> @@ -340,30 +341,15 @@ static int mtk_rtc_probe(struct platform_device *pdev)
>
> device_init_wakeup(&pdev->dev, 1);
>
> - rtc->rtc_dev = rtc_device_register("mt6397-rtc", &pdev->dev,
> - &mtk_rtc_ops, THIS_MODULE);
> + rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "mt6397-rtc",
> + &mtk_rtc_ops, THIS_MODULE);
You should probably switch to devm_rtc_allocate_device() and
rtc_register_device instead of devm_rtc_device_register.
> if (IS_ERR(rtc->rtc_dev)) {
> dev_err(&pdev->dev, "register rtc device failed\n");
> ret = PTR_ERR(rtc->rtc_dev);
> - goto out_free_irq;
> + return ret;
ret doesn't seem necessary anymore here.
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 09/16] rtc: mediatek: convert to use device managed functions
2018-03-23 10:50 ` Alexandre Belloni
@ 2018-03-26 4:07 ` Sean Wang
2018-03-27 15:07 ` Alexandre Belloni
0 siblings, 1 reply; 46+ messages in thread
From: Sean Wang @ 2018-03-26 4:07 UTC (permalink / raw)
To: Alexandre Belloni
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
On Fri, 2018-03-23 at 11:50 +0100, Alexandre Belloni wrote:
> On 23/03/2018 at 17:15:06 +0800, sean.wang@mediatek.com wrote:
> > From: Sean Wang <sean.wang@mediatek.com>
> >
> > Use device managed operation to simplify error handling, reduce source
> > code size, and reduce the likelyhood of bugs, and remove our removal
> > callback which contains anything already done by device managed functions.
> >
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> > drivers/rtc/rtc-mt6397.c | 31 ++++++++-----------------------
> > 1 file changed, 8 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> > index cefb83b..bfc5d6f 100644
> > --- a/drivers/rtc/rtc-mt6397.c
> > +++ b/drivers/rtc/rtc-mt6397.c
> > @@ -14,6 +14,7 @@
> >
> > #include <linux/delay.h>
> > #include <linux/init.h>
> > +#include <linux/interrupt.h>
> > #include <linux/module.h>
> > #include <linux/regmap.h>
> > #include <linux/rtc.h>
> > @@ -328,10 +329,10 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> >
> > platform_set_drvdata(pdev, rtc);
> >
> > - ret = request_threaded_irq(rtc->irq, NULL,
> > - mtk_rtc_irq_handler_thread,
> > - IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
> > - "mt6397-rtc", rtc);
> > + ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
> > + mtk_rtc_irq_handler_thread,
> > + IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
> > + "mt6397-rtc", rtc);
> > if (ret) {
> > dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
> > rtc->irq, ret);
> > @@ -340,30 +341,15 @@ static int mtk_rtc_probe(struct platform_device *pdev)
> >
> > device_init_wakeup(&pdev->dev, 1);
> >
> > - rtc->rtc_dev = rtc_device_register("mt6397-rtc", &pdev->dev,
> > - &mtk_rtc_ops, THIS_MODULE);
> > + rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "mt6397-rtc",
> > + &mtk_rtc_ops, THIS_MODULE);
>
> You should probably switch to devm_rtc_allocate_device() and
> rtc_register_device instead of devm_rtc_device_register.
>
Just would like to know something details
It seems you just encourage me to switch into the new registration
method and currently devm_rtc_device_register I used for the driver
shouldn't cause any harm. right?
> > if (IS_ERR(rtc->rtc_dev)) {
> > dev_err(&pdev->dev, "register rtc device failed\n");
> > ret = PTR_ERR(rtc->rtc_dev);
> > - goto out_free_irq;
> > + return ret;
>
> ret doesn't seem necessary anymore here.
okay, it'll be removed
>
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 09/16] rtc: mediatek: convert to use device managed functions
2018-03-26 4:07 ` Sean Wang
@ 2018-03-27 15:07 ` Alexandre Belloni
0 siblings, 0 replies; 46+ messages in thread
From: Alexandre Belloni @ 2018-03-27 15:07 UTC (permalink / raw)
To: Sean Wang
Cc: mark.rutland-5wv7dgnIgG8, a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, sre-DgEjT+Ai2ygdnm+yROfE0A,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w,
lee.jones-QSEj5FYQhm4dnm+yROfE0A,
linux-rtc-u79uwXL29TY76Z2rM5mHXA
On 26/03/2018 at 12:07:45 +0800, Sean Wang wrote:
> > > - rtc->rtc_dev = rtc_device_register("mt6397-rtc", &pdev->dev,
> > > - &mtk_rtc_ops, THIS_MODULE);
> > > + rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "mt6397-rtc",
> > > + &mtk_rtc_ops, THIS_MODULE);
> >
> > You should probably switch to devm_rtc_allocate_device() and
> > rtc_register_device instead of devm_rtc_device_register.
> >
>
> Just would like to know something details
>
> It seems you just encourage me to switch into the new registration
> method and currently devm_rtc_device_register I used for the driver
> shouldn't cause any harm. right?
>
It will work but it will have to be converted to rtc_register_device
later anyway.
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 46+ messages in thread
* [PATCH v1 10/16] rtc: mediatek: add devm_of_platform_populate
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (6 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 09/16] rtc: mediatek: convert to use device managed functions sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 9:15 ` [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (3 subsequent siblings)
11 siblings, 0 replies; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add devm_of_platform_populate to populate all child nodes according to
the dt-binding.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/rtc/rtc-mt6397.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index bfc5d6f..d133d1f 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -16,6 +16,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/of_platform.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
#include <linux/jiffies.h>
@@ -349,7 +350,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
return ret;
}
- return 0;
+ return devm_of_platform_populate(&pdev->dev);
}
#ifdef CONFIG_PM_SLEEP
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (7 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 10/16] rtc: mediatek: add devm_of_platform_populate sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
[not found] ` <53afbe8172fb1afd809ce9ba1afeda924b9ea705.1521794177.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-03-24 20:00 ` Fabio Estevam
2018-03-23 9:15 ` [PATCH v1 13/16] rtc: mediatek: update license converting to using SPDX identifiers sean.wang-NuS5LvNUpcJWk0Htik3J/w
` (2 subsequent siblings)
11 siblings, 2 replies; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
This is in preparation for allowing other drivers can share the
declaration, so move the declaration into a globally visible header file.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/rtc/rtc-mt6397.c | 53 +---------------------------------
include/linux/rtc/mt6397.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 52 deletions(-)
create mode 100644 include/linux/rtc/mt6397.h
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index d133d1f..015609d 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -19,63 +19,12 @@
#include <linux/of_platform.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
-#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/io.h>
#include <linux/mfd/mt6397/core.h>
-
-#define RTC_BBPU 0x0000
-#define RTC_BBPU_CBUSY BIT(6)
-
-#define RTC_WRTGR 0x003c
-
-#define RTC_IRQ_STA 0x0002
-#define RTC_IRQ_STA_AL BIT(0)
-#define RTC_IRQ_STA_LP BIT(3)
-
-#define RTC_IRQ_EN 0x0004
-#define RTC_IRQ_EN_AL BIT(0)
-#define RTC_IRQ_EN_ONESHOT BIT(2)
-#define RTC_IRQ_EN_LP BIT(3)
-#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
-
-#define RTC_AL_MASK 0x0008
-#define RTC_AL_MASK_DOW BIT(4)
-
-#define RTC_TC_SEC 0x000a
-/* Min, Hour, Dom... register offset to RTC_TC_SEC */
-#define RTC_OFFSET_SEC 0
-#define RTC_OFFSET_MIN 1
-#define RTC_OFFSET_HOUR 2
-#define RTC_OFFSET_DOM 3
-#define RTC_OFFSET_DOW 4
-#define RTC_OFFSET_MTH 5
-#define RTC_OFFSET_YEAR 6
-#define RTC_OFFSET_COUNT 7
-
-#define RTC_AL_SEC 0x0018
-
-#define RTC_PDN2 0x002e
-#define RTC_PDN2_PWRON_ALARM BIT(4)
-
-#define RTC_MIN_YEAR 1968
-#define RTC_BASE_YEAR 1900
-#define RTC_NUM_YEARS 128
-#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
-
-#define MTK_RTC_POLL_DELAY_US 10
-#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
-
-struct mt6397_rtc {
- struct device *dev;
- struct rtc_device *rtc_dev;
- struct mutex lock;
- struct regmap *regmap;
- int irq;
- u32 addr_base;
-};
+#include <linux/rtc/mt6397.h>
static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
{
diff --git a/include/linux/rtc/mt6397.h b/include/linux/rtc/mt6397.h
new file mode 100644
index 0000000..4b19f51
--- /dev/null
+++ b/include/linux/rtc/mt6397.h
@@ -0,0 +1,72 @@
+
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2014-2018 MediaTek Inc.
+ *
+ * Author: Tianping.Fang <tianping.fang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
+ * Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
+ */
+
+#ifndef _LINUX_RTC_MT6397_H_
+#define _LINUX_RTC_MT6397_H_
+
+#include <linux/jiffies.h>
+#include <linux/mutex.h>
+#include <linux/regmap.h>
+#include <linux/rtc.h>
+
+#define RTC_BBPU 0x0000
+#define RTC_BBPU_CBUSY BIT(6)
+
+#define RTC_WRTGR 0x003c
+
+#define RTC_IRQ_STA 0x0002
+#define RTC_IRQ_STA_AL BIT(0)
+#define RTC_IRQ_STA_LP BIT(3)
+
+#define RTC_IRQ_EN 0x0004
+#define RTC_IRQ_EN_AL BIT(0)
+#define RTC_IRQ_EN_ONESHOT BIT(2)
+#define RTC_IRQ_EN_LP BIT(3)
+#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
+
+#define RTC_AL_MASK 0x0008
+#define RTC_AL_MASK_DOW BIT(4)
+
+#define RTC_TC_SEC 0x000a
+/* Min, Hour, Dom... register offset to RTC_TC_SEC */
+#define RTC_OFFSET_SEC 0
+#define RTC_OFFSET_MIN 1
+#define RTC_OFFSET_HOUR 2
+#define RTC_OFFSET_DOM 3
+#define RTC_OFFSET_DOW 4
+#define RTC_OFFSET_MTH 5
+#define RTC_OFFSET_YEAR 6
+#define RTC_OFFSET_COUNT 7
+
+#define RTC_AL_SEC 0x0018
+
+#define RTC_PDN2 0x002e
+#define RTC_PDN2_PWRON_ALARM BIT(4)
+
+#define RTC_MIN_YEAR 1968
+#define RTC_BASE_YEAR 1900
+#define RTC_NUM_YEARS 128
+#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
+
+#define MTK_RTC_POLL_DELAY_US 10
+#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
+
+struct mt6397_rtc {
+ struct device *dev;
+ struct rtc_device *rtc_dev;
+
+ /* protect registers accessing */
+ struct mutex lock;
+ struct regmap *regmap;
+ int irq;
+ u32 addr_base;
+};
+
+#endif /* _LINUX_RTC_MT6397_H_ */
+
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
[parent not found: <53afbe8172fb1afd809ce9ba1afeda924b9ea705.1521794177.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>]
* Re: [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file
[not found] ` <53afbe8172fb1afd809ce9ba1afeda924b9ea705.1521794177.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2018-03-23 9:57 ` Alexandre Belloni
2018-03-24 7:31 ` Sean Wang
0 siblings, 1 reply; 46+ messages in thread
From: Alexandre Belloni @ 2018-03-23 9:57 UTC (permalink / raw)
To: sean.wang-NuS5LvNUpcJWk0Htik3J/w
Cc: mark.rutland-5wv7dgnIgG8, a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, sre-DgEjT+Ai2ygdnm+yROfE0A,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w,
lee.jones-QSEj5FYQhm4dnm+yROfE0A,
linux-rtc-u79uwXL29TY76Z2rM5mHXA
On 23/03/2018 at 17:15:08 +0800, sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org wrote:
> From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
>
> This is in preparation for allowing other drivers can share the
> declaration, so move the declaration into a globally visible header file.
>
> Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
> drivers/rtc/rtc-mt6397.c | 53 +---------------------------------
> include/linux/rtc/mt6397.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++
This should go in include/linux/mfd/
> 2 files changed, 73 insertions(+), 52 deletions(-)
> create mode 100644 include/linux/rtc/mt6397.h
>
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index d133d1f..015609d 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -19,63 +19,12 @@
> #include <linux/of_platform.h>
> #include <linux/regmap.h>
> #include <linux/rtc.h>
> -#include <linux/jiffies.h>
> #include <linux/platform_device.h>
> #include <linux/of_address.h>
> #include <linux/of_irq.h>
> #include <linux/io.h>
> #include <linux/mfd/mt6397/core.h>
> -
> -#define RTC_BBPU 0x0000
> -#define RTC_BBPU_CBUSY BIT(6)
> -
> -#define RTC_WRTGR 0x003c
> -
> -#define RTC_IRQ_STA 0x0002
> -#define RTC_IRQ_STA_AL BIT(0)
> -#define RTC_IRQ_STA_LP BIT(3)
> -
> -#define RTC_IRQ_EN 0x0004
> -#define RTC_IRQ_EN_AL BIT(0)
> -#define RTC_IRQ_EN_ONESHOT BIT(2)
> -#define RTC_IRQ_EN_LP BIT(3)
> -#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
> -
> -#define RTC_AL_MASK 0x0008
> -#define RTC_AL_MASK_DOW BIT(4)
> -
> -#define RTC_TC_SEC 0x000a
> -/* Min, Hour, Dom... register offset to RTC_TC_SEC */
> -#define RTC_OFFSET_SEC 0
> -#define RTC_OFFSET_MIN 1
> -#define RTC_OFFSET_HOUR 2
> -#define RTC_OFFSET_DOM 3
> -#define RTC_OFFSET_DOW 4
> -#define RTC_OFFSET_MTH 5
> -#define RTC_OFFSET_YEAR 6
> -#define RTC_OFFSET_COUNT 7
> -
> -#define RTC_AL_SEC 0x0018
> -
> -#define RTC_PDN2 0x002e
> -#define RTC_PDN2_PWRON_ALARM BIT(4)
> -
> -#define RTC_MIN_YEAR 1968
> -#define RTC_BASE_YEAR 1900
> -#define RTC_NUM_YEARS 128
> -#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
> -
> -#define MTK_RTC_POLL_DELAY_US 10
> -#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
> -
> -struct mt6397_rtc {
> - struct device *dev;
> - struct rtc_device *rtc_dev;
> - struct mutex lock;
> - struct regmap *regmap;
> - int irq;
> - u32 addr_base;
> -};
> +#include <linux/rtc/mt6397.h>
>
> static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
> {
> diff --git a/include/linux/rtc/mt6397.h b/include/linux/rtc/mt6397.h
> new file mode 100644
> index 0000000..4b19f51
> --- /dev/null
> +++ b/include/linux/rtc/mt6397.h
> @@ -0,0 +1,72 @@
> +
Unnecessary empty line
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2014-2018 MediaTek Inc.
> + *
> + * Author: Tianping.Fang <tianping.fang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> + * Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> + */
> +
> +#ifndef _LINUX_RTC_MT6397_H_
> +#define _LINUX_RTC_MT6397_H_
> +
> +#include <linux/jiffies.h>
> +#include <linux/mutex.h>
> +#include <linux/regmap.h>
> +#include <linux/rtc.h>
> +
> +#define RTC_BBPU 0x0000
> +#define RTC_BBPU_CBUSY BIT(6)
> +
> +#define RTC_WRTGR 0x003c
> +
> +#define RTC_IRQ_STA 0x0002
> +#define RTC_IRQ_STA_AL BIT(0)
> +#define RTC_IRQ_STA_LP BIT(3)
> +
> +#define RTC_IRQ_EN 0x0004
> +#define RTC_IRQ_EN_AL BIT(0)
> +#define RTC_IRQ_EN_ONESHOT BIT(2)
> +#define RTC_IRQ_EN_LP BIT(3)
> +#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
> +
> +#define RTC_AL_MASK 0x0008
> +#define RTC_AL_MASK_DOW BIT(4)
> +
> +#define RTC_TC_SEC 0x000a
> +/* Min, Hour, Dom... register offset to RTC_TC_SEC */
> +#define RTC_OFFSET_SEC 0
> +#define RTC_OFFSET_MIN 1
> +#define RTC_OFFSET_HOUR 2
> +#define RTC_OFFSET_DOM 3
> +#define RTC_OFFSET_DOW 4
> +#define RTC_OFFSET_MTH 5
> +#define RTC_OFFSET_YEAR 6
> +#define RTC_OFFSET_COUNT 7
> +
> +#define RTC_AL_SEC 0x0018
> +
> +#define RTC_PDN2 0x002e
> +#define RTC_PDN2_PWRON_ALARM BIT(4)
> +
> +#define RTC_MIN_YEAR 1968
> +#define RTC_BASE_YEAR 1900
> +#define RTC_NUM_YEARS 128
> +#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
> +
> +#define MTK_RTC_POLL_DELAY_US 10
> +#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
> +
> +struct mt6397_rtc {
> + struct device *dev;
> + struct rtc_device *rtc_dev;
> +
> + /* protect registers accessing */
> + struct mutex lock;
> + struct regmap *regmap;
> + int irq;
> + u32 addr_base;
> +};
> +
> +#endif /* _LINUX_RTC_MT6397_H_ */
> +
> --
> 2.7.4
>
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file
2018-03-23 9:57 ` Alexandre Belloni
@ 2018-03-24 7:31 ` Sean Wang
2018-03-24 18:54 ` Alexandre Belloni
0 siblings, 1 reply; 46+ messages in thread
From: Sean Wang @ 2018-03-24 7:31 UTC (permalink / raw)
To: Alexandre Belloni
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
On Fri, 2018-03-23 at 10:57 +0100, Alexandre Belloni wrote:
> On 23/03/2018 at 17:15:08 +0800, sean.wang@mediatek.com wrote:
> > From: Sean Wang <sean.wang@mediatek.com>
> >
> > This is in preparation for allowing other drivers can share the
> > declaration, so move the declaration into a globally visible header file.
> >
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> > drivers/rtc/rtc-mt6397.c | 53 +---------------------------------
> > include/linux/rtc/mt6397.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++
>
> This should go in include/linux/mfd/
include/linux/mfd/mt6397 is present, so include/linux/mfd/mt6397/rtc.h
seems a nice place to keep these declarations for the pmic rtc.
> > 2 files changed, 73 insertions(+), 52 deletions(-)
> > create mode 100644 include/linux/rtc/mt6397.h
> >
> > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> > index d133d1f..015609d 100644
> > --- a/drivers/rtc/rtc-mt6397.c
> > +++ b/drivers/rtc/rtc-mt6397.c
> > @@ -19,63 +19,12 @@
> > #include <linux/of_platform.h>
> > #include <linux/regmap.h>
> > #include <linux/rtc.h>
> > -#include <linux/jiffies.h>
> > #include <linux/platform_device.h>
> > #include <linux/of_address.h>
> > #include <linux/of_irq.h>
> > #include <linux/io.h>
> > #include <linux/mfd/mt6397/core.h>
> > -
> > -#define RTC_BBPU 0x0000
> > -#define RTC_BBPU_CBUSY BIT(6)
> > -
> > -#define RTC_WRTGR 0x003c
> > -
> > -#define RTC_IRQ_STA 0x0002
> > -#define RTC_IRQ_STA_AL BIT(0)
> > -#define RTC_IRQ_STA_LP BIT(3)
> > -
> > -#define RTC_IRQ_EN 0x0004
> > -#define RTC_IRQ_EN_AL BIT(0)
> > -#define RTC_IRQ_EN_ONESHOT BIT(2)
> > -#define RTC_IRQ_EN_LP BIT(3)
> > -#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
> > -
> > -#define RTC_AL_MASK 0x0008
> > -#define RTC_AL_MASK_DOW BIT(4)
> > -
> > -#define RTC_TC_SEC 0x000a
> > -/* Min, Hour, Dom... register offset to RTC_TC_SEC */
> > -#define RTC_OFFSET_SEC 0
> > -#define RTC_OFFSET_MIN 1
> > -#define RTC_OFFSET_HOUR 2
> > -#define RTC_OFFSET_DOM 3
> > -#define RTC_OFFSET_DOW 4
> > -#define RTC_OFFSET_MTH 5
> > -#define RTC_OFFSET_YEAR 6
> > -#define RTC_OFFSET_COUNT 7
> > -
> > -#define RTC_AL_SEC 0x0018
> > -
> > -#define RTC_PDN2 0x002e
> > -#define RTC_PDN2_PWRON_ALARM BIT(4)
> > -
> > -#define RTC_MIN_YEAR 1968
> > -#define RTC_BASE_YEAR 1900
> > -#define RTC_NUM_YEARS 128
> > -#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
> > -
> > -#define MTK_RTC_POLL_DELAY_US 10
> > -#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
> > -
> > -struct mt6397_rtc {
> > - struct device *dev;
> > - struct rtc_device *rtc_dev;
> > - struct mutex lock;
> > - struct regmap *regmap;
> > - int irq;
> > - u32 addr_base;
> > -};
> > +#include <linux/rtc/mt6397.h>
> >
> > static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
> > {
> > diff --git a/include/linux/rtc/mt6397.h b/include/linux/rtc/mt6397.h
> > new file mode 100644
> > index 0000000..4b19f51
> > --- /dev/null
> > +++ b/include/linux/rtc/mt6397.h
> > @@ -0,0 +1,72 @@
> > +
>
> Unnecessary empty line
>
will remove the unnecessary empty line
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright (C) 2014-2018 MediaTek Inc.
> > + *
> > + * Author: Tianping.Fang <tianping.fang@mediatek.com>
> > + * Sean Wang <sean.wang@mediatek.com>
> > + */
> > +
> > +#ifndef _LINUX_RTC_MT6397_H_
> > +#define _LINUX_RTC_MT6397_H_
> > +
> > +#include <linux/jiffies.h>
> > +#include <linux/mutex.h>
> > +#include <linux/regmap.h>
> > +#include <linux/rtc.h>
> > +
> > +#define RTC_BBPU 0x0000
> > +#define RTC_BBPU_CBUSY BIT(6)
> > +
> > +#define RTC_WRTGR 0x003c
> > +
> > +#define RTC_IRQ_STA 0x0002
> > +#define RTC_IRQ_STA_AL BIT(0)
> > +#define RTC_IRQ_STA_LP BIT(3)
> > +
> > +#define RTC_IRQ_EN 0x0004
> > +#define RTC_IRQ_EN_AL BIT(0)
> > +#define RTC_IRQ_EN_ONESHOT BIT(2)
> > +#define RTC_IRQ_EN_LP BIT(3)
> > +#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
> > +
> > +#define RTC_AL_MASK 0x0008
> > +#define RTC_AL_MASK_DOW BIT(4)
> > +
> > +#define RTC_TC_SEC 0x000a
> > +/* Min, Hour, Dom... register offset to RTC_TC_SEC */
> > +#define RTC_OFFSET_SEC 0
> > +#define RTC_OFFSET_MIN 1
> > +#define RTC_OFFSET_HOUR 2
> > +#define RTC_OFFSET_DOM 3
> > +#define RTC_OFFSET_DOW 4
> > +#define RTC_OFFSET_MTH 5
> > +#define RTC_OFFSET_YEAR 6
> > +#define RTC_OFFSET_COUNT 7
> > +
> > +#define RTC_AL_SEC 0x0018
> > +
> > +#define RTC_PDN2 0x002e
> > +#define RTC_PDN2_PWRON_ALARM BIT(4)
> > +
> > +#define RTC_MIN_YEAR 1968
> > +#define RTC_BASE_YEAR 1900
> > +#define RTC_NUM_YEARS 128
> > +#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
> > +
> > +#define MTK_RTC_POLL_DELAY_US 10
> > +#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
> > +
> > +struct mt6397_rtc {
> > + struct device *dev;
> > + struct rtc_device *rtc_dev;
> > +
> > + /* protect registers accessing */
> > + struct mutex lock;
> > + struct regmap *regmap;
> > + int irq;
> > + u32 addr_base;
> > +};
> > +
> > +#endif /* _LINUX_RTC_MT6397_H_ */
> > +
> > --
> > 2.7.4
> >
>
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file
2018-03-24 7:31 ` Sean Wang
@ 2018-03-24 18:54 ` Alexandre Belloni
0 siblings, 0 replies; 46+ messages in thread
From: Alexandre Belloni @ 2018-03-24 18:54 UTC (permalink / raw)
To: Sean Wang
Cc: robh+dt, mark.rutland, sre, lee.jones, a.zummo, eddie.huang,
devicetree, linux-rtc, linux-pm, linux-mediatek, linux-kernel
On 24/03/2018 at 15:31:49 +0800, Sean Wang wrote:
> On Fri, 2018-03-23 at 10:57 +0100, Alexandre Belloni wrote:
> > On 23/03/2018 at 17:15:08 +0800, sean.wang@mediatek.com wrote:
> > > From: Sean Wang <sean.wang@mediatek.com>
> > >
> > > This is in preparation for allowing other drivers can share the
> > > declaration, so move the declaration into a globally visible header file.
> > >
> > > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > > ---
> > > drivers/rtc/rtc-mt6397.c | 53 +---------------------------------
> > > include/linux/rtc/mt6397.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++
> >
> > This should go in include/linux/mfd/
>
> include/linux/mfd/mt6397 is present, so include/linux/mfd/mt6397/rtc.h
> seems a nice place to keep these declarations for the pmic rtc.
>
Yes, this seems good to me.
> > > 2 files changed, 73 insertions(+), 52 deletions(-)
> > > create mode 100644 include/linux/rtc/mt6397.h
> > >
> > > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> > > index d133d1f..015609d 100644
> > > --- a/drivers/rtc/rtc-mt6397.c
> > > +++ b/drivers/rtc/rtc-mt6397.c
> > > @@ -19,63 +19,12 @@
> > > #include <linux/of_platform.h>
> > > #include <linux/regmap.h>
> > > #include <linux/rtc.h>
> > > -#include <linux/jiffies.h>
> > > #include <linux/platform_device.h>
> > > #include <linux/of_address.h>
> > > #include <linux/of_irq.h>
> > > #include <linux/io.h>
> > > #include <linux/mfd/mt6397/core.h>
> > > -
> > > -#define RTC_BBPU 0x0000
> > > -#define RTC_BBPU_CBUSY BIT(6)
> > > -
> > > -#define RTC_WRTGR 0x003c
> > > -
> > > -#define RTC_IRQ_STA 0x0002
> > > -#define RTC_IRQ_STA_AL BIT(0)
> > > -#define RTC_IRQ_STA_LP BIT(3)
> > > -
> > > -#define RTC_IRQ_EN 0x0004
> > > -#define RTC_IRQ_EN_AL BIT(0)
> > > -#define RTC_IRQ_EN_ONESHOT BIT(2)
> > > -#define RTC_IRQ_EN_LP BIT(3)
> > > -#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
> > > -
> > > -#define RTC_AL_MASK 0x0008
> > > -#define RTC_AL_MASK_DOW BIT(4)
> > > -
> > > -#define RTC_TC_SEC 0x000a
> > > -/* Min, Hour, Dom... register offset to RTC_TC_SEC */
> > > -#define RTC_OFFSET_SEC 0
> > > -#define RTC_OFFSET_MIN 1
> > > -#define RTC_OFFSET_HOUR 2
> > > -#define RTC_OFFSET_DOM 3
> > > -#define RTC_OFFSET_DOW 4
> > > -#define RTC_OFFSET_MTH 5
> > > -#define RTC_OFFSET_YEAR 6
> > > -#define RTC_OFFSET_COUNT 7
> > > -
> > > -#define RTC_AL_SEC 0x0018
> > > -
> > > -#define RTC_PDN2 0x002e
> > > -#define RTC_PDN2_PWRON_ALARM BIT(4)
> > > -
> > > -#define RTC_MIN_YEAR 1968
> > > -#define RTC_BASE_YEAR 1900
> > > -#define RTC_NUM_YEARS 128
> > > -#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
> > > -
> > > -#define MTK_RTC_POLL_DELAY_US 10
> > > -#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
> > > -
> > > -struct mt6397_rtc {
> > > - struct device *dev;
> > > - struct rtc_device *rtc_dev;
> > > - struct mutex lock;
> > > - struct regmap *regmap;
> > > - int irq;
> > > - u32 addr_base;
> > > -};
> > > +#include <linux/rtc/mt6397.h>
> > >
> > > static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
> > > {
> > > diff --git a/include/linux/rtc/mt6397.h b/include/linux/rtc/mt6397.h
> > > new file mode 100644
> > > index 0000000..4b19f51
> > > --- /dev/null
> > > +++ b/include/linux/rtc/mt6397.h
> > > @@ -0,0 +1,72 @@
> > > +
> >
> > Unnecessary empty line
> >
>
> will remove the unnecessary empty line
>
> > > +// SPDX-License-Identifier: GPL-2.0
> > > +/*
> > > + * Copyright (C) 2014-2018 MediaTek Inc.
> > > + *
> > > + * Author: Tianping.Fang <tianping.fang@mediatek.com>
> > > + * Sean Wang <sean.wang@mediatek.com>
> > > + */
> > > +
> > > +#ifndef _LINUX_RTC_MT6397_H_
> > > +#define _LINUX_RTC_MT6397_H_
> > > +
> > > +#include <linux/jiffies.h>
> > > +#include <linux/mutex.h>
> > > +#include <linux/regmap.h>
> > > +#include <linux/rtc.h>
> > > +
> > > +#define RTC_BBPU 0x0000
> > > +#define RTC_BBPU_CBUSY BIT(6)
> > > +
> > > +#define RTC_WRTGR 0x003c
> > > +
> > > +#define RTC_IRQ_STA 0x0002
> > > +#define RTC_IRQ_STA_AL BIT(0)
> > > +#define RTC_IRQ_STA_LP BIT(3)
> > > +
> > > +#define RTC_IRQ_EN 0x0004
> > > +#define RTC_IRQ_EN_AL BIT(0)
> > > +#define RTC_IRQ_EN_ONESHOT BIT(2)
> > > +#define RTC_IRQ_EN_LP BIT(3)
> > > +#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
> > > +
> > > +#define RTC_AL_MASK 0x0008
> > > +#define RTC_AL_MASK_DOW BIT(4)
> > > +
> > > +#define RTC_TC_SEC 0x000a
> > > +/* Min, Hour, Dom... register offset to RTC_TC_SEC */
> > > +#define RTC_OFFSET_SEC 0
> > > +#define RTC_OFFSET_MIN 1
> > > +#define RTC_OFFSET_HOUR 2
> > > +#define RTC_OFFSET_DOM 3
> > > +#define RTC_OFFSET_DOW 4
> > > +#define RTC_OFFSET_MTH 5
> > > +#define RTC_OFFSET_YEAR 6
> > > +#define RTC_OFFSET_COUNT 7
> > > +
> > > +#define RTC_AL_SEC 0x0018
> > > +
> > > +#define RTC_PDN2 0x002e
> > > +#define RTC_PDN2_PWRON_ALARM BIT(4)
> > > +
> > > +#define RTC_MIN_YEAR 1968
> > > +#define RTC_BASE_YEAR 1900
> > > +#define RTC_NUM_YEARS 128
> > > +#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
> > > +
> > > +#define MTK_RTC_POLL_DELAY_US 10
> > > +#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
> > > +
> > > +struct mt6397_rtc {
> > > + struct device *dev;
> > > + struct rtc_device *rtc_dev;
> > > +
> > > + /* protect registers accessing */
> > > + struct mutex lock;
> > > + struct regmap *regmap;
> > > + int irq;
> > > + u32 addr_base;
> > > +};
> > > +
> > > +#endif /* _LINUX_RTC_MT6397_H_ */
> > > +
> > > --
> > > 2.7.4
> > >
> >
>
>
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file
2018-03-23 9:15 ` [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file sean.wang-NuS5LvNUpcJWk0Htik3J/w
[not found] ` <53afbe8172fb1afd809ce9ba1afeda924b9ea705.1521794177.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2018-03-24 20:00 ` Fabio Estevam
2018-03-25 3:13 ` Sean Wang
1 sibling, 1 reply; 46+ messages in thread
From: Fabio Estevam @ 2018-03-24 20:00 UTC (permalink / raw)
To: sean.wang
Cc: Rob Herring, Mark Rutland, Sebastian Reichel, Lee Jones,
Alessandro Zummo, Alexandre Belloni, eddie.huang,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list:REAL TIME CLOCK (RTC) SUBSYSTEM, linux-pm,
linux-mediatek, linux-kernel
On Fri, Mar 23, 2018 at 6:15 AM, <sean.wang@mediatek.com> wrote:
> --- /dev/null
> +++ b/include/linux/rtc/mt6397.h
> @@ -0,0 +1,72 @@
> +
> +// SPDX-License-Identifier: GPL-2.0
According to Documentation/process/license-rules.rst the SPDX notation
for C header file should be:
/* SPDX-License-Identifier: GPL-2.0 */
^ permalink raw reply [flat|nested] 46+ messages in thread
* Re: [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file
2018-03-24 20:00 ` Fabio Estevam
@ 2018-03-25 3:13 ` Sean Wang
0 siblings, 0 replies; 46+ messages in thread
From: Sean Wang @ 2018-03-25 3:13 UTC (permalink / raw)
To: Fabio Estevam
Cc: Rob Herring, Mark Rutland, Sebastian Reichel, Lee Jones,
Alessandro Zummo, Alexandre Belloni, eddie.huang,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list:REAL TIME CLOCK (RTC) SUBSYSTEM, linux-pm,
linux-mediatek, linux-kernel
On Sat, 2018-03-24 at 17:00 -0300, Fabio Estevam wrote:
> On Fri, Mar 23, 2018 at 6:15 AM, <sean.wang@mediatek.com> wrote:
>
> > --- /dev/null
> > +++ b/include/linux/rtc/mt6397.h
> > @@ -0,0 +1,72 @@
> > +
> > +// SPDX-License-Identifier: GPL-2.0
>
> According to Documentation/process/license-rules.rst the SPDX notation
> for C header file should be:
>
> /* SPDX-License-Identifier: GPL-2.0 */
Thank you, I'll have an improvement according to the license rule.
^ permalink raw reply [flat|nested] 46+ messages in thread
* [PATCH v1 13/16] rtc: mediatek: update license converting to using SPDX identifiers
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (8 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 11/16] rtc: mediatek: move the declaration into a globally visible header file sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 9:15 ` [PATCH v1 15/16] MAINTAINERS: update entry for ARM/Mediatek RTC DRIVER sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 9:15 ` [PATCH v1 16/16] MAINTAINERS: add an entry for MediaTek board level shutdown driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
11 siblings, 0 replies; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Update the license and as well convert to using SPDX identifiers.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/rtc/rtc-mt6397.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index f5dc70d..ad336a4 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -1,16 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0
/*
-* Copyright (c) 2014-2015 MediaTek Inc.
-* Author: Tianping.Fang <tianping.fang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2 as
-* published by the Free Software Foundation.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*/
+ * MediaTek PMIC RTC driver
+ *
+ * Copyright (C) 2014-2018 MediaTek Inc.
+ *
+ * Author: Tianping.Fang <tianping.fang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
+ * Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
+ */
#include <linux/err.h>
#include <linux/interrupt.h>
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH v1 15/16] MAINTAINERS: update entry for ARM/Mediatek RTC DRIVER
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (9 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 13/16] rtc: mediatek: update license converting to using SPDX identifiers sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-03-23 9:15 ` [PATCH v1 16/16] MAINTAINERS: add an entry for MediaTek board level shutdown driver sean.wang-NuS5LvNUpcJWk0Htik3J/w
11 siblings, 0 replies; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add new files for new dt-bindings and a globally visible header file.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index d3c33d7..1c13f29 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1626,9 +1626,11 @@ M: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
L: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org (moderated for non-subscribers)
L: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org (moderated for non-subscribers)
S: Maintained
+F: Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
F: Documentation/devicetree/bindings/rtc/rtc-mt7622.txt
F: drivers/rtc/rtc-mt6397.c
F: drivers/rtc/rtc-mt7622.c
+F: include/linux/rtc/mt6397.h
ARM/Mediatek SoC support
M: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread
* [PATCH v1 16/16] MAINTAINERS: add an entry for MediaTek board level shutdown driver
[not found] ` <cover.1521794176.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
` (10 preceding siblings ...)
2018-03-23 9:15 ` [PATCH v1 15/16] MAINTAINERS: update entry for ARM/Mediatek RTC DRIVER sean.wang-NuS5LvNUpcJWk0Htik3J/w
@ 2018-03-23 9:15 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w
11 siblings, 0 replies; 46+ messages in thread
From: sean.wang-NuS5LvNUpcJWk0Htik3J/w @ 2018-03-23 9:15 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
sre-DgEjT+Ai2ygdnm+yROfE0A, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, Sean Wang,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add an entry for the MediaTek board level shutdown driver.
Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
MAINTAINERS | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 1c13f29..863d1e3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8818,6 +8818,13 @@ S: Maintained
F: drivers/net/dsa/mt7530.*
F: net/dsa/tag_mtk.c
+MEDIATEK BOARD LEVEL SHUTDOWN DRIVERS
+M: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
+L: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
+S: Maintained
+F: Documentation/devicetree/bindings/power/reset/mt6397-rtc-poweroff.txt
+F: drivers/power/reset/mt6397-rtc-poweroff.c
+
MEDIATEK JPEG DRIVER
M: Rick Chang <rick.chang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
M: Bin Liu <bin.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
--
2.7.4
^ permalink raw reply related [flat|nested] 46+ messages in thread