devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Irina Tirdea
	<irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	Peter Meerwald <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Subject: Re: [PATCH 1/3] iio: core: Introduce IIO_CHAN_INFO_CALIBREPETITIONS
Date: Sat, 18 Apr 2015 17:47:14 +0100	[thread overview]
Message-ID: <55328A92.9020807@kernel.org> (raw)
In-Reply-To: <1429267830-13681-2-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

On 17/04/15 11:50, Irina Tirdea wrote:
> Some magnetometers can perform a number of repetitions in HW
> for each measurement to increase accuracy. One example is
> Bosch BMC150:
> http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf.
> 
> Introduce an interface to set the number of repetitions
> for these devices.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  Documentation/ABI/testing/sysfs-bus-iio | 10 ++++++++++
>  drivers/iio/industrialio-core.c         |  1 +
>  include/linux/iio/iio.h                 |  1 +
>  3 files changed, 12 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 866b4ec..74c1444 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -1375,3 +1375,13 @@ Description:
>  		The emissivity ratio of the surface in the field of view of the
>  		contactless temperature sensor.  Emissivity varies from 0 to 1,
>  		with 1 being the emissivity of a black body.
> +
> +What:		/sys/bus/iio/devices/iio:deviceX/in_magn_x_calibrepetitions
> +What:		/sys/bus/iio/devices/iio:deviceX/in_magn_y_calibrepetitions
> +What:		/sys/bus/iio/devices/iio:deviceX/in_magn_z_calibrepetitions
> +KernelVersion:	4.2
> +Contact:	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> +Description:
> +		Hardware applied number of repetitions for acquiring one
> +		data point. The HW will do <type>[_name]_calibrepetitions
> +		measurements and return the average value as output data.
This is an interesting way of naming what is often referred to as oversampling.
I'd like to get some other opinions on naming before we go with the ABI for this..

We do have one driver in staging exporting oversampling_ratio which is probably
the same thing, but that ABI was never standardized so I have no problem with
ignoring that one case.  A couple of other drivers provide oversampling control
via platform data.   We must make sure we give a sensible default for this.

There is also the interesting question of whether sampling_frequency applies
before or after this...  I'd argue after, but again would like more opinions
before we dictate that.  However, whatever we choose should definitely be
documented here!

> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 7c98bc1..9e0da7f 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -129,6 +129,7 @@ static const char * const iio_chan_info_postfix[] = {
>  	[IIO_CHAN_INFO_DEBOUNCE_COUNT] = "debounce_count",
>  	[IIO_CHAN_INFO_DEBOUNCE_TIME] = "debounce_time",
>  	[IIO_CHAN_INFO_CALIBEMISSIVITY] = "calibemissivity",
> +	[IIO_CHAN_INFO_CALIBREPETITIONS] = "calibrepetitions",
>  };
>  
>  /**
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index b1e46ae..07fbfb2 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -44,6 +44,7 @@ enum iio_chan_info_enum {
>  	IIO_CHAN_INFO_DEBOUNCE_COUNT,
>  	IIO_CHAN_INFO_DEBOUNCE_TIME,
>  	IIO_CHAN_INFO_CALIBEMISSIVITY,
> +	IIO_CHAN_INFO_CALIBREPETITIONS,
>  };
>  
>  enum iio_shared_by {
> 

  parent reply	other threads:[~2015-04-18 16:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 10:50 [PATCH 0/3] Add support for BMC150 magnetometer Irina Tirdea
2015-04-17 10:50 ` [PATCH 1/3] iio: core: Introduce IIO_CHAN_INFO_CALIBREPETITIONS Irina Tirdea
     [not found]   ` <1429267830-13681-2-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-18 16:47     ` Jonathan Cameron [this message]
2015-04-22 11:33       ` Tirdea, Irina
     [not found]         ` <1F3AC3675D538145B1661F571FE1805F19A5B355-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-04-22 21:00           ` Jonathan Cameron
     [not found] ` <1429267830-13681-1-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-17 10:50   ` [PATCH 2/3] iio: magn: Add support for BMC150 magnetometer Irina Tirdea
     [not found]     ` <1429267830-13681-3-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-18 18:07       ` Jonathan Cameron
     [not found]         ` <55329D45.2080001-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-04-22 12:45           ` Tirdea, Irina
     [not found]             ` <1F3AC3675D538145B1661F571FE1805F19A5B393-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-04-22 21:06               ` Jonathan Cameron
2015-04-17 10:50 ` [PATCH 3/3] iio: magn: bmc150_magn: Add devicetree binding documentation Irina Tirdea
     [not found]   ` <1429267830-13681-4-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-18 18:08     ` Jonathan Cameron
     [not found]       ` <55329DA9.1050305-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-04-22 12:47         ` Tirdea, Irina

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=55328A92.9020807@kernel.org \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).