Linux-PM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2
@ 2019-07-29 17:41 Frank Wunderlich
  2019-07-29 17:41 ` [PATCH v3 01/10] dt-bindings: add powercontroller Frank Wunderlich
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Frank Wunderlich

mainline-driver does not support mt6323

this series makes some cleanup to mt6397-rtc-driver, adds mt6323 and
implement power-controller on it.

tested on bananapi-r2

Original Patch from Josef Friedl

changes since v2:
	- Splitted some parts and rebased on 5.3-rc2:

	v2.1 dt-bindings: add powercontroller – try to make better subject
	v2.2 separate rtc-mt6397.txt (suggested by Alexandre Belloni)
		add missing commit-message (suggested by Matthias Brugger)
	v2.3 fix alloc after IRQ (suggested by Alexandre Belloni)
		new compatible (splitting suggested by Alexandre Belloni)
		needed due to different rtc-base/size see #7
	v2.4 simplifications (Define-res-macros)
		add mt6323 rtc+pwrc
	v2.5 add poweroff-driver (no change)
	v2.6 MAINTAINERS (no change)
	v2.7 DTS-Changes (no change)

changes since v1:
	- splitted into functional parts
	- more infos about changes

Josef Friedl (10):
  dt-bindings: add powercontroller
  dt-bindings: add missing mt6397 rtc
  rtc: mt6397: move some common definitions into rtc.h
  rtc: mt6397: improvements of rtc driver
  rtc: mt6397: add compatible for mt6323
  mfd: mt6323: some improvements of mt6397-core
  mfd: mt6323: add mt6323 rtc+pwrc
  power: reset: add driver for mt6323 poweroff
  MAINTAINERS: add Mediatek shutdown drivers
  arm: dts: mt6323: add keys, power-controller, rtc and codec

 .../devicetree/bindings/mfd/mt6397.txt        |  10 +-
 .../bindings/power/reset/mt6323-poweroff.txt  |  20 ++++
 .../devicetree/bindings/rtc/rtc-mt6397.txt    |  29 +++++
 MAINTAINERS                                   |   7 ++
 arch/arm/boot/dts/mt6323.dtsi                 |  27 +++++
 drivers/mfd/mt6397-core.c                     |  40 +++++--
 drivers/power/reset/Kconfig                   |  10 ++
 drivers/power/reset/Makefile                  |   1 +
 drivers/power/reset/mt6323-poweroff.c         |  97 ++++++++++++++++
 drivers/rtc/rtc-mt6397.c                      | 107 ++++--------------
 include/linux/mfd/mt6397/core.h               |   2 +
 include/linux/mfd/mt6397/rtc.h                |  71 ++++++++++++
 12 files changed, 323 insertions(+), 98 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
 create mode 100644 drivers/power/reset/mt6323-poweroff.c
 create mode 100644 include/linux/mfd/mt6397/rtc.h

--
2.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 01/10] dt-bindings: add powercontroller
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-08-12 10:20   ` Lee Jones
  2019-07-29 17:41 ` [PATCH v3 02/10] dt-bindings: add missing mt6397 rtc Frank Wunderlich
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

add mt6323-rtc and mt6323-pwrc to mt6397 mfd DT bindings
an example is shown in mt6323-poweroff.txt

changes since v2: separated rtc-mt6397.txt to part 2

Suggested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 .../devicetree/bindings/mfd/mt6397.txt        | 10 +++++++++-
 .../bindings/power/reset/mt6323-poweroff.txt  | 20 +++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt

diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
index 0ebd08af777d..44acb9827716 100644
--- a/Documentation/devicetree/bindings/mfd/mt6397.txt
+++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
@@ -8,6 +8,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules:
 - Clock
 - LED
 - Keys
+- Power controller

 It is interfaced to host controller using SPI interface by a proprietary hardware
 called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap.
@@ -22,8 +23,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"
@@ -46,6 +49,11 @@ Optional subnodes:
 		- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
 	see Documentation/devicetree/bindings/input/mtk-pmic-keys.txt

+- power-controller
+	Required properties:
+		- compatible: "mediatek,mt6323-pwrc"
+	For details, see Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt
+
 Example:
 	pwrap: pwrap@1000f000 {
 		compatible = "mediatek,mt8135-pwrap";
diff --git a/Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt b/Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt
new file mode 100644
index 000000000000..933f0c48e887
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt
@@ -0,0 +1,20 @@
+Device Tree Bindings for Power Controller on MediaTek PMIC
+
+The power controller which could be found on PMIC is responsible for externally
+powering off or on the remote MediaTek SoC through the circuit BBPU.
+
+Required properties:
+- compatible: Should be one of follows
+       "mediatek,mt6323-pwrc": for MT6323 PMIC
+
+Example:
+
+       pmic {
+               compatible = "mediatek,mt6323";
+
+               ...
+
+               power-controller {
+                       compatible = "mediatek,mt6323-pwrc";
+               };
+       }
--
2.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 02/10] dt-bindings: add missing mt6397 rtc
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
  2019-07-29 17:41 ` [PATCH v3 01/10] dt-bindings: add powercontroller Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-08-05 13:47   ` Alexandre Belloni
  2019-07-29 17:41 ` [PATCH v3 03/10] rtc: mt6397: move some common definitions into rtc.h Frank Wunderlich
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

add missing devicetree-binding document for mt6397 rtc
in later patch driver is extended with mt6323 chip

changes since v2: splitted rtc-mt6397.txt from first patch

