mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: N?stor Amigo Cairo <nestorac@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: QUESTION: How can I make a driver for a special serial keyboard which also supports output (maybe via serio_raw)?
Date: Tue, 27 May 2008 08:53:13 -0400	[thread overview]
Message-ID: <20080527084431.ZZRA012@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <b321594e0805250952q18465dc2h8af60aa25143693d@mail.gmail.com>

Hi,

On Sun, May 25, 2008 at 06:52:26PM +0200, N?stor Amigo Cairo wrote:
> Hello!
> 
> I'm trying to make a driver for a special keyboard with just three keys, for
> an embedded application. This really is a PIC attached to a serial interface
> which sends some bytes to the computer to manage an application, and then
> receives some others to control an embedded device using the same cable. So
> there's a two way connection between them.
> For now, I have been able to customize the newtonkbd driver to adapt it to
> receive some bytes and translate them to keys, but I'm not able to send any
> data. /dev/ttyS0 gets blocked when setting up the driver with a customized
> version of `inputattach`, an application which ioctl's the serial device to
> the driver. Write() does not work, since it's not implemented in the driver.
> Is there any way of implementing access to this device using the same
> Write() calls as in other apps?
> Or is there any other way of doing it?? Some documentation??
> 

You would need to implement ->event() handler in your 'keyboard' that
would call serio->write() on the underlying serio port. Then, by
opening /dev/input/eventX and writing into it you can send input
events back to the device.

Although I wonder if your device really useable as a generic
keyboard/button device. You may be better off just using the serial
port from the userspace.

-- 
Dmitry

       reply	other threads:[~2008-05-27 12:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b321594e0805250952q18465dc2h8af60aa25143693d@mail.gmail.com>
2008-05-27 12:53 ` Dmitry Torokhov [this message]
     [not found]   ` <b321594e0805271025ia60c356hc19a040920587713@mail.gmail.com>
2008-05-27 17:27     ` Fwd: " Néstor Amigo Cairo
2008-05-27 17:40       ` Benoit Boissinot
     [not found]         ` <b321594e0805271451l79912cfcpaf05406a319800aa@mail.gmail.com>
2008-05-28  8:00           ` Fwd: " Néstor Amigo Cairo

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=20080527084431.ZZRA012@mailhub.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nestorac@gmail.com \
    /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®