aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorNelson Castillo <nelsoneci@gmail.com>2008-11-19 17:11:25 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:25 +0000
commit3880c3963d398e90c6737849955bdf20c61b64b9 (patch)
tree1219632ff163ca5d9fa38515b0ad20c081eb3099 /arch/arm
parent4c68341d014cdd5142882377f326672ed382f80f (diff)
Subject: [PATCH 1/2] fix-gta02_lis302dl_bitbang.patch
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@gmail.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 8189724c02d..21a147db695 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;
}