From: Jonathan Cameron <jic23@kernel.org>
To: Jagath Jog J <jagathjog1996@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Bastien Nocera <hadess@hadess.net>,
Hans de Goede <hdegoede@redhat.com>,
linux-iio <linux-iio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] iio: accel: bma400: Add support for single and double tap events
Date: Sun, 28 Aug 2022 19:03:32 +0100 [thread overview]
Message-ID: <20220828190332.57ee9aa2@jic23-huawei> (raw)
In-Reply-To: <CAM+2Eu+a8LM+XBELAm9H51EWVwCDqcYaxfdj4_-Sk9TtJ0gLJA@mail.gmail.com>
On Sat, 27 Aug 2022 03:36:23 +0530
Jagath Jog J <jagathjog1996@gmail.com> wrote:
> Hi Andy,
>
> On Fri, Aug 26, 2022 at 1:53 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > 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.
>
> This is the terminator case so I have not added a comma in the last.
> All three tap configurations have only 4 value options.
>
> >
> > > +};
> >
> > ...
> >
> > > +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?
>
> All tap configuration value arrays are of size 4, I will define a
> macro for that.
>
> >
> > Also you may add it to each data structure in question.
>
> Do you mean storing these values in the device's private structure?
I suspect Andy means making sure they are all 4 long via
+static int tap_reset_timeout[NEW_LENGTH_DEFINE] = {
etc.
>
> Tap configuration values are not stored in the device's private
> structure because.
> - I am directly accessing the device registers in _read_event_value()
> and _write_event_value().
> - These configuration values are not used in the other parts of
> the driver.
> - Two of these configurations have a default value so instead of
> reading and storing these values in the device's private structure
> during device init, I am directly accessing the device's register.
>
> >
> > > + 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
>
> Sure, I will correct these in the next patch series.
>
> Thank you
> Jagath
>
> >
> > > + * See section 4.7 "Tap sensing interrupt" in datasheet v1.2.
> > > + */
> >
> > --
> > With Best Regards,
> > Andy Shevchenko
next prev parent reply other threads:[~2022-08-28 18:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 19:46 [PATCH v3 0/2] iio: Add single and double tap events support Jagath Jog J
2022-08-25 19:46 ` [PATCH v3 1/2] iio: Add new event type gesture and use direction for single and double tap Jagath Jog J
2022-08-29 16:51 ` Jonathan Cameron
2022-08-25 19:46 ` [PATCH v3 2/2] iio: accel: bma400: Add support for single and double tap events Jagath Jog J
2022-08-25 20:23 ` Andy Shevchenko
2022-08-26 22:06 ` Jagath Jog J
2022-08-28 18:03 ` Jonathan Cameron [this message]
2022-08-29 16:55 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220828190332.57ee9aa2@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=hadess@hadess.net \
--cc=hdegoede@redhat.com \
--cc=jagathjog1996@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.