dslinux/linux-2.6.x/arch/arm/mach-nds/arm7 sound.c time.c

amadeus dslinux_amadeus at user.in-berlin.de
Wed Aug 16 15:55:09 CEST 2006


Update of /cvsroot/dslinux/dslinux/linux-2.6.x/arch/arm/mach-nds/arm7
In directory antilope:/tmp/cvs-serv619/linux-2.6.x/arch/arm/mach-nds/arm7

Modified Files:
	sound.c time.c 
Log Message:
8bit write cleanup

Index: time.c
===================================================================
RCS file: /cvsroot/dslinux/dslinux/linux-2.6.x/arch/arm/mach-nds/arm7/time.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- time.c	20 Feb 2006 18:20:17 -0000	1.1
+++ time.c	16 Aug 2006 13:55:07 -0000	1.2
@@ -1,4 +1,4 @@
-#define RTC_CR8         (* (volatile u8*) 0x04000138)
+#define RTC_CR8            0x04000138
 #define READ_DATA_REG1     0x65
 #define READ_STATUS_REG1   0x61
 #define RTC_DELAY 48
@@ -16,6 +16,7 @@
 #define HOUR_MASK 0x3f
 
 #include "asm/types.h"
+#include "asm/io.h"
 #include "linux/timex.h"
 
 #include "time.h"
@@ -27,17 +28,17 @@
 	u8 bit;
 	u8 i;
 
-	RTC_CR8 = CS_0 | SCK_1 | SIO_1;
+	writeb(CS_0 | SCK_1 | SIO_1, RTC_CR8);
 	swiDelay(RTC_DELAY);
-	RTC_CR8 = CS_1 | SCK_1 | SIO_1;
+	writeb(CS_1 | SCK_1 | SIO_1, RTC_CR8);
 	swiDelay(RTC_DELAY);
 
 	for (i = 0; i < commandLen; i++) {
 		for (bit = 0; bit < 8; bit++) {
-			RTC_CR8 = CS_1 | SCK_0 | SIO_out | (command[i] >> 7);
+			writeb(CS_1 | SCK_0 | SIO_out | (command[i] >> 7), RTC_CR8);
 			swiDelay(RTC_DELAY);
 
-			RTC_CR8 = CS_1 | SCK_1 | SIO_out | (command[i] >> 7);
+			writeb(CS_1 | SCK_1 | SIO_out | (command[i] >> 7), RTC_CR8);
 			swiDelay(RTC_DELAY);
 
 			command[i] = command[i] << 1;
@@ -47,18 +48,18 @@
 	for (i = 0; i < resultLen; i++) {
 		result[i] = 0;
 		for (bit = 0; bit < 8; bit++) {
-			RTC_CR8 = CS_1 | SCK_0;
+			writeb(CS_1 | SCK_0, RTC_CR8);
 			swiDelay(RTC_DELAY);
 
-			RTC_CR8 = CS_1 | SCK_1;
+			writeb(CS_1 | SCK_1, RTC_CR8);
 			swiDelay(RTC_DELAY);
 
-			if (RTC_CR8 & SIO_in)
+			if (readb(RTC_CR8) & SIO_in)
 				result[i] |= (1 << bit);
 		}
 	}
 
-	RTC_CR8 = CS_0 | SCK_1;
+	writeb(CS_0 | SCK_1, RTC_CR8);
 	swiDelay(RTC_DELAY);
 }
 

Index: sound.c
===================================================================
RCS file: /cvsroot/dslinux/dslinux/linux-2.6.x/arch/arm/mach-nds/arm7/sound.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sound.c	26 Apr 2006 05:38:25 -0000	1.3
+++ sound.c	16 Aug 2006 13:55:06 -0000	1.4
@@ -1,4 +1,5 @@
 #include "asm/types.h"
+#include "asm/io.h"
 
 #include "sound.h"
 
@@ -18,8 +19,8 @@
 
 #define SCHANNEL_TIMER(n)	(*(volatile u16*)(0x04000408 + ((n)<<4)))
 #define SCHANNEL_CR(n)		(*(volatile u32*)(0x04000400 + ((n)<<4)))
-#define SCHANNEL_VOL(n)		(*(volatile u8*)(0x04000400 + ((n)<<4)))
-#define SCHANNEL_PAN(n)		(*(volatile u8*)(0x04000402 + ((n)<<4)))
+#define SCHANNEL_VOL(n)		(0x04000400 + ((n)<<4))
+#define SCHANNEL_PAN(n)		(0x04000402 + ((n)<<4))
 #define SCHANNEL_SOURCE(n)	(*(volatile u32*)(0x04000404 + ((n)<<4)))
 #define SCHANNEL_REPEAT_POINT(n) (*(volatile u16*)(0x0400040A + ((n)<<4)))
 #define SCHANNEL_LENGTH(n)	(*(volatile u32*)(0x0400040C + ((n)<<4)))
@@ -37,13 +38,13 @@
 
 	for (i = 0; i < s_channels; i++) {
 		SCHANNEL_CR(i) = SCHANNEL_ENABLE | SOUND_REPEAT | s_format;
-		SCHANNEL_VOL(i) = SOUND_VOL(127);
-		SCHANNEL_PAN(i) = (i % 2) ? 127 : 0;
+		writeb(SOUND_VOL(127), SCHANNEL_VOL(i));
+		writeb(((i % 2) ? 127 : 0), SCHANNEL_PAN(i));
 		SCHANNEL_REPEAT_POINT(i) = 0;
 	}
 
 	if (s_channels == 1) {
-		SCHANNEL_PAN(0) = 64;
+		writeb(64, SCHANNEL_PAN(0));
 	}
 
 	sound_set_master_volume(127);




More information about the dslinux-commit mailing list