Thread (1 message) 1 message, 1 author, 2016-07-12

[rtc-linux] Re: [PATCH v3 1/4] rtc: support for amlogic meson rtc

From: Alexandre Belloni <hidden>
Date: 2016-07-12 17:37:53
Also in: linux-amlogic, linux-devicetree

On 12/07/2016 at 18:27:12 +0100, Ben Dooks wrote :
On 12/07/16 18:22, Alexandre Belloni wrote:
quoted
Hi,

Very few comments below

On 05/07/2016 at 20:48:41 +0100, Ben Dooks wrote :
quoted
+/* registers accessed from cpu bus */
+#define RTC_REG(x)		((x) * 4)	/* rtc registers 0-4 */
+
+#define LINE_SDI		(1 << 2)
+#define LINE_SEN		(1 << 1)
+#define LINE_SCLK		(1 << 0)
Maybe use BIT() here.
I'll sort that out later.
quoted
quoted
+/* RTC interface layer functions */
+
+static int meson_rtc_gettime(struct device *dev, struct rtc_time *tm)
+{
+	struct meson_rtc *rtc = dev_get_drvdata(dev);
+	int ret;
+	u32 time;
+
+	mutex_lock(&rtc->lock);
+
+	ret = meson_rtc_read(rtc, RTC_COUNTER, &time);
+	if (!ret) {
+		rtc_time_to_tm(time, tm);
Can you use the 64bit version?
What would the 64bit version gain? The hardware register is 32bit.
Well, at some point, I'll remove the 32bit version:
http://lxr.free-electrons.com/source/include/linux/rtc.h#L36

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

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help