Suggested-By: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Josef Friedl <josef.friedl@speed.at>
---
 .../devicetree/bindings/rtc/rtc-mt6397.txt    | 29 +++++++++++++++++++
 1 file changed, 29 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 000000000000..ebd1cf80dcc8
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
@@ -0,0 +1,29 @@
+Device-Tree bindings for MediaTek PMIC based RTC
+
+MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
+as a type of multi-function device (MFD). The RTC can be configured and set up
+with PMIC wrapper bus which is a common resource shared with the other
+functions found on the same PMIC.
+
+For MediaTek PMIC MFD bindings, see:
+Documentation/devicetree/bindings/mfd/mt6397.txt
+
+For MediaTek PMIC wrapper bus bindings, see:
+Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
+
+Required properties:
+- compatible: Should be one of follows
+       "mediatek,mt6323-rtc": for MT6323 PMIC
+       "mediatek,mt6397-rtc": for MT6397 PMIC
+
+Example:
+
+       pmic {
+               compatible = "mediatek,mt6323";
+
+               ...
+
+               rtc {
+                       compatible = "mediatek,mt6323-rtc";
+               };
+       };
--
2.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 03/10] rtc: mt6397: move some common definitions into rtc.h
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
  2019-07-29 17:41 ` [PATCH v3 01/10] dt-bindings: add powercontroller Frank Wunderlich
  2019-07-29 17:41 ` [PATCH v3 02/10] dt-bindings: add missing mt6397 rtc Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-08-05 13:48   ` Alexandre Belloni
  2019-07-29 17:41 ` [PATCH v3 04/10] rtc: mt6397: improvements of rtc driver Frank Wunderlich
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

move code to separate header-file to reuse definitions later
in poweroff-driver (drivers/power/reset/mt6323-poweroff.c)

changes since v2: add missing commit-message

Suggested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/rtc/rtc-mt6397.c       | 55 +-------------------------
 include/linux/mfd/mt6397/rtc.h | 71 ++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 54 deletions(-)
 create mode 100644 include/linux/mfd/mt6397/rtc.h

diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index b46ed4dc7015..c08ee5edf865 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -9,60 +9,7 @@
 #include <linux/module.h>
 #include <linux/regmap.h>
 #include <linux/rtc.h>
