mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, davem@davemloft.net,
	mchehab@kernel.org, jikos@kernel.org
Subject: [patch 0/2] add actuators support
Date: Mon, 17 Jul 2017 18:19:12 +0200	[thread overview]
Message-ID: <20170717161914.5043-1-jiri@resnulli.us> (raw)

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

             reply	other threads:[~2017-07-17 16:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 16:19 Jiri Pirko [this message]
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

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=20170717161914.5043-1-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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®