25 May, 2010

2 commits

  • Content for the 8bit device threaded interrupt handlers. Depending on the
    interrupt line and chip configuration, either click or wakeup / freefall
    handler is called. In case of click, BTN_ event is sent via input device.
    In case of wakeup or freefall, input device ABS_ events are updated
    immediatelly.

    It is still possible to configure interrupt line 1 for fast freefall
    detection and use the second line either for click or threshold based
    interrupts. Or both lines can be used for click / threshold interrupts.

    Polled input device can be set to stopped state and still get coordinate
    updates via input device using interrupt based method. Polled mode and
    interrupt mode can also be used parallel.

    BTN_ events are remapped based on existing axis remapping information.

    Signed-off-by: Samu Onkalo
    Acked-by: Eric Piel
    Cc: Daniel Mack
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Definitions for click were missing.

    Signed-off-by: Samu Onkalo
    Acked-by: Eric Piel
    Tested-by: Daniel Mack
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     

16 Dec, 2009

7 commits

  • Report output values as 1/1000 of earth gravity.

    Output values from lis3 can be read from sysfs position entry and from
    input device. Input device can be accessed as event device and as
    joystick device. Joystick device can be in two modes. Meaning of the
    output values varies from case to case depending on the chip type and
    configuration (scale). Only joystick interface in JS_CORR_BROKEN mode
    returned somehow similar output values in different configurations.
    Joystick device is in that state by default in case of lis3.

    Position sysfs entry, input event device and raw joystick device have been
    little bit broken since meaning of the output values has been varied
    between 12 and 8 bit devices. Applications which relayed on those methods
    failed if the chip is different than the expected one.

    This patch converts output values to mean similar thing in different
    configurations. Both 8 and 12 bit devices reports now same acceleration
    values. If somebody implements full scale support to the driver, output
    values will still mean the same. Scaling factor and input device range
    must be updated in that case.

    Joystick interface in JS_CORR_BROKEN mode is not touched by this patch.
    All other interfaces have different scale after this change. For 12 bit
    device scaling factor is 0.977 which keeps scaled and unscaled values are
    quite close to each others. For 8 bit device, scaled values are 18 times
    bigger than unscaled values.

    Signed-off-by: Samu Onkalo
    Acked-by: Éric Piel
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • It is possible to read position information at the chip measurement rate
    via sysfs. This patch adds possibility to configure chip measurement
    rate.

    Signed-off-by: Samu Onkalo
    Signed-off-by: Éric Piel
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Chip is calibrated by the manufacturer. There is no need to calibarate it
    at driver level. If the chip is used as a joystick, calibaration can be
    done using joystick device calibration mechanism.

    Signed-off-by: Samu Onkalo
    Acked-by: Éric Piel
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Implement selftest feature as specified by chip manufacturer. Control:
    read selftest sysfs entry

    Response: "OK x y z" or "FAIL x y z"

    where x, y, and z are difference between selftest mode and normal mode.
    Test is passed when values are within acceptance limit values.

    Acceptance limits are provided via platform data. See chip spesifications
    for acceptance limits. If limits are not properly set, OK / FAIL decision
    is meaningless. However, userspace application can still make decision
    based on the numeric x, y, z values.

    Selftest is meant for HW diagnostic purposes. It is not meant to be
    called during normal use of the chip. It may cause false interrupt
    events. Selftest mode delays polling of the normal results but it doesn't
    cause wrong values. Chip must be in static state during selftest. Any
    acceration during the test causes most probably failure.

    Signed-off-by: Samu Onkalo
    Acked-by: Éric Piel
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Lis3 accelerometer sensors have quite long power on delay (up to 125
    ms). This patch adds necessary delay to power on sequence for currently
    supported lis3 chips.

    Signed-off-by: Samu Onkalo
    Tested-by: Éric Piel
    Acked-by: Éric Piel
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samu Onkalo
     
  • Originally the driver was only targeted to 12bits sensors. When support
    for 8bits sensors was added, some slight difference in the registers were
    overlooked. This should fix it, both for initialization, and for
    displaying the rate.

    Reported-by: Kalhan Trisal
    Reported-by: Christoph Plattner
    Tested-by: Christoph Plattner
    Tested-by: Samu Onkalo
    Signed-off-by: Éric Piel
    Signed-off-by: Samu Onkalo
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Most of the documentation and comments were written when the driver was
    only supporting one type of chip, only via ACPI/HP. Update the info to
    the much clearer understanding that we have now.

    Signed-off-by: Éric Piel
    Signed-off-by: Samu Onkalo
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     

22 Sep, 2009

1 commit

  • This offers a way for platforms to define flags and thresholds for the
    free-fall/wakeup functions of the lis302d chips.

    More registers needed to be seperated as they are specific to the

    Signed-off-by: Daniel Mack
    Acked-by: Pavel Machek
    Cc: Eric Piel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Mack
     

17 Jun, 2009

3 commits

  • The LIS302DL accelerometer chip has a 'click' feature which can be used to
    detect sudden motion on any of the three axis. Configuration data is
    passed via spi platform_data and no action is taken if that's not
    specified, so it won't harm any existing platform.

    To make the configuration effective, the IRQ lines need to be set up
    appropriately. This patch also adds a way to do that from board support
    code.

    The DD_* definitions were factored out to an own enum because they are
    specific to LIS3LV02D devices.

    Signed-off-by: Daniel Mack
    Acked-by: Pavel Machek
    Acked-by: Eric Piel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Mack
     
  • Now that there is no need to hookup on the open/close of the joystick,
    it's possible to use the simplified interface input_polled_device, instead
    of creating our own kthread.

    [randy.dunlap@oracle.com: fix Kconfig]
    [randy.dunlap@oracle.com: fix Kconfig some more]
    Signed-off-by: Eric Piel
    Signed-off-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Piel
     
  • After measurement on my laptop, it seems that turning off the device does
    not bring any energy saving (within 0.1W precision). So let's keep the
    device always on. It simplifies the code, and it avoids the problem of
    reading a wrong value sometimes just after turning the device on.

    Moreover, since commit ef2cfc790bf5f0ff189b01eabc0f4feb5e8524df had been
    too zealous, the device was actually never turned off anyway. This patch
    also restores the damages done by this commit concerning the
    initialisation/poweroff.

    Also do more clean up with the usage of the lis3_dev global variable.

    Signed-off-by: Eric Piel
    Signed-off-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Piel
     

01 Apr, 2009

2 commits

  • This solves the dependency between lis3lv02d.[ch] and ACPI specific
    methods. It introduces a ->bus_priv pointer to the device struct which is
    casted to 'struct acpi_device' in the ACIP layer. Changed hp_accel.c
    accordingly.

    Signed-off-by: Daniel Mack
    Acked-by: Pavel Machek
    Acked-by: Eric Piel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Mack
     
  • As Andrew noted, adev is pretty poor name for symbol being exported.
    Rename it to lis3.

    Signed-off-by: Pavel Machek
    Cc: Eric Piel
    Cc: Vladimir Botka
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek
     

19 Feb, 2009

2 commits

  • Sensors responding with 0x3B to WHO_AM_I only have one data register per
    direction, thus returning a signed byte from the position which is
    occupied by the MSB in sensors responding with 0x3A.

    Since multiple sensors share the reply to WHO_AM_I, we rename the defines
    to better indicate what they identify (family of single and double
    precision sensors).

    We support both kind of sensors by checking for the sensor type on init
    and defining appropriate data-access routines and sensor limits (for the
    joystick) depending on what we find.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Giuseppe Bilotta
    Acked-by: Eric Piel
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Giuseppe Bilotta
     
  • This adds freefall handling to hp_accel driver. According to HP, it
    should just work, without us having to set the chip up by hand.

    hpfall.c is example .c program that parks the disk when accelerometer
    detects free fall. It should work; for now, it uses fixed 20seconds
    protection period.

    Signed-off-by: Pavel Machek
    Cc: Thomas Renninger
    Cc: Éric Piel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek
     

10 Jan, 2009

1 commit

  • The sensor can be accessed via various buses. In particular, SPI, I²C
    and, on HP laptops, via a specific ACPI API (the only one currently
    supported). Separate this latest platform from the core of the sensor
    driver to allow support for the other bus type. The second, and more
    direct goal is actually to be able to merge this part with the
    hp-disk-leds driver, which has the same ACPI PNP number.

    Signed-off-by: Pavel Machek
    Signed-off-by: Eric Piel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Piel
     

13 Nov, 2008

1 commit

  • This adds a driver to the accelerometer sensor found in several HP
    laptops (under the commercial names of "HP Mobile Data Protection System
    3D" and "HP 3D driveguard"). It tries to have more or less the same
    interfaces as the hdaps and other accelerometer drivers: in sysfs and as
    a joystick.

    This driver was first written by Yan Burman. Eric Piel has updated it
    and slimed it up (including the removal of an interface to access to the
    free-fall feature of the sensor because it is not reliable enough for
    now). Pavel Machek removed few more features and switched locking from
    semaphore to mutex.

    Several people have contributed to the database of the axes.

    [eric.piel@tremplin-utc.net: LIS3LV02D: Conform to the new ACPI API]
    Signed-off-by: Eric Piel
    Signed-off-by: Yan Burman
    Signed-off-by: Pavel Machek
    Cc: "Mark M. Hoffman"
    Signed-off-by: Eric Piel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek