mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 0/2] add actuators support
@ 2017-07-17 16:19 Jiri Pirko
  2017-07-17 16:19 ` [patch 1/2] add support for generic actuator devices Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jiri Pirko @ 2017-07-17 16:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, davem, mchehab, jikos

From: Jiri Pirko <jiri@mellanox.com>

I am owner of height adjustable desk and naturally, as it has an USB
interface, I need to controll it from my computer. Started to think
about what would be the best way, I realized that I need to introduce
a new driver class in kernel. The reason is a need to have one API
for all possible kinds of actuator devices (USB, I2C, gpio, etc).

So the first patch introduces generic actuator device class. Please
see the patch description for more info. Basically it allows device
drivers to register actuators providing set of ops. Also it exposes
actuator manipulation possibilities via generic Netlink interface
to userspace.

The second patch introduces driver based on the actuator driver class
for Linak USB2LIN device.

I created a library which wraps-up the generic netlink API so it could
be easily used by applications. The library comes with a utility called
"act" which can be used to manipulate the actuator devices. It has
iproute2 command line and stdout syntax.
Here there are couple of examples:

$ act dev show
usb/1-2/0: driver_name usb2lin type linear units um value 70200 move_state stopped
$ act dev move usb/1-2/0 value 100000
$ act dev stop usb/1-2/0

You can monitor the actuator status changes:

$ act mon
get: usb/1-2/0: driver_name usb2lin type linear units um value 70300 move_state positive
get: usb/1-2/0: driver_name usb2lin type linear units um value 99900 move_state stopped
get: usb/1-2/0: driver_name usb2lin type linear units um value 100300 move_state negative
get: usb/1-2/0: driver_name usb2lin type linear units um value 10100 move_state stopped
get: usb/1-2/0: driver_name usb2lin type linear units um value 10500 move_state positive
get: usb/1-2/0: driver_name usb2lin type linear units um value 99900 move_state stopped

The libactuator is available here:
https://git.kernel.org/pub/scm/linux/kernel/git/jpirko/libactuator.git/

This patchset is based on current net-next git tree.
I apologize, I'm not used to send patches outside netdev subsystem
so please tell me on top of which tree to rebase this if neede and
who to cc. Thanks!

Jiri Pirko (2):
  add support for generic actuator devices
  actuator: introduce Linak USB2LIN cable support

 MAINTAINERS                   |   7 +
 drivers/Kconfig               |   2 +
 drivers/Makefile              |   1 +
 drivers/actuator/Kconfig      |  26 +++
 drivers/actuator/Makefile     |   2 +
 drivers/actuator/actuator.c   | 410 +++++++++++++++++++++++++++++++++++++++
 drivers/actuator/usb2lin.c    | 433 ++++++++++++++++++++++++++++++++++++++++++
 drivers/hid/hid-core.c        |   1 +
 drivers/hid/hid-ids.h         |   3 +
 include/linux/actuator.h      |  43 +++++
 include/uapi/linux/actuator.h |  74 ++++++++
 11 files changed, 1002 insertions(+)
 create mode 100644 drivers/actuator/Kconfig
 create mode 100644 drivers/actuator/Makefile
 create mode 100644 drivers/actuator/actuator.c
 create mode 100644 drivers/actuator/usb2lin.c
 create mode 100644 include/linux/actuator.h
 create mode 100644 include/uapi/linux/actuator.h

-- 
2.9.3

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

end of thread, other threads:[~2017-07-17 16:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 16:19 [patch 0/2] add actuators support Jiri Pirko
2017-07-17 16:19 ` [patch 1/2] add support for generic actuator devices Jiri Pirko
2017-07-17 16:19 ` [patch 2/2] actuator: introduce Linak USB2LIN cable support Jiri Pirko
2017-07-17 16:28 ` [patch 0/2] add actuators support Greg KH
2017-07-17 16:34   ` Jiri Pirko
2017-07-17 16:40     ` Greg KH
2017-07-17 16:48       ` Jiri Pirko

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®