linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] arm64: Realtek RTD1295 RTC
@ 2017-09-04 22:53 Andreas Färber
  2017-09-04 22:53 ` [PATCH v4 1/3] dt-bindings: rtc: Add Realtek RTD1295 Andreas Färber
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andreas Färber @ 2017-09-04 22:53 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Roc He, 蒋丽琴,
	Andreas Färber, Alessandro Zummo, Alexandre Belloni,
	linux-rtc, devicetree, Andrew Lunn

Hello,

This series adds the RTC for the Realtek RTD1295 SoC.
Based on my RTD1295 clk series.

There being no public source code for RTD1295, the implementation is based on
register offsets seen in the vendor DT, as well as older mach-rtk119x code
published by QNAP.

v4 adds a missing clk_put().

The DT node depends on the clk series for clock index and header.

More experimental patches at:
https://github.com/afaerber/linux/commits/rtd1295-next

Have a lot of fun!

Cheers,
Andreas

v3 -> v4:
* Added clk_put() (Alexandre)

v2 -> v3:
* Dropped spinlock (Andrew)
* Improved year_days vs. days_in_year readability

v1 -> v2:
* Updated rtc driver to no longer use open/release (Alexandre)
* Cleaned up debug output (Andrew)
* Avoided COMPILE_TEST division errors (kbuild)
* Various cleanups and extensions

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: linux-rtc@vger.kernel.org
Cc: Roc He <hepeng@zidoo.tv>
Cc: 蒋丽琴 <jiang.liqin@geniatech.com>
Cc: devicetree@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>

Andreas Färber (3):
  dt-bindings: rtc: Add Realtek RTD1295
  rtc: Add Realtek RTD1295
  arm64: dts: realtek: Add RTD1295 RTC node

 .../devicetree/bindings/rtc/realtek,rtd119x.txt    |  16 ++
 arch/arm64/boot/dts/realtek/rtd1295.dtsi           |   6 +
 drivers/rtc/Kconfig                                |   8 +
 drivers/rtc/Makefile                               |   1 +
 drivers/rtc/rtc-rtd119x.c                          | 242 +++++++++++++++++++++
 5 files changed, 273 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt
 create mode 100644 drivers/rtc/rtc-rtd119x.c

-- 
2.13.5

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

* [PATCH v4 1/3] dt-bindings: rtc: Add Realtek RTD1295
  2017-09-04 22:53 [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Andreas Färber
@ 2017-09-04 22:53 ` Andreas Färber
  2017-09-04 22:53 ` [PATCH v4 2/3] " Andreas Färber
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2017-09-04 22:53 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Roc He, 蒋丽琴,
	Andreas Färber, Alessandro Zummo, Alexandre Belloni,
	Rob Herring, Mark Rutland, linux-rtc, devicetree

Add a binding for the RTC on the Realtek RTD119x/RTD129x SoC families.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v1 -> v2 -> v3 -> v4: Unchanged
 
 .../devicetree/bindings/rtc/realtek,rtd119x.txt          | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt

diff --git a/Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt b/Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt
new file mode 100644
index 000000000000..bbf1ccb5df31
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt
@@ -0,0 +1,16 @@
+Realtek RTD129x Real-Time Clock
+===============================
+
+Required properties:
+- compatible :  Should be "realtek,rtd1295-rtc"
+- reg        :  Specifies the physical base address and size
+- clocks     :  Specifies the clock gate
+
+
+Example:
+
+	rtc@9801b600 {
+		compatible = "realtek,rtd1295-clk";
+		reg = <0x9801b600 0x100>;
+		clocks = <&clkc RTD1295_CLK_EN_MISC_RTC>;
+	};
-- 
2.13.5

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

* [PATCH v4 2/3] rtc: Add Realtek RTD1295
  2017-09-04 22:53 [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Andreas Färber
  2017-09-04 22:53 ` [PATCH v4 1/3] dt-bindings: rtc: Add Realtek RTD1295 Andreas Färber
