devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] new driver for TI eQEP
@ 2019-07-22 15:45 David Lechner
  2019-07-22 15:45 ` [PATCH 1/4] dt-bindings: counter: new bindings " David Lechner
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: David Lechner @ 2019-07-22 15:45 UTC (permalink / raw)
  To: linux-iio, linux-omap, devicetree
  Cc: David Lechner, Rob Herring, Mark Rutland, Benoît Cousson,
	Tony Lindgren, William Breathitt Gray, Thierry Reding,
	linux-kernel, linux-pwm

This series adds device tree bindings and a new counter driver for the Texas
Instruments Enhanced Quadrature Encoder Pulse (eQEP).

As mentioned in one of the commit messages, to start with, the driver only
supports reading the current counter value and setting the min/max values.
Other features can be added on an as-needed basis.

The only other feature I am interested in is adding is getting time data in
order to calculate the rotational speed of a motor. However, there probably
needs to be a higher level discussion of how this can fit into the counter
subsystem in general first.

This series has been tested on a BeagleBone Blue with the following script:

#!/usr/bin/env python3

from os import path
from time import sleep

COUNTER_PATH = '/sys/bus/counter/devices'
COUNTERS = ['counter0', 'counter1', 'counter2']
COUNT0 = 'count0'
COUNT = 'count'
CEILING = 'ceiling'
FLOOR = 'floor'
ENABLE = 'enable'

cnts = []

for c in COUNTERS:
    enable_path = path.join(COUNTER_PATH, c, COUNT0, ENABLE)
    with open(enable_path, 'w') as f:
        f.write('1')
    ceiling_path = path.join(COUNTER_PATH, c, COUNT0, CEILING)
    with open(ceiling_path, 'w') as f:
        f.write(str(0xffffffff))

    cnt_path = path.join(COUNTER_PATH, c, COUNT0, COUNT)
    cnts.append(open(cnt_path, 'r'))

while True:
    for c in cnts:
        c.seek(0)
        val = int(c.read())
        if val >= 0x80000000:
            val -= 0x100000000
        print(val, end=' ')
    print()
    sleep(1)

David Lechner (4):
  dt-bindings: counter: new bindings for TI eQEP
  counter: new TI eQEP driver
  ARM: dts: am33xx: Add nodes for eQEP
  ARM: dts: am335x-boneblue: Enable eQEP

 .../devicetree/bindings/counter/ti-eqep.txt   |  18 +
 MAINTAINERS                                   |   6 +
 arch/arm/boot/dts/am335x-boneblue.dts         |  54 +++
 arch/arm/boot/dts/am33xx-l4.dtsi              |  27 ++
 drivers/counter/Kconfig                       |  12 +
 drivers/counter/Makefile                      |   1 +
 drivers/counter/ti-eqep.c                     | 381 ++++++++++++++++++
 drivers/pwm/Kconfig                           |   2 +-
 8 files changed, 500 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/counter/ti-eqep.txt
 create mode 100644 drivers/counter/ti-eqep.c

-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-08-02 16:40 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 15:45 [PATCH 0/4] new driver for TI eQEP David Lechner
2019-07-22 15:45 ` [PATCH 1/4] dt-bindings: counter: new bindings " David Lechner
2019-07-27 19:48   ` Jonathan Cameron
2019-08-02  7:25     ` William Breathitt Gray
2019-08-02 13:34       ` Rob Herring
2019-08-02 13:58         ` William Breathitt Gray
2019-07-22 15:45 ` [PATCH 2/4] counter: new TI eQEP driver David Lechner
2019-07-30 12:35   ` Uwe Kleine-König
2019-07-30 15:28     ` David Lechner
2019-08-02  9:27   ` William Breathitt Gray
2019-08-02 16:09     ` David Lechner
2019-08-02 16:17     ` David Lechner
2019-08-02 16:40       ` William Breathitt Gray
2019-07-22 15:45 ` [PATCH 3/4] ARM: dts: am33xx: Add nodes for eQEP David Lechner
2019-07-23  8:42   ` Tony Lindgren
2019-07-23 14:45     ` David Lechner
2019-07-23 14:51       ` Tony Lindgren
2019-07-22 15:45 ` [PATCH 4/4] ARM: dts: am335x-boneblue: Enable eQEP David Lechner
2019-07-25 12:40 ` [PATCH 0/4] new driver for TI eQEP William Breathitt Gray
2019-07-25 22:52   ` David Lechner
2019-07-27 19:45     ` Jonathan Cameron
2019-07-30  4:45     ` William Breathitt Gray
2019-08-01 17:37       ` David Lechner

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).