linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: 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: Sun, 3 Jul 2016 11:37:40 +0100	[thread overview]
Message-ID: <2b14035b-3df6-0100-3fac-d7de1bfff4b1@kernel.org> (raw)
In-Reply-To: <1467214869.8970.122.camel@linux.intel.com>

On 29/06/16 16:41, Srinivas Pandruvada wrote:
> On Wed, 2016-06-29 at 17:13 +0200, Steffen Trumtrar wrote:
>> 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 ? :-)
> Sorry, I missed this. I am fine with this change.
Cool.

Applied to the togreg branch of iio.git and initially pushed out as
testing for the autobuilders to play cricket with it...

Thanks,

Jonathan
> 
> Thanks,
> Srinivas
>>
>> Best regards,
>> Steffen
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2016-07-03 10:37 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
2016-06-29 15:41               ` Srinivas Pandruvada
2016-07-03 10:37                 ` Jonathan Cameron [this message]
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=2b14035b-3df6-0100-3fac-d7de1bfff4b1@kernel.org \
    --to=jic23@kernel.org \
    --cc=jic23@jic23.retrosnub.co.uk \
    --cc=kernel@pengutronix.de \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=s.trumtrar@pengutronix.de \
    --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).