-#include <linux/irqdomain.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)
-
-struct mt6397_rtc {
-	struct device		*dev;
-	struct rtc_device	*rtc_dev;
-	struct mutex		lock;
-	struct regmap		*regmap;
-	int			irq;
-	u32			addr_base;
-};
+#include <linux/mfd/mt6397/rtc.h>

 static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
 {
diff --git a/include/linux/mfd/mt6397/rtc.h b/include/linux/mfd/mt6397/rtc.h
new file mode 100644
index 000000000000..b702c29e8c74
--- /dev/null
+++ b/include/linux/mfd/mt6397/rtc.h
@@ -0,0 +1,71 @@
+/* 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_MFD_MT6397_RTC_H_
+#define _LINUX_MFD_MT6397_RTC_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_BBPU_KEY            (0x43 << 8)
+
+#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 register access from multiple tasks */
+	struct mutex            lock;
+	struct regmap           *regmap;
+	int                     irq;
+	u32                     addr_base;
+};
+
+#endif /* _LINUX_MFD_MT6397_RTC_H_ */
--
2.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 04/10] rtc: mt6397: improvements of rtc driver
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
                   ` (2 preceding siblings ...)
  2019-07-29 17:41 ` [PATCH v3 03/10] rtc: mt6397: move some common definitions into rtc.h Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-07-29 17:41 ` [PATCH v3 05/10] rtc: mt6397: add compatible for mt6323 Frank Wunderlich
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

- use regmap_read_poll_timeout to drop while-loop
- use devm-api to drop remove-callback

changes since v2:

- fix allocation after irq-request
- compatible for mt6323 in separate commit => part 5

Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/rtc/rtc-mt6397.c | 51 +++++++++++++++-------------------------
 1 file changed, 19 insertions(+), 32 deletions(-)

diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index c08ee5edf865..9370b7fc9f81 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -4,16 +4,19 @@
 * Author: Tianping.Fang <tianping.fang@mediatek.com>
 */

-#include <linux/delay.h>
-#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/mfd/mt6397/core.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/rtc.h>
 #include <linux/mfd/mt6397/rtc.h>
+#include <linux/mod_devicetable.h>

 static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
 {
-	unsigned long timeout = jiffies + HZ;
 	int ret;
 	u32 data;

@@ -21,19 +24,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 < 0)
+		dev_err(rtc->dev, "failed to write WRTGE: %d\n", ret);

 	return ret;
 }
@@ -266,19 +263,19 @@ static int mtk_rtc_probe(struct platform_device *pdev)
 		return rtc->irq;

 	rtc->regmap = mt6397_chip->regmap;
-	rtc->dev = &pdev->dev;
 	mutex_init(&rtc->lock);

 	platform_set_drvdata(pdev, rtc);

-	rtc->rtc_dev = devm_rtc_allocate_device(rtc->dev);
+	rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc->rtc_dev))
 		return PTR_ERR(rtc->rtc_dev);

-	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);
@@ -302,15 +299,6 @@ static int mtk_rtc_probe(struct platform_device *pdev)
 	return ret;
 }

-static int mtk_rtc_remove(struct platform_device *pdev)
-{
-	struct mt6397_rtc *rtc = platform_get_drvdata(pdev);
-
-	free_irq(rtc->irq, rtc);
-
-	return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int mt6397_rtc_suspend(struct device *dev)
 {
@@ -349,7 +337,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.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 05/10] rtc: mt6397: add compatible for mt6323
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
                   ` (3 preceding siblings ...)
  2019-07-29 17:41 ` [PATCH v3 04/10] rtc: mt6397: improvements of rtc driver Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-08-05 13:50   ` Alexandre Belloni
  2019-07-29 17:41 ` [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core Frank Wunderlich
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

use mt6397 rtc driver also for mt6323
compatible needed because of different rtc-base/size see part 7

changes since v2: splitted this from v2.3 suggested-by Alexandre Belloni

Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 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 9370b7fc9f81..21cd9cc8b4c7 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -325,6 +325,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.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
                   ` (4 preceding siblings ...)
  2019-07-29 17:41 ` [PATCH v3 05/10] rtc: mt6397: add compatible for mt6323 Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-08-12 10:22   ` Lee Jones
  2019-07-29 17:41 ` [PATCH v3 07/10] mfd: mt6323: add mt6323 rtc+pwrc Frank Wunderlich
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

simplyfications (resource definitions my DEFINE_RES_* macros)

changes since v2: splitted v2 part 4 into 6+7

Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/mfd/mt6397-core.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 337bcccdb914..5f7070267c9a 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -1,10 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2014 MediaTek Inc.
+ * Copyright (c) 2014-2018 MediaTek Inc.
  * Author: Flora Fu, MediaTek
  */

 #include <linux/interrupt.h>
+#include <linux/ioport.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/of_irq.h>
@@ -23,16 +24,8 @@
 #define MT6397_CID_CODE		0x97

 static const struct resource mt6397_rtc_resources[] = {
-	{
-		.start = MT6397_RTC_BASE,
-		.end   = MT6397_RTC_BASE + MT6397_RTC_SIZE,
-		.flags = IORESOURCE_MEM,
-	},
-	{
-		.start = MT6397_IRQ_RTC,
-		.end   = MT6397_IRQ_RTC,
-		.flags = IORESOURCE_IRQ,
-	},
+	DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE),
+	DEFINE_RES_IRQ(MT6397_IRQ_RTC),
 };

 static const struct resource mt6323_keys_resources[] = {
--
2.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 07/10] mfd: mt6323: add mt6323 rtc+pwrc
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
                   ` (5 preceding siblings ...)
  2019-07-29 17:41 ` [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-08-12 10:22   ` Lee Jones
  2019-07-29 17:41 ` [PATCH v3 08/10] power: reset: add driver for mt6323 poweroff Frank Wunderlich
  2019-07-29 18:16 ` [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
  8 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

add entry for rtc and power-controller to mt6323

changes since v2: only splitting, second part of v2 part 4

Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/mfd/mt6397-core.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 5f7070267c9a..a4abce00f156 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -16,13 +16,24 @@
 #include <linux/mfd/mt6397/registers.h>
 #include <linux/mfd/mt6323/registers.h>

+#define MT6323_RTC_BASE		0x8000
+#define MT6323_RTC_SIZE		0x40
+
 #define MT6397_RTC_BASE		0xe000
 #define MT6397_RTC_SIZE		0x3e

+#define MT6323_PWRC_BASE	0x8000
+#define MT6323_PWRC_SIZE	0x40
+
 #define MT6323_CID_CODE		0x23
 #define MT6391_CID_CODE		0x91
 #define MT6397_CID_CODE		0x97

+static const struct resource mt6323_rtc_resources[] = {
+	DEFINE_RES_MEM(MT6323_RTC_BASE, MT6323_RTC_SIZE),
+	DEFINE_RES_IRQ(MT6323_IRQ_STATUS_RTC),
+};
+
 static const struct resource mt6397_rtc_resources[] = {
 	DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE),
 	DEFINE_RES_IRQ(MT6397_IRQ_RTC),
@@ -38,8 +49,17 @@ static const struct resource mt6397_keys_resources[] = {
 	DEFINE_RES_IRQ(MT6397_IRQ_HOMEKEY),
 };

+static const struct resource mt6323_pwrc_resources[] = {
+	DEFINE_RES_MEM(MT6323_PWRC_BASE, MT6323_PWRC_SIZE),
+};
+
 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"
 	}, {
@@ -50,6 +70,11 @@ static const struct mfd_cell mt6323_devs[] = {
 		.num_resources = ARRAY_SIZE(mt6323_keys_resources),
 		.resources = mt6323_keys_resources,
 		.of_compatible = "mediatek,mt6323-keys"
+	}, {
+		.name = "mt6323-pwrc",
+		.num_resources = ARRAY_SIZE(mt6323_pwrc_resources),
+		.resources = mt6323_pwrc_resources,
+		.of_compatible = "mediatek,mt6323-pwrc"
 	},
 };

--
2.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 08/10] power: reset: add driver for mt6323 poweroff
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
                   ` (6 preceding siblings ...)
  2019-07-29 17:41 ` [PATCH v3 07/10] mfd: mt6323: add mt6323 rtc+pwrc Frank Wunderlich
