[patch 0/2] add actuators support

From: Jiri Pirko
Date: Mon Jul 17 2017 - 12:19:22 EST


From: Jiri Pirko <jiri@xxxxxxxxxxxx>

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