linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Remove __raw_* accessors from PL031 RTC
@ 2009-11-12  7:13 Linus Walleij
  2009-11-15 21:35 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2009-11-12  7:13 UTC (permalink / raw)
  To: linux-arm-kernel

This switches __raw_[read|write]l() for plain [read|write]l in
the PL031 RTC driver. The sister driver for PL030 use the simple
accessors as most PrimeCell drivers.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/rtc/rtc-pl031.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index f41873f..0264b11 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -51,10 +51,10 @@ static int pl031_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
 
 	switch (cmd) {
 	case RTC_AIE_OFF:
-		__raw_writel(1, ldata->base + RTC_MIS);
+		writel(1, ldata->base + RTC_MIS);
 		return 0;
 	case RTC_AIE_ON:
-		__raw_writel(0, ldata->base + RTC_MIS);
+		writel(0, ldata->base + RTC_MIS);
 		return 0;
 	}
 
@@ -65,7 +65,7 @@ static int pl031_read_time(struct device *dev, struct rtc_time *tm)
 {
 	struct pl031_local *ldata = dev_get_drvdata(dev);
 
-	rtc_time_to_tm(__raw_readl(ldata->base + RTC_DR), tm);
+	rtc_time_to_tm(readl(ldata->base + RTC_DR), tm);
 
 	return 0;
 }
@@ -76,7 +76,7 @@ static int pl031_set_time(struct device *dev, struct rtc_time *tm)
 	struct pl031_local *ldata = dev_get_drvdata(dev);
 
 	rtc_tm_to_time(tm, &time);
-	__raw_writel(time, ldata->base + RTC_LR);
+	writel(time, ldata->base + RTC_LR);
 
 	return 0;
 }
@@ -85,9 +85,9 @@ static int pl031_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 {
 	struct pl031_local *ldata = dev_get_drvdata(dev);
 
-	rtc_time_to_tm(__raw_readl(ldata->base + RTC_MR), &alarm->time);
-	alarm->pending = __raw_readl(ldata->base + RTC_RIS);
-	alarm->enabled = __raw_readl(ldata->base + RTC_IMSC);
+	rtc_time_to_tm(readl(ldata->base + RTC_MR), &alarm->time);
+	alarm->pending = readl(ldata->base + RTC_RIS);
+	alarm->enabled = readl(ldata->base + RTC_IMSC);
 
 	return 0;
 }
@@ -99,8 +99,8 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
 
 	rtc_tm_to_time(&alarm->time, &time);
 
-	__raw_writel(time, ldata->base + RTC_MR);
-	__raw_writel(!alarm->enabled, ldata->base + RTC_MIS);
+	writel(time, ldata->base + RTC_MR);
+	writel(!alarm->enabled, ldata->base + RTC_MIS);
 
 	return 0;
 }
@@ -180,8 +180,9 @@ err_req:
 
 static struct amba_id pl031_ids[] __initdata = {
 	{
-		 .id = 0x00041031,
-	 	.mask = 0x000fffff, },
+		.id = 0x00041031,
+		.mask = 0x000fffff,
+	},
 	{0, 0},
 };
 
-- 
1.6.2.5

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

* [PATCH] Remove __raw_* accessors from PL031 RTC
  2009-11-12  7:13 [PATCH] Remove __raw_* accessors from PL031 RTC Linus Walleij
@ 2009-11-15 21:35 ` Uwe Kleine-König
  2009-11-15 22:09   ` [rtc-linux] " Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2009-11-15 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Thu, Nov 12, 2009 at 08:13:07AM +0100, Linus Walleij wrote:
> This switches __raw_[read|write]l() for plain [read|write]l in
> the PL031 RTC driver. The sister driver for PL030 use the simple
> accessors as most PrimeCell drivers.
> 
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
>  drivers/rtc/rtc-pl031.c |   23 ++++++++++++-----------
>  1 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
> index f41873f..0264b11 100644
> --- a/drivers/rtc/rtc-pl031.c
> +++ b/drivers/rtc/rtc-pl031.c
> @@ -51,10 +51,10 @@ static int pl031_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
>  
>  	switch (cmd) {
>  	case RTC_AIE_OFF:
> -		__raw_writel(1, ldata->base + RTC_MIS);
> +		writel(1, ldata->base + RTC_MIS);
arch/arm/include/asm/io.h defines writel like so:

	#define writel(v,c)		__raw_writel((__force __u32) \
						cpu_to_le32(v),__mem_pci(c))

So this change isn't a noop on big-endian systems that define __mem_pci.
I don't know how many of these exist though.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

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

* [rtc-linux] Re: [PATCH] Remove __raw_* accessors from PL031 RTC
  2009-11-15 21:35 ` Uwe Kleine-König
@ 2009-11-15 22:09   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2009-11-15 22:09 UTC (permalink / raw)
  To: linux-arm-kernel

2009/11/15 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:

> arch/arm/include/asm/io.h defines writel like so:
>
> ? ? ? ?#define writel(v,c) ? ? ? ? ? ? __raw_writel((__force __u32) \
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?cpu_to_le32(v),__mem_pci(c))
>
> So this change isn't a noop on big-endian systems that define __mem_pci.
> I don't know how many of these exist though.

Yeah it's not supposed to be a noop, it's supposed to be a bugfix, all
other PrimeCell drivers use readl()/writel(). The assumption is that PrimeCell
registers shall always be accessed LE, and AFAICT that's what the above
macro does.

Linus

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

end of thread, other threads:[~2009-11-15 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12  7:13 [PATCH] Remove __raw_* accessors from PL031 RTC Linus Walleij
2009-11-15 21:35 ` Uwe Kleine-König
2009-11-15 22:09   ` [rtc-linux] " Linus Walleij

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