r4052 - branches/src/target/kernel/2.6.24.x/patches

werner at sita.openmoko.org werner at sita.openmoko.org
Tue Feb 12 23:58:08 CET 2008


Author: werner
Date: 2008-02-12 23:58:05 +0100 (Tue, 12 Feb 2008)
New Revision: 4052

Modified:
   branches/src/target/kernel/2.6.24.x/patches/fiq-hdq.patch
Log:
[PATCH Try#2] introduce-fiq-hdq.patch

From: Andy Green <andy at openmoko.com>

fiq-hdq.patch:
- drivers/power/gta02_hdq.c: cleanup after review
- include/linux/gta02_hdq.h: added previously missing file



Modified: branches/src/target/kernel/2.6.24.x/patches/fiq-hdq.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/fiq-hdq.patch	2008-02-11 10:50:32 UTC (rev 4051)
+++ branches/src/target/kernel/2.6.24.x/patches/fiq-hdq.patch	2008-02-12 22:58:05 UTC (rev 4052)
@@ -376,7 +376,7 @@
 +	int n;
 +	int v;
 +	u8 u8a[128]; /* whole address space for HDQ */
-+	char *buf1 = buf;
++	char *end = buf;
 +
 +	/* the dump does not take care about 16 bit regs, because at this
 +	 * bus level we don't know about the chip details
@@ -385,16 +385,16 @@
 +		v = gta02hdq_read(n);
 +		if (v < 0)
 +			goto bail;
-+		u8a[n] = (u8)v;
++		u8a[n] = v;
 +	}
 +
 +	for (n = 0; n < sizeof(u8a); n += 16) {
-+		hex_dump_to_buffer(u8a + n, sizeof(u8a), 16, 1, buf1, 4096, 0);
-+		buf1 += strlen(buf1);
-+		*buf1++ = '\n';
-+		*buf1 = '\0';
++		hex_dump_to_buffer(u8a + n, sizeof(u8a), 16, 1, end, 4096, 0);
++		end += strlen(end);
++		*end++ = '\n';
++		*end = '\0';
 +	}
-+	return (buf1 - buf);
++	return (end - buf);
 +
 +bail:
 +	return sprintf(buf, "ERROR %d\n", v);
@@ -408,19 +408,19 @@
 +			       struct device_attribute *attr,
 +			       const char *buf, size_t count)
 +{
-+	const char *buf1 = buf + count;
++	const char *end = buf + count;
 +	int address = atoi(buf);
 +
-+	while ((buf < buf1) && (*buf != ' '))
++	while ((buf != end) && (*buf != ' '))
 +		buf++;
-+	if (buf >= buf1)
++	if (buf >= end)
 +		return 0;
-+	while ((buf < buf1) && (*buf == ' '))
++	while ((buf < end) && (*buf == ' '))
 +		buf++;
-+	if (buf >= buf1)
++	if (buf >= end)
 +		return 0;
 +
-+	gta02hdq_write(address, (u8)atoi(buf));
++	gta02hdq_write(address, atoi(buf));
 +
 +	return count;
 +}
@@ -514,7 +514,7 @@
 +module_exit(gta02hdq_exit);
 +
 +MODULE_AUTHOR("Andy Green <andy at openmoko.com>");
-+MODULE_DESCRIPTION("FIC Neo1973 GTA02 HDQ driver");
++MODULE_DESCRIPTION("Neo Freerunner HDQ driver");
 +MODULE_LICENSE("GPL");
 Index: linux-2.6.24/include/asm-arm/arch-s3c2410/fiq_ipc_gta02.h
 ===================================================================
@@ -568,3 +568,16 @@
  
  #define GTA02_GPIO_nG1_INT	S3C2410_GPF0
  #define GTA02_GPIO_IO1		S3C2410_GPF1
+Index: linux-2.6.24/include/linux/gta02_hdq.h
+===================================================================
+--- /dev/null
++++ linux-2.6.24/include/linux/gta02_hdq.h
+@@ -0,0 +1,8 @@
++#ifndef __GTA02HDQ_H__
++#define __GTA02HDQ_H__
++
++int gta02hdq_read(int address);
++int gta02hdq_write(int address, u8 data);
++int gta02hdq_initialized(void);
++
++#endif





More information about the commitlog mailing list