[RFC/PATCH,0/1] Quadrature Encoder Support
mbox series

Message ID 20190909121605.92008-1-felipe.balbi@linux.intel.com
Headers show
Series
  • Quadrature Encoder Support
Related show

Message

Felipe Balbi Sept. 9, 2019, 12:16 p.m. UTC
Hi,

Here's a simple RFC for Intel's Quadrature Encoder. Let me make it clear
that I don't mean we should the following patch as is, rather I'd like
to open the discussion to, perhaps, extending Industrial Automation
Framework with support for Quadrature Encoders.

Let me know if you think IIO would be correct place for such devices,
then I can start reworking the driver to provide an IIO-compliant
interface.

I'm thinking we would need standard sysfs files for configuring the QEP
into single-shot QEP mode or buffered Capture mode, configure thresholds
and other details.

Cheers

Felipe Balbi (1):
  misc: introduce intel QEP

 drivers/misc/Kconfig     |   7 +
 drivers/misc/Makefile    |   1 +
 drivers/misc/intel-qep.c | 813 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 821 insertions(+)
 create mode 100644 drivers/misc/intel-qep.c

Comments

Jonathan Cameron Sept. 15, 2019, 1:53 p.m. UTC | #1
On Mon,  9 Sep 2019 15:16:04 +0300
Felipe Balbi <felipe.balbi@linux.intel.com> wrote:

> Hi,
> 
> Here's a simple RFC for Intel's Quadrature Encoder. Let me make it clear
> that I don't mean we should the following patch as is, rather I'd like
> to open the discussion to, perhaps, extending Industrial Automation
> Framework with support for Quadrature Encoders.
> 
> Let me know if you think IIO would be correct place for such devices,
> then I can start reworking the driver to provide an IIO-compliant
> interface.
> 
> I'm thinking we would need standard sysfs files for configuring the QEP
> into single-shot QEP mode or buffered Capture mode, configure thresholds
> and other details.

Hi Felipe,

Fairly recently, similar concerns that IIO didn't really suite these
devices lead William to create a specific 'counters' subsystem.
+CC William.

It may not address all of your requirements yet, but I would imagine it
is a better fit than IIO would ever be.  We have moved all the older
counter drivers out of IIO and across to this new subsystem.

Thanks,

Jonathan


> 
> Cheers
> 
> Felipe Balbi (1):
>   misc: introduce intel QEP
> 
>  drivers/misc/Kconfig     |   7 +
>  drivers/misc/Makefile    |   1 +
>  drivers/misc/intel-qep.c | 813 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 821 insertions(+)
>  create mode 100644 drivers/misc/intel-qep.c
>
William Breathitt Gray Sept. 15, 2019, 2:23 p.m. UTC | #2
On Sun, Sep 15, 2019 at 02:53:47PM +0100, Jonathan Cameron wrote:
> On Mon,  9 Sep 2019 15:16:04 +0300
> Felipe Balbi <felipe.balbi@linux.intel.com> wrote:
> 
> > Hi,
> > 
> > Here's a simple RFC for Intel's Quadrature Encoder. Let me make it clear
> > that I don't mean we should the following patch as is, rather I'd like
> > to open the discussion to, perhaps, extending Industrial Automation
> > Framework with support for Quadrature Encoders.
> > 
> > Let me know if you think IIO would be correct place for such devices,
> > then I can start reworking the driver to provide an IIO-compliant
> > interface.
> > 
> > I'm thinking we would need standard sysfs files for configuring the QEP
> > into single-shot QEP mode or buffered Capture mode, configure thresholds
> > and other details.
> 
> Hi Felipe,
> 
> Fairly recently, similar concerns that IIO didn't really suite these
> devices lead William to create a specific 'counters' subsystem.
> +CC William.
> 
> It may not address all of your requirements yet, but I would imagine it
> is a better fit than IIO would ever be.  We have moved all the older
> counter drivers out of IIO and across to this new subsystem.
> 
> Thanks,
> 
> Jonathan

Felipe,

Take a look at the Generic Counter interface, it may be what you need:
https://www.kernel.org/doc/html/latest/driver-api/generic-counter.html

There are some existing quadrature encoder counter devices using this
interface already; look at the files under drivers/counter for
reference.

This interface is still relatively new, so if you have any problems just
shoot me an email and I'll be happy to help. :-)

William Breathitt Gray

> 
> 
> > 
> > Cheers
> > 
> > Felipe Balbi (1):
> >   misc: introduce intel QEP
> > 
> >  drivers/misc/Kconfig     |   7 +
> >  drivers/misc/Makefile    |   1 +
> >  drivers/misc/intel-qep.c | 813 +++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 821 insertions(+)
> >  create mode 100644 drivers/misc/intel-qep.c
> > 
>
Felipe Balbi Sept. 16, 2019, 6:16 a.m. UTC | #3
Hi,

William Breathitt Gray <vilhelm.gray@gmail.com> writes:
> On Sun, Sep 15, 2019 at 02:53:47PM +0100, Jonathan Cameron wrote:
>> On Mon,  9 Sep 2019 15:16:04 +0300
>> Felipe Balbi <felipe.balbi@linux.intel.com> wrote:
>> 
>> > Hi,
>> > 
>> > Here's a simple RFC for Intel's Quadrature Encoder. Let me make it clear
>> > that I don't mean we should the following patch as is, rather I'd like
>> > to open the discussion to, perhaps, extending Industrial Automation
>> > Framework with support for Quadrature Encoders.
>> > 
>> > Let me know if you think IIO would be correct place for such devices,
>> > then I can start reworking the driver to provide an IIO-compliant
>> > interface.
>> > 
>> > I'm thinking we would need standard sysfs files for configuring the QEP
>> > into single-shot QEP mode or buffered Capture mode, configure thresholds
>> > and other details.
>> 
>> Hi Felipe,
>> 
>> Fairly recently, similar concerns that IIO didn't really suite these
>> devices lead William to create a specific 'counters' subsystem.
>> +CC William.
>> 
>> It may not address all of your requirements yet, but I would imagine it
>> is a better fit than IIO would ever be.  We have moved all the older
>> counter drivers out of IIO and across to this new subsystem.
>> 
>> Thanks,
>> 
>> Jonathan
>
> Felipe,
>
> Take a look at the Generic Counter interface, it may be what you need:
> https://www.kernel.org/doc/html/latest/driver-api/generic-counter.html

Thanks guys, I wasn't aware of this new subsystem. I'll have a look at
start porting the driver over.

> There are some existing quadrature encoder counter devices using this
> interface already; look at the files under drivers/counter for
> reference.
>
> This interface is still relatively new, so if you have any problems just
> shoot me an email and I'll be happy to help. :-)

Will do William.

cheers