All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] ppc4xx: use correct io accessors for esd's LCD code
@ 2007-12-28 16:10 Matthias Fuchs
  0 siblings, 0 replies; only message in thread
From: Matthias Fuchs @ 2007-12-28 16:10 UTC (permalink / raw)
  To: u-boot

This patch fixes esd's LCD dectection code to work correctly with
newer gcc versions.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
 board/esd/common/lcd.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/board/esd/common/lcd.c b/board/esd/common/lcd.c
index 196171c..71d5058 100644
--- a/board/esd/common/lcd.c
+++ b/board/esd/common/lcd.c
@@ -24,6 +24,7 @@
  * MA 02111-1307 USA
  */
 
+#include "asm/io.h"
 #include "lcd.h"
 
 
@@ -229,10 +230,10 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
 	/*
 	 * Detect epson
 	 */
-	lcd_reg[0] = 0x00;
-	lcd_reg[1] = 0x00;
+	out_8(&lcd_reg[0], 0x00);
+	out_8(&lcd_reg[1], 0x00);
 
-	if (lcd_reg[0] == 0x1c) {
+	      if (in_8(&lcd_reg[0]) == 0x1c) {
 		/*
 		 * Big epson detected
 		 */
@@ -241,7 +242,7 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
 		palette_value = 0x1e4;
 		lcd_depth = 16;
 		puts("LCD:   S1D13806");
-	} else if (lcd_reg[1] == 0x1c) {
+	      } else if (in_8(&lcd_reg[1]) == 0x1c) {
 		/*
 		 * Big epson detected (with register swap bug)
 		 */
@@ -250,7 +251,7 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
 		palette_value = 0x1e5;
 		lcd_depth = 16;
 		puts("LCD:   S1D13806S");
-	} else if (lcd_reg[0] == 0x18) {
+	      } else if (in_8(&lcd_reg[0]) == 0x18) {
 		/*
 		 * Small epson detected (704)
 		 */
@@ -259,7 +260,7 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
 		palette_value = 0x17;
 		lcd_depth = 8;
 		puts("LCD:   S1D13704");
-	} else if (lcd_reg[0x10000] == 0x24) {
+	      } else if (in_8(&lcd_reg[0x10000]) == 0x24) {
 		/*
 		 * Small epson detected (705)
 		 */
@@ -277,7 +278,7 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
 	/*
 	 * Setup lcd controller regs
 	 */
-	for (i = 0; i<reg_count; i++) {
+	for (i = 0; i < reg_count; i++) {
 		s1dReg = regs[i].Index;
 		if (reg_byte_swap) {
 			if ((s1dReg & 0x0001) == 0)
-- 
1.5.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-28 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-28 16:10 [U-Boot-Users] [PATCH] ppc4xx: use correct io accessors for esd's LCD code Matthias Fuchs

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.