aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw27@cam.ac.uk>2009-03-27 12:18:30 +0000
committerThomas White <taw27@cam.ac.uk>2009-03-27 12:20:33 +0000
commit5279f42fb412cac3758aff57e339a9c787846ce6 (patch)
treeded48fbbc0fa0600d63b2abb0f8f69bce3048fa8
parent05cf81da2d23f04151cd24823cd32e1095b01dcf (diff)
Handle the latest changes to the Openmoko kernel
-rw-r--r--src/accelerometers.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/accelerometers.c b/src/accelerometers.c
index 9933657..3e219a3 100644
--- a/src/accelerometers.c
+++ b/src/accelerometers.c
@@ -73,6 +73,13 @@ static FILE *accelerometer_freerunner_open_threshold(const char *mode)
return fh;
}
+ /* Try 2.6.29-ish+ method */
+ fh = fopen("/sys/devices/platform/s3c2440-i2c/i2c-adapter:i2c-0"
+ "/0-0073/spi_s3c24xx_gpio.0/spi3.1/threshold", mode);
+ if ( fh != NULL ) {
+ return fh;
+ }
+
return NULL;
}
@@ -260,7 +267,9 @@ int accelerometer_moo_freerunner(AccelHandle *accel)
return 0; /* No data */
}
- if ( ev.type == EV_REL ) {
+ /* Nasty, but the event type has changed.
+ * For now, we must support both types. */
+ if ( (ev.type == EV_REL) || (ev.type == EV_ABS) ) {
if ( ev.code == REL_X ) {
accel->lx = ev.value;
}