@ 2019-07-29 17:41 ` Frank Wunderlich
  2019-07-29 18:16 ` [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
  8 siblings, 0 replies; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 17:41 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang
  Cc: Josef Friedl, Frank Wunderlich

From: Josef Friedl <josef.friedl@speed.at>

add poweroff driver for mt6323 and make Makefile and Kconfig-Entries

changes since v2: none (=v2 part 5)

Suggested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/power/reset/Kconfig           | 10 +++
 drivers/power/reset/Makefile          |  1 +
 drivers/power/reset/mt6323-poweroff.c | 97 +++++++++++++++++++++++++++
 include/linux/mfd/mt6397/core.h       |  2 +
 4 files changed, 110 insertions(+)
 create mode 100644 drivers/power/reset/mt6323-poweroff.c

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index a564237278ff..c721939767eb 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -140,6 +140,16 @@ config POWER_RESET_LTC2952
 	  This driver supports an external powerdown trigger and board power
 	  down via the LTC2952. Bindings are made in the device tree.

+config POWER_RESET_MT6323
+       bool "MediaTek MT6323 power-off driver"
+       depends on MFD_MT6397
+       help
+         The power-off driver is responsible for externally shutdown down
+         the power of a remote MediaTek SoC MT6323 is connected to through
+         controlling a tiny circuit BBPU inside MT6323 RTC.
+
+         Say Y if you have a board where MT6323 could be found.
+
 config POWER_RESET_QNAP
 	bool "QNAP power-off driver"
 	depends on OF_GPIO && PLAT_ORION
diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile
index 85da3198e4e0..da37f8b851dc 100644
--- a/drivers/power/reset/Makefile
+++ b/drivers/power/reset/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o
 obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o
 obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o
 obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o
+obj-$(CONFIG_POWER_RESET_MT6323) += mt6323-poweroff.o
 obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o
 obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o
 obj-$(CONFIG_POWER_RESET_PIIX4_POWEROFF) += piix4-poweroff.o
diff --git a/drivers/power/reset/mt6323-poweroff.c b/drivers/power/reset/mt6323-poweroff.c
new file mode 100644
index 000000000000..1caf43d9e46d
--- /dev/null
+++ b/drivers/power/reset/mt6323-poweroff.c
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Power off through MediaTek PMIC
+ *
+ * Copyright (C) 2018 MediaTek Inc.
+ *
+ * Author: Sean Wang <sean.wang@mediatek.com>
+ *
+ */
+
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/mfd/mt6397/core.h>
+#include <linux/mfd/mt6397/rtc.h>
+
+struct mt6323_pwrc {
+	struct device *dev;
+	struct regmap *regmap;
+	u32 base;
+};
+
+static struct mt6323_pwrc *mt_pwrc;
+
+static void mt6323_do_pwroff(void)
+{
+	struct mt6323_pwrc *pwrc = mt_pwrc;
+	unsigned int val;
+	int ret;
+
+	regmap_write(pwrc->regmap, pwrc->base + RTC_BBPU, RTC_BBPU_KEY);
+	regmap_write(pwrc->regmap, pwrc->base + RTC_WRTGR, 1);
+
+	ret = regmap_read_poll_timeout(pwrc->regmap,
+					pwrc->base + RTC_BBPU, val,
+					!(val & RTC_BBPU_CBUSY),
+					MTK_RTC_POLL_DELAY_US,
+					MTK_RTC_POLL_TIMEOUT);
+	if (ret)
+		dev_err(pwrc->dev, "failed to write BBPU: %d\n", ret);
+
+	/* Wait some time until system down, otherwise, notice with a warn */
+	mdelay(1000);
+
+	WARN_ONCE(1, "Unable to power off system\n");
+}
+
+static int mt6323_pwrc_probe(struct platform_device *pdev)
+{
+	struct mt6397_chip *mt6397_chip = dev_get_drvdata(pdev->dev.parent);
+	struct mt6323_pwrc *pwrc;
+	struct resource *res;
+
+	pwrc = devm_kzalloc(&pdev->dev, sizeof(*pwrc), GFP_KERNEL);
+	if (!pwrc)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	pwrc->base = res->start;
+	pwrc->regmap = mt6397_chip->regmap;
+	pwrc->dev = &pdev->dev;
+	mt_pwrc = pwrc;
+
+	pm_power_off = &mt6323_do_pwroff;
+
+	return 0;
+}
+
+static int mt6323_pwrc_remove(struct platform_device *pdev)
+{
+	if (pm_power_off == &mt6323_do_pwroff)
+		pm_power_off = NULL;
+
+	return 0;
+}
+
+static const struct of_device_id mt6323_pwrc_dt_match[] = {
+	{ .compatible = "mediatek,mt6323-pwrc" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mt6323_pwrc_dt_match);
+
+static struct platform_driver mt6323_pwrc_driver = {
+	.probe          = mt6323_pwrc_probe,
+	.remove         = mt6323_pwrc_remove,
+	.driver         = {
+		.name   = "mt6323-pwrc",
+		.of_match_table = mt6323_pwrc_dt_match,
+	},
+};
+
+module_platform_driver(mt6323_pwrc_driver);
+
+MODULE_DESCRIPTION("Poweroff driver for MT6323 PMIC");
+MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/mfd/mt6397/core.h b/include/linux/mfd/mt6397/core.h
index 25a95e72179b..652da61e3711 100644
--- a/include/linux/mfd/mt6397/core.h
+++ b/include/linux/mfd/mt6397/core.h
@@ -7,6 +7,8 @@
 #ifndef __MFD_MT6397_CORE_H__
 #define __MFD_MT6397_CORE_H__

+#include <linux/mutex.h>
+
 enum mt6397_irq_numbers {
 	MT6397_IRQ_SPKL_AB = 0,
 	MT6397_IRQ_SPKR_AB,
--
2.17.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2
  2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
                   ` (7 preceding siblings ...)
  2019-07-29 17:41 ` [PATCH v3 08/10] power: reset: add driver for mt6323 poweroff Frank Wunderlich
@ 2019-07-29 18:16 ` Frank Wunderlich
  8 siblings, 0 replies; 23+ messages in thread
From: Frank Wunderlich @ 2019-07-29 18:16 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, Lee Jones, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang

Hi,

sorry about missing part 9+10, my mail-provider blocks the mails, 
currently i cannot send with this account

i try sending with another

regards Frank

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 02/10] dt-bindings: add missing mt6397 rtc
  2019-07-29 17:41 ` [PATCH v3 02/10] dt-bindings: add missing mt6397 rtc Frank Wunderlich
@ 2019-08-05 13:47   ` Alexandre Belloni
  0 siblings, 0 replies; 23+ messages in thread
From: Alexandre Belloni @ 2019-08-05 13:47 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Allison Randal, David S. Miller, devicetree,
	Eddie Huang, Greg Kroah-Hartman, Jonathan Cameron, Kate Stewart,
	Lee Jones, linux-arm-kernel, linux-kernel, linux-mediatek,
	linux-pm, linux-rtc, Mark Rutland, Matthias Brugger,
	Mauro Carvalho Chehab, Nicolas Ferre, Richard Fontana,
	Rob Herring, Sean Wang, Sebastian Reichel, Thomas Gleixner,
	Tianping . Fang, Josef Friedl

On 29/07/2019 19:41:46+0200, Frank Wunderlich wrote:
> From: Josef Friedl <josef.friedl@speed.at>
> 
> add missing devicetree-binding document for mt6397 rtc
> in later patch driver is extended with mt6323 chip
> 
> changes since v2: splitted rtc-mt6397.txt from first patch

This line should be after the --- marker.
> 
> Suggested-By: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Your SoB should appear last.

> Signed-off-by: Josef Friedl <josef.friedl@speed.at>
> ---
>  .../devicetree/bindings/rtc/rtc-mt6397.txt    | 29 +++++++++++++++++++
>  1 file changed, 29 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 000000000000..ebd1cf80dcc8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
> @@ -0,0 +1,29 @@
> +Device-Tree bindings for MediaTek PMIC based RTC
> +
> +MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
> +as a type of multi-function device (MFD). The RTC can be configured and set up
> +with PMIC wrapper bus which is a common resource shared with the other
> +functions found on the same PMIC.
> +
> +For MediaTek PMIC MFD bindings, see:
> +Documentation/devicetree/bindings/mfd/mt6397.txt
> +
> +For MediaTek PMIC wrapper bus bindings, see:
> +Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
> +
> +Required properties:
> +- compatible: Should be one of follows
> +       "mediatek,mt6323-rtc": for MT6323 PMIC
> +       "mediatek,mt6397-rtc": for MT6397 PMIC
> +
> +Example:
> +
> +       pmic {
> +               compatible = "mediatek,mt6323";
> +
> +               ...
> +
> +               rtc {
> +                       compatible = "mediatek,mt6323-rtc";
> +               };
> +       };
> --
> 2.17.1
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 03/10] rtc: mt6397: move some common definitions into rtc.h
  2019-07-29 17:41 ` [PATCH v3 03/10] rtc: mt6397: move some common definitions into rtc.h Frank Wunderlich
@ 2019-08-05 13:48   ` Alexandre Belloni
  2019-08-12 10:18     ` Lee Jones
  0 siblings, 1 reply; 23+ messages in thread
From: Alexandre Belloni @ 2019-08-05 13:48 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Allison Randal, David S. Miller, devicetree,
	Eddie Huang, Greg Kroah-Hartman, Jonathan Cameron, Kate Stewart,
	Lee Jones, linux-arm-kernel, linux-kernel, linux-mediatek,
	linux-pm, linux-rtc, Mark Rutland, Matthias Brugger,
	Mauro Carvalho Chehab, Nicolas Ferre, Richard Fontana,
	Rob Herring, Sean Wang, Sebastian Reichel, Thomas Gleixner,
	Tianping . Fang, Josef Friedl

On 29/07/2019 19:41:47+0200, Frank Wunderlich wrote:
> From: Josef Friedl <josef.friedl@speed.at>
> 
> move code to separate header-file to reuse definitions later
> in poweroff-driver (drivers/power/reset/mt6323-poweroff.c)
> 
> changes since v2: add missing commit-message

The changelog should be after the --- marker.
> 
> Suggested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Josef Friedl <josef.friedl@speed.at>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>  drivers/rtc/rtc-mt6397.c       | 55 +-------------------------
>  include/linux/mfd/mt6397/rtc.h | 71 ++++++++++++++++++++++++++++++++++
>  2 files changed, 72 insertions(+), 54 deletions(-)
>  create mode 100644 include/linux/mfd/mt6397/rtc.h
> 
> diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
> index b46ed4dc7015..c08ee5edf865 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -9,60 +9,7 @@
>  #include <linux/module.h>
>  #include <linux/regmap.h>
>  #include <linux/rtc.h>
> -#include <linux/irqdomain.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)
> -
> -struct mt6397_rtc {
> -	struct device		*dev;
> -	struct rtc_device	*rtc_dev;
> -	struct mutex		lock;
> -	struct regmap		*regmap;
> -	int			irq;
> -	u32			addr_base;
> -};
> +#include <linux/mfd/mt6397/rtc.h>
> 
>  static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
>  {
> diff --git a/include/linux/mfd/mt6397/rtc.h b/include/linux/mfd/mt6397/rtc.h
> new file mode 100644
> index 000000000000..b702c29e8c74
> --- /dev/null
> +++ b/include/linux/mfd/mt6397/rtc.h
> @@ -0,0 +1,71 @@
> +/* 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_MFD_MT6397_RTC_H_
> +#define _LINUX_MFD_MT6397_RTC_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_BBPU_KEY            (0x43 << 8)
> +
> +#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 register access from multiple tasks */
> +	struct mutex            lock;
> +	struct regmap           *regmap;
> +	int                     irq;
> +	u32                     addr_base;
> +};
> +
> +#endif /* _LINUX_MFD_MT6397_RTC_H_ */
> --
> 2.17.1
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 05/10] rtc: mt6397: add compatible for mt6323
  2019-07-29 17:41 ` [PATCH v3 05/10] rtc: mt6397: add compatible for mt6323 Frank Wunderlich
@ 2019-08-05 13:50   ` Alexandre Belloni
  0 siblings, 0 replies; 23+ messages in thread
From: Alexandre Belloni @ 2019-08-05 13:50 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Allison Randal, David S. Miller, devicetree,
	Eddie Huang, Greg Kroah-Hartman, Jonathan Cameron, Kate Stewart,
	Lee Jones, linux-arm-kernel, linux-kernel, linux-mediatek,
	linux-pm, linux-rtc, Mark Rutland, Matthias Brugger,
	Mauro Carvalho Chehab, Nicolas Ferre, Richard Fontana,
	Rob Herring, Sean Wang, Sebastian Reichel, Thomas Gleixner,
	Tianping . Fang, Josef Friedl

On 29/07/2019 19:41:49+0200, Frank Wunderlich wrote:
> From: Josef Friedl <josef.friedl@speed.at>
> 
> use mt6397 rtc driver also for mt6323
> compatible needed because of different rtc-base/size see part 7

I still don't think this is a good reason so I would remove that
sentence. Also, it refers to part 7 which is an info that will not be
available when looking at the git history.

> 
> changes since v2: splitted this from v2.3 suggested-by Alexandre Belloni
> 

Changelog after the --- marker please.

> Signed-off-by: Josef Friedl <josef.friedl@speed.at>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>  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 9370b7fc9f81..21cd9cc8b4c7 100644
> --- a/drivers/rtc/rtc-mt6397.c
> +++ b/drivers/rtc/rtc-mt6397.c
> @@ -325,6 +325,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.17.1
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 03/10] rtc: mt6397: move some common definitions into rtc.h
  2019-08-05 13:48   ` Alexandre Belloni
@ 2019-08-12 10:18     ` Lee Jones
  0 siblings, 0 replies; 23+ messages in thread
From: Lee Jones @ 2019-08-12 10:18 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Frank Wunderlich, Alessandro Zummo, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

On Mon, 05 Aug 2019, Alexandre Belloni wrote:

> On 29/07/2019 19:41:47+0200, Frank Wunderlich wrote:
> > From: Josef Friedl <josef.friedl@speed.at>
> > 
> > move code to separate header-file to reuse definitions later
> > in poweroff-driver (drivers/power/reset/mt6323-poweroff.c)
> > 
> > changes since v2: add missing commit-message
> 
> The changelog should be after the --- marker.
> > 
> > Suggested-by: Frank Wunderlich <frank-w@public-files.de>
> > Signed-off-by: Josef Friedl <josef.friedl@speed.at>
> > Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> > ---
> >  drivers/rtc/rtc-mt6397.c       | 55 +-------------------------
> >  include/linux/mfd/mt6397/rtc.h | 71 ++++++++++++++++++++++++++++++++++

I think include/linux/rtc/mt6397.h would be better?

Certainly from a maintainance PoV, it would be better reviewed and
looked after by an RTC expert.

> >  2 files changed, 72 insertions(+), 54 deletions(-)
> >  create mode 100644 include/linux/mfd/mt6397/rtc.h

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 01/10] dt-bindings: add powercontroller
  2019-07-29 17:41 ` [PATCH v3 01/10] dt-bindings: add powercontroller Frank Wunderlich
@ 2019-08-12 10:20   ` Lee Jones
  2019-08-12 11:10     ` Aw: " Frank Wunderlich
  0 siblings, 1 reply; 23+ messages in thread
From: Lee Jones @ 2019-08-12 10:20 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

On Mon, 29 Jul 2019, Frank Wunderlich wrote:

> From: Josef Friedl <josef.friedl@speed.at>
> 
> add mt6323-rtc and mt6323-pwrc to mt6397 mfd DT bindings
> an example is shown in mt6323-poweroff.txt
> 
> changes since v2: separated rtc-mt6397.txt to part 2
> 
> Suggested-by: Frank Wunderlich <frank-w@public-files.de>
> Signed-off-by: Josef Friedl <josef.friedl@speed.at>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>  .../devicetree/bindings/mfd/mt6397.txt        | 10 +++++++++-
>  .../bindings/power/reset/mt6323-poweroff.txt  | 20 +++++++++++++++++++
>  2 files changed, 29 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt
> 
> diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
> index 0ebd08af777d..44acb9827716 100644
> --- a/Documentation/devicetree/bindings/mfd/mt6397.txt
> +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
> @@ -8,6 +8,7 @@ MT6397/MT6323 is a multifunction device with the following sub modules:
>  - Clock
>  - LED
>  - Keys
> +- Power controller
> 
>  It is interfaced to host controller using SPI interface by a proprietary hardware
>  called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap.
> @@ -22,8 +23,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

Please use relative paths.

E.g: ../bindings/rtc/rtc-mt6397.txt

Apart from that, the MFD parts look okay to me.

For my own reference:
  Acked-for-MFD-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] 23+ messages in thread

* Re: [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core
  2019-07-29 17:41 ` [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core Frank Wunderlich
@ 2019-08-12 10:22   ` Lee Jones
  2019-08-12 11:25     ` Aw: " Frank Wunderlich
  0 siblings, 1 reply; 23+ messages in thread
From: Lee Jones @ 2019-08-12 10:22 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

On Mon, 29 Jul 2019, Frank Wunderlich wrote:

> From: Josef Friedl <josef.friedl@speed.at>
> 
> simplyfications (resource definitions my DEFINE_RES_* macros)
> 
> changes since v2: splitted v2 part 4 into 6+7
> 
> Signed-off-by: Josef Friedl <josef.friedl@speed.at>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>  drivers/mfd/mt6397-core.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> index 337bcccdb914..5f7070267c9a 100644
> --- a/drivers/mfd/mt6397-core.c
> +++ b/drivers/mfd/mt6397-core.c
> @@ -1,10 +1,11 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  /*
> - * Copyright (c) 2014 MediaTek Inc.
> + * Copyright (c) 2014-2018 MediaTek Inc.

This is out of date.  Please update it.

Once fixed, please apply my:

For my own reference:
  Acked-for-MFD-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] 23+ messages in thread

* Re: [PATCH v3 07/10] mfd: mt6323: add mt6323 rtc+pwrc
  2019-07-29 17:41 ` [PATCH v3 07/10] mfd: mt6323: add mt6323 rtc+pwrc Frank Wunderlich
@ 2019-08-12 10:22   ` Lee Jones
  0 siblings, 0 replies; 23+ messages in thread
From: Lee Jones @ 2019-08-12 10:22 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

On Mon, 29 Jul 2019, Frank Wunderlich wrote:

> From: Josef Friedl <josef.friedl@speed.at>
> 
> add entry for rtc and power-controller to mt6323
> 
> changes since v2: only splitting, second part of v2 part 4
> 
> Signed-off-by: Josef Friedl <josef.friedl@speed.at>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>  drivers/mfd/mt6397-core.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)

For my own reference:
  Acked-for-MFD-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] 23+ messages in thread

* Aw: Re: [PATCH v3 01/10] dt-bindings: add powercontroller
  2019-08-12 10:20   ` Lee Jones
@ 2019-08-12 11:10     ` " Frank Wunderlich
  2019-08-12 11:25       ` Lee Jones
  0 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-08-12 11:10 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

> Gesendet: Montag, 12. August 2019 um 12:20 Uhr
> Von: "Lee Jones" <lee.jones@linaro.org>

> > --- a/Documentation/devicetree/bindings/mfd/mt6397.txt
...
> > +	For details, see Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
>
> Please use relative paths.
>
> E.g: ../bindings/rtc/rtc-mt6397.txt

Hi,

as we are in Documentation/devicetree/bindings/mfd/ it should be ../../bindings/..., right? or ../rtc/rtc-mt6397.txt ?

regards Frank

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Re: [PATCH v3 01/10] dt-bindings: add powercontroller
  2019-08-12 11:10     ` Aw: " Frank Wunderlich
@ 2019-08-12 11:25       ` Lee Jones
  2019-08-12 11:37         ` Aw: " Frank Wunderlich
  0 siblings, 1 reply; 23+ messages in thread
From: Lee Jones @ 2019-08-12 11:25 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

On Mon, 12 Aug 2019, Frank Wunderlich wrote:

> > Gesendet: Montag, 12. August 2019 um 12:20 Uhr
> > Von: "Lee Jones" <lee.jones@linaro.org>
> 
> > > --- a/Documentation/devicetree/bindings/mfd/mt6397.txt
> ...
> > > +	For details, see Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
> >
> > Please use relative paths.
> >
> > E.g: ../bindings/rtc/rtc-mt6397.txt
> 
> Hi,
> 
> as we are in Documentation/devicetree/bindings/mfd/ it should be
> ../../bindings/..., right? or ../rtc/rtc-mt6397.txt ?

It was an example (hence the "E.g.").

You will need to adapt it depending on where the file ends up.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Aw: Re: [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core
  2019-08-12 10:22   ` Lee Jones
@ 2019-08-12 11:25     ` " Frank Wunderlich
  2019-08-12 11:27       ` Lee Jones
  0 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-08-12 11:25 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kate Stewart, Mark Rutland, Alexandre Belloni, linux-kernel,
	Richard Fontana, Mauro Carvalho Chehab, linux-rtc,
	Allison Randal, Nicolas Ferre, devicetree, linux-pm, Sean Wang,
	Tianping . Fang, Rob Herring, linux-mediatek, Jonathan Cameron,
	Matthias Brugger, Thomas Gleixner, Eddie Huang, linux-arm-kernel,
	Alessandro Zummo, Josef Friedl, Greg Kroah-Hartman,
	Sebastian Reichel, David S. Miller

> Gesendet: Montag, 12. August 2019 um 12:22 Uhr
> Von: "Lee Jones" <lee.jones@linaro.org>

> > - * Copyright (c) 2014 MediaTek Inc.
> > + * Copyright (c) 2014-2018 MediaTek Inc.
>
> This is out of date.  Please update it.

maybe i should drop change of this line completely (else it needs to be adjusted every year)

regards Frank

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Re: [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core
  2019-08-12 11:25     ` Aw: " Frank Wunderlich
@ 2019-08-12 11:27       ` Lee Jones
  0 siblings, 0 replies; 23+ messages in thread
From: Lee Jones @ 2019-08-12 11:27 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Kate Stewart, Mark Rutland, Alexandre Belloni, linux-kernel,
	Richard Fontana, Mauro Carvalho Chehab, linux-rtc,
	Allison Randal, Nicolas Ferre, devicetree, linux-pm, Sean Wang,
	Tianping . Fang, Rob Herring, linux-mediatek, Jonathan Cameron,
	Matthias Brugger, Thomas Gleixner, Eddie Huang, linux-arm-kernel,
	Alessandro Zummo, Josef Friedl, Greg Kroah-Hartman,
	Sebastian Reichel, David S. Miller

On Mon, 12 Aug 2019, Frank Wunderlich wrote:

> > Gesendet: Montag, 12. August 2019 um 12:22 Uhr
> > Von: "Lee Jones" <lee.jones@linaro.org>
> 
> > > - * Copyright (c) 2014 MediaTek Inc.
> > > + * Copyright (c) 2014-2018 MediaTek Inc.
> >
> > This is out of date.  Please update it.
> 
> maybe i should drop change of this line completely (else it needs to be adjusted every year)

It only needs changing when the Copyright is changed.

If you want to update it to 2014-2019, that's fine.

Or leaving it untouched, is also fine.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Aw: Re: Re: [PATCH v3 01/10] dt-bindings: add powercontroller
  2019-08-12 11:25       ` Lee Jones
@ 2019-08-12 11:37         ` " Frank Wunderlich
  2019-08-12 11:51           ` Lee Jones
  0 siblings, 1 reply; 23+ messages in thread
From: Frank Wunderlich @ 2019-08-12 11:37 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

> Gesendet: Montag, 12. August 2019 um 13:25 Uhr
> Von: "Lee Jones" <lee.jones@linaro.org>
> It was an example (hence the "E.g.").
>
> You will need to adapt it depending on where the file ends up.

i saw the e.g., but i wanted to know relative to which directory ;) your example mentions that it should contain the dt-bindings-folder and i think it should be relative to current file...

have applied your suggestions to my tree

https://github.com/frank-w/BPI-R2-4.14/commits/5.3-poweroff

please take a short look if i don't miss anything

regards Frank

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Re: Re: [PATCH v3 01/10] dt-bindings: add powercontroller
  2019-08-12 11:37         ` Aw: " Frank Wunderlich
@ 2019-08-12 11:51           ` Lee Jones
  0 siblings, 0 replies; 23+ messages in thread
From: Lee Jones @ 2019-08-12 11:51 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Alessandro Zummo, Alexandre Belloni, Allison Randal,
	David S. Miller, devicetree, Eddie Huang, Greg Kroah-Hartman,
	Jonathan Cameron, Kate Stewart, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-pm, linux-rtc, Mark Rutland,
	Matthias Brugger, Mauro Carvalho Chehab, Nicolas Ferre,
	Richard Fontana, Rob Herring, Sean Wang, Sebastian Reichel,
	Thomas Gleixner, Tianping . Fang, Josef Friedl

On Mon, 12 Aug 2019, Frank Wunderlich wrote:

> > Gesendet: Montag, 12. August 2019 um 13:25 Uhr
> > Von: "Lee Jones" <lee.jones@linaro.org>
> > It was an example (hence the "E.g.").
> >
> > You will need to adapt it depending on where the file ends up.
> 
> i saw the e.g., but i wanted to know relative to which directory ;) your example mentions that it should contain the dt-bindings-folder and i think it should be relative to current file...
> 
> have applied your suggestions to my tree
> 
> https://github.com/frank-w/BPI-R2-4.14/commits/5.3-poweroff
> 
> please take a short look if i don't miss anything

Just resubmit them.  Doing off-list reviews is a slippery slope.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, back to index

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 17:41 [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich
2019-07-29 17:41 ` [PATCH v3 01/10] dt-bindings: add powercontroller Frank Wunderlich
2019-08-12 10:20   ` Lee Jones
2019-08-12 11:10     ` Aw: " Frank Wunderlich
2019-08-12 11:25       ` Lee Jones
2019-08-12 11:37         ` Aw: " Frank Wunderlich
2019-08-12 11:51           ` Lee Jones
2019-07-29 17:41 ` [PATCH v3 02/10] dt-bindings: add missing mt6397 rtc Frank Wunderlich
2019-08-05 13:47   ` Alexandre Belloni
2019-07-29 17:41 ` [PATCH v3 03/10] rtc: mt6397: move some common definitions into rtc.h Frank Wunderlich
2019-08-05 13:48   ` Alexandre Belloni
2019-08-12 10:18     ` Lee Jones
2019-07-29 17:41 ` [PATCH v3 04/10] rtc: mt6397: improvements of rtc driver Frank Wunderlich
2019-07-29 17:41 ` [PATCH v3 05/10] rtc: mt6397: add compatible for mt6323 Frank Wunderlich
2019-08-05 13:50   ` Alexandre Belloni
2019-07-29 17:41 ` [PATCH v3 06/10] mfd: mt6323: some improvements of mt6397-core Frank Wunderlich
2019-08-12 10:22   ` Lee Jones
2019-08-12 11:25     ` Aw: " Frank Wunderlich
2019-08-12 11:27       ` Lee Jones
2019-07-29 17:41 ` [PATCH v3 07/10] mfd: mt6323: add mt6323 rtc+pwrc Frank Wunderlich
2019-08-12 10:22   ` Lee Jones
2019-07-29 17:41 ` [PATCH v3 08/10] power: reset: add driver for mt6323 poweroff Frank Wunderlich
2019-07-29 18:16 ` [PATCH v3 00/10] implement poweroff for mt6323 / bpi-r2 Frank Wunderlich

Linux-PM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pm/0 linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ https://lore.kernel.org/linux-pm \
		linux-pm@vger.kernel.org linux-pm@archiver.kernel.org
	public-inbox-index linux-pm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox