linux-mips
[Top] [All Lists]

Re: [PATCH] zs: Move to the serial subsystem

To: "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH] zs: Move to the serial subsystem
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Date: Fri, 1 Jun 2007 16:03:31 +0200
Cc: Jan Rekorajski <baggins@sith.mimuw.edu.pl>, linux-mips@linux-mips.org
In-reply-to: <Pine.LNX.4.64N.0705301802570.27697@blysk.ds.pg.gda.pl>
Mail-followup-to: "Maciej W. Rozycki" <macro@linux-mips.org>, Jan Rekorajski <baggins@sith.mimuw.edu.pl>, linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.64N.0705291258390.14456@blysk.ds.pg.gda.pl> <20070530165842.GL29894@sith.mimuw.edu.pl> <Pine.LNX.4.64N.0705301802570.27697@blysk.ds.pg.gda.pl>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.13 (2006-08-11)
On Wed, 2007-05-30 18:25:46 +0100, Maciej W. Rozycki <macro@linux-mips.org> 
wrote:
> On Wed, 30 May 2007, Jan Rekorajski wrote:
> > Any chance to get LK201/401 keyboard and vsxxxaa mouse working with this?
> 
>  For the time being a solution is the patch below and then:
> 
> CONFIG_INPUT=y
> CONFIG_INPUT_KEYBOARD=y
> CONFIG_KEYBOARD_LKKBD=y
> CONFIG_INPUT_MOUSE=y
> CONFIG_MOUSE_VSXXXAA=y
> CONFIG_SERIO=y
> CONFIG_SERIO_SERPORT=y
> CONFIG_VT=y
> CONFIG_VT_CONSOLE=y
> CONFIG_HW_CONSOLE=y
> CONFIG_VT_HW_CONSOLE_BINDING=y
> 
> plus your framebuffer of choice.  To activate the keyboard you have to run 
> the following program:
> 
> #include <fcntl.h>
> #include <sys/ioctl.h>
> #include <unistd.h>
> 
> #define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
> #define SERIO_LKKBD 0x28
> 
> int main(void)
> {
>       int fd, ldisc = N_MOUSE, type = SERIO_LKKBD;
>       char buf;
> 
>       fd = open("/dev/ttyS2", O_RDWR | O_NONBLOCK);
>       ioctl(fd, TIOCSETD, &ldisc);
>       ioctl(fd, SPIOCSTYPE, &type);
>       read(fd, &buf, 1);
>       close(fd);
> 
>       return 0;
> }

Another way would be to use the `inputattach' program, which is
shipped with the `joystick' package (sic) and also does line speed
setting etc. for you.

MfG, JBG

>  I am looking into a solution that would make it automatic without the 
> need of involving userland which just does not seem right here -- you do 
> want to run your kernel with "init=/bin/bash" or suchlike and have your 
> virtual terminal console usable.  I will remove the old lk201 bits then.

IIRC the serial port needs to register a serio device, set correct
baud/cstopb/... settings and set VSXXXAA/LKKBD identity on the two
serio ports. I *hope* the rest happens automatically then. (Another
way would be to look into how the Sun guys get their keyboards
up'n'running...)

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of: 23:53 <@jbglaw> So, ich kletter' jetzt mal ins Bett.
the second  : 23:57 <@jever2> .oO( kletter ..., hat er noch Gitter vorm Bett, 
wie früher meine Kinder?)
              00:00 <@jbglaw> jever2: *patsch*
              00:01 <@jever2> *aua*, wofür, Gedanken sind frei!
              00:02 <@jbglaw> Nee, freie Gedanken, die sind seit 1984 doch aus!
              00:03 <@jever2> 1984? ich bin erst seit 1985 verheiratet!

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>