[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ANN: apple motion sensor reverse engineered



Le vendredi 19 août 2005 à 13:21 +0200, Johannes Berg a écrit :

> Hi,
> 
> I have successfully reverse engineered the AMS
[...]
> Have fun. Maybe I'll see a real driver that can even handle interrupts
> (I have no idea how to get the interrupt GPIO stuff from the PROM/OF)
> when I get back online after the weekend? ;)

Well, it took a bit longer since I was taking some days off :)

An initial working implementation (_with_ interrupts) is available at:
	http://www.popies.net/ams/

This version does not implement an input device but makes the x/y/z
values available through /sys attributes (/sys/devices/ams/{x,y,z}).
I'm not sure the input device is really useful.

Also missing from the code is the action to take when an interrupt is
detected (currently it only prints a message). Should it park the hard
drive heads like OSX does (and if yes, how to do that ?) ? Or should the
action be configurable ? (something like telling the driver what
userspace program to launch when the freefall/shock is detected. But I
fear that in the freefall case it will take too long for the program to
execute and the shock will happen before the drive heads were safely
parked).

The driver could also be enhanced by adding some /sys attributes to set
the thresholds, enable/disable the device etc. 

Comments are welcomed.

Stelian.
-- 
Stelian Pop <stelian@popies.net>



Reply to: