From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: gmane@reliableembeddedsystems.com
Cc: linux-iio@vger.kernel.org
Subject: Re: iio A/D converter input to input event subsystem
Date: Sun, 3 Aug 2014 11:56:10 +0200 [thread overview]
Message-ID: <20140803095610.GQ3214@piout.net> (raw)
In-Reply-To: <b12ce7f23b622a613c07e9de19ece607@reliableembeddedsystems.com>
Hi Robert,
On 02/08/2014 at 13:14:30 -0500, gmane@reliableembeddedsystems.com wrote :
> Hi,
>
> I would like to use a couple of resistors and keys and one Analog
> input[1], read the analogue voltage from a kernel driver, figure out
> which key is pressed and pass this on to the Linux input subsystem.
> (Am I really the only one with this use case?)
>
> In my specific case it's about a beagle bone black, which means that
> the A/D driver is an iio adc driver[2].
>
> How would it be possible to reuse the iio A/D converter driver code
> for my driver? Maybe it would even be possible to create something
> more generic so iio A/D converter channels could be used as input
> keys. Some sample code which would enable me to choose an analog
> input and read from it from kernel space would help me to write some
> basic sample driver, I guess.
>
> The reason I would like to write a device driver instead of a user
> space application is mainly the input subsystem. From the user space
> application's point of view utilizing a device driver which feeds
> the input subsystem would make it easy to exchange what's underneath
> without user space even noticing. (keys to Input pins, a key matrix
> to I/O pins, i2c input, A/D converter,...).
>
Did you have a look at uinput? This would allow you to inject input
events after processing the ADC values in userspace.
Simple example: http://thiemonge.org/getting-started-with-uinput
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-08-03 9:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-02 18:14 iio A/D converter input to input event subsystem gmane
2014-08-03 9:56 ` Alexandre Belloni [this message]
2014-08-03 15:08 ` gmane
2014-08-03 15:43 ` Jonathan Cameron
2014-08-03 16:39 ` gmane
2014-08-03 20:43 ` Jonathan Cameron
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=20140803095610.GQ3214@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=gmane@reliableembeddedsystems.com \
--cc=linux-iio@vger.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;
as well as URLs for NNTP newsgroup(s).