All of lore.kernel.org
 help / color / mirror / Atom feed
From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v3 1/4] rtc: support for amlogic meson rtc
Date: Tue, 12 Jul 2016 19:22:35 +0200	[thread overview]
Message-ID: <20160712172235.GU22202@piout.net> (raw)
In-Reply-To: <1467748122-14833-3-git-send-email-ben.dooks@codethink.co.uk>

Hi,

Very few comments below

On 05/07/2016 at 20:48:41 +0100, Ben Dooks wrote :
> +/* 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.

> +/* 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?

> +		dev_dbg(dev, "read time %lu\n", (unsigned long)time);
> +	}
> +
> +	mutex_unlock(&rtc->lock);
> +	return ret;
> +}
> +
> +static int meson_rtc_settime(struct device *dev, struct rtc_time *tm)
> +{
> +	struct meson_rtc *rtc = dev_get_drvdata(dev);
> +	unsigned long time;
> +	int ret;
> +
> +	mutex_lock(&rtc->lock);
> +
> +	rtc_tm_to_time(tm, &time);

Ditto.


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

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>
Cc: linux-kernel@lists.codethink.co.uk,
	linux-amlogic@lists.infradead.org, rtc-linux@googlegroups.com,
	a.zummo@towertech.it, devicetree@vger.kernel.org,
	narmstrong@baylibre.com, frowand.list@gmail.com,
	khilman@baylibre.com
Subject: [rtc-linux] Re: [PATCH v3 1/4] rtc: support for amlogic meson rtc
Date: Tue, 12 Jul 2016 19:22:35 +0200	[thread overview]
Message-ID: <20160712172235.GU22202@piout.net> (raw)
In-Reply-To: <1467748122-14833-3-git-send-email-ben.dooks@codethink.co.uk>

Hi,

Very few comments below

On 05/07/2016 at 20:48:41 +0100, Ben Dooks wrote :
> +/* 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.

> +/* 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?

> +		dev_dbg(dev, "read time %lu\n", (unsigned long)time);
> +	}
> +
> +	mutex_unlock(&rtc->lock);
> +	return ret;
> +}
> +
> +static int meson_rtc_settime(struct device *dev, struct rtc_time *tm)
> +{
> +	struct meson_rtc *rtc = dev_get_drvdata(dev);
> +	unsigned long time;
> +	int ret;
> +
> +	mutex_lock(&rtc->lock);
> +
> +	rtc_tm_to_time(tm, &time);

Ditto.


-- 
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.

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Ben Dooks <ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
Cc: linux-kernel-81qHHgoATdFT9dQujB1mzip2UmYkHbXO@public.gmane.org,
	linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH v3 1/4] rtc: support for amlogic meson rtc
Date: Tue, 12 Jul 2016 19:22:35 +0200	[thread overview]
Message-ID: <20160712172235.GU22202@piout.net> (raw)
In-Reply-To: <1467748122-14833-3-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>

Hi,

Very few comments below

On 05/07/2016 at 20:48:41 +0100, Ben Dooks wrote :
> +/* 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.

> +/* 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?

> +		dev_dbg(dev, "read time %lu\n", (unsigned long)time);
> +	}
> +
> +	mutex_unlock(&rtc->lock);
> +	return ret;
> +}
> +
> +static int meson_rtc_settime(struct device *dev, struct rtc_time *tm)
> +{
> +	struct meson_rtc *rtc = dev_get_drvdata(dev);
> +	unsigned long time;
> +	int ret;
> +
> +	mutex_lock(&rtc->lock);
> +
> +	rtc_tm_to_time(tm, &time);

Ditto.


-- 
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

  parent reply	other threads:[~2016-07-12 17:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 19:48 [PATCH v3 0/2] AMLogic Meson SoC RTC driver Ben Dooks
2016-07-05 19:48 ` Ben Dooks
2016-07-05 19:48 ` [rtc-linux] " Ben Dooks
2016-07-05 19:48 ` Ben Dooks
2016-07-05 19:48   ` Ben Dooks
2016-07-05 19:48   ` [rtc-linux] " Ben Dooks
2016-07-05 19:48 ` [PATCH v3 1/4] rtc: support for amlogic meson rtc Ben Dooks
2016-07-05 19:48   ` Ben Dooks
2016-07-05 19:48   ` [rtc-linux] " Ben Dooks
2016-07-08 16:16   ` Kevin Hilman
2016-07-08 16:16     ` Kevin Hilman
2016-07-08 16:16     ` [rtc-linux] " Kevin Hilman
2016-07-12 17:22   ` Alexandre Belloni [this message]
2016-07-12 17:22     ` Alexandre Belloni
2016-07-12 17:22     ` [rtc-linux] " Alexandre Belloni
2016-07-12 17:27     ` Ben Dooks
2016-07-12 17:27       ` Ben Dooks
2016-07-12 17:27       ` [rtc-linux] " Ben Dooks
2016-07-12 17:37       ` Alexandre Belloni
2016-07-12 17:37         ` Alexandre Belloni
2016-07-12 17:37         ` [rtc-linux] " Alexandre Belloni
2016-07-05 19:48 ` [PATCH v3 2/4] meson-rtc: add device-tree binding Ben Dooks
2016-07-05 19:48   ` Ben Dooks
2016-07-05 19:48   ` [rtc-linux] " Ben Dooks
2016-07-13  5:57   ` Frank Rowand
2016-07-13  5:57     ` Frank Rowand
2016-07-13  5:57     ` [rtc-linux] " Frank Rowand
2016-07-13  9:09     ` Ben Dooks
2016-07-13  9:09       ` Ben Dooks
2016-07-13  9:09       ` [rtc-linux] " Ben Dooks
2016-07-13 11:25       ` Mark Rutland
2016-07-13 11:25         ` Mark Rutland
2016-07-13 11:25         ` [rtc-linux] " Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160712172235.GU22202@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=linus-amlogic@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.