lkml.org 
[lkml]   [2022]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 2/2] iio: accel: bma400: Add support for single and double tap events
On Thu, Aug 25, 2022 at 10:46 PM Jagath Jog J <jagathjog1996@gmail.com> wrote:
>
> Add support for single and double tap events based on the tap threshold
> value, minimum quiet time before and after the tap and minimum time
> between the taps in the double tap. The INT1 pin is used to interrupt
> and the event is pushed to userspace.

...

> +static int tap_reset_timeout[] = {
> + 300000,
> + 400000,
> + 500000,
> + 600000

+ Comma and so on for the rest of the similar cases.

> +};

...

> +static int usec_to_tapreg_raw(int usec, const int *time_list)
> +{
> + int index;
> +
> + for (index = 0; index < 4; index++) {

Magic. Shouldn't be defined?

Also you may add it to each data structure in question.

> + if (usec == time_list[index])
> + return index;
> + }
> + return -EINVAL;
> +}

...

> + int ret;
> + unsigned int mask, field_value;

Reversed xmas tree order?

...

> + /*
> + * Tap interrupts are operating with the data rate of 200Hz.

a data

> + * See section 4.7 "Tap sensing interrupt" in datasheet v1.2.
> + */

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-08-25 22:24    [W:0.151 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site