All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Gwendal Grignou <gwendal@chromium.org>
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:23:36 +0200	[thread overview]
Message-ID: <CAHp75Vda3htVLApWwqoKb8uyoJaQWdOL2JK4kzMn_OH4OHa4Lg@mail.gmail.com> (raw)
In-Reply-To: <20210112040923.2613711-1-gwendal@chromium.org>

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 ;

...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?

I'll send a patch soon. You may include it in your series as prerequisite.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-01-12 14:23 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 [this message]
2021-01-13  0:15   ` Gwendal Grignou

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=CAHp75Vda3htVLApWwqoKb8uyoJaQWdOL2JK4kzMn_OH4OHa4Lg@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=gwendal@chromium.org \
    --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 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.