From: Nishant Malpani <nish.malpani25@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
"Bogdan, Dragos" <dragos.bogdan@analog.com>,
darius.berghe@analog.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290
Date: Wed, 22 Jul 2020 15:10:06 +0530 [thread overview]
Message-ID: <5cb55101-af5c-b6a2-d770-9717f8a463cc@gmail.com> (raw)
In-Reply-To: <CAHp75VdYVC9n7-2MH62J46N0p+sNSE9QVwonor5QfdnvL4hoLg@mail.gmail.com>
On 22/07/20 3:08 am, Andy Shevchenko wrote:
> On Tue, Jul 21, 2020 at 11:35 PM Nishant Malpani
> <nish.malpani25@gmail.com> wrote:
>> On 22/07/20 1:16 am, Andy Shevchenko wrote:
>>> On Tue, Jul 21, 2020 at 9:20 PM Nishant Malpani
>>> <nish.malpani25@gmail.com> wrote:
>
> ...
>
>>>> + *vals = (const int *)adxrs290_lpf_3db_freq_tbl;
>>>
>>> Why casting?
>>>
>> adxrs290_lpf_3db_freq_tbl is of type (int *)[2], right? Without the
>> casting, an incompatible-pointer-type error is thrown.
>>
>>> ...
>>>
>>>> + *vals = (const int *)adxrs290_hpf_3db_freq_tbl;
>>>
>>> Ditto.
>>>
>> See above comment.
>
> Can't you declare table as const int?
>
I'm not sure I understand you completely here; do you mean const int *?
So, an array of alternate integer and fractional parts? I suppose that's
possible but we'd be introducing unwanted complexity I feel - for
example, currently the index of the 3db frequency in the table is used
to directly map & set bits in the filter register corresponding to that
frequency but with the approach you share, we'd have to apply a
transformation (div by 2) to set the same bits in the filter register.
Do you think the added complexity justifies the removal of the casting?
> ...
>
>>>> + /* max transition time to measurement mode */
>>>> + msleep_interruptible(ADXRS290_MAX_TRANSITION_TIME_MS);
>>>
>>> I'm not sure what the point of interruptible variant here?
>>>
>> I referred Documentation/timers/timers-howto.rst for this.
>> My reasoning was shaped to use the interruptible variant because the
>> transition settles in a time *less than* 100ms and since 100ms is quite
>> a huge time to sleep, it should be interrupted in case a signal arrives.
>
> This is probe of the device,
> What are the expectations here?
>
I fail to understand why this can't be used in the probe() but perhaps
in a routine to standby/resume. Could you please elaborate?
With regards,
Nishant Malpani
next prev parent reply other threads:[~2020-07-22 9:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 18:19 [PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290 Nishant Malpani
2020-07-21 19:46 ` Andy Shevchenko
2020-07-21 20:35 ` Nishant Malpani
2020-07-21 21:14 ` Nishant Malpani
2020-07-21 21:38 ` Andy Shevchenko
2020-07-22 9:40 ` Nishant Malpani [this message]
2020-07-22 10:23 ` Andy Shevchenko
2020-07-22 14:29 ` Nishant Malpani
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=5cb55101-af5c-b6a2-d770-9717f8a463cc@gmail.com \
--to=nish.malpani25@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=darius.berghe@analog.com \
--cc=dragos.bogdan@analog.com \
--cc=jic23@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox