[Letux-kernel] alternate accelerometer driver for GTA04

H. Nikolaus Schaller hns at goldelico.com
Mon Dec 5 20:55:50 CET 2016


recently there was found that our BMA180 patch for the
input device driver of the BMA150 is wrong.

I was able to vote against complete removal from the
upstream kernel but there must be a better solution than
keeping the wrong patch.

We still need this input event since it is the standard
method of (older?) Android user spaces to read device position:


With the ideas from the tsc2007 driver which mixes input
events and iio, I had the idea to patch the iio core
to optionally detect registration of an accelerometer
device and register it additionally as /dev/input.

I have hacked together a patch set that
a) detects registration of iio accelerometers
b) creates a new /dev/input/event if neeed
c) tells the input layer about ABS_X, ABS_Y, ABS_Z
d) has two callback functions that are called if someone opens or closes the input event

This works so far that the /dev/input/event is created.

What is missing:
* starting/stopping the iio data capture if someone opens/closes /dev/input/event
* poll for (or register an interrupt) to receive accelerometer data
* reformat and send positions as input events
* proper and automatic scaling

How to use:

simply merge the new branch work/hns/iio-input-bridge on
top of letux-4.9-rc8 and test on GTA04 (the BMA180 is already
reconfigured as iio and the old bma150 input driver is removed).



More information about the Letux-kernel mailing list