Re: [PATCH 2/3] iio: Provide new API to get the current resolution of timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/03/15 20:56, Harald Geyer wrote:
> Signed-off-by: Harald Geyer <harald@xxxxxxxxx>
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
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux