All of lore.kernel.org
 help / color / mirror / Atom feed
From: ryan@bluewatersys.com (Ryan Mallon)
To: linux-arm-kernel@lists.infradead.org
Subject: AT91: Convert RTC and RTT drivers to be independent of processor base-address
Date: Thu, 05 May 2011 08:49:13 +1200	[thread overview]
Message-ID: <4DC1BBC9.1070306@bluewatersys.com> (raw)
In-Reply-To: <1304106068.25025.8.camel@redbox>

On 04/30/2011 07:41 AM, Andrew Victor wrote:
> For supporting multiple AT91 processors in a single kernel image, the
> following changes to the RTC and RTT driver support:
>  * pass base addresses via platform resources
>  * replace calls to at91_sys_read() / at91_sys_write()
>  * rename AT91_RTT/AT91_RTC to AT91xxx_RTT/AT91xxx_RTC to denote they
> are processor-specific.
> 
> Signed-off-by: Andrew Victor <linux@maxim.org.za>

Looks mostly good. Couple of minor comments below.

~Ryan

> diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
> index e39b77a..971271c 100644
> --- a/drivers/rtc/rtc-at91rm9200.c
> +++ b/drivers/rtc/rtc-at91rm9200.c
> @@ -27,6 +27,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/ioctl.h>
>  #include <linux/completion.h>
> +#include <linux/slab.h>
>  
>  #include <asm/uaccess.h>
>  
> @@ -35,23 +36,33 @@
>  
>  #define AT91_RTC_EPOCH		1900UL	/* just like arch/arm/common/rtctime.c */
>  
> +struct at91_rtc {
> +	struct rtc_device	*rtcdev;
> +	void __iomem		*regbase;
> +	unsigned int		alarm_year;
> +};
> +
>  static DECLARE_COMPLETION(at91_rtc_updated);
> -static unsigned int at91_alarm_year = AT91_RTC_EPOCH;
> +
> +#define rtc_readl(rtc, reg) \
> +	__raw_readl((rtc)->regbase + (reg))
> +#define rtc_writel(rtc, reg, value) \
> +	__raw_writel((value), (rtc)->regbase + (reg))

static inline unsigned rtc_readl(struct at91_rtc, unsigned reg)
{
	return __raw_readl(rtc->regbase + reg);
}

static inline void rtc_writel(struct at91_rtc, unsigned reg,
				unsigned value)
{
	__raw_writel(valie, rtc->regbase + reg);
}

>  
>  /*
>   * Decode time/date into rtc_time structure
>   */
> -static void at91_rtc_decodetime(unsigned int timereg, unsigned int calreg,
> -				struct rtc_time *tm)
> +static void at91_rtc_decodetime(struct at91_rtc* rtc,

Nitpick, should be:

	struct at91_rtc *rtc,

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934

      parent reply	other threads:[~2011-05-04 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 19:41 AT91: Convert RTC and RTT drivers to be independent of processor base-address Andrew Victor
2011-04-30  1:27 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-04 20:49 ` Ryan Mallon [this message]

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=4DC1BBC9.1070306@bluewatersys.com \
    --to=ryan@bluewatersys.com \
    --cc=linux-arm-kernel@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.