lkml.org 
[lkml]   [2022]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 2/2] iio: accel: bma400: Add support for single and double tap events
On Sun, 5 Jun 2022 10:38:10 +0530
Jagath Jog J <jagathjog1996@gmail.com> wrote:

> Hi Jonathan and Andy.
>
> On Sat, Jun 4, 2022 at 8:22 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > On Sun, 29 May 2022 09:31:53 +0530
> > Jagath Jog J <jagathjog1996@gmail.com> wrote:
> >
> > > Add support for single and double tap events based on the tap threshold
> > > value and minimum quite time value between the taps. INT1 pin is used to
> > > interrupt and event is pushed to userspace.
> > >
> > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
> >
> > Hi Jagath,
> >
> > A few comments inline.
> >
> > Thanks,
> >
> > Jonathan



> > > +
> > > + /*
> > > + * acc_filt1 is the data source for the tap interrupt and it is
> > > + * operating on an input data rate of 200Hz.
> > > + */
> > > + if (!data->tap_event_en) {
> >
> > Feels like checking the wrong thing. If we need 200Hz, check if the
> > data rate is at 200Hz rather than if the tap_event is not enabled.
> > Obviously same result, but one seems more obvious.
>
> if (!data->tap_event_en)
> This checking is to make sure not to execute
> bma400_set_accel_output_data_rate() function while disabling the
> tap event to avoid the negative (-EBUSY) return value from the
> function bma400_set_accel_output_data_rate() when either of
> the tap is enabled.

Ah. Fair enough. It's a little odd looking though. You could push
the check out of bma400_set_accel_output_data_rate() and into
write_raw though would need to be within the lock to avoid potential
race conditions. Perhaps just not worth the effort.

Jonathan


\
 
 \ /
  Last update: 2022-06-06 17:03    [W:1.040 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site