Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1268014

Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's accelerometers

From Martin Kepplinger <martink@posteo.de>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's accelerometers
Date 2015-11-12 16:10 +0100
Message-ID <qu1FE-240-17@gated-at.bofh.it> (permalink)
References <qtItk-6q2-7@gated-at.bofh.it> <qtIWm-6Rf-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am 2015-11-11 um 20:08 schrieb Lars-Peter Clausen:
> On 11/11/2015 07:38 PM, Martin Kepplinger wrote:
>> 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.
>>
> 
> Hi,
> 
> Thanks for the patch, looks pretty good. Just a few things.
> 
>> In freefall mode, the current acceleration values of all activated axis 
>> are added and if the *sum* falls *under* the threshold specified
> 
> Are you sure its not the magnitude of the vector rather than the sum of the
> individual components?

It's the acceleration magnitude, logical AND combination of the values.
Will correct this for v2.

> 
>> (in_accel_mag_falling_value), the appropriate IIO event code is 
>> generated.
> [...]
>> +enum { +	axis_x, +	axis_y, +	axis_z, +};
> 
> That should be part of patch two I guess.

Will do.

> 
> [...]
>> +static IIO_DEVICE_ATTR_NAMED(accel_xayaz_mag_falling_en, + 
>> in_accel_x&y&z_mag_falling_en, +			     S_IRUGO | S_IWUSR, + 
>> mma8452_get_freefall_mode, +			     mma8452_set_freefall_mode, + 0);
> 
> This should be created by the core based on the event spec, shouldn't it?
> 

I'll check if this works when I get to it.

thanks for the review!

                                  martin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] iio: mma8452: add freefall detection for Freescale's accelerometers Martin Kepplinger <martink@posteo.de> - 2015-11-11 19:40 +0100
  [PATCH 2/3] iio: mma8452: use enum for numbering the axis Martin Kepplinger <martink@posteo.de> - 2015-11-11 19:40 +0100
  Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's  accelerometers Lars-Peter Clausen <lars@metafoo.de> - 2015-11-11 20:10 +0100
    Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's  accelerometers Martin Kepplinger <martink@posteo.de> - 2015-11-12 16:10 +0100
  Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's  accelerometers Jonathan Cameron <jic23@kernel.org> - 2015-11-14 19:10 +0100
    Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's  accelerometers Martin Kepplinger <martink@posteo.de> - 2015-11-14 19:50 +0100
      Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's  accelerometers Jonathan Cameron <jic23@kernel.org> - 2015-11-14 20:10 +0100

csiph-web