From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751929AbbKKTIQ (ORCPT ); Wed, 11 Nov 2015 14:08:16 -0500 Received: from smtp-out-225.synserver.de ([212.40.185.225]:1056 "EHLO smtp-out-188.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751013AbbKKTIO (ORCPT ); Wed, 11 Nov 2015 14:08:14 -0500 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@laprican.de X-SynServer-PPID: 29600 Message-ID: <5643921B.5070707@metafoo.de> Date: Wed, 11 Nov 2015 20:08:11 +0100 From: Lars-Peter Clausen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Martin Kepplinger , jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, christoph.muellner@theobroma-systems.com, mfuzzey@parkeon.com CC: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kepplinger Subject: Re: [PATCH 1/3] iio: mma8452: add freefall detection for Freescale's accelerometers References: <1447267094-2248-1-git-send-email-martink@posteo.de> In-Reply-To: <1447267094-2248-1-git-send-email-martink@posteo.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > (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. [...] > +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?