From: Gwendal Grignou <gwendal@chromium.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v5] iio: hrtimer: Allow sub Hz granularity
Date: Tue, 12 Jan 2021 16:15:15 -0800 [thread overview]
Message-ID: <CAPUE2usVJU98D50enyf5+L3OdXcjzFnLdYt82g=AHCfeqgOyCA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75Vda3htVLApWwqoKb8uyoJaQWdOL2JK4kzMn_OH4OHa4Lg@mail.gmail.com>
On Tue, Jan 12, 2021 at 6:22 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Jan 12, 2021 at 6:09 AM Gwendal Grignou <gwendal@chromium.org> wrote:
> >
> > Allow setting frequency below 1Hz or sub 1Hz precision.
> > Useful for slow sensors like ALS.
> >
> > Test frequency is set properly:
> > modprobe iio-trig-hrtimer && \
> > mkdir /sys/kernel/config/iio/triggers/hrtimer/t1 && \
>
> This && seems strange...
>
> > cd /sys/bus/iio/devices/triggerX ;
This is just for testing. X in triggerX should be replaced with the
newly created trigger.
>
> ...because if the above fails, the below becomes a total train wreck.
>
> > for i in 1 .1 .01 .001 ; do
> > echo $i > sampling_frequency
> > cat sampling_frequency
> > done
>
> Something like this perhaps (note {} and also I dropped unneeded ; and
> whitespace)
> modprobe iio-trig-hrtimer && \
> mkdir /sys/kernel/config/iio/triggers/hrtimer/t1 && { \
> cd /sys/bus/iio/devices/triggerX
> for i in 1 .1 .01 .001; do
> echo $i > sampling_frequency
> cat sampling_frequency
> done
> }
>
> ...
>
> > + if (!val || val > NSEC_PER_SEC * 1000)
> > return -EINVAL;
>
> > + info->period = NSEC_PER_SEC * 1000;
>
> I didn't get these * 1000 parts, why not define and use PSEC_PER_SEC?
Indeed only Nano and Femto SEC_PER_SEC are defined.
>
> I'll send a patch soon. You may include it in your series as prerequisite.
Thanks,
Gwendal.
>
> --
> With Best Regards,
> Andy Shevchenko
prev parent reply other threads:[~2021-01-13 0:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 4:09 [PATCH v5] iio: hrtimer: Allow sub Hz granularity Gwendal Grignou
2021-01-12 14:23 ` Andy Shevchenko
2021-01-13 0:15 ` Gwendal Grignou [this message]
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='CAPUE2usVJU98D50enyf5+L3OdXcjzFnLdYt82g=AHCfeqgOyCA@mail.gmail.com' \
--to=gwendal@chromium.org \
--cc=andy.shevchenko@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).