[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56A26336.3030506@posteo.de>
Date: Fri, 22 Jan 2016 18:13:26 +0100
From: Martin Kepplinger <martink@...teo.de>
To: jic23@...nel.org, knaack.h@....de, lars@...afoo.de,
pmeerw@...erw.net, christoph.muellner@...obroma-systems.com,
mfuzzey@...keon.com
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
Martin Kepplinger <martin.kepplinger@...obroma-systems.com>
Subject: Re: [PATCH v6 1/3] iio: mma8452: add freefall detection for
Freescale's accelerometers
Am 2016-01-16 um 15:35 schrieb Martin Kepplinger:
> This adds freefall event detection to the supported devices. It adds
> the in_accel_x&y&z_mag_falling_en iio event attribute, which activates
> freefall mode.
>
> In freefall mode, the current acceleration magnitude (AND combination
> of all axis values) is compared to the specified threshold.
> If it falls under the threshold (in_accel_mag_falling_value),
> the appropriate IIO event code is generated.
>
> This is what the sysfs "events" directory for these devices looks
> like after this change:
>
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_falling_period
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_falling_value
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_rising_period
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_mag_rising_value
> -r--r--r-- 4096 Oct 23 08:45 in_accel_scale
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_x&y&z_mag_falling_en
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_x_mag_rising_en
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_y_mag_rising_en
> -rw-r--r-- 4096 Oct 23 08:45 in_accel_z_mag_rising_en
>
> Signed-off-by: Martin Kepplinger <martin.kepplinger@...obroma-systems.com>
> Signed-off-by: Christoph Muellner <christoph.muellner@...obroma-systems.com>
> ---
> revision history
> ----------------
> v1:
> initial post
> v2:
> build all from correct event and channel spec structs
> v3:
> rising and falling are treated as equal now. Until last time, I had
> misunderstood the iio events' user API definition. This works and
> values always reflect the current state of operation.
> v4:
> fix error that caused a build warning
> v5:
> changes according to Peter's review
> v6:
> changes according to Jonathan's review:
> improve set_freefall_mode(); fix error case
>
>
Any more thoughts, advice or objections on this?
thanks
martin
Powered by blists - more mailing lists