@ 2017-09-04 22:53 ` Andreas Färber
  2017-09-04 22:53 ` [PATCH v4 3/3] arm64: dts: realtek: Add RTD1295 RTC node Andreas Färber
  2017-09-05  7:59 ` [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Alexandre Belloni
  3 siblings, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2017-09-04 22:53 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Roc He, 蒋丽琴,
	Andreas Färber, Alessandro Zummo, Alexandre Belloni,
	linux-rtc

Based on QNAP's arch/arm/mach-rtk119x/driver/rtk_rtc_drv.c code and
mach-rtk119x/driver/dc2vo/fpga/include/mis_reg.h register definitions.

The base year 2014 was observed on all of Zidoo X9S, ProBox2 Ava and
Beelink Lake I.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v3 -> v4:
 * Added missing clk_put() (Alexandre)
 
 v2 -> v3:
 * Dropped spinlock (Andrew)
 * Refactored days-in-year helper to avoid rtc_year_days()
 
 v1 -> v2:
 * Dropped open/release in favor of probe/remove (Alexandre)
 * read_time: Reordered register accesses (Alexandre)
 * read_time/set_time: Refactored day calculations to avoid time64_t (Alexandre)
 * read_time: Retry if seconds change (Alexandre)
 * probe: Added missing RTCACR initialization code
 * set_time: Fixed year check (off by 1900)
 * set_time: Fixed new seconds (off by factor two)
 * Cleaned up debug output (Andrew)
 * Added spinlocks around register accesses
 * Added masks for register fields
 
 drivers/rtc/Kconfig       |   8 ++
 drivers/rtc/Makefile      |   1 +
 drivers/rtc/rtc-rtd119x.c | 242 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 251 insertions(+)
 create mode 100644 drivers/rtc/rtc-rtd119x.c

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index a76a26e2292a..e0e58f3b1420 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1765,6 +1765,14 @@ config RTC_DRV_CPCAP
 	   Say y here for CPCAP rtc found on some Motorola phones
 	   and tablets such as Droid 4.
 
+config RTC_DRV_RTD119X
+	bool "Realtek RTD129x RTC"
+	depends on ARCH_REALTEK || COMPILE_TEST
+	default ARCH_REALTEK
+	help
+	  If you say yes here, you get support for the RTD1295 SoC
+	  Real Time Clock.
+
 comment "HID Sensor RTC drivers"
 
 config RTC_DRV_HID_SENSOR_TIME
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index d995d49d8218..7230014c92af 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -131,6 +131,7 @@ obj-$(CONFIG_RTC_DRV_RP5C01)	+= rtc-rp5c01.o
 obj-$(CONFIG_RTC_DRV_RS5C313)	+= rtc-rs5c313.o
 obj-$(CONFIG_RTC_DRV_RS5C348)	+= rtc-rs5c348.o
 obj-$(CONFIG_RTC_DRV_RS5C372)	+= rtc-rs5c372.o
+obj-$(CONFIG_RTC_DRV_RTD119X)	+= rtc-rtd119x.o
 obj-$(CONFIG_RTC_DRV_RV3029C2)	+= rtc-rv3029c2.o
 obj-$(CONFIG_RTC_DRV_RV8803)	+= rtc-rv8803.o
 obj-$(CONFIG_RTC_DRV_RX4581)	+= rtc-rx4581.o
diff --git a/drivers/rtc/rtc-rtd119x.c b/drivers/rtc/rtc-rtd119x.c
new file mode 100644
index 000000000000..b3b0b97b98e2
--- /dev/null
+++ b/drivers/rtc/rtc-rtd119x.c
@@ -0,0 +1,242 @@
+/*
+ * Realtek RTD129x RTC
+ *
+ * Copyright (c) 2017 Andreas Färber
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/rtc.h>
+#include <linux/spinlock.h>
+
+#define RTD_RTCSEC		0x00
+#define RTD_RTCMIN		0x04
+#define RTD_RTCHR		0x08
+#define RTD_RTCDATE1		0x0c
+#define RTD_RTCDATE2		0x10
+#define RTD_RTCACR		0x28
+#define RTD_RTCEN		0x2c
+#define RTD_RTCCR		0x30
+
+#define RTD_RTCSEC_RTCSEC_MASK		0x7f
+
+#define RTD_RTCMIN_RTCMIN_MASK		0x3f
+
+#define RTD_RTCHR_RTCHR_MASK		0x1f
+
+#define RTD_RTCDATE1_RTCDATE1_MASK	0xff
+
+#define RTD_RTCDATE2_RTCDATE2_MASK	0x7f
+
+#define RTD_RTCACR_RTCPWR		BIT(7)
+
+#define RTD_RTCEN_RTCEN_MASK		0xff
+
+#define RTD_RTCCR_RTCRST		BIT(6)
+
+struct rtd119x_rtc {
+	void __iomem *base;
+	struct clk *clk;
+	struct rtc_device *rtcdev;
+	unsigned int base_year;
+};
+
+static inline int rtd119x_rtc_days_in_year(int year)
+{
+	return 365 + (is_leap_year(year) ? 1 : 0);
+}
+
+static void rtd119x_rtc_reset(struct device *dev)
+{
+	struct rtd119x_rtc *data = dev_get_drvdata(dev);
+	u32 val;
+
+	val = readl_relaxed(data->base + RTD_RTCCR);
+	val |= RTD_RTCCR_RTCRST;
+	writel_relaxed(val, data->base + RTD_RTCCR);
+
+	val &= ~RTD_RTCCR_RTCRST;
+	writel(val, data->base + RTD_RTCCR);
+}
+
+static void rtd119x_rtc_set_enabled(struct device *dev, bool enable)
+{
+	struct rtd119x_rtc *data = dev_get_drvdata(dev);
+	u32 val;
+
+	val = readl_relaxed(data->base + RTD_RTCEN);
+	if (enable) {
+		if ((val & RTD_RTCEN_RTCEN_MASK) == 0x5a)
+			return;
+		writel_relaxed(0x5a, data->base + RTD_RTCEN);
+	} else {
+		writel_relaxed(0, data->base + RTD_RTCEN);
+	}
+}
+
+static int rtd119x_rtc_read_time(struct device *dev, struct rtc_time *tm)
+{
+	struct rtd119x_rtc *data = dev_get_drvdata(dev);
+	s32 day;
+	u32 sec;
+	unsigned int year;
+	int tries = 0;
+
+	while (true) {
+		tm->tm_sec = (readl_relaxed(data->base + RTD_RTCSEC) & RTD_RTCSEC_RTCSEC_MASK) >> 1;
+		tm->tm_min  = readl_relaxed(data->base + RTD_RTCMIN) & RTD_RTCMIN_RTCMIN_MASK;
+		tm->tm_hour = readl_relaxed(data->base + RTD_RTCHR) & RTD_RTCHR_RTCHR_MASK;
+		day  =  readl_relaxed(data->base + RTD_RTCDATE1) & RTD_RTCDATE1_RTCDATE1_MASK;
+		day |= (readl_relaxed(data->base + RTD_RTCDATE2) & RTD_RTCDATE2_RTCDATE2_MASK) << 8;
+		sec  = (readl_relaxed(data->base + RTD_RTCSEC) & RTD_RTCSEC_RTCSEC_MASK) >> 1;
+		tries++;
+
+		if (sec == tm->tm_sec)
+			break;
+
+		if (tries >= 3)
+			return -EINVAL;
+	}
+	if (tries > 1)
+		dev_dbg(dev, "%s: needed %i tries\n", __func__, tries);
+
+	year = data->base_year;
+	while (day >= rtd119x_rtc_days_in_year(year)) {
+		day -= rtd119x_rtc_days_in_year(year);
+		year++;
+	}
+	tm->tm_year = year - 1900;
+	tm->tm_yday = day;
+
+	tm->tm_mon = 0;
+	while (day >= rtc_month_days(tm->tm_mon, year)) {
+		day -= rtc_month_days(tm->tm_mon, year);
+		tm->tm_mon++;
+	}
+	tm->tm_mday = day + 1;
+
+	return 0;
+}
+
+static int rtd119x_rtc_set_time(struct device *dev, struct rtc_time *tm)
+{
+	struct rtd119x_rtc *data = dev_get_drvdata(dev);
+	unsigned int day;
+	int i;
+
+	if (1900 + tm->tm_year < data->base_year)
+		return -EINVAL;
+
+	day = 0;
+	for (i = data->base_year; i < 1900 + tm->tm_year; i++)
+		day += rtd119x_rtc_days_in_year(i);
+
+	day += tm->tm_yday;
+	if (day > 0x7fff)
+		return -EINVAL;
+
+	rtd119x_rtc_set_enabled(dev, false);
+
+	writel_relaxed((tm->tm_sec << 1) & RTD_RTCSEC_RTCSEC_MASK, data->base + RTD_RTCSEC);
+	writel_relaxed(tm->tm_min & RTD_RTCMIN_RTCMIN_MASK, data->base + RTD_RTCMIN);
+	writel_relaxed(tm->tm_hour & RTD_RTCHR_RTCHR_MASK, data->base + RTD_RTCHR);
+	writel_relaxed(day & RTD_RTCDATE1_RTCDATE1_MASK, data->base + RTD_RTCDATE1);
+	writel_relaxed((day >> 8) & RTD_RTCDATE2_RTCDATE2_MASK, data->base + RTD_RTCDATE2);
+
+	rtd119x_rtc_set_enabled(dev, true);
+
+	return 0;
+}
+
+static const struct rtc_class_ops rtd119x_rtc_ops = {
+	.read_time	= rtd119x_rtc_read_time,
+	.set_time	= rtd119x_rtc_set_time,
+};
+
+static const struct of_device_id rtd119x_rtc_dt_ids[] = {
+	 { .compatible = "realtek,rtd1295-rtc" },
+	 { }
+};
+
+static int rtd119x_rtc_probe(struct platform_device *pdev)
+{
+	struct rtd119x_rtc *data;
+	struct resource *res;
+	u32 val;
+	int ret;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	platform_set_drvdata(pdev, data);
+	data->base_year = 2014;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	data->base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(data->base))
+		return PTR_ERR(data->base);
+
+	data->clk = of_clk_get(pdev->dev.of_node, 0);
+	if (IS_ERR(data->clk))
+		return PTR_ERR(data->clk);
+
+	ret = clk_prepare_enable(data->clk);
+	if (ret) {
+		clk_put(data->clk);
+		return ret;
+	}
+
+	val = readl_relaxed(data->base + RTD_RTCACR);
+	if (!(val & RTD_RTCACR_RTCPWR)) {
+		writel_relaxed(RTD_RTCACR_RTCPWR, data->base + RTD_RTCACR);
+
+		rtd119x_rtc_reset(&pdev->dev);
+
+		writel_relaxed(0, data->base + RTD_RTCMIN);
+		writel_relaxed(0, data->base + RTD_RTCHR);
+		writel_relaxed(0, data->base + RTD_RTCDATE1);
+		writel_relaxed(0, data->base + RTD_RTCDATE2);
+	}
+
+	rtd119x_rtc_set_enabled(&pdev->dev, true);
+
+	data->rtcdev = devm_rtc_device_register(&pdev->dev, "rtc",
+				&rtd119x_rtc_ops, THIS_MODULE);
+	if (IS_ERR(data->rtcdev)) {
+		dev_err(&pdev->dev, "failed to register rtc device");
+		clk_disable_unprepare(data->clk);
+		clk_put(data->clk);
+		return PTR_ERR(data->rtcdev);
+	}
+
+	return 0;
+}
+
+static int rtd119x_rtc_remove(struct platform_device *pdev)
+{
+	struct rtd119x_rtc *data = platform_get_drvdata(pdev);
+
+	rtd119x_rtc_set_enabled(&pdev->dev, false);
+
+	clk_disable_unprepare(data->clk);
+	clk_put(data->clk);
+
+	return 0;
+}
+
+static struct platform_driver rtd119x_rtc_driver = {
+	.probe = rtd119x_rtc_probe,
+	.remove = rtd119x_rtc_remove,
+	.driver = {
+		.name = "rtd1295-rtc",
+		.of_match_table	= rtd119x_rtc_dt_ids,
+	},
+};
+builtin_platform_driver(rtd119x_rtc_driver);
-- 
2.13.5

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

* [PATCH v4 3/3] arm64: dts: realtek: Add RTD1295 RTC node
  2017-09-04 22:53 [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Andreas Färber
  2017-09-04 22:53 ` [PATCH v4 1/3] dt-bindings: rtc: Add Realtek RTD1295 Andreas Färber
  2017-09-04 22:53 ` [PATCH v4 2/3] " Andreas Färber
@ 2017-09-04 22:53 ` Andreas Färber
  2017-09-05  7:59 ` [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Alexandre Belloni
  3 siblings, 0 replies; 7+ messages in thread
From: Andreas Färber @ 2017-09-04 22:53 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Roc He, 蒋丽琴,
	Andreas Färber, Rob Herring, Mark Rutland, Catalin Marinas,
	Will Deacon, devicetree

Add RTC node to the Realtek RTD1295 Device Tree.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v3 -> v4: Unchanged
 
 v2 -> v3:
 * Rebased to no longer depend on reset controller series
 
 v1 -> v2: Unchanged
 
 Depends on the pending clock bindings.
 
 arch/arm64/boot/dts/realtek/rtd1295.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/realtek/rtd1295.dtsi b/arch/arm64/boot/dts/realtek/rtd1295.dtsi
index ab72255f843f..fbbd6456079e 100644
--- a/arch/arm64/boot/dts/realtek/rtd1295.dtsi
+++ b/arch/arm64/boot/dts/realtek/rtd1295.dtsi
@@ -164,6 +164,12 @@
 			status = "disabled";
 		};
 
+		rtc@9801b600 {
+			compatible = "realtek,rtd1295-rtc";
+			reg = <0x9801b600 0x100>;
+			clocks = <&clkc RTD1295_CLK_EN_MISC_RTC>;
+		};
+
 		gic: interrupt-controller@ff011000 {
 			compatible = "arm,gic-400";
 			reg = <0xff011000 0x1000>,
-- 
2.13.5

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

* Re: [PATCH v4 0/3] arm64: Realtek RTD1295 RTC
  2017-09-04 22:53 [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Andreas Färber
                   ` (2 preceding siblings ...)
  2017-09-04 22:53 ` [PATCH v4 3/3] arm64: dts: realtek: Add RTD1295 RTC node Andreas Färber
@ 2017-09-05  7:59 ` Alexandre Belloni
  2017-09-05  8:03   ` Andreas Färber
  3 siblings, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2017-09-05  7:59 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-arm-kernel, linux-kernel, Roc He, 蒋丽琴,
	Alessandro Zummo, linux-rtc, devicetree, Andrew Lunn

On 05/09/2017 at 00:53:21 +0200, Andreas Färber wrote:
> Hello,
> 
> This series adds the RTC for the Realtek RTD1295 SoC.
> Based on my RTD1295 clk series.
> 
> There being no public source code for RTD1295, the implementation is based on
> register offsets seen in the vendor DT, as well as older mach-rtk119x code
> published by QNAP.
> 
> v4 adds a missing clk_put().
> 
> The DT node depends on the clk series for clock index and header.
> 
> More experimental patches at:
> https://github.com/afaerber/linux/commits/rtd1295-next
> 
> Have a lot of fun!
> 
> Cheers,
> Andreas
> 
> v3 -> v4:
> * Added clk_put() (Alexandre)
> 
> v2 -> v3:
> * Dropped spinlock (Andrew)
> * Improved year_days vs. days_in_year readability
> 
> v1 -> v2:
> * Updated rtc driver to no longer use open/release (Alexandre)
> * Cleaned up debug output (Andrew)
> * Avoided COMPILE_TEST division errors (kbuild)
> * Various cleanups and extensions
> 
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Cc: linux-rtc@vger.kernel.org
> Cc: Roc He <hepeng@zidoo.tv>
> Cc: 蒋丽琴 <jiang.liqin@geniatech.com>
> Cc: devicetree@vger.kernel.org
> Cc: Andrew Lunn <andrew@lunn.ch>
> 
> Andreas Färber (3):
>   dt-bindings: rtc: Add Realtek RTD1295
>   rtc: Add Realtek RTD1295
>   arm64: dts: realtek: Add RTD1295 RTC node
> 
>  .../devicetree/bindings/rtc/realtek,rtd119x.txt    |  16 ++
>  arch/arm64/boot/dts/realtek/rtd1295.dtsi           |   6 +
>  drivers/rtc/Kconfig                                |   8 +
>  drivers/rtc/Makefile                               |   1 +
>  drivers/rtc/rtc-rtd119x.c                          | 242 +++++++++++++++++++++
>  5 files changed, 273 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt
>  create mode 100644 drivers/rtc/rtc-rtd119x.c
> 
Applied, thanks.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* Re: [PATCH v4 0/3] arm64: Realtek RTD1295 RTC
  2017-09-05  7:59 ` [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Alexandre Belloni
@ 2017-09-05  8:03   ` Andreas Färber
  2017-09-05  8:09     ` Alexandre Belloni
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Färber @ 2017-09-05  8:03 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: linux-arm-kernel, linux-kernel, Roc He, 蒋丽琴,
	Alessandro Zummo, linux-rtc, devicetree, Andrew Lunn

Am 05.09.2017 um 09:59 schrieb Alexandre Belloni:
> On 05/09/2017 at 00:53:21 +0200, Andreas Färber wrote:
>> Hello,
>>
>> This series adds the RTC for the Realtek RTD1295 SoC.
>> Based on my RTD1295 clk series.
>>
>> There being no public source code for RTD1295, the implementation is based on
>> register offsets seen in the vendor DT, as well as older mach-rtk119x code
>> published by QNAP.
>>
>> v4 adds a missing clk_put().
>>
>> The DT node depends on the clk series for clock index and header.
>>
>> More experimental patches at:
>> https://github.com/afaerber/linux/commits/rtd1295-next
>>
>> Have a lot of fun!
>>
>> Cheers,
>> Andreas
>>
>> v3 -> v4:
>> * Added clk_put() (Alexandre)
>>
>> v2 -> v3:
>> * Dropped spinlock (Andrew)
>> * Improved year_days vs. days_in_year readability
>>
>> v1 -> v2:
>> * Updated rtc driver to no longer use open/release (Alexandre)
>> * Cleaned up debug output (Andrew)
>> * Avoided COMPILE_TEST division errors (kbuild)
>> * Various cleanups and extensions
>>
>> Cc: Alessandro Zummo <a.zummo@towertech.it>
>> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> Cc: linux-rtc@vger.kernel.org
>> Cc: Roc He <hepeng@zidoo.tv>
>> Cc: 蒋丽琴 <jiang.liqin@geniatech.com>
>> Cc: devicetree@vger.kernel.org
>> Cc: Andrew Lunn <andrew@lunn.ch>
>>
>> Andreas Färber (3):
>>   dt-bindings: rtc: Add Realtek RTD1295
>>   rtc: Add Realtek RTD1295
>>   arm64: dts: realtek: Add RTD1295 RTC node
>>
>>  .../devicetree/bindings/rtc/realtek,rtd119x.txt    |  16 ++
>>  arch/arm64/boot/dts/realtek/rtd1295.dtsi           |   6 +
>>  drivers/rtc/Kconfig                                |   8 +
>>  drivers/rtc/Makefile                               |   1 +
>>  drivers/rtc/rtc-rtd119x.c                          | 242 +++++++++++++++++++++
>>  5 files changed, 273 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt
>>  create mode 100644 drivers/rtc/rtc-rtd119x.c
>>
> Applied, thanks.

Err, I am hoping you only queued patches 1-2? Please do not queue patch
3, that needs to go through my tree as per the comments - it will not build.

Thanks,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

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

* Re: [PATCH v4 0/3] arm64: Realtek RTD1295 RTC
  2017-09-05  8:03   ` Andreas Färber
@ 2017-09-05  8:09     ` Alexandre Belloni
  0 siblings, 0 replies; 7+ messages in thread
From: Alexandre Belloni @ 2017-09-05  8:09 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-arm-kernel, linux-kernel, Roc He, 蒋丽琴,
	Alessandro Zummo, linux-rtc, devicetree, Andrew Lunn

On 05/09/2017 at 10:03:58 +0200, Andreas Färber wrote:
> Am 05.09.2017 um 09:59 schrieb Alexandre Belloni:
> > On 05/09/2017 at 00:53:21 +0200, Andreas Färber wrote:
> >> Hello,
> >>
> >> This series adds the RTC for the Realtek RTD1295 SoC.
> >> Based on my RTD1295 clk series.
> >>
> >> There being no public source code for RTD1295, the implementation is based on
> >> register offsets seen in the vendor DT, as well as older mach-rtk119x code
> >> published by QNAP.
> >>
> >> v4 adds a missing clk_put().
> >>
> >> The DT node depends on the clk series for clock index and header.
> >>
> >> More experimental patches at:
> >> https://github.com/afaerber/linux/commits/rtd1295-next
> >>
> >> Have a lot of fun!
> >>
> >> Cheers,
> >> Andreas
> >>
> >> v3 -> v4:
> >> * Added clk_put() (Alexandre)
> >>
> >> v2 -> v3:
> >> * Dropped spinlock (Andrew)
> >> * Improved year_days vs. days_in_year readability
> >>
> >> v1 -> v2:
> >> * Updated rtc driver to no longer use open/release (Alexandre)
> >> * Cleaned up debug output (Andrew)
> >> * Avoided COMPILE_TEST division errors (kbuild)
> >> * Various cleanups and extensions
> >>
> >> Cc: Alessandro Zummo <a.zummo@towertech.it>
> >> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> >> Cc: linux-rtc@vger.kernel.org
> >> Cc: Roc He <hepeng@zidoo.tv>
> >> Cc: 蒋丽琴 <jiang.liqin@geniatech.com>
> >> Cc: devicetree@vger.kernel.org
> >> Cc: Andrew Lunn <andrew@lunn.ch>
> >>
> >> Andreas Färber (3):
> >>   dt-bindings: rtc: Add Realtek RTD1295
> >>   rtc: Add Realtek RTD1295
> >>   arm64: dts: realtek: Add RTD1295 RTC node
> >>
> >>  .../devicetree/bindings/rtc/realtek,rtd119x.txt    |  16 ++
> >>  arch/arm64/boot/dts/realtek/rtd1295.dtsi           |   6 +
> >>  drivers/rtc/Kconfig                                |   8 +
> >>  drivers/rtc/Makefile                               |   1 +
> >>  drivers/rtc/rtc-rtd119x.c                          | 242 +++++++++++++++++++++
> >>  5 files changed, 273 insertions(+)
> >>  create mode 100644 Documentation/devicetree/bindings/rtc/realtek,rtd119x.txt
> >>  create mode 100644 drivers/rtc/rtc-rtd119x.c
> >>
> > Applied, thanks.
> 
> Err, I am hoping you only queued patches 1-2? Please do not queue patch
> 3, that needs to go through my tree as per the comments - it will not build.
> 

Yes, I'm not taking DT patches through the RTC tree.
I didn't receive v4 of the DT patch that's why I forgot to clarify.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2017-09-05  8:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-04 22:53 [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Andreas Färber
2017-09-04 22:53 ` [PATCH v4 1/3] dt-bindings: rtc: Add Realtek RTD1295 Andreas Färber
2017-09-04 22:53 ` [PATCH v4 2/3] " Andreas Färber
2017-09-04 22:53 ` [PATCH v4 3/3] arm64: dts: realtek: Add RTD1295 RTC node Andreas Färber
2017-09-05  7:59 ` [PATCH v4 0/3] arm64: Realtek RTD1295 RTC Alexandre Belloni
2017-09-05  8:03   ` Andreas Färber
2017-09-05  8:09     ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).