From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Jonathan Cameron <jic23@jic23.retrosnub.co.uk>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] iio: bmg160: add callbacks for the filter frequency
Date: Wed, 29 Jun 2016 17:13:29 +0200 [thread overview]
Message-ID: <20160629151329.GA28114@pengutronix.de> (raw)
In-Reply-To: <a78e04db-502d-a915-1667-5bee4af15392@kernel.org>
On Wed, May 04, 2016 at 10:55:56AM +0100, Jonathan Cameron wrote:
> On 01/05/16 21:02, Jonathan Cameron wrote:
> > On 26/04/16 22:36, Srinivas Pandruvada wrote:
> >> On Tue, 2016-04-26 at 22:15 +0100, Jonathan Cameron wrote:
> >>>
> >>> On 26 April 2016 21:25:22 BST, Srinivas Pandruvada <srinivas.pandruva
> >>> da@linux.intel.com> wrote:
> >>>>
> >>>> On Mon, 2016-04-25 at 20:31 +0100, Jonathan Cameron wrote:
> >>>>>
> >>>>> On 21/04/16 11:49, Steffen Trumtrar wrote:
> >>>>>>
> >>>>>>
> >>>>>> The filter frequency and sample rate have a fixed relationship.
> >>>>>> Only the filter frequency is unique, however.
> >>>>>> Currently the driver ignores the filter settings for 32 Hz and
> >>>>>> 64 Hz.
> >>>>>>
> >>>>>> This patch adds the necessary callbacks to be able to configure
> >>>>>> and read the filter setting from sysfs.
> >>>>>>
> >>>>>> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> >>>>> cc'd Srinivas as it's his driver... Looks superficially fine to
> >>>>> me.
> >>>>>
> >>>>> Jonathan
> >>>>>>
> >>>>>>
> >>>>>> ---
> >>>>>>
> >>>>>> Changing the sample rate will result in using the first match
> >>>>>> and therefore selecting the filter accordingly. Is this a
> >>>>>> misuse
> >>>>>> of the ABI and should be handled differently or is this okay?
> >>>>>>
> >>>> This is the reason they were omitted. Now you can't uniquely set
> >>>> 100Hz
> >>>> sampling frequency. Depending on filter it will have different
> >>>> results.
> >>>>
> >>>> I think this needs some ABI level changes, where you display
> >>>> available
> >>>> and allow to specify both ODR and Filter to uniquely select.
> >>> Unfortunately the moment the ABI allows for combined elements it
> >>> becomes a
> >>> nightmare for complexity. In some devices a single parameter change
> >>> can
> >>> change everything else. There are no simple rules unfortunately.
> >>>
> >>> The way we avoid this being a problem is that we very deliberately
> >>> allow any ABI element
> >>> to be able to result in a change in any other. This includes
> >>> changing the
> >>> available values list as here. It might be slightly nicer to jump to
> >>> the nearest
> >>> available option though.
> >>>
> >>> An alternative would be to have an interface to fake such changes
> >>> then
> >>> apply them atomically if possible.
> >>> That level of complexity just does seem warranted here and would
> >>> still need userspace to check valid ranges as it
> >>> pretends to change the state. Hence no real gain....
> >>>
> >> I think we should add some documentation for this driver about this.
> >> They should rather change filer rather than sampling freq to have
> >> unique setting.
> > whilst that would get around the problem, people are going to be expecting
> > to have explicit control of sampling frequency if they see it is variable for
> > the part...
> >
> > Tricky unfortunately.
> So Srinivas, I'm in favour of the patch as it stands. Have I convinced you?
So, any conclusion ? :-)
Best regards,
Steffen
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2016-06-29 15:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 10:49 [PATCH] iio: bmg160: add callbacks for the filter frequency Steffen Trumtrar
2016-04-25 19:31 ` Jonathan Cameron
[not found] ` <1461702322.14657.15.camel@linux.intel.com>
2016-04-26 21:15 ` Jonathan Cameron
2016-04-26 21:36 ` Srinivas Pandruvada
2016-05-01 20:02 ` Jonathan Cameron
2016-05-04 9:55 ` Jonathan Cameron
2016-06-29 15:13 ` Steffen Trumtrar [this message]
2016-06-29 15:41 ` Srinivas Pandruvada
2016-07-03 10:37 ` Jonathan Cameron
2016-07-03 11:41 ` Jonathan Cameron
2016-07-04 8:32 ` Steffen Trumtrar
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=20160629151329.GA28114@pengutronix.de \
--to=s.trumtrar@pengutronix.de \
--cc=jic23@jic23.retrosnub.co.uk \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=srinivas.pandruvada@linux.intel.com \
/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).