All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Harald Geyer <harald@ccbib.org>,
	John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: linux-iio@vger.kernel.org, Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH 2/3] iio: Provide new API to get the current resolution of timestamps
Date: Sat, 07 Mar 2015 19:05:21 +0000	[thread overview]
Message-ID: <54FB4BF1.3050102@kernel.org> (raw)
In-Reply-To: <1425329766-14703-3-git-send-email-harald@ccbib.org>

On 02/03/15 20:56, Harald Geyer wrote:
> Signed-off-by: Harald Geyer <harald@ccbib.org>
This use of the iio_get_timestamp call is very driver
specific. I'd be tempted not to wrap it at all and
to call your ktime_get_resolution_ns directly in the driver.
Arguably, don't use the wrapper on the timestamp either
as the intent of that is to provide a consistent way
of getting times that are reported to userspace via the
iio chrdevs.  I'm not entirely sure why a wrapper made
sense a long time ago for that use either though!

Jonathan
> ---
>  include/linux/iio/iio.h |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 80d8550..2d352a0 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -286,6 +286,11 @@ static inline s64 iio_get_time_ns(void)
>  	return ktime_get_real_ns();
>  }
>  
> +static inline u32 iio_get_time_resolution_ns(void)
> +{
> +	return ktime_get_resolution_ns();
> +}
> +
>  /* Device operating modes */
>  #define INDIO_DIRECT_MODE		0x01
>  #define INDIO_BUFFER_TRIGGERED		0x02
> 


  reply	other threads:[~2015-03-07 19:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 20:56 [PATCH 0/3] Provide new API to get the current time resolution Harald Geyer
2015-03-02 20:56 ` [PATCH 1/3] timekeeping: " Harald Geyer
2015-03-02 21:18   ` John Stultz
2015-03-03 11:17     ` Harald Geyer
2015-03-02 20:56 ` [PATCH 2/3] iio: Provide new API to get the current resolution of timestamps Harald Geyer
2015-03-07 19:05   ` Jonathan Cameron [this message]
2015-03-02 20:56 ` [PATCH 3/3] iio: dht11: Use new function iio_get_time_resolution_ns() Harald Geyer

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=54FB4BF1.3050102@kernel.org \
    --to=jic23@kernel.org \
    --cc=harald@ccbib.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=tglx@linutronix.de \
    /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.