[PATCH 0/4] Accelerometer enhancements

NeilBrown neilb at suse.de
Mon Nov 2 02:32:44 CET 2009

I've been meaning to post these for some months now... finally I
remembered to :-) 

The following patch series makes some useful changes to the interface
to the accelerometers.

The important changes are:
  'sample_rate' can now be any value, not just 100 or 400.
  For smaller values, a timer is used to deliver samples at
  the required rate.  This way userspace doesn't have to be
  reading constantly to still get useful data.

  'threshold' is made more reliable and useful.  Any change that
  exceeds the threshold is guaranteed to be reported as a change that
  appear to be larger than the threshold.

  Using these two together, you can arrange for regular updates
  (e.g. every second or so) but still get more frequent updates if the
  orientation of the device is changing quickly.

The only change that is not back-compatible is the last, and is
independent of the others.
It changes the 'full_scale' attribute to be more flexible in the
values it accepts, and to report the current value in a more useful
way.  Rather than "2.3" or "9.2", it reports
  2 [8]
  [2] 8

Thus listing valid values and showing which one is currently

These patches are against andy-tracking.

I have the beginnings of patches to report 'tap' and maybe even
'double-tap' events too but they aren't quite there yet.

Thanks for any attention that these might get.



NeilBrown (4):
      lis302dl: improve 'full_scale' attribute
      lis302d: make 'threshold' detection more reliable.
      lis302dl: tiny optimisation in __reg_set_bit_mask
      lis302dl:  allow accelerometer sample_rate to be other values including fractions.

 drivers/input/misc/lis302dl.c |  263 +++++++++++++++++++++++++++++++++++------
 include/linux/lis302dl.h      |   15 ++
 2 files changed, 241 insertions(+), 37 deletions(-)


More information about the openmoko-kernel mailing list