From: David Lechner <david@lechnology.com>
To: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-kernel@vger.kernel.org,
William Breathitt Gray <vilhelm.gray@gmail.com>
Subject: Re: [PATCH] iio: add channel type for frequency
Date: Mon, 2 Jul 2018 10:33:52 -0500 [thread overview]
Message-ID: <51fa1708-a19e-aa05-6145-b2479a89805b@lechnology.com> (raw)
In-Reply-To: <20180702140352.00002c6c@huawei.com>
On 07/02/2018 08:03 AM, Jonathan Cameron wrote:
> On Sun, 1 Jul 2018 17:24:34 -0500
> David Lechner <david@lechnology.com> wrote:
>
>> On 07/01/2018 02:18 AM, Lars-Peter Clausen wrote:
>>> On 07/01/2018 04:59 AM, David Lechner wrote:
>>>> This adds a new type for frequency to the IIO channel type enumeration.
>>>>
>>>> Units are in Hz.
>>>>
>>>
>>> Documentation?
>>
>> I take it that you mean Documentation/ABI/testing/sysfs-bus-iio? Or
>> somewhere else too?
>
> Yes.
>
>>
>>>
>>> We already have the altvoltage channel type with the frequency attribute.
>>> Difficult to say if there are any overlaps without documentation on how this
>>> new attribute is supposed to be used.
>>
>> I'm basically trying to implement a quadrature encoder in iio. I want to be
>> able to use it in-kernel to get a rotational speed value for a motor.
>
> Have you seen the counters subsystem work that is pretty much ready to merge?
I hadn't seen that. Thanks. It sounds like the way to go since I am dealing with
a quadrature encoder.
>
> https://lkml.org/lkml/2018/6/21/659
>
>>
>> The motors (and encoder wheels) are hot-swapable, so we don't know how many
>> counts from the quadrature encoder equals one rotation because it depends on
>> which motor is being used. So using IIO_ANGL_VEL doesn't work for this case.
>
> Hmm. This always ugly when we have hotswappable external devices. Ideal is
> to describe them with device tree or similar none the less as this stuff isn't
> really something userspace should have to figure out.
>
>>
>> It seems to me that the proper generic unit for "speed" from the quadrature
>> encoder would be counts per second, hence the suggestion of a frequency unit.
>
> It is probably not that clear cut, as what is it frequency of? All depends on
> what mode the quadrature counter is working in x4 or x1 for simplest options.
>
>
>> I'm not sure if voltage frequency works here since a "count" on a quadrature
>> encoder is derived from two different voltage signals (and may vary depending
>> on how the encoder determines what one count it).
>>
>> Also, unrelated to my quadrature encoder project, I was thinking that
>> frequency counters would use this unit as well (although the voltage alt
>> makes more sense for this case).
>>
>> There are also sound sensors that measure frequency that could use this unit.
>
> I have not fundamental issue with having a frequency channel, but only
> if we have a clear cut use case. I suspect the right option here is to
> look at what extensions are needed to William's counter subsystem instead
> of in IIO (which frankly failed to stretch far enough to support counters
> well).
>
Agreed. Let's drop this patch.
prev parent reply other threads:[~2018-07-02 15:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-01 2:59 David Lechner
2018-07-01 7:18 ` Lars-Peter Clausen
2018-07-01 22:24 ` David Lechner
2018-07-02 13:03 ` Jonathan Cameron
2018-07-02 15:33 ` David Lechner [this message]
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=51fa1708-a19e-aa05-6145-b2479a89805b@lechnology.com \
--to=david@lechnology.com \
--cc=jic23@kernel.org \
--cc=jonathan.cameron@huawei.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=vilhelm.gray@gmail.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
all inboxes | Powered by JetHome®