[PATCH 1/2] fix-gta02_lis302dl_bitbang.patch

Nelson Castillo nelsoneci at gmail.com
Sat Nov 15 03:28:14 CET 2008


Make accelerometers work again in stable-tracking.
They stopped working with a previous commit.

(shifter >> 7) & 1); ...; shifter <<= 1;
  Had been changed to:
(shifter >> (7 - n)) & 1) /* assuming tx_bytes == 1 */

The problem: an unneeded shifter <<= 1 was still there.

We make a small change to the indexing code to make things work again.

Signed-off-by: Nelson Castillo <nelsoneci at gmail.com>
---

 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 8189724..21a147d 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -1080,9 +1080,9 @@ static void __gta02_lis302dl_bitbang(struct lis302dl_info *lis, u8 *tx,
 	/* send the register index, r/w and autoinc bits */
 	for (n = 0; n < (tx_bytes << 3); n++) {
 		if (!(n & 7))
-			shifter = tx[n >> 3];
+			shifter = ~tx[n >> 3];
 		s3c2410_gpio_setpin(pdata->pin_clk, 0);
-		s3c2410_gpio_setpin(pdata->pin_mosi, (shifter >> (7 - n)) & 1);
+		s3c2410_gpio_setpin(pdata->pin_mosi, !(shifter & 0x80));
 		s3c2410_gpio_setpin(pdata->pin_clk, 1);
 		shifter <<= 1;
 	}




More information about the openmoko-kernel